LBAC rule set: DB2LBACRULES

The DB2LBACRULES LBAC rule set provides a traditional set of rules for comparing the values of security label components. It protects from both write-up and write-down.

What are write-up and write down?

Write-up and write-down apply only to components of type ARRAY and only to write access. Write up occurs when the value protecting data that you are writing to is higher than your value. Write-down is when the value protecting the data is lower than yours. By default neither write-up nor write-down is allowed, meaning that you can only write data that is protected by the same value that you have.

When comparing two values for the same component, which rules are used depends on the type of the component (ARRAY, SET, or TREE) and what type of access is being attempted (read, or write). This table lists the rules, tells when each is used, and describes how the rule determines if access is blocked.

Table 1. Summary of the DB2LBACRULES rules
Rule name Used to compare values of this type of component Used for this type of access Access is blocked when this condition is met
DB2LBACREADARRAY ARRAY Read The user's value is lower than the protecting value.
DB2LBACREADSET SET Read There are one or more protecting values that the user does not hold.
DB2LBACREADTREE TREE Read None of the user's values is equal to or an ancestor of one of the protecting values.
DB2LBACWRITEARRAY ARRAY Write The user's value is higher than the protecting value or lower than the protecting value.1
DB2LBACWRITESET SET Write There are one or more protecting values that the user does not hold.
DB2LBACWRITETREE TREE Write None of the user's values is equal to or an ancestor of one of the protecting values.
Note:
  1. The DB2LBACWRITEARRAY rule can be thought of as being two different rules combined. One prevents writing to data that is higher than your level (write-up) and the other prevents writing to data that is lower than your level (write-down). When granting an exemption to this rule you can exempt the user from either of these rules or from both.

How the rules handle empty values

All rules treat empty values the same way. An empty value blocks no other values and is blocked by any non-empty value.

DB2LBACREADSET and DB2LBACWRITESET examples

These examples are valid for a user trying to read or trying to write protected data. They assume that the values are for a component of type SET that has these elements: one two three four
Table 2. Examples of applying the DB2LBACREADSET and DB2LBACWRITESET rules.
User's value Protecting value Access blocked?
'one' 'one' Not blocked. The values are the same.
'(one,two,three)' 'one' Not blocked. The user's value contains the element 'one'.
'(one,two)' '(one,two,four)' Blocked. The element 'four' is in the protecting value but not in the user's value.
'()' 'one' Blocked. An empty value is blocked by any non-empty value.
'one' '()' Not blocked. No value is blocked by an empty value.
'()' '()' Not blocked. No value is blocked by an empty value.

DB2LBACREADTREE and DB2LBACWRITETREE

These examples are valid for both read access and write access. They assume that the values are for a component of type TREE that was defined in this way:
CREATE SECURITY LABEL COMPONENT mycomp 
TREE ( 
    'Corporate'      ROOT, 
    'Publishing'     UNDER 'Corporate', 
    'Software'       UNDER 'Corporate', 
    'Development'    UNDER 'Software', 
    'Sales'          UNDER 'Software', 
    'Support'        UNDER 'Software' 
    'Business Sales' UNDER 'Sales'
    'Home Sales'     UNDER 'Sales'
)
This means the elements are in this arrangement:
Diagram shows the arrangement of the TREE component used in the examples.
Table 3. Examples of applying the DB2LBACREADTREE and DB2LBACWRITETREE rules.
User's value Protecting value Access blocked?
'(Support,Sales)' 'Development' Blocked. The element 'Development' is not one of the user's values and neither 'Support' nor 'Sales' is an ancestor of 'Development'.
'(Development,Software)' '(Business Sales,Publishing)' Not blocked. The element 'Software' is an ancestor of 'Business Sales'.
'(Publishing,Sales)' '(Publishing,Support)' Not blocked. The element 'Publishing' is in both sets of values.
'Corporate' 'Development' Not blocked. The root value is an ancestor of all other values.
'()' 'Sales' Blocked. An empty value is blocked by any non-empty value.
'Home Sales' '()' Not blocked. No value is blocked by an empty value.
'()' '()' Not blocked. No value is blocked by an empty value.

DB2LBACREADARRAY examples

These examples are for read access only. They assume that the values are for a component of type ARRAY that includes these elements in this arrangement:
The elements are listed in order of decreasing value. Top secret is first, then Secret, then Employee, then Public.
Table 4. Examples of applying the DB2LBACREADARRAY rule.
User's value Protecting value Read access blocked?
'Secret' 'Employee' Not blocked. The element 'Secret' is higher than the element 'Employee'.
'Secret' 'Secret' Not blocked. The values are the same.
'Secret' 'Top Secret' Blocked. The element 'Top Secret' is higher than the element 'Secret'.
'()' 'Public' Blocked. An empty value is blocked by any non-empty value.
'Public' '()' Not blocked. No value is blocked by an empty value.
'()' '()' Not blocked. No value is blocked by an empty value.

DB2LBACWRITEARRAY examples

These examples are for write access only. They assume that the values are for a component of type ARRAY that includes these elements in this arrangement:
The elements are listed in order of decreasing value. Top secret is first, then Secret, then Employee, then Public.
Table 5. Examples of applying the DB2LBACWRITEARRAY rule.
User's value Protecting value Write access blocked?
'Secret' 'Employee' Blocked. The element 'Employee' is lower than the element 'Secret'.
'Secret' 'Secret' Not blocked. The values are the same.
'Secret' 'Top Secret' Blocked. The element 'Top Secret' is higher than the element 'Secret'.
'()' 'Public' Blocked. An empty value is blocked by any non-empty value.
'Public' '()' Not blocked. No value is blocked by an empty value.
'()' '()' Not blocked. No value is blocked by an empty value.