About Application Privileges
The database has predefined system privileges, such as CREATE TABLE, and object privileges, such as UPDATE. A large number of custom privileges that must be defined for enterprise applications are often called application-defined privileges. Real Application Security introduces the definition of these privileges, termed application privileges, in the database. For application developers, these custom application privileges are used for access control on application-level operations. These application-level operations allow fine-grained access on data at a granular level of columns, rows, or cells.
When an application privilege is explicitly bound to a resource, for example, rows and columns of a table, an application privilege can be used to protect an application-level operation on a database object. Alternatively, it may be used in the same manner as a system privilege when binding to a resource is not required.
See Also: About Checking ACLs for a Privilege
This section contains the following topic: Aggregate Privilege.
Aggregate Privilege
A Real Application Security aggregate privilege implies a set of other application privileges. The implied application privileges of an aggregate privilege can be any application privilege defined by the current security class or an inherited application privilege (see “About Configuring Security Classes” for more information). When an aggregate privilege is granted or denied, its implied application privileges are implicitly granted or denied.
When an aggregate privilege AG implies the application privileges p1 and p2, granting the application privilege, AG, implies that both p1 and p2 are granted. However, granting both the p1 and p2 does not imply that AG is granted.
Aggregate privileges are useful for the following purposes:
-
Enabling grouping and granting a set of application privileges as a single grant, simplifying application privilege administration. A group name or an alias for a set of application privileges, where the group name itself is not an application privilege, makes checking for the set simpler as it checks for each application privilege in the group.
-
Providing an efficient way to check a set of application privileges based on a single application privilege check.
Example: Adding an Aggregate Privilege to a Security Class adds an aggregate privilege called UPDATE_INFO to the HRPRIVS security class. The aggregate privilege contains the implied privileges UPDATE, DELETE, and INSERT.
When the group name itself is a first class privilege, there may be several possible semantics for the aggregate privilege based on its relationship to its members. When defining a semantic to represent an aggregate privilege, you must consider various relations between the aggregate privilege and its members, such as imply and include. For example, consider the imply relation in Java Security; selecting this semantic when granting an aggregate privilege implies granting all its member application privileges individually, but not the aggregate privilege. Therefore, granting all the member application privileges of an aggregate does not imply granting the aggregate privilege.
Example: Adding Implied Privileges to an Aggregate Privilege adds a list of implied application privileges for the aggregate privilege UPDATE_INFO.
An aggregate privilege is not an application role. An application role itself is not an application privilege that protects a resource. Application roles are used to activate and deactivate application privileges available to an application user to enforce role-based access control constraints.
Also, an aggregate privilege is not a security class. A security class is not an application privilege that can be granted to a user. A security class lists a set of application privileges including aggregate privileges that may be either granted or denied in an ACL. Within a security class, many aggregate privileges may be defined based on the application privileges available in the security class.
An aggregate privilege can have other aggregate privileges as its members. Note that the member privileges of an aggregate privilege must be defined in the same security class (or in an ancestor security class) as the aggregate privilege. An aggregate privilege definition cannot create a cycle.
Example: Adding an Aggregate Privilege 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: Adding Implied Privileges to an Aggregate Privilege
BEGIN
SYS.XS_SECURITY_CLASS.ADD_IMPLIED_PRIVILEGES(sec_class =>'HRPRIVS',(priv=>'UPDATE_INFO',
implied_priv_list=>XS$NAME_LIST('"UPDATE"', '"DELETE"', '"INSERT"'));
END;
This section contains: ALL Privilege.
ALL Privilege
The ALL privilege is a predefined aggregate privilege. Every security class has the ALL privilege, and it contains all the application privileges of that security class. ALL is not explicitly defined in every security class, but it is internally understood by the system based on the security class associated with the ACL. The cardinality of an ALL for a security class changes whenever an application privilege is added or removed from the security class.
Use of the ALL construct enables Real Application Security to express access control policy such as “grant all the application privileges to the application user u1 defined for an application except the specific privilege p1”. Example: Using ALL Grant shows an ACL in the security class, AppSecurityClass, which has all the application privileges for the application. The ordered evaluation of ACEs ensures that the ALL except p1 is granted to the application user u1.
Example: Using ALL Grant
select NAME, SECURITY_CLASS, PARENT_ACL from DBA_XS_ACLS;
NAME SECURITY_CLASS PARENT_ACL
---------- ---------------- ---------------
sampleACL AppSecurityClass
select ACL, ACE_ORDER, GRANT_TYPE, PRINCIPAL, PRIVILEGE from DBA_XS_ACES;
ACL ACE_ORDER GRANT_TYPE PRINCIPAL PRIVILEGE
--------- --------- ---------- ------------ ----------
sampleACL 1 DENY U1 p1
sampleACL 2 GRANT U1 ALL