2.4a Informix Security LBAC Lab
2.4a Informix Security LBAC Lab
Informix Security -
Label-Based
Access Control
(LBAC)
1. INTRODUCTION ...........................................................................................3
2. SUGGESTED READING...............................................................................4
3. IMPLEMENTING COLUMN LEVEL SECURITY ...........................................4
3.1 PROBLEM IN HAND .....................................................................................5
3.2 ANALYZING THE DATA RESTRICTIONS ..........................................................7
3.3 DESIGNING THE SECURITY SOLUTION ..........................................................7
3.4 IMPLEMENTING THE SECURITY SOLUTION .....................................................9
3.5 WATCH THE LBAC SOLUTION IN ACTION....................................................18
2
1. Introduction
Label-based access control (LBAC) is an implementation of multi-level
security (MLS) that enables you to control who has read access and
who has write access to individual rows and columns of table data.
Label-Based Access Control (LBAC) controls access to table objects
by attaching security labels to them. Users attempting to access an
object must have its security label granted to them. When there's a
match, access is permitted; without a match, access is denied.
There are three types of security labels:
Row security labels: A security label associated with a data
row or record in a database table.
Column security labels: A security label associated with a
column in a database table.
User security labels: A security label granted to a user.
A security label is composed of one or more security label
components. There are three types of security label components that
you can use to build your security labels:
Sets: A set is a collection of elements where the order in which
those elements appear is not important. All elements are
deemed equal.
Arrays: An array is an ordered set that can be used to represent a
simple hierarchy. In an array, the order in which the
elements appear is important. For example, the first element
ranks higher than the second element, and the second
higher than the third.
Trees: A tree represents a more complex hierarchy that can have
multiple nodes and branches. For example, trees can be
used to represent organizational charts.
You use a security policy to define the security label components
that make up a particular security label.
The Informix Security Administrator (DBSECADM) is required to
create and manipulate LBAC objects. DBSECADM authority can only
be granted by the database manager (DBM). DBM does not have
DBSECADM role by default.
3
2. Suggested Reading
4
3.1 Problem in hand
The Human Resource department of Global Life Financial would like
to allow employees, managers, and HR staff to access data in the
EMP table. This table contains information with different levels of
sensitivity, and so some restrictions should be made with regards to
access:
¾ Name, gender, department, and phone number are considered
to be unclassified information and can be available to all
employees.
¾ Employee number, hire date, job, and education level are
confidential and should be restricted to managers and HR staff.
¾ Birth date, salary, bonus, and commission are highly
confidential information and should be restricted to HR staff.
Some of the users who access the table are summarized in the
following table:
NAME POSITION
Jen HR Staff
Noel Manager
Sunny Regular Employee
5
The existing EMP table is tagged with security labels that indicate a
column's level of sensitivity.
6
3.2 Analyzing the data restrictions
In this exercise, you need to determine how to manage access to the
columns of the EMP table. You need to enforce the following
restrictions:
¾ Anyone with access to the EMP table can read unclassified
columns.
¾ Managers can also read all confidential columns.
¾ HR staff has READ/WRITE access to all columns in the table.
7
3.3.1 Selecting the column security labels
From your analysis, you determine that each column requires a
security label based on its sensitivity. Therefore, three security labels
are needed: one for each level of sensitivity -- HIGHLY
CONFIDENTIAL, CONFIDENTIAL, and UNCLASSIFIED. This seems
to be a simple hierarchy, and you consider using an ARRAY for the
security label component.
8
An ARRAY still seems to be appropriate for the security label. If the
order of elements in the array is HIGHLY CONFIDENTIAL,
CONFIDENTIAL, UNCLASSIFIED, then HR members granted a
HIGHLY CONFIDENTIAL security label would have access to all
information at the HIGHLY CONFIDENTIAL level and below (in this
case, CONFIDENTIAL and UNCLASSIFIED).
HR access to data in the EMP table should be READ/WRITE.
9
¾ Right click on the desktop area and choose Open Terminal.
10
unset DBDATE
11
3.4.3.1 Define the Security Label Component
From your analysis, you decided that an array-type security label
component can be used for the following ordered set of elements:
HIGHLY CONFIDENTIAL, CONFIDENTIAL, and UNCLASSIFIED.
The following statement creates this security label component.
12
3.4.3.2 Define the Security Policy
After the security label component is created, you need to create the
security policy. The following statements create a security policy called
access_employee_policy that uses the slc_level component you
previously created.
CREATE SECURITY POLICY access_employee_policy
COMPONENTS slc_level WITH IDSLBACRULES
RESTRICT NOT AUTHORIZED WRITE SECURITY LABEL
13
The following statements create the security labels:
CREATE SECURITY LABEL
access_employee_policy.HIGHCONFIDENTIAL
COMPONENT slc_level 'HIGHLY CONFIDENTIAL';
CREATE SECURITY LABEL
access_employee_policy.CONFIDENTIAL
COMPONENT slc_level 'CONFIDENTIAL';
CREATE SECURITY LABEL
access_employee_policy.UNCLASSIFIED
COMPONENT slc_level 'UNCLASSIFIED';
14
3.4.4 Create the EMP table and load the sample data
Following commands create the EMP table and insert a sample row
into the table.
CREATE TABLE EMP (EMPNO CHARACTER(6), FIRSTNAME VARCHAR(12),
MIDINIT CHARACTER(1), LASTNAME VARCHAR(15), WORKDEPT
CHARACTER(3), PHONENO CHARACTER(4), GENDER CHARACTER(1),
HIREDATE DATE, JOB CHARACTER(8), EDLEVEL SMALLINT, BIRTHDATE
DATE, SALARY DECIMAL(9), BONUS DECIMAL(9), COMMISSION
DECIMAL(9));
15
3.4.5 Protect the EMP table
Now you need to alter the EMP table in order to protect the columns
with the security labels you defined and attach the security policy to
the table.
The following statement is used to accomplish this task:
ALTER TABLE EMP
16
¾ If the command is executed successfully, you will see the
following messages on the screen.
Database selected.
Table altered.
Database closed.
17
¾ If the command is executed successfully, you will see the
following messages on the screen.
Database selected.
Security label granted.
Security label granted.
Security label granted.
Database closed.
18
¾ Connect to the demo_on instance as user jen at the DB-
Access prompt.
connect to ‘@demo_on’ user ‘jen’;
Enter jen as the password when prompted.
Result: Once you enter the password, you will see a message
saying that you are connected.
Result: You will see the entire table contents displayed. This is
because user Jen has full read access to all the columns in the
EMP table.
19
3.5.2 Login as Noel and try to access the EMP table
3.5.2.1 Try to access Highly Confidential columns
Try to access the highly confidential columns such as SALARY and
BONUS, that Noel doesn’t have access to.
¾ At the DB-Access interactive prompt, connect to the demo_on
instance as user Noel.
connect to ‘@demo_on’ user ‘noel’;
Enter noel as the password when prompted.
Result: Once you enter the password, you will see a message
saying that you are connected.
Result: You will see an error message saying that the user
doesn’t have access to protected columns.
20
3.5.2.2 Trying to access Unclassified and Confidential columns
Try to access unclassified and confidential columns that Noel does
have access to.
¾ Enter the following SELECT statement.
select empno, firstname, job from emp;
Result: Once you enter the password, you will see a message
saying that you are connected.
21
¾ Enter the following SELECT statement.
select empno, hiredate, salary, bonus from
emp;
Result: You will see an error message saying that the user
doesn’t have access to protected columns.
This concludes the lab. If you have completed all the exercises and have
extra time, feel free to continue exploring with the utilities/functionality
described here – for example, try inserting, updating, and deleting
columns or implement LBAC at the row level. Otherwise, you can close
the open any open terminal and web browser windows.
22
© Copyright IBM Corporation 2011
All Rights Reserved.
IBM Canada
8200 Warden Avenue
Markham, ON
L6G 1C7
Canada
Printed in Canada
01/2011
IBM, IBM (logo), and Informix are trademarks or registered Information concerning non-IBM products was obtained from the
trademarks of International Business Machines Corporation in the suppliers of those products, their published announcements or
United States, other countries, or both. other publicly available sources. IBM has not tested those products
and cannot confirm the accuracy of performance, compatibility or
Linux is a trademark of Linus Torvalds in the United States, other any other claims related to non-IBM products. Questions on the
countries, or both capabilities of non-IBM products should be addressed to the
suppliers of those products.
UNIX is a registered trademark of The Open Group in the United
States, other countries, or both The information in this publication is provided AS IS without
warranty. Such information was obtained from publicly available
Windows is a trademark of Microsoft Corporation in the United sources, is current as of January 2010, and is subject to change.
States, other countries, or both. Any performance data included in the paper was obtained in the
specific operating environment and is provided as an illustration.
Other company, product, or service names may be trademarks or Performance in other operating environments may vary. More
service marks of others. specific information about the capabilities of products described
should be obtained from the suppliers of those products.
References in this publication to IBM products or services do not
imply that IBM intends to make them available in all countries in
which IBM operates. The following paragraph does not apply to the
United Kingdom or any other country where such provisions are
inconsistent with local law:
23