programming4us
programming4us
DATABASE

SQL Server :ONE-WAY ENCRYPTION - Creating the Interface (part 2) - Setting and Verifying Permissions to the Stored Procedures

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
5/31/2014 3:42:35 AM

Setting and Verifying Permissions to the Stored Procedures

Once the stored procedures have been created, we need to grant the appropriate permissions to them (see Listing 6). With the HomeLending database we will be operating on the assumption that the Sensitive_high database role will have access to the information that will be inserted and updated to the Borrower_Identification table.

The ability to search the data that is in the Borrower_Identification table will be granted to the Sensitive_high and Sensitive_medium database roles, due to our use of the Identification_Value_HT column that contains a hash value of the last four digits of our original plain text.

Listing 6. Setting permissions to the stored procedures.

Now that our stored procedures have been created we will want to verify that the permissions are effective, using of EXECUTEASUSER to impersonate a member of the various database roles. The use of REVERT terminates the impersonation and returns us to our original user account.

Listing 7 executes the Search_Borrower_Identification stored procedure with the plain text value of "0143", which is the last four digits of a known Social Security Number, being passed as its argument.

Listing 7. Verifying permissions.

The result of this verification will reflect that rows were returned for the queries for the Sensitive_high and Sensitive_medium members; but since permissions did not exist for the Sensitive_low members the actual rows will not be returned. Instead the following will appear:



To view the actual rows returned, execute each batch in this script individually.

Other  
  •  SQL Server : Implementing One-Way Encryption (part 1) - Populate the Hash Columns, Verify the Implementation, Drop the Unencrypted Column
  •  SQL Server : Implementing One-Way Encryption (part 1) - Create the Primary Hash Column,Create a Secondary Hash Column for Searching
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Hierarchical Table Indexing Strategies
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Populating the Hierarchy (part 3) - The GetAncestor Method
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Populating the Hierarchy (part 2) - The ToString Method
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - Populating the Hierarchy (part 1)
  •  Sql Server 2012 : Hierarchical Data and the Relational Database - The hierarchyid Data Type, Creating a Hierarchical Table
  •  Personal Cloud WD My Cloud EX2 Review
  •  Synology DS213j Your Own Cloud Entertainment Starts Here
  •  ADATA Premier Pro SP920 256GB
  •  
    programming4us
     
     
    programming4us