DB2 Lbac
DB2 Lbac
Agenda
Introduction
Basic Concepts
Protected Tables
Row Level Labeling Example
LBAC and Constraints
LBAC and Query Optimization
LBAC and Data Partitioning
Security Model Extensions
Summary
Introduction
Label-Based Access Control (LBAC) is an implementation of Mandatory
Access Control (MAC)
In the context of database systems, LBAC is commonly referred to as the ability
to control access to data rows based on security labels.
Basic Concepts
Security Label Component
Represents any criteria upon which you would like to control access
Three (3) types are supported:
Array: An ordered set, e.g., level = [HS', 'S', 'C', NS']
Set: A set, e.g., Projects = {'A', 'B', 'C', 'D'}
Tree: A hierarchy, e.g., departments = {G1, G2, G3}, where G1 is "root", and
G2, G3 are children of G1
Security Policy
Defines a security label type and access rules.
The access rules are predefined within DB2 and collectively referred to as
DB2LBACRULES
Read access rules: They apply when data is retrieved (data is retrieved on
SELECT, UPDATE and DELETE SQL statements)
Write access rules: They apply on INSERT, UPDATE and DELETE SQL
statements
Example
CREATE SECURITY POLICY mySecPolicy
COMPONENTS level, Projects WITH DB2LBACRULES
Data Label
User Label
Component 1
Component 1
Component 2
Component 2
Component 3
Component 3
...
Component N
...
Access rule for component N
...
Component N
Protected Tables
A protected table is a table on which LBAC is enforced
DB2 offers two flavours of protected tables:
Protected table with row level granularity
Protected table with column level granularity
Unlike with non protected tables, a Database Administrator (DBADM) has no inherent
ability to access data within a protected table!
No security label/exemptions, no rows!
The content of a protected table with row level granularity appears different depending
on the identity of the user accessing such table
Think of the Truman Show movie with Jim Carrey :-)
Example
10
Suppose we have the following protected table with row level granularity:
CREATE TABLE T1 (A DB2SECURITYLABEL,B INTEGER,C CHAR(5))
SECURITY POLICY mySecPolicy
11
OR
INSERT INTO T1
VALUES
(SECLABEL('mySecPolicy','S:A'),
1,
'Test')
12
13
Table level labeling associates a security label with the table as whole
When all the data in a table is known to always have the same security label,
table level labeling avoids incurring:
Example
15
DEPTNO INTEGER)
SECURITY POLICY DATAACCESS
16
EMPNO
LASTNAME
1 SMITH
DEPTNO
11
The statement fails because user Joe is not allowed to write down.
INSERT INTO EMPLOYEE VALUES (SECLABEL('DATAACCESS','HIGHLY SENSITIVE'),
3, 'WILLIAMS', 11)
The statement fails because user Joe is not allowed to write up.
17
1 SMITH
11
CONFIDENTIAL
2 MILLER
11
Will this UPDATE statement from user Nancy (who holds the same security
label as user Joe) succeed or fail?
UPDATE EMPLOYEE SET DEPTNO = 66 WHERE DEPTNO = 11
18
EMPNO
LASTNAME
DEPTNO
SENSITIVE
1 SMITH
66
CONFIDENTIAL
2 MILLER
11
The SECADM creates and grants a new security label to user Alice
CREATE SECURITY LABEL DATAACCESS.EMPLOYEESECLABEL
COMPONENT LEVEL 'CONFIDENTIAL'
GRANT SECURITY LABEL DATAACCESS.EMPLOYEESECLABEL
TO USER ALICE
19
EMPNO
CONFIDENTIAL
LASTNAME
DEPTNO
2 MILLER
11
21
EMPNO
LASTNAME
1 SMITH
DEPTNO
66
22
23
24
25
27
28
29
30
Summary
What are the advantages of the DB2 for LUW LBAC capability?
Column Level Labeling
Works independently of row level labeling
Allows to control access to a column based on security labels
Table Level Labeling
Can be easily set up as a special case of column level labeling
Provides better performance (and storage savings) than row level labeling
in application scenarios where all the data in a table is known to have the
same security label
Can be leveraged by applications that do not manage classified information
to prevent the DBADM from gaining access to the applications tables
Flexibility of Security Policy Definition
Security Administrators can define the security policy that suits them best
Security Administrators can choose from three predefined security label
component types (array, set, and tree) to define a security label type
A security label can have any number of components of any types as
defined by the security policy (i.e., not the hard-wired level and
compartments as with other MAC solutions)
31
Summary (Continued)
DB2 LBAC selects and applies the relevant LBAC rules based on the
security policy (i.e., not the hard-wired read and write access rules as with
other MAC solutions)
DB2 LBAC can be easily used to address the requirements of application
scenarios where the security label consists of more or less than the
traditional level and compartments components (foreign governments apps.)
Flexibility of Security Label to User Assignment
Database users can be granted a security label for both read and write
access, for read access only, or for write access only
Granting a database user a security label for read access only allows them
to read data, but not modify such data (attractive for assigning to database
users who need access to sensitive data only to generate reports)
Fine Granularity
Security Administrators can protect different tables with different security
policies within the same database
Security Label Encoding
Users provide and retrieve data row labels in the character representation
they are familiar with, but DB2 LBAC stores data row labels in an internal
binary representation for efficient enforcement of the LBAC access rules
32
Summary (Continued)
The following are some points to consider when using LBAC
Create your database, ideally with the new RESTRICT option
Determine who should be your security administrator (SECADM) and assign that
authority to them
Determine how you would like to label your data, e.g., how many security label
components make up your security label, and what are the types of those
components (ARRAY, SET, TREE)?
Determine who should be granted a security label, and who would need to be
granted one or more exemptions
Have your SECADM set the security policy, and grant security labels and
exemptions to users as required
Determine whether you need row level labeling, column level labeling or table
level labeling
Create your tables with the level of granularity you need
33
Thank you!
34