3. Exclude Objects from Any Access

Some objects, especially internal ones, must never be part of an object group. Global exclusion rules exclude them from all object groups at once, so they do not have to be excluded in each object group again.

3.1. Add an Exclusion Rule

To exclude objects, use API_SCURTY.ADD_EXCL_OBJ_DISCOVER_RULE. All exclude patterns default to ‘.*’. Restrict at least one of them, as otherwise every object would be excluded.

The following example excludes the complete schema PSV_TEST_TA.

Example: Exclude the Schema PSV_TEST_TA

1EXECUTE SCRIPT API_SCURTY.ADD_EXCL_OBJ_DISCOVER_RULE(
2    'PSV_TEST_TA'   -- p_schema_excl_pattern
3   ,'.*'            -- p_object_excl_pattern
4   ,'.*'            -- p_comment_excl_pattern
5   ,'excl-test'     -- p_rule_comment
6);

The rule is stored in SCURTY.REP_EXCL_OBJ_DISCOVER_RULES:

RULE_ID

SCHEMA_EXCL_PATTERN

OBJECT_EXCL_PATTERN

COMMENT_EXCL_PATTERN

RULE_COMMENT

37

PSV_TEST_TA

.*

.*

excl-test

3.2. Change an Exclusion Rule

To change an exclusion rule, use API_SCURTY.CHANGE_EXCL_OBJ_DISCOVER_RULE with the rule ID from SCURTY.REP_EXCL_OBJ_DISCOVER_RULES. NULL leaves a parameter unchanged, while a blank (’ ‘) restores the default value ‘.*’.

In the following example only the objects containing ‘_TAB’ of the schema are excluded; the rule comment is changed as well.

Example: Restrict the Rule to Objects Containing ‘_TAB’

1EXECUTE SCRIPT API_SCURTY.CHANGE_EXCL_OBJ_DISCOVER_RULE(
2    37                    -- p_rule_id
3   ,null                  -- p_schema_excl_pattern
4   ,'.*_TAB.*'            -- p_object_excl_pattern
5   ,null                  -- p_comment_excl_pattern
6   ,'excl-test-change'    -- p_rule_comment
7);

The rule in SCURTY.REP_EXCL_OBJ_DISCOVER_RULES has changed:

RULE_ID

SCHEMA_EXCL_PATTERN

OBJECT_EXCL_PATTERN

COMMENT_EXCL_PATTERN

RULE_COMMENT

37

PSV_TEST_TA

._TAB.

.*

excl-test-change

3.3. Remove an Exclusion Rule

To remove an exclusion rule, execute API_SCURTY.REMOVE_EXCL_OBJ_DISCOVER_RULE.

Example: Remove the Rule 37

1EXECUTE SCRIPT API_SCURTY.REMOVE_EXCL_OBJ_DISCOVER_RULE(
2    37    -- p_rule_id
3);

The rule is removed from SCURTY.REP_EXCL_OBJ_DISCOVER_RULES. Like all rule changes, it takes effect with the next security refresh.