About Configuring Security Classes
This section contains the following topics:
About Security Classes
A security class is a scope for a set of application privileges. The same application privilege can be defined in multiple security classes. A security class restricts the set of application privileges that may be granted or denied within an ACL. A security class is both a place to define a collection of relevant application privileges and a way to associate an ACL with one security class.
Real Application Security supports a set of predefined application privileges and security classes and also allows applications to define their own custom application privileges using security classes. Each class of object being protected is associated with a security class that indicates the set of operations that may be performed on its objects. There are predefined security classes that define built-in application privileges.
Security classes simplify the task of managing a large number of application privileges. Each ACL is associated with one security class. This security class defines the scope of application privileges that may be granted within the ACL.
Each object type can support a large number of application privileges, and many different object types may share a common set of operations. To simplify these types of specifications, security classes support inheritance.
Security Class Inheritance
A security class can inherit application privileges from parent security classes. A child security class implicitly contains all the application privileges defined in the parent security classes. The application privileges available in a security class are the combination of the application privileges defined in the security class and the application privileges inherited from parent security classes.
A security class can specify a list of parent security classes. The application privileges available in these parent classes become available in the child class. When the same application privilege name is defined in a child and its parent security class, the application privilege in the child replaces or overrides the application privilege in the parent.
Example: Showing Security Class Inheritance shows security class inheritance by creating a security class called HRPRIVS. The HRPRIVS security class defines two application privileges, VIEW_SENSITIVE_INFO and UPDATE_INFO. UPDATE_INFO, which is an aggregate privilege that implies three other privileges: UPDATE, DELETE, and INSERT. The security class HRPRIVS inherits application privileges from DML security class as specified by the parent_list parameter.
Example: Showing Security Class Inheritance
DECLARE
pr_list XS$PRIVILEGE_LIST;
BEGIN
pr_list :=XS$PRIVILEGE_LIST(
XS$PRIVILEGE(name=>'VIEW_SENSITIVE_INFO'),
XS$PRIVILEGE(name=>'UPDATE_INFO',
implied_priv_list=>XS$NAME_LIST
('"UPDATE"', '"DELETE"', '"INSERT"')));
sys.xs_security_class.create_security_class(
name=>'HRPRIVS',
parent_list=>XS$NAME_LIST('DML'),
priv_list=>pr_list);
END;
/
Security Class as Privilege Scope
An ACL has a single security class as its scope. An ACL grants application privileges to principals to control access to protected data or functionality; it can grant only the application privileges that are defined in its security class. The security_class parameter is used to specify the security class in an ACL. When checking an application privilege against an ACL, the security class of the application privilege is resolved based on the security class of the ACL, as the ACL always has an associated security class. If no security class is specified, then the DML Security Class is used as the default security class. Different ACLs can have as their scope the same security class.
DML Security Class
The DML security class is predefined or created during installation. The DML security class contains common application privileges for object manipulation: SELECT, INSERT, UPDATE, and DELETE. If an ACL does not specify its security class, DML is the default security class for the ACL.
Real Application Security DML application privileges are the same as database object privileges and inherently enforced by database object-level operations. However, Real Application Security DML application privileges are effective only when Real Application Security Data Security is enabled for database tables.
About Validating Security Classes
Oracle recommends that you always validate the Real Application Security objects after administrative configuration changes. The XS_DIAG package provides a set of validation APIs to help ensure that these changes do not damage the complicated relationships among your Real Application Security objects.
See “VALIDATE_SECURITY_CLASS Function” for more information about validating a security class.
Manipulating Security Classes
To manipulate security classes, use the procedures in PL/SQL package XS_SECURITY_CLASS; it includes procedures to create, manage, and delete security classes and their application privileges. This package also includes procedures for managing security class inheritance; see “XS_SECURITY_CLASS Package”.
Example: Adding Parent Security Classes for a Specified Security Class invokes ADD_PARENTS to add the parent security class GENPRIVS to the HRPRIVS security class.
Example: Removing One or More Parent Classes for a Specified Security Class invokes REMOVE_PARENTS to remove the parent security class GENPRIVS from the HRPRIVS security class.
Example: Adding One or More Application Privileges to a Security Class invokes ADD_PRIVILEGES to add an aggregate privilege called UPDATE_INFO to the HRPRIVS security class. The aggregate privilege contains the implied privileges UPDATE, DELETE, and INSERT. Note that ADD_PRIVILEGES may be used to add several application privileges to a security class. See “Aggregate Privilege” for more information.
Example: Removing One or More Application Privileges from a Specified Security Class invokes REMOVE_PRIVILEGES to remove the UPDATE_INFO application privilege from the HRPRIVS security class.
Example: Removing all Application Privileges for a Specified Security Class invokes REMOVE_PRIVILEGES to remove all application privileges from the HRPRIVS security class.
Example: Adding One or More Implied Application Privileges to an Aggregate Privilege invokes ADD_IMPLIED_PRIVILEGES to add a list of implied application privileges for the aggregate privilege UPDATE_INFO.
Example: Removing a Specified Implied Application Privileges from an Aggregate Privilege invokes REMOVE_IMPLIED_PRIVILEGES to remove the implicit privilege DELETE from the aggregate privilege UPDATE_INFO.
Example: Removing all Implied Application Privileges from an Aggregate Privilege invokes REMOVE_IMPLIED_PRIVILEGES to remove all implicit application privileges from the aggregate privilege UPDATE_INFO.
The procedure sets a description string for the specified security class. Example: Setting a Description String for a Specified Security Class invokes SET_DESCRIPTION to set a description string for the HRPRIVS security class.
Example: Deleting a Specified Security Class invokes DELETE_SECURITY_CLASS to delete the HRACL ACL using the default delete option DEFAULT_OPTION. Note that this option is defined in “XS_ADMIN_UTIL Package”.
Example: Adding Parent Security Classes for a Specified Security Class
BEGIN
SYS.XS_SECURITY_CLASS.ADD_PARENTS('HRPRIVS','GENPRIVS');
END;
Example: Removing One or More Parent Classes for a Specified Security Class
BEGIN
SYS.XS_SECURITY_CLASS.REMOVE_PARENTS('HRPRIVS','GENPRIVS');
END;
Example: Adding One or More Application Privileges to a Security Class
BEGIN
SYS.XS_SECURITY_CLASS.ADD_PRIVILEGES(sec_class=>'HRPRIVS',
priv=>'UPDATE_INFO',
implied_priv_list=>XS$NAME_LIST('"UPDATE"',
'"DELETE"', '"INSERT"'));
END;
Example: Removing One or More Application Privileges from a Specified Security Class
BEGIN
SYS.XS_SECURITY_CLASS.REMOVE_PRIVILEGES('HRPRIVS','UPDATE_INFO');
END;
Example: Removing all Application Privileges for a Specified Security Class
BEGIN
SYS.XS_SECURITY_CLASS.REMOVE_PRIVILEGES('HRPRIVS');
END;
Example: Adding One or More Implied Application Privileges to an Aggregate Privilege
BEGIN
SYS.XS_SECURITY_CLASS.ADD_IMPLIED_PRIVILEGES(priv=>'UPDATE_INFO',
implied_priv_list=>XS$NAME_LIST('"UPDATE"', '"DELETE"', '"INSERT"'));
END;
Example: Removing a Specified Implied Application Privileges from an Aggregate Privilege
BEGIN
SYS.XS_SECURITY_CLASS.REMOVE_IMPLIED_PRIVILEGES('UPDATE_INFO','"DELETE"');
END;
Example: Removing all Implied Application Privileges from an Aggregate Privilege
BEGIN
SYS.XS_SECURITY_CLASS.REMOVE_IMPLIED_PRIVILEGES('UPDATE_INFO');
END;
Example: Setting a Description String for a Specified Security Class
BEGIN
SYS.XS_SECURITY_CLASS.SET_DESCRIPTION(
'HRPRIVS','Contains privileges required to manage HR data');
END;
Example: Deleting a Specified Security Class
BEGIN
SYS.XS_SECURITY_CLASS.DELETE_SECURITY_CLASS('HRPRIVS',XS_ADMIN_UTIL.DEFAULT_OPTION);
END;