| Oracle® Label Security Administrator's Guide 10g Release 1 (10.1) Part Number B10774-01 |
|
|
View PDF |
In Oracle Label Security, you can set authorizations for users, and grant privileges to users or stored program units by means of the available Oracle Label Security packages, or Oracle Policy Manager.
To manage user labels and privileges, you must have EXECUTE privilege for the SA_USER_ADMIN package, and must have been granted th e policy_DBA role.
To perform these functions with Oracle Policy Ma nager, go to Oracle Label Security Policies--> policyname-->Authorizations-->Users and use the User property sheet.
The SA_USER_ADM IN package provides the functions to manage the Oracle Label Security user security attributes. It contains several procedures to man age user labels by component: that is, specifying user levels, compartments, and groups. For convenience, there are additional proced ures that accept character string representations of full labels, rather than components. Note that the level, compartment and group parameters use the short name defined for each component.
All of the label and privilege in formation is stored in Oracle Label Security data dictionary tables. When a user connects to the database, his session labels are est ablished based on the information stored in the Oracle Label Security data dictionary.
Note that a user can be authorized under multiple policies.
The following SA_USER_ADMIN procedures enable you to manage user labels by label component:
The SET_LEVELS procedure assigns a minimum and maximum level to a us er and identifies default values for the user's session label and row label.
Syntax:
PROCEDURE SET_LEVELS (policy_name IN VARCHAR2, user_name IN VARCHAR2, max_level IN VARCHAR2, min_level IN VARCHAR2 DEFAULT NULL, def_level IN VARCHAR2 DEFAULT NULL, row_level IN VARCHAR2 DEFAU LT NULL);
|
Parameter |
< p class="THC" align="center">Meaning |
|---|---|
|
policy_name |
Specifies the policy |
|
user_name |
Specifies the user name |
|
max_level |
<
/a>
The highest level for read and write access |
|
min_level |
The lowest level for write access |
|
def_level |
S pecifies the default level (equal to or greater than the minimum level, and equal to or less than the maximum level) |
row_level |
Specifies the row level (equal to or greater than the minimum lev el, and equal to or less than the default level) |
The SET_COMPARTMENTS procedure assigns compartments to a user and identifies default values for the user 's session label and row label.
All users must have their levels se t before their authorized compartments can be established.
The write compartments, if speci fied, must be a subset of the read compartments. (The write compartments are those to which the user should have write access.)
< a name="1012276">Syntax:
PROCEDURE SET_CO MPARTMENTS (policy_name IN VARCHAR2, user_name IN VARCHAR2, read_comps IN VARC HAR2, write_comps IN VARCHAR2 DEFAULT NULL, def_comps IN VARCHAR2 DEFAULT NULL, row_comps IN VARCHAR2 DEFAULT NULL);
The SET_GROUPS procedure assigns groups to a user and identifies default va lues for the user's session label and row label.
All users mu st have their levels set before their authorized groups can be established.
Syntax:
PROCEDURE SET_GROUPS (policy_name IN VARCHAR2, user_name IN VARCHAR2, read_groups IN VARCHAR2, write_groups IN VA RCHAR2 DEFAULT NULL, def_group IN VARCHAR2 DEFAULT NULL, row_groups IN V ARCHAR2 DEFAULT NULL);
The ALTER_COMPARTMENTS procedure changes the write ac cess, the default label indicator, and/or the row label indicator for each of the compartments in the list.
Syntax:
PROCEDURE ALTER_COMPARTMENTS (policy _name IN VARCHAR2, user_name IN VARCHAR2, comps IN VARCHAR2, access_mode IN VARCHAR2 DEFAULT NULL, in_def IN VARCHAR2 DEFAULT NULL, in_row IN VARCHAR2 DEFAULT NULL);
|
Parameter |
Meaning |
|---|---|
|
policy_name |
Specifies the policy | <
/tr>
|
user_n ame |
Specifies the user name |
|
comps |
A comma-delimited list of compartments to modify |
|
access_mode |
One of two public variables that contain string values that can specify the type of a ccess authorized. The variable names, values, and meaning are as follows: SA_UTL.READ_ONLY R EAD_ONLY Indicates no write access SA_UTL.READ_WRITE READ_WRITE Indicates write is authorize d If access_mode is NULL, then access_mode for the compartment is un altered. |
|
in_def |
Specifies whether these compartments should be in the default compartments (Y/N) If in_def is NULL, then in_def for the compartment is unaltered. |
| <
/a>
in_row |
Specifies whether these compartments should be in the row label (Y/N) If in_row is NU LL, then in_row for the compartment is unaltered. |
This procedure adds compartments to a user's authorizations, indicating whether the compartments are au thorized for write as well as read.
Syntax:
PROCEDURE ADD_COMPARTMENTS (policy_name IN VARCHAR2, user_name IN VARCHAR2, comps IN VARCHAR2, access_model IN VARCHAR2 DEFAULT NULL, in_ def IN VARCHAR2 DEFAULT NULL, in_row IN VARCHAR2 DEFAULT NULL);
|
Parameter |
Meaning |
|---|---|
| policy_name | Specifies the policy |
| user_name | Specifies the user nam e |
| comps | A comma-delimited list of read compartments to add |
| access_mode |
One of two public variables that contain str ing values that can specify the type of access authorized. The variable names, values, and meaning are as follows: SA_UTL.READ_ONLY READ_ONLY Indicates no write access SA_UTL.READ_WRIT E READ_WRITE Indicates write is authorized If access_mode is NULL, t hen it is set to SA_UTL.READ_ONLY. |
| <
/a>
in_def |
Specifies whether these compartments should be in the default compartments (Y/N) If in_def is NULL, then it is set to Y. |
|
in_row |
Specifies whethe r these compartments should be in the row label (Y/N) If in_row is N ULL, then it is set to N. |
The DROP_COMPARTMENTS procedure drops the specified compartments from a user's authorizations.
Syntax:
PROCEDURE DROP_COMPARTMENTS (policy_name I N VARCHAR2, user_name IN VARCHAR2, comps IN VARCHAR2);
|
Para meter |
Meaning |
|---|---|
|
policy_name |
|
|
user_name |
Specifies the user name |
|
comps |
A comma-delimited list of compartments to drop |
The DROP_ALL_COMPARTMENTS procedure drops all compartments from a user's authorizations.
Syntax:
PROCEDURE DROP_ALL_COMPAR TMENTS (policy_name IN VARCHAR2, user_name IN VARCHAR2);
|
Parameter th> |
Meaning |
|---|---|
|
policy_name |
Specifies the policy |
|
user_name |
Specifies the user name |
Th e ADD_GROUPS procedure adds groups to a user, indicating whether the groups are authorized for write as well as read.
Syntax:
PROCEDURE ADD_GROUPS (poli cy_name IN VARCHAR2, user_name IN VARCHAR2, groups IN VARCHAR2, access_mode IN VARCHAR2 DEFAULT NULL, in_def IN VARCHAR2 DEFAULT NULL, in_row IN VARCHAR2 DEFAULT NULL);
The ALTER_GROUPS proce dure changes the write access, the default label indicator, and/or the row label indicator for each of the groups in the list.
Syntax:
PROCEDURE ALTER_G ROUPS (policy_name IN VARCHAR2, user_name IN VARCHAR2, groups IN VAR CHAR2, access_mode IN VARCHAR2 DEFAULT NULL, in_def IN VARCHAR2 DEFAUL T NULL, in_row IN VARCHAR2 DEFAULT NULL);
The DROP_GROUPS procedure drops the specified groups from a user's authorizations.
Syntax:
PROCEDURE DROP_GROUPS (policy_name IN VARCHAR2, user_name IN VARCHAR2, groups IN VARCHAR2);
|
Parameter |
Meaning |
|---|---|
|
Specifies the policy | |
|
user_name |
Spe cifies the user name |
|
groups |
A comma-delimited list of group s to drop |
The DROP_AL L_GROUPS procedure drops all groups from a user's authorizations.
Synt ax:
PROCEDURE DROP_ALL_GROUPS (policy_name IN VARCHAR2, us er_name IN VARCHAR2);
|
Parameter |
Meaning |
|---|---|
|
policy_name |
Specifies the policy |
|
user_name |
Specifies the user name |
The following SA_USER_ADMIN procedures e nable you to manage user labels by specifying the complete character label string:
The SET_USER_LABELS procedure sets the user's levels, compartments, and groups using a set of labels, instead of the individual c omponents.
Syntax:
PROCEDURE SET_USER_LABELS ( policy_name IN VARCHAR2, user_name IN VARCHAR 2, max_read_label IN VARCHAR2, max_write_label IN VARCHAR2 DEFAULT NULL, min_write_label IN VARCHAR2 DEFAULT NULL, def_label IN VARCHAR2 DEFAULT NULL, row_label IN VARCHAR2 DEFAULT NULL);
The SET_DEFAUL T_LABEL procedure sets the user's initial session label to the one specified.
Syntax:
PROCEDURE SET_DEFAULT_LABELS ( policy_name IN VARCHAR2, user_name IN VARCHAR2, def_label IN VARCHAR2);
As long as the row label will s till be dominated by the new write label, the user can set the session label to:
The row label must be dominated by the new write label that will result f rom resetting the session label. If this condition is not true, the SET_DEFAULT_LABEL procedure will fail.
For example, suppose the current row label is S:A,B, and that you have write access to both compartments. If you atte mpt to set the new default label to C:A,B the SET_LABEL procedure will fail. This is because the new write label would be C:A,B, whic h does not dominate the current row label.
To successfully reset the session label in this case, you must first lower the row label to a value that will be dominated by the resulting session label.
Use the SET_ROW_LABEL procedure to set the user's initial row label to the one specified.
Syntax:
PROCEDURE SET_ROW_LABEL ( policy_name IN VARCHAR2, user_name IN VARCHAR2, row_label IN VARCHAR2);
The user can set the row label in dependently, but only to:
If you try to set the row label to an invalid value, the operation is disallowed, and the row label value is unchanged.
Use the DROP_USER_ACCESS procedure to remove all Oracle Label Security authorizations and privileges from the specified user. This procedure must be issued from the command line. It is not available in Oracle Policy Man ager.
Syntax:
PROCE DURE DROP_USER_ACCESS ( policy_name IN VARCHAR2, user_name IN VARCHAR2);
|
Parameter |
Meaning |
policy_name em> |
Specifies the policy |
|---|---|
|
user_name |
Specifies the user name |
The SET_USER_PRIVS procedure sets policy-specific privilege s for users. These privileges do not become effective in the current session; rather, they become effective the next time the user lo gs in. The new set of privileges replaces any existing privileges. A NULL value for the privileges parameter removes the user's privi leges for the policy.
To assign policy privileges to users, you must have EXECUTE privilege for the SA_USER_ADMIN package, and must have been granted the policy_DBA role.
< p class="BP">To use Oracle Policy Manager to perform these functions, go to the Privileges tab of the User property sheet.Syntax:
PROCEDURE SET_USER_PR IVS ( policy_name IN VARCHAR2, user_name IN VARCHAR2, privileges IN VARCHAR2);
The SET_ACCESS_PROFILE procedure sets t he Oracle Label Security authorizations and privileges of the database session to those of the specified user. (Note that the origina ting user retains the PROFILE_ACCESS privilege.)
The user executing the SA_SESSION.SET_ACCE SS_PROFILE procedure must have the PROFILE_ACCESS privilege. Note that the logged-in database user (the Oracle userid) does not chang e. That user assumes only the authorizations and privileges of the specified user. By contrast, the Oracle Label Security user name < em class="Italic">is changed.
This administrative procedure is useful for various task s:
Syntax:
PROCEDURE SET_ACCESS_PROFILE (policy_n ame IN VARCHAR2 user_name IN VARCHAR2);
|
Parameter |
Meaning |
|---|---|
|
policy_name |
The name of an existing policy |
|
user_name |
Name of the user whose authorizations and privileges should be assumed |
The SA_USER_NAME function returns the name of the current Oracle Label Security user, as set by the SET_ACCESS_PROFILE procedure (or as established at login). This is how you can determine the identity of the curr ent user in relation to Oracle Label Security, rather than in relation to your Oracle login name.
Syntax:
FUNCTION SA_USER_NAME (policy_name IN VARCHAR2 ) RETURN VARCHAR2;
|
Parameter |
Meaning |
|---|---|
|
policy_name |
The name of an existing polic y |
This section de scribes views you can use to see the user authorization and privilege assignments made by the administrator.
a>Note that the views are designed to display these values from two different perspectives. The DBA_SA_USERS view is optimized for users of the command-line interface. The component views are optimized for users of the Oracle Policy Manager administr ative tool.
The DBA_SA_USERS view displays the values assigned for privileges, levels, compartments, and gro ups all together--corresponding to how you enter these values through the SA_USER_ADMIN command-line interface. The values include: p>
USER_PRIVILEGES
MAX_READ_LABEL
MAX_WRITE_LABEL
MIN_WRITE_LABEL
DEFAULT_READ_LABEL
DEFAULT_WRITE_LABEL
DEFA ULT_ROW_LABEL
USER_LABELS
This information is stor ed in data dictionary tables, and used to establish session and row labels when a user logs in.
|
Note: The field USER_LABE LS in DBA_SA_USERS is retained solely for backward compatibility and will be removed in the next release. |
The following views displ ay individually each component of the label, corresponding to how you enter these values through Oracle Policy Manager.