Database Security and Auditing: Protecting Data Integrity and Accessibility
Database Security and Auditing: Protecting Data Integrity and Accessibility
Database Security and Auditing: Protecting Data Integrity and Accessibility
Chapter 6
Virtual Private Databases
Objectives
• Security
– Server-enforced security (as opposed to
application-enforced).
• Purposes/benefits:
– Security requirements necessitate data
access be restricted at row or column level
(FGA)
– One database schema serves multiple
unrelated groups or entities
• Restrictions
– Applies only to ‘select’ statements
– The predicate must be a simple boolean expression.
• Users can access e_id’s and names without any restriction. But
users can access only their own salary information.
e_id Name
1 Alice
2 Bob
3 Carl
e_id Name
1 Alice
2 Bob
3 Carl
Example:
DBMS_SESSION.SET_CONTEXT(‘USERENV’,
‘IP_ADDRESS’, “192.168.1.2”);
SYS_CONTEXT(‘USERENV’, ‘IP_ADDRESS’)
Returns 192.168.1.2
Database Security & Auditing: Protecting Data Integrity & Accessibility 32
Implementing a VPD Using
Application Context in Oracle
• Application context:
– Functionality specific to Oracle
– Allows to set database application variables
that can be retrieved by database sessions
– Variables can be used for security context-
based or user-defined environmental
attributes
Table
Package
Security
USER Step 1 Step 2
Policy
Step 5
Step 4
Where Step 3
Predicate
– Any attribute in the “emp_env” context can only be set by procedures in the
“Emp_env_context” package.