17.07.2015 Views

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5 – Cell-Level EncryptionTesting the Access to Key HierarchyNow that our encryption key hierarchy has been created, we need to verify thatit is effective. The native functionality of the sys.symmetric_keys catalogview reveals the symmetric keys to which a user either has VIEWDEFINITION permissions directly granted, or has permission to accessthrough membership of a database role that has been granted VIEWDEFINITION permissions.Through the use of EXECUTE AS USER, we can impersonate another userwithin the database. The use of REVERT terminates the impersonation andreturns us to our original user account. For our verification, we are selecting auser that is a member of the Sensitive_high database role, a user that is amember of the Sensitive_medium database role and a user that is a memberof the Sensitive_low database role.USE HomeLending;GO-- execute as a user who is a member of Sensitive_high roleEXECUTE AS USER = 'WOLFBA';GOSELECT * FROM sys.symmetric_keys;GOREVERT;GO-- execute as a user who is a member of Sensitive_medium roleEXECUTE AS USER = 'KELLEYWB';GOSELECT * FROM sys.symmetric_keys;GOREVERT;GO-- execute as a user who is a member of Sensitive_low roleEXECUTE AS USER = 'JONESBF';GOSELECT * FROM sys.symmetric_keys;GOREVERT;GOListing 5-8: Validating the access to key hierarchy.113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!