From the course: Complete Guide to Advanced SQL Server

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Verify ledger integrity

Verify ledger integrity

Now that we've saved a copy of the ledger digest to our system, we can use that file to run a consistency check on the database. The result will tell us whether the data that's currently stored has been tampered with through external methods, such as if an attacker modifies the data files directly on disk without going through the security checks provided by SQL Server's authentication protocols. Before we begin, though, we need to make a small change to the database's configuration. Ledger verification requires snapshot isolation to be enabled, so I'll first alter the database and turn that feature on. Next, there's a stored procedure that will take the digest JSON data as an input and compare it to the actual blocks on the blockchain. To use the sp_verify_database_ledger stored procedure, you simply copy in the text from your JSON digest that we exported in the prior movie. I've already done that here with my digest, but keep in mind that the hash is specifically tied to my…

Contents