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.

7 – One-Way Encryptiondatabase roles, due to our use of the Identification_Value_HT columnthat contains a hash value of the last four digits of our original plain text.USE HomeLending;GO-- Grant Execute Permissions to Sensitive_high database roleGRANT EXECUTE ON dbo.Update_Borrower_IdentificationTO Sensitive_high;GO-- Grant Execute Permissions to Sensitive_high database roleGRANT EXECUTE ON dbo.Insert_Borrower_IdentificationTO Sensitive_high;GO-- Grant Execute Permissions to Sensitive_high-- and Sensitive_medium database rolesGRANT EXECUTE ON dbo.Search_Borrower_IdentificationTO Sensitive_high, Sensitive_medium;GOListing 7-14: Setting permissions to the stored procedures.Now that our stored procedures have been created we will want to verify thatthe permissions are effective, using of EXECUTE AS USER to impersonate amember of the various database roles. The use of REVERT terminates theimpersonation and returns us to our original user account.Listing 7-15 executes the Search_Borrower_Identification storedprocedure with the plain text value of "0143", which is the last four digits of aknown Social Security Number, being passed as its argument.USE HomeLending;GO-- execute as a user who is a member of Sensitive_high roleEXECUTE AS USER = 'WOLFBA';GOExec dbo.Search_Borrower_Identification '0143';GOREVERT;GO-- execute as a user who is a member of Sensitive_medium role168

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

Saved successfully!

Ooh no, something went wrong!