Database Vault Administrators Guide
Database Vault Administrators Guide
Database Vault Administrators Guide
Administrator's Guide
E85657-18
Contributors: Taousif Ansari , Tom Best, Sanjay Bharadwaj , Todd Bottger, Ji-won Byun, Ben Chang, Martin
Cheng, Chi Ching Chui, Scott Gaetjen, Viksit Gaur, Rishabh Gupta, Lijie Heng, Dominique Jeunot, Peter
Knaggs, Suman Kumar, Chon Lee, Rudregowda Mallegowda, Paul Needham, Yi Ouyang, Hozefa
Palitanawala, Robert Pang, Gayathri Sairamkrishnan, Vipin Samar, James Spiller, Srividya Tata, Kamal
Tbeileh, Saravana Soundararajan, Sudheesh Varma, Peter Wahl, Alan Williams
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,
transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse
engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is
prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software, software documentation, data (as defined in the Federal Acquisition Regulation), or related
documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S.
Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software,
any programs embedded, installed, or activated on delivered hardware, and modifications of such programs)
and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end
users are "commercial computer software," "commercial computer software documentation," or "limited rights
data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental
regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation
of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated
software, any programs embedded, installed, or activated on delivered hardware, and modifications of such
programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and
limitations specified in the license contained in the applicable contract. The terms governing the U.S.
Government's use of Oracle cloud services are defined by the applicable contract for such services. No other
rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications.
It is not developed or intended for use in any inherently dangerous applications, including applications that
may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you
shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its
safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this
software or hardware in dangerous applications.
Oracle®, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are
used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc,
and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered
trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products,
and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly
disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise
set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be
responsible for any loss, costs, or damages incurred due to your access to or use of third-party content,
products, or services, except as set forth in an applicable agreement between you and Oracle.
Contents
Preface
Audience xxxi
Documentation Accessibility xxxi
Related Documents xxxi
Conventions xxxii
iii
2 What to Expect After You Enable Oracle Database Vault
2.1 Initialization and Password Parameter Settings That Change 2-1
2.2 How Oracle Database Vault Restricts User Authorizations 2-3
2.3 New Database Roles to Enforce Separation of Duties 2-3
2.4 Privileges That Are Revoked from Existing Users and Roles 2-3
2.5 Privileges That Are Prevented for Existing Users and Roles 2-5
2.6 Modified AUDIT Statement Settings for a Non-Unified Audit Environment 2-5
iv
4.1.5.2 Development of Secure Applications 4-4
4.1.6 How Does a Multitenant Environment Affect Privilege Analysis? 4-4
4.2 Creating and Managing Privilege Analysis Policies 4-5
4.2.1 About Creating and Managing Privilege Analysis Policies 4-5
4.2.2 General Steps for Managing Privilege Analysis 4-6
4.2.3 Creating a Privilege Analysis Policy 4-6
4.2.3.1 About Creating a Privilege Analysis Policy 4-7
4.2.3.2 Creating a Privilege Analysis Policy in Enterprise Manager Cloud Control 4-7
4.2.3.3 Creating a Privilege Analysis Policy Using
DBMS_PRIVILEGE_CAPTURE 4-9
4.2.4 Examples of Privilege Analysis Policies 4-11
4.2.4.1 Example: Privilege Analysis of Database-Wide Privileges 4-11
4.2.4.2 Example: Privilege Analysis of Privilege Usage of Two Roles 4-11
4.2.4.3 Example: Privilege Analysis of Privileges During SQL*Plus Use 4-12
4.2.4.4 Example: Privilege Analysis of PSMITH Privileges During SQL*Plus
Access 4-12
4.2.5 Enabling a Privilege Analysis Policy 4-12
4.2.5.1 About Enabling a Privilege Analysis Policy 4-13
4.2.5.2 Enabling a Privilege Analysis Policy Using Cloud Control 4-14
4.2.5.3 Enabling a Privilege Analysis Policy Using
DBMS_PRIVILEGE_CAPTURE 4-14
4.2.6 Disabling a Privilege Analysis Policy 4-14
4.2.6.1 About Disabling a Privilege Analysis Policy 4-15
4.2.6.2 Disabling a Privilege Analysis Policy Using Cloud Control 4-15
4.2.6.3 Disabling a Privilege Analysis Policy Using
DBMS_PRIVILEGE_CAPTURE 4-15
4.2.7 Generating a Privilege Analysis Report 4-15
4.2.7.1 About Generating a Privilege Analysis Report 4-16
4.2.7.2 Generating a Privilege Analysis Report Using Cloud Control 4-16
4.2.7.3 Accessing Privilege Analysis Reports Using Cloud Control 4-16
4.2.7.4 Generating a Privilege Analysis Report Using
DBMS_PRIVILEGE_CAPTURE 4-17
4.2.8 Dropping a Privilege Analysis Policy 4-18
4.2.8.1 About Dropping a Privilege Analysis Policy 4-18
4.2.8.2 Dropping a Privilege Analysis Policy Using Cloud Control 4-18
4.2.8.3 Dropping a Privilege Analysis Policy Using the
DBMS_PRIVILEGE_CAPTURE Package 4-18
4.3 Creating Roles and Managing Privileges Using Cloud Control 4-19
4.3.1 Creating a Role from a Privilege Analysis Report in Cloud Control 4-19
4.3.2 Revoking and Regranting Roles and Privileges Using Cloud Control 4-20
4.3.3 Generating a Revoke or Regrant Script Using Cloud Control 4-20
4.3.3.1 About Generating Revoke and Regrant Scripts 4-21
4.3.3.2 Generating a Revoke Script 4-21
v
4.3.3.3 Generating a Regrant Script 4-22
4.4 Tutorial: Using Capture Runs to Analyze ANY Privilege Use 4-22
4.4.1 Step 1: Create User Accounts 4-23
4.4.2 Step 2: Create and Enable a Privilege Analysis Policy 4-24
4.4.3 Step 3: Use the READ ANY TABLE System Privilege 4-24
4.4.4 Step 4: Disable the Privilege Analysis Policy 4-25
4.4.5 Step 5: Generate and View a Privilege Analysis Report 4-25
4.4.6 Step 6: Create a Second Capture Run 4-26
4.4.7 Step 7: Remove the Components for This Tutorial 4-27
4.5 Tutorial: Analyzing Privilege Use by a User Who Has the DBA Role 4-27
4.5.1 Step 1: Create User Accounts 4-28
4.5.2 Step 2: Create and Enable a Privilege Analysis Policy 4-29
4.5.3 Step 3: Perform the Database Tuning Operations 4-29
4.5.4 Step 4: Disable the Privilege Analysis Policy 4-30
4.5.5 Step 5: Generate and View Privilege Analysis Reports 4-30
4.5.6 Step 6: Remove the Components for This Tutorial 4-32
4.6 Privilege Analysis Policy and Report Data Dictionary Views 4-32
5 Configuring Realms
5.1 What Are Realms? 5-2
5.1.1 About Realms 5-2
5.1.2 Mandatory Realms to Restrict User Access to Objects within a Realm 5-3
5.1.3 Realms in a Multitenant Environment 5-4
5.1.4 Object Types That Realms Can Protect 5-5
5.2 Default Realms 5-5
5.2.1 Oracle Database Vault Realm 5-6
5.2.2 Database Vault Account Management Realm 5-6
5.2.3 Oracle Enterprise Manager Realm 5-7
5.2.4 Oracle Default Schema Protection Realm 5-7
5.2.5 Oracle System Privilege and Role Management Realm 5-7
5.2.6 Oracle Default Component Protection Realm 5-8
5.3 Creating a Realm 5-8
5.4 About Realm-Secured Objects 5-11
5.5 About Realm Authorization 5-12
5.6 Realm Authorizations in a Multitenant Environment 5-12
5.7 Modifying the Enablement Status of a Realm 5-14
5.8 Deleting a Realm 5-14
5.9 How Realms Work 5-14
5.10 How Authorizations Work in a Realm 5-16
5.10.1 About Authorizations in a Realm 5-16
vi
5.10.2 Examples of Realm Authorizations 5-16
5.10.2.1 Example: Unauthorized User Trying to Create a Table 5-17
5.10.2.2 Example: Unauthorized User Trying to Use the DELETE ANY TABLE
Privilege 5-17
5.10.2.3 Example: Authorized User Performing DELETE Operation 5-17
5.11 Access to Objects That Are Protected by a Realm 5-18
5.12 Example of How Realms Work 5-18
5.13 How Realms Affect Other Oracle Database Vault Components 5-19
5.14 Guidelines for Designing Realms 5-19
5.15 How Realms Affect Performance 5-21
5.16 Realm Related Reports and Data Dictionary Views 5-21
vii
6.11.2 Step 1: Create Users for This Tutorial 6-24
6.11.3 Step 2: Create a Function to Check if User patch_boss Is Logged In 6-25
6.11.4 Step 3: Create Rules, a Rule Set, and a Command Rule to Control User
Access 6-25
6.11.5 Step 4: Test the Users' Access 6-27
6.11.6 Step 5: Remove the Components for This Tutorial 6-28
6.12 Guidelines for Designing Rule Sets 6-28
6.13 How Rule Sets Affect Performance 6-29
6.14 Rule Set and Rule Related Reports and Data Dictionary Views 6-30
8 Configuring Factors
8.1 What Are Factors? 8-1
8.2 Default Factors 8-2
8.3 Creating a Factor 8-5
8.3.1 Accessing the Create Factors Page 8-5
8.3.2 Completing the General Page for Factor Creation 8-6
8.3.3 Configurations Page for Factor Creation 8-7
8.3.3.1 Setting the Factor Identification Information 8-7
viii
8.3.3.2 How Factor Identities Work 8-8
8.3.3.3 Setting the Evaluation Information for a Factor 8-9
8.3.3.4 Setting the Oracle Label Security Labeling Information for a Factor 8-9
8.3.3.5 Setting the Retrieval Method for a Factor 8-10
8.3.3.6 How Retrieval Methods Work 8-10
8.3.3.7 Setting the Validation Method for a Factor 8-11
8.3.4 Options Page of Factor Creation 8-11
8.3.4.1 Assigning a Rule Set to a Factor 8-12
8.3.4.2 Setting Error Options for a Factor 8-12
8.3.4.3 Setting Audit Options for a Factor 8-13
8.3.4.4 How Factor Auditing Works 8-13
8.4 Adding an Identity to a Factor 8-13
8.4.1 About Factor Identities 8-14
8.4.2 About Trust Levels 8-14
8.4.3 About Label Identities 8-15
8.4.4 Creating and Configuring a Factor Identity 8-15
8.4.5 Deleting a Factor Identity 8-17
8.4.6 Using Identity Mapping to Configure an Identity to Use Other Factors 8-17
8.4.6.1 About Identity Mapping 8-17
8.4.6.2 Mapping an Identity to a Factor 8-18
8.5 Deleting a Factor 8-19
8.6 How Factors Work 8-19
8.6.1 How Factors Are Processed When a Session Is Established 8-20
8.6.2 How Factors Are Retrieved 8-21
8.6.3 How Factors Are Set 8-22
8.7 Tutorial: Preventing Ad Hoc Tool Access to the Database 8-22
8.7.1 About This Tutorial 8-23
8.7.2 Step 1: Enable the HR and OE User Accounts 8-23
8.7.3 Step 2: Create the Factor 8-24
8.7.4 Step 3: Create the Rule Set and Rules 8-25
8.7.5 Step 4: Create the CONNECT Command Rule 8-26
8.7.6 Step 5: Test the Ad Hoc Tool Access Restriction 8-26
8.7.7 Step 6: Remove the Components for This Tutorial 8-27
8.8 Tutorial: Restricting User Activities Based on Session Data 8-28
8.8.1 About This Tutorial 8-28
8.8.2 Step 1: Create an Administrative User 8-29
8.8.3 Step 2: Add Identities to the Domain Factor 8-29
8.8.4 Step 3: Map the Domain Factor Identities to the Client_IP Factor 8-30
8.8.5 Step 4: Create a Rule Set to Set the Hours and Select the Factor Identity 8-32
8.8.6 Step 5: Create a Command Rule That Uses the Rule Set 8-33
8.8.7 Step 6: Test the Factor Identity Settings 8-33
ix
8.8.8 Step 7: Remove the Components for This Tutorial 8-34
8.9 Guidelines for Designing Factors 8-35
8.10 How Factors Affect Performance 8-36
8.11 Factor Related Reports and Data Dictionary Views 8-36
11 Using Simulation Mode for Logging Realm and Command Rule Activities
11.1 About Simulation Mode 11-1
11.2 Simulation Mode Use Cases 11-2
11.3 Tutorial: Tracking Violations to a Realm Using Simulation Mode 11-3
x
11.3.1 About This Tutorial 11-3
11.3.2 Step 1: Create Users for This Tutorial 11-4
11.3.3 Step 2: Create a Realm and an Oracle Database Vault Policy 11-5
11.3.4 Step 3: Test the Realm and Policy 11-6
11.3.5 Step 4: Query the DBA_DV_SIMULATION_LOG View for Violations 11-6
11.3.6 Step 5: Enable and Re-test the Realm 11-7
11.3.7 Step 6: Remove the Components for This Tutorial 11-8
xi
12.6 Registering Oracle Internet Directory Using Oracle Database Configuration
Asssitant 12-18
xii
13.7 Oracle Recovery Manager and Oracle Database Vault 13-20
13.8 Privileges for Using Oracle Streams with Oracle Database Vault 13-21
13.9 Privileges for Using XStream with Oracle Database Vault 13-21
13.10 Privileges for Using Oracle GoldenGate with Oracle Database Vault 13-22
13.11 Using Data Masking in an Oracle Database Vault Environment 13-23
13.11.1 About Data Masking in an Oracle Database Vault Enabled Database 13-23
13.11.2 Adding Data Masking Users to the Data Dictionary Realm Authorizations 13-24
13.11.3 Giving Users Access to Tables or Schemas That They Want to Mask 13-24
13.11.4 Creating a Command Rule to Control Data Masking Privileges 13-25
13.12 Converting a Standalone Oracle Database to a PDB and Plugging It into a CDB 13-26
13.13 Using the ORADEBUG Utility with Oracle Database Vault 13-28
13.14 Performing Patch Operations in an Oracle Database Vault Environment 13-29
xiii
15 Oracle Database Vault Realm APIs
15.1 ADD_AUTH_TO_REALM Procedure 15-1
15.2 ADD_OBJECT_TO_REALM Procedure 15-4
15.3 CREATE_REALM Procedure 15-5
15.4 DELETE_AUTH_FROM_REALM Procedure 15-7
15.5 DELETE_OBJECT_FROM_REALM Procedure 15-8
15.6 DELETE_REALM Procedure 15-9
15.7 DELETE_REALM_CASCADE Procedure 15-10
15.8 RENAME_REALM Procedure 15-10
15.9 UPDATE_REALM Procedure 15-11
15.10 UPDATE_REALM_AUTH Procedure 15-13
xiv
17.5 DELETE_COMMAND_RULE Procedure 17-13
17.6 DELETE_CONNECT_COMMAND_RULE Procedure 17-15
17.7 DELETE_SESSION_EVENT_CMD_RULE Procedure 17-16
17.8 DELETE_SYSTEM_EVENT_CMD_RULE Procedure 17-17
17.9 UPDATE_COMMAND_RULE Procedure 17-17
17.10 UPDATE_CONNECT_COMMAND_RULE Procedure 17-20
17.11 UPDATE_SESSION_EVENT_CMD_RULE Procedure 17-21
17.12 UPDATE_SYSTEM_EVENT_CMD_RULE Procedure 17-23
xv
18.2.7 ROLE_IS_ENABLED Function 18-27
18.3 Oracle Database Vault DVF PL/SQL Factor Functions 18-27
18.3.1 About Oracle Database Vault DVF PL/SQL Factor Functions 18-29
18.3.2 F$AUTHENTICATION_METHOD Function 18-29
18.3.3 F$CLIENT_IP Function 18-30
18.3.4 F$DATABASE_DOMAIN Function 18-31
18.3.5 F$DATABASE_HOSTNAME Function 18-31
18.3.6 F$DATABASE_INSTANCE Function 18-31
18.3.7 F$DATABASE_IP Function 18-32
18.3.8 F$DATABASE_NAME Function 18-32
18.3.9 F$DOMAIN Function 18-33
18.3.10 F$ENTERPRISE_IDENTITY Function 18-33
18.3.11 F$IDENTIFICATION_TYPE Function 18-34
18.3.12 F$LANG Function 18-35
18.3.13 F$LANGUAGE Function 18-35
18.3.14 F$MACHINE Function 18-36
18.3.15 F$NETWORK_PROTOCOL Function 18-36
18.3.16 F$PROXY_ENTERPRISE_IDENTITY Function 18-36
18.3.17 F$SESSION_USER Function 18-37
xvi
21 Oracle Database Vault Utility APIs
21.1 DBMS_MACUTL Constants 21-1
21.1.1 DBMS_MACUTL Listing of Constants 21-1
21.1.2 Example: Creating a Realm Using DBMS_MACUTL Constants 21-5
21.1.3 Example: Creating a Rule Set Using DBMS_MACUTL Constants 21-5
21.1.4 Example: Creating a Factor Using DBMS_MACUTL Constants 21-6
21.2 DBMS_MACUTL Package Procedures and Functions 21-6
21.2.1 CHECK_DVSYS_DML_ALLOWED Procedure 21-7
21.2.2 GET_CODE_VALUE Function 21-8
21.2.3 GET_SECOND Function 21-9
21.2.4 GET_MINUTE Function 21-10
21.2.5 GET_HOUR Function 21-10
21.2.6 GET_DAY Function 21-11
21.2.7 GET_MONTH Function 21-12
21.2.8 GET_YEAR Function 21-12
21.2.9 IS_ALPHA Function 21-13
21.2.10 IS_DIGIT Function 21-14
21.2.11 IS_DVSYS_OWNER Function 21-14
21.2.12 IS_OLS_INSTALLED Function 21-15
21.2.13 IS_OLS_INSTALLED_VARCHAR Function 21-16
21.2.14 USER_HAS_OBJECT_PRIVILEGE Function 21-16
21.2.15 USER_HAS_ROLE Function 21-17
21.2.16 USER_HAS_ROLE_VARCHAR Function 21-18
21.2.17 USER_HAS_SYSTEM_PRIVILEGE Function 21-19
21.2.18 ROLE_GRANTED_ENABLED_VARCHAR Function 21-20
xvii
22.1.13 UNAUTHORIZE_PROXY_USER Procedure 22-13
22.1.14 UNAUTHORIZE_SCHEDULER_USER Procedure 22-13
22.1.15 UNAUTHORIZE_TTS_USER Procedure 22-14
22.1.16 DISABLE_DV Procedure 22-15
22.1.17 DISABLE_DV_DICTIONARY_ACCTS Procedure 22-15
22.1.18 DISABLE_DV_PATCH_ADMIN_AUDIT Procedure 22-16
22.1.19 DISABLE_ORADEBUG Procedure 22-16
22.1.20 ENABLE_DV Procedure 22-17
22.1.21 ENABLE_DV_PATCH_ADMIN_AUDIT Procedure 22-18
22.1.22 ENABLE_DV_DICTIONARY_ACCTS Procedure 22-18
22.1.23 ENABLE_ORADEBUG Procedure 22-19
22.2 CONFIGURE_DV General System Maintenance Procedure 22-19
xviii
25.6 DBA_DV_DDL_AUTH View 25-9
25.7 DBA_DV_DICTIONARY_ACCTS View 25-10
25.8 DBA_DV_FACTOR View 25-10
25.9 DBA_DV_FACTOR_TYPE View 25-12
25.10 DBA_DV_FACTOR_LINK View 25-13
25.11 DBA_DV_IDENTITY View 25-14
25.12 DBA_DV_IDENTITY_MAP View 25-14
25.13 DBA_DV_JOB_AUTH View 25-15
25.14 DBA_DV_MAC_POLICY View 25-15
25.15 DBA_DV_MAC_POLICY_FACTOR View 25-16
25.16 DBA_DV_MAINTENANCE_AUTH View 25-17
25.17 DBA_DV_ORADEBUG View 25-17
25.18 DBA_DV_PATCH_ADMIN_AUDIT View 25-18
25.19 DBA_DV_POLICY View 25-18
25.20 DBA_DV_POLICY_LABEL View 25-19
25.21 DBA_DV_POLICY_OBJECT View 25-20
25.22 DBA_DV_POLICY_OWNER View 25-21
25.23 DBA_DV_PROXY_AUTH View 25-22
25.24 DBA_DV_PUB_PRIVS View 25-22
25.25 DBA_DV_REALM View 25-23
25.26 DBA_DV_REALM_AUTH View 25-24
25.27 DBA_DV_REALM_OBJECT View 25-26
25.28 DBA_DV_ROLE View 25-27
25.29 DBA_DV_RULE View 25-27
25.30 DBA_DV_RULE_SET View 25-28
25.31 DBA_DV_RULE_SET_RULE View 25-30
25.32 DBA_DV_STATUS View 25-31
25.33 DBA_DV_SIMULATION_LOG View 25-32
25.34 DBA_DV_TTS_AUTH View 25-33
25.35 DBA_DV_USER_PRIVS View 25-34
25.36 DBA_DV_USER_PRIVS_ALL View 25-35
25.37 DVSYS.DV$CONFIGURATION_AUDIT View 25-35
25.38 DVSYS.DV$ENFORCEMENT_AUDIT View 25-40
25.39 DVSYS.DV$REALM View 25-43
25.40 DVSYS.POLICY_OWNER_COMMAND_RULE View 25-44
25.41 DVSYS.POLICY_OWNER_POLICY View 25-45
25.42 DVSYS.POLICY_OWNER_REALM View 25-46
25.43 DVSYS.POLICY_OWNER_REALM_AUTH View 25-47
25.44 DVSYS.POLICY_OWNER_REALM_OBJECT View 25-48
25.45 DVSYS.POLICY_OWNER_RULE View 25-49
25.46 DVSYS.POLICY_OWNER_RULE_SET View 25-50
xix
25.47 DVSYS.POLICY_OWNER_RULE_SET_RULE View 25-52
25.48 SYS.DV$CONFIGURATION_AUDIT View 25-52
25.49 SYS.DV$ENFORCEMENT_AUDIT View 25-53
xx
27.6.3 Sensitive Objects Reports 27-10
27.6.3.1 Execute Privileges to Strong SYS Packages Report 27-10
27.6.3.2 Access to Sensitive Objects Report 27-11
27.6.3.3 Public Execute Privilege To SYS PL/SQL Procedures Report 27-11
27.6.3.4 Accounts with SYSDBA/SYSOPER Privilege Report 27-12
27.6.4 Privilege Management - Summary Reports 27-12
27.6.4.1 Privileges Distribution By Grantee Report 27-12
27.6.4.2 Privileges Distribution By Grantee, Owner Report 27-12
27.6.4.3 Privileges Distribution By Grantee, Owner, Privilege Report 27-13
27.6.5 Powerful Database Accounts and Roles Reports 27-13
27.6.5.1 WITH ADMIN Privilege Grants Report 27-14
27.6.5.2 Accounts With DBA Roles Report 27-14
27.6.5.3 Security Policy Exemption Report 27-14
27.6.5.4 BECOME USER Report 27-14
27.6.5.5 ALTER SYSTEM or ALTER SESSION Report 27-14
27.6.5.6 Password History Access Report 27-15
27.6.5.7 WITH GRANT Privileges Report 27-15
27.6.5.8 Roles/Accounts That Have a Given Role Report 27-15
27.6.5.9 Database Accounts With Catalog Roles Report 27-15
27.6.5.10 AUDIT Privileges Report 27-16
27.6.5.11 OS Security Vulnerability Privileges Report 27-16
27.6.6 Initialization Parameters and Profiles Reports 27-16
27.6.6.1 Security Related Database Parameters Report 27-16
27.6.6.2 Resource Profiles Report 27-16
27.6.6.3 System Resource Limits Report 27-16
27.6.7 Database Account Password Reports 27-17
27.6.7.1 Database Account Default Password Report 27-17
27.6.7.2 Database Account Status Report 27-17
27.6.8 Security Audit Report: Core Database Audit Report 27-17
27.6.9 Other Security Vulnerability Reports 27-18
27.6.9.1 Java Policy Grants Report 27-18
27.6.9.2 OS Directory Objects Report 27-19
27.6.9.3 Objects Dependent on Dynamic SQL Report 27-19
27.6.9.4 Unwrapped PL/SQL Package Bodies Report 27-19
27.6.9.5 Username/Password Tables Report 27-19
27.6.9.6 Tablespace Quotas Report 27-19
27.6.9.7 Non-Owner Object Trigger Report 27-20
xxi
A.2 Protection of the Unified Audit Trail in an Oracle Database Vault Environment A-2
A.3 Oracle Database Vault Specific Audit Events A-2
A.3.1 Oracle Database Vault Policy Audit Events A-3
A.3.2 Oracle Database Vault Audit Trail Record Format A-3
A.4 Archiving and Purging the Oracle Database Vault Audit Trail A-5
A.4.1 About Archiving and Purging the Oracle Database Vault Audit Trail A-6
A.4.2 Archiving the Oracle Database Vault Audit Trail A-6
A.4.3 Purging the Oracle Database Vault Audit Trail A-8
A.5 Oracle Database Audit Settings Created for Oracle Database Vault A-8
xxii
D.5 Guidelines for Using Oracle Database Vault in a Production Environment D-10
D.6 Secure Configuration Guidelines D-10
D.6.1 General Secure Configuration Guidelines D-10
D.6.2 UTL_FILE and DBMS_FILE_TRANSFER Package Security Considerations D-11
D.6.2.1 About Security Considerations for the UTL_FILE and
DBMS_FILE_TRANSFER Packages D-11
D.6.2.2 Securing Access to the DBMS_FILE_TRANSFER Package D-12
D.6.2.3 Example: Creating a Command Rule to Deny Access to CREATE
DATABASE LINK D-12
D.6.2.4 Example: Creating a Command Rule to Enable Access to CREATE
DATABASE LINK D-13
D.6.2.5 Example: Command Rules to Disable and Enable Access to CREATE
DIRECTORY D-13
D.6.3 CREATE ANY JOB Privilege Security Considerations D-14
D.6.4 CREATE EXTERNAL JOB Privilege Security Considerations D-14
D.6.5 LogMiner Package Security Considerations D-14
D.6.6 ALTER SYSTEM and ALTER SESSION Privilege Security Considerations D-15
D.6.6.1 About ALTER SYSTEM and ALTER SESSION Privilege Security
Considerations D-15
D.6.6.2 Example: Adding Rules to the Existing ALTER SYSTEM Command Rule D-15
xxiii
E.2 General Diagnostic Tips E-11
E.3 Configuration Problems with Oracle Database Vault Components E-12
E.4 Resetting Oracle Database Vault Account Passwords E-12
E.4.1 Resetting the DV_OWNER User Password E-12
E.4.2 Resetting the DV_ACCTMGR User Password E-13
Index
xxiv
List of Figures
1-1 Oracle Database Vault Realm Blocking DBA Access to Data 1-3
1-2 Oracle Database Vault Security 1-10
1-3 Oracle Database Vault in a Multitenant Environment with Regular Mode 1-12
5-1 How Authorizations Work for Realms and Realm Owners 5-19
12-1 Encrypted Data and Oracle Database Vault 12-5
14-1 How Oracle Database Vault Roles Are Categorized 14-4
xxv
List of Tables
1-1 Regulations That Address Potential Security Threats 1-8
2-1 Modified Database Initialization Parameter Settings 2-2
2-2 Privileges Oracle Database Vault Revokes 2-4
4-1 Data Dictionary Views That Display Privilege Analysis Information 4-32
5-1 Reports Related to Realms 5-21
5-2 Data Dictionary Views Used for Realms 5-22
6-1 Current Default Oracle Database Vault Rules 6-9
6-2 Reports Related to Rule Sets 6-30
6-3 Data Dictionary Views Used for Rules and Rule Sets 6-30
7-1 Default Command Rules 7-6
7-2 Reports Related to Command Rules 7-15
8-1 Reports Related to Factors and Their Identities 8-36
8-2 Data Dictionary Views Used for Factors and Factor Identities 8-37
9-1 Reports Related to Secure Application Roles 9-11
10-1 Data Dictionary Views Used for Oracle Database Vault Policies 10-6
12-1 Reports Related to Database Vault and Oracle Label Security Integration 12-14
12-2 Data Dictionary Views Used for Oracle Label Security 12-15
13-1 Levels of Authorization for Oracle Data Pump Regular Operations 13-8
13-2 Levels of Authorization for Oracle Data Pump Transporatable Operations 13-11
14-1 Database Accounts Used by Oracle Database Vault 14-28
14-2 Model Oracle Database Vault Database Accounts 14-28
15-1 ADD_AUTH_TO_REALM Parameters 15-2
15-2 ADD_OBJECT_TO_REALM Parameters 15-4
15-3 CREATE_REALM Parameters 15-5
15-4 DELETE_AUTH_FROM_REALM Parameters 15-8
15-5 DELETE_OBJECT_FROM_REALM Parameters 15-8
15-6 DELETE_REALM Parameter 15-9
15-7 DELETE_REALM_CASCADE Parameter 15-10
15-8 RENAME_REALM Parameters 15-11
15-9 UPDATE_REALM Parameters 15-11
15-10 UPDATE_REALM_AUTH Parameters 15-13
16-1 ADD_RULE_TO_RULE_SET Parameters 16-2
16-2 CREATE_RULE Parameters 16-3
16-3 CREATE_RULE_SET Parameters 16-5
16-4 DELETE_RULE Parameter 16-8
xxvi
16-5 DELETE_RULE_FROM_RULE_SET Parameters 16-8
16-6 DELETE_RULE_SET Parameter 16-9
16-7 RENAME_RULE Parameters 16-9
16-8 RENAME_RULE_SET Parameters 16-10
16-9 UPDATE_RULE Parameters 16-11
16-10 UPDATE_RULE_SET Parameters 16-12
17-1 CREATE_COMMAND_RULE Parameters 17-2
17-2 ALTER SYSTEM Command Rule Settings 17-4
17-3 ALTER SESSION Command Rule Settings 17-5
17-4 CREATE_CONNECT_COMMAND_RULE Parameters 17-9
17-5 CREATE_SESSION_EVENT_CMD_RULE Parameters 17-10
17-6 CREATE_SYSTEM_EVENT_CMD_RULE Parameters 17-12
17-7 DELETE_COMMAND_RULE Parameters 17-14
17-8 DELETE_CONNECT_COMMAND_RULE Parameters 17-15
17-9 DELETE_SESSION_EVENT_CMD_RULE Parameters 17-16
17-10 DELETE_SYSTEM_EVENT_CMD_RULE Parameters 17-17
17-11 UPDATE_COMMAND_RULE Parameters 17-18
17-12 UPDATE_CONNECT_COMMAND_RULE Parameters 17-20
17-13 UPDATE_SESSION_EVENT_CMD_RULE Parameters 17-22
17-14 UPDATE_SYSTEM_EVENT_CMD_RULE Parameters 17-23
18-1 ADD_FACTOR_LINK Parameters 18-3
18-2 ADD_POLICY_FACTOR Parameters 18-4
18-3 CHANGE_IDENTITY_FACTOR Parameters 18-5
18-4 CHANGE_IDENTITY_VALUE Parameters 18-5
18-5 CREATE_DOMAIN_IDENTITY Parameters 18-6
18-6 CREATE_FACTOR Parameters 18-7
18-7 CREATE_FACTOR_TYPE Parameters 18-9
18-8 CREATE_IDENTITY Parameters 18-10
18-9 CREATE_IDENTITY_MAP Parameters 18-11
18-10 DELETE_FACTOR Parameter 18-12
18-11 DELETE_FACTOR_LINK Parameters 18-12
18-12 DELETE_FACTOR_TYPE Parameters 18-13
18-13 DELETE_IDENTITY Parameters 18-13
18-14 DELETE_IDENTITY_MAP Parameters 18-14
18-15 DROP_DOMAIN_IDENTITY Parameters 18-15
18-16 GET_SESSION_INFO Parameter 18-16
18-17 GET_INSTANCE_INFO Parameter 18-16
xxvii
18-18 RENAME_FACTOR Parameters 18-17
18-19 RENAME_FACTOR_TYPE Parameters 18-17
18-20 UPDATE_FACTOR 18-18
18-21 UPDATE_FACTOR_TYPE Parameters 18-21
18-22 UPDATE_IDENTITY Parameters 18-21
18-23 SET_FACTOR Parameters 18-23
18-24 GET_FACTOR Parameter 18-24
18-25 GET_FACTOR_LABEL Parameters 18-25
18-26 GET_TRUST_LEVEL Parameter 18-26
18-27 GET_TRUST_LEVEL_FOR_IDENTITY Parameters 18-26
18-28 ROLE_IS_ENABLED Parameter 18-27
19-1 CREATE_ROLE Parameters 19-2
19-2 DELETE_ROLE Parameter 19-2
19-3 RENAME_ROLE Parameters 19-3
19-4 UPDATE_ROLE Parameters 19-3
19-5 CAN_SET_ROLE Parameter 19-5
19-6 SET_ROLE Parameter 19-5
20-1 CREATE_MAC_POLICY Parameters 20-2
20-2 Oracle Label Security Merge Algorithm Codes 20-2
20-3 CREATE_POLICY_LABEL Parameters 20-3
20-4 DELETE_MAC_POLICY_CASCADE Parameter 20-4
20-5 DELETE_POLICY_FACTOR Parameters 20-5
20-6 DELETE_POLICY_LABEL Parameters 20-6
20-7 UPDATE_MAC_POLICY 20-7
21-1 DBMS_MACUTL Listing of Constants 21-1
21-2 CHECK_DVSYS_DML_ALLOWED Parameter 21-8
21-3 GET_CODE_VALUE Parameters 21-9
21-4 GET_SECOND Parameter 21-9
21-5 GET_MINUTE Parameter 21-10
21-6 GET_HOUR Parameter 21-11
21-7 GET_DAY Parameter 21-11
21-8 GET_MONTH Parameter 21-12
21-9 GET_YEAR Parameter 21-13
21-10 IS_ALPHA Parameter 21-13
21-11 IS_DIGIT Parameter 21-14
21-12 IS_DVSYS_OWNER Parameter 21-15
21-13 USER_HAS_OBJECT_PRIVILEGE Parameters 21-16
xxviii
21-14 USER_HAS_ROLE Parameters 21-18
21-15 USER_HAS_ROLE_VARCHAR Parameters 21-19
21-16 USER_HAS_SYSTEM_PRIVILEGE Parameters 21-19
21-17 ROLE_GRANTED_ENABLED_VARCHAR Parameters 21-20
22-1 ADD_NLS_DATA 22-3
22-2 AUTHORIZE_DATAPUMP_USER 22-4
22-3 AUTHORIZE_DDL 22-5
22-4 AUTHORIZE_DIAGNOSTIC_ADMIN 22-5
22-5 AUTHORIZE_MAINTENANCE_USER 22-6
22-6 AUTHORIZE_PROXY_USER 22-7
22-7 AUTHORIZE_SCHEDULER_USER 22-8
22-8 AUTHORIZE_TTS_USER 22-9
22-9 UNAUTHORIZE_DATAPUMP_USER 22-10
22-10 UNAUTHORIZE_DDL 22-10
22-11 UNAUTHORIZE_DIAGNOSTIC_ADMIN 22-11
22-12 UNAUTHORIZE_MAINTENANCE_USER 22-12
22-13 UNAUTHORIZE_PROXY_USER 22-13
22-14 UNAUTHORIZE_SCHEDULER_USER 22-14
22-15 UNAUTHORIZE_TTS_USER 22-15
22-16 ENABLE_DV 22-17
22-17 CONFIGURE_DV 22-20
23-1 ADD_CMD_RULE_TO_POLICY Parameters 23-2
23-2 ADD_OWNER_TO_POLICY Parameters 23-4
23-3 ADD_REALM_TO_POLICY Parameters 23-5
23-4 CREATE_POLICY Parameters 23-5
23-5 DELETE_CMD_RULE_FROM_POLICY Parameters 23-7
23-6 DELETE_OWNER_FROM_POLICY Parameters 23-8
23-7 DELETE_REALM_FROM_POLICY Parameters 23-9
23-8 DROP_POLICY Parameters 23-9
23-9 RENAME_POLICY Parameters 23-10
23-10 UPDATE_POLICY_DESCRIPTION Parameters 23-11
23-11 UPDATE_POLICY_STATE Parameters 23-11
24-1 DBMS_MACADM Realm Procedures 24-1
24-2 DBMS_MACADM Rule Set and Rule Procedures 24-2
24-3 DBMS_MACADM Command Rule Procedures 24-2
24-4 DBMS_MACADM Factor Procedures and Functions 24-3
24-5 DBMS_MACADM Secure Application Role Procedures 24-4
xxix
24-6 DBMS_MACADM Oracle Label Security Procedures 24-5
24-7 DBMS_MACADM Database Vault Policy Procedures 24-5
24-8 DBMS_MACADM General Administrative Procedures 24-6
24-9 DBMS_MACSEC_ROLES PL/SQL Package Contents 24-7
24-10 DBMS_MACUTL PL/SQL Package Contents 24-7
24-11 DVF PL/SQL Interface Contents 24-8
25-1 DBA_DV_CODE View CODE_GROUP Values 25-6
25-2 DBA_DV_SIMULATION_LOG VIOLATION_TYPE Code Values 25-33
25-3 DVSYS.DV$CONFIGURATION_AUDIT View ACTION Values 25-37
25-4 DVSYS.DV$ENFORCEMENT_AUDIT View ACTION Values 25-42
A-1 Oracle Database Vault Audit Trail Format A-4
A-2 Audit Policy Settings Oracle Database Vault Adds to Oracle Database A-9
D-1 Example Separation of Duty Matrix D-4
D-2 Example Application Protection Maxtrix D-5
D-3 Trusted Oracle Database Vault Roles and Privileges D-7
E-1 Contents of Oracle Database Vault Trace Files E-2
xxx
Preface
Oracle Database Vault Administrator's Guide explains how to configure access control-based
security in an Oracle Database environment by using Oracle Database Vault.
• Audience
• Documentation Accessibility
• Related Documents
• Conventions
Audience
This document is intended for security managers, audit managers, label administrators, and
Oracle database administrators (DBAs) who are involved in the configuration of Oracle
Database Vault.
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility
Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.
Related Documents
For more information refer to the following documents:
• Oracle Database Security Guide
• Oracle Label Security Administrator’s Guide
• Oracle Database Administrator’s Guide
• Oracle Database SQL Language Reference
xxxi
Preface
https://www.oracle.com/technical-resources/
My Oracle Support
You can find information about security patches, certifications, and the support
knowledge base by visiting My Oracle Support (formerly OracleMetaLink) at
https://support.oracle.com
Conventions
The following text conventions are used in this document:
Convention Meaning
boldface Boldface type indicates graphical user interface elements associated
with an action, or terms defined in text or the glossary.
italic Italic type indicates book titles, emphasis, or placeholder variables for
which you supply particular values.
monospace Monospace type indicates commands within a paragraph, URLs, code
in examples, text that appears on the screen, or text that you enter.
xxxii
Changes in This Release for
Oracle Database Vault Administrator's Guide
This preface contains:
• Changes in Oracle Database Vault 12c Release 2 (12.2.0.1)
New Features
The following features are new for this release:
• Ability to Create Oracle Database Vault Policies
An Oracle Database Vault policy groups and manages realms and command rules that
have something in common in a single policy.
• Ability to Configure Simulation Mode Protection
Simulation mode protects Oracle Database Vault security objects so that SQL commands
are not blocked, but violations to the security controls are logged.
• Privilege Analysis Enhancements
Privilege analysis policies now capture more privilege use than in previous releases, find
unused privilege grants, and create named capture runs.
• Ability to Create Common Realms and Common Command Rules for Oracle Multitenant
In a multitenant environment, you now can create common realms and common
command rules within the application PDB context.
• ALTER SESSION, ALTER SYSTEM, and CONNECT Command Rule Enhancements
Command rules now provide more ALTER SESSION and ALTER SYSTEM functionality, and
CONNECT command rule enhancements.
• Enhancements for the Authentication_Method Default Factor
Starting with this release, the Authentication_Method default factor can be used for
external and global user authentication.
• Changed Default Value for SQL92_SECURITY Parameter
Starting with this release, the default value for the SQL92_SECURITY parameter has
changed from FALSE to TRUE.
xxxiii
Changes in This Release for Oracle Database Vault Administrator's Guide
xxxiv
Changes in This Release for Oracle Database Vault Administrator's Guide
– DVSYS.POLICY_OWNER_REALM
– DVSYS.POLICY_OWNER_REALM_AUTH
– DVSYS.POLICY_OWNER_REALM_OBJECT
– DVSYS.POLICY_OWNER_RULE
– DVSYS.POLICY_OWNER_RULE_SET
– DVSYS.POLICY_OWNER_RULE_SET_RULE
Related Topics
• Configuring Oracle Database Vault Policies
You can use Oracle Database Vault policies to implement frequently used realm and
command rule settings.
• DV_POLICY_OWNER Database Vault Owner Role
The DV_POLICY_OWNER role enables database users to manage to a limited degree Oracle
Database Vault policies.
• Oracle Database Vault Data Dictionary Views
You can find information about the Oracle Database Vault configuration settings by
querying the Database Vault-specific data dictionary views.
xxxv
Changes in This Release for Oracle Database Vault Administrator's Guide
– DBMS_MACADM.CREATE_CONNECT_COMMAND_RULE (new)
– DBMS_MACADM.UPDATE_CONNECT_COMMAND_RULE (new)
– DBMS_MACADM.DELETE_CONNECT_COMMAND_RULE (new)
– DBMS_MACADM.CREATE_SESSION_EVENT_CMD_RULE (new)
– DBMS_MACADM.UPDATE_SESSION_EVENT_CMD_RULE (new)
– DBMS_MACADM.DELETE_SESSION_EVENT_CMD_RULE (new)
– DBMS_MACADM.CREATE_SYSTEM_EVENT_CMD_RULE (new)
– DBMS_MACADM.UPDATE_SYSTEM_EVENT_CMD_RULE (new)
– DBMS_MACADM.DELETE_SYSTEM_EVENT_CMD_RULE (new)
• New data dictionary view and table:
– DBA_DV_SIMULATION_LOG data dictionary view
– DVSYS.SIMULATION_LOG$ table
Related Topics
• Using Simulation Mode for Logging Realm and Command Rule Activities
Simulation mode writes the activities performed on realms and command rules to
a log file, which is accessible through a data dictionary view.
• Oracle Database Vault Realm APIs
The DBMS_MACADM PL/SQL package enables you to configure Oracle Database
Vault realms.
• Oracle Database Vault Command Rule APIs
The DBMS_MACADM PL/SQL package provides procedures for configuring command
rules. .
• DBA_DV_SIMULATION_LOG View
The DBA_DV_SIMULATION_LOG data dictionary view captures simulation log
information for realms and command rules that have had simulation mode
enabled.
xxxvi
Changes in This Release for Oracle Database Vault Administrator's Guide
Related Topics
• Performing Privilege Analysis to Find Privilege Use
Privilege analysis dynamically analyzes the privileges and roles that users use and do not
use.
Ability to Create Common Realms and Common Command Rules for Oracle
Multitenant
In a multitenant environment, you now can create common realms and common command
rules within the application PDB context.
The benefit of creating common realms and command rules (that is, in the application root) is
that you can manage them from a central location in a multitenant environment, rather than in
individual pluggable databases (PDBs). Realms for the application root common objects must
be configured in the application PDB or root. Local realms and local command rules can still
be implemented on individual PDBs over and above any common realms and common
command rules.
Common realms can only be created on common objects in the application root. You cannot
create common realms in the CDB root. However, you can create common command rules in
either the application root or the CDB root. A common command rule in the application root
applies to its associated PDBs. Common command rules that are in the CDB root will apply
to all PDBs in the CDB environment. When you create a common object in the application
root and in the CDB root, you must synchronize it so that it is visible in the individual PDBs.
To synchronize an object in the application root, you use the ALTER PLUGGABLE DATABASE
APPLICATION statement with the SYNC clause.
xxxvii
Changes in This Release for Oracle Database Vault Administrator's Guide
Related Topics
• Realms in a Multitenant Environment
In a multitenant environment, you can create a realm to protect common objects in
the application root.
• Command Rules in a Multitenant Environment
In a multitenant environment, you can create common and local command rules in
either the CDB root or the application root.
• Oracle Database Vault Realm APIs
The DBMS_MACADM PL/SQL package enables you to configure Oracle Database
Vault realms.
• Oracle Database Vault Command Rule APIs
The DBMS_MACADM PL/SQL package provides procedures for configuring command
rules. .
• Oracle Database Vault Policy APIs
You can use the DBMS_MACADM PL/SQL package to manage Oracle Database Vault
policies.
• Oracle Database Vault Data Dictionary Views
You can find information about the Oracle Database Vault configuration settings by
querying the Database Vault-specific data dictionary views.
xxxviii
Changes in This Release for Oracle Database Vault Administrator's Guide
• DBMS_MACADM.CREATE_SESSION_EVENT_CMD_RULE (new)
• DBMS_MACADM.UPDATE_SESSION_EVENT_CMD_RULE (new)
• DBMS_MACADM.DELETE_SESSION_EVENT_CMD_RULE (new)
• DBMS_MACADM.CREATE_SYSTEM_EVENT_CMD_RULE (new)
• DBMS_MACADM.UPDATE_SYSTEM_EVENT_CMD_RULE (new)
• DBMS_MACADM.DELETE_SYSTEM_EVENT_CMD_RULE (new)
Related Topics
• ALTER SESSION and ALTER SYSTEM Command Rules
You can create different kinds of ALTER SESSION and ALTER SYSTEM command rules that
provide fine-grained control for these SQL statements.
• CONNECT Command Rule
The DBMS_MACADM.CREATE_CONNECT_CMD_RULE procedure creates a user-specific
CONNECT command rule.
• Ability to Configure Simulation Mode Protection
Simulation mode protects Oracle Database Vault security objects so that SQL commands
are not blocked, but violations to the security controls are logged.
• Ability to Create Common Realms and Common Command Rules for Oracle Multitenant
In a multitenant environment, you now can create common realms and common
command rules within the application PDB context.
See Also:
Oracle Database Reference for more information about the SQL92_SECURITY
parameter
xxxix
Changes in This Release for Oracle Database Vault Administrator's Guide
The Oracle Flashback Technology enhancement enables you to use Database Vault
realms and command rules to control access to database objects while you are using
the Oracle Flashback features. You can protect the PURGE TABLE, PURGE INDEX,
FLASHBACK TABLE, PURGE TABLESPACE, PURGE RECYCLEBIN, PURGE DBA_RECYCLEBIN,
CREATE FLASHBACK ARCHIVE, ALTER FLASHBACK ARCHIVE, DROP FLASHBACK ARCHIVE
SQL statements with Database Vault command rules.
The ILM enhancement enables you to use Database Vault realms and command rules
with the Automatic Data Optimization (ADO) features, including granting to users the
authorization to enable an ADO administrative user to perform ILM operations on
Database Vault-protected objects. This enhancement enables ILM to meet regulatory
compliance requirements for data retention and protection, and to store large amounts
of data at the lowest cost, using storage tiering. To manage authorizations for users to
perform ILM operations, two new procedures are introduced with this release:
DBMS_MACADM.AUTHORIZE_MAINTENANCE_USER and
DBMS_MACADM.UNAUTHORIZE_MAINTENANCE_USER. To find information about ILM
authorization grants, a new data dictionary view, DBA_DV_MAINTENANCE_AUTH, is
provided.
See Also:
• About Realms for more information about how realms are affected by
this enhancement
• About Command Rules for more information about command rules
• SQL Statements That Can Be Protected by Command Rules for a list of
the Oracle Flashback Technology SQL statements that can be protected
by Database Vault command rules
• Using Information Lifecycle Management with Oracle Database Vault for
information about granting users authorization to perform ILM tasks in a
Database Vault environment
• AUTHORIZE_MAINTENANCE_USER Procedure for information about
the DBMS_MACADM.AUTHORIZE_MAINTAINANCE_USER procedure
• UNAUTHORIZE_MAINTENANCE_USER Procedure for information
about the DBMS_MACADM.UNAUTHORIZE_MAINTAINANCE_USER procedure
• DBA_DV_MAINTENANCE_AUTH View for information about the
DBA_DV_MAINTENANCE_USER data dictionary view
• Oracle Database VLDB and Partitioning Guide for more information
about ILM
• Oracle Database Backup and Recovery User’s Guide for more
information about Oracle Flashback Recovery
Support for Rolling Upgrades for Data Guard Logical Standby Databases
Oracle Data Guard logical standby databases can perform rolling upgrades for Oracle
Database Vault-enabled systems using transient logical standby and the DBMS_ROLLING
package.
xl
Changes in This Release for Oracle Database Vault Administrator's Guide
See Integrating Oracle Database Vault with Oracle Data Guard for more information.
Related Topics
• Integrating Oracle Database Vault with Oracle Data Guard
An Oracle Database Vault-Oracle Data Guard integration requires first, the primary
database configuration, then the standby database configration.
Deprecated Features
The following features have been deprecated for this release.
• Deprecated Rules and Rule Sets
Several default rules and rule sets are no longer included in a fresh installation of Oracle
Database Vault.
• Deprecated UTL_FILE_DIR Parameter
The UTL_FILE_DIR parameter has been deprecated for this release.
xli
Changes in This Release for Oracle Database Vault Administrator's Guide
xlii
1
Introduction to Oracle Database Vault
Oracle Database Vault enables you to control administrative access to your data.
• What Is Oracle Database Vault?
Oracle Database Vault provides controls to prevent unauthorized privileged users from
accessing sensitive data and to prevent unauthorized database changes.
• What Privileges Do You Need to Use Oracle Database Vault?
Oracle Database Vault provides database roles that enable different users to perform
specific tasks, based on separation-of-duty guidelines.
• Components of Oracle Database Vault
Oracle Database Vault has a set of components that include PL/SQL packages and other
special tools.
• How Oracle Database Vault Addresses Compliance Regulations
One of the biggest side benefits resulting from regulatory compliance has been security
awareness.
• How Oracle Database Vault Protects Privileged User Accounts
Many security breaches, both external and internal, target privileged users database
accounts to steal data from databases.
• How Oracle Database Vault Allows for Flexible Security Policies
Oracle Database Vault helps you design flexible security policies for your database.
• How Oracle Database Vault Addresses Database Consolidation Concerns
Consolidation and cloud environments reduce cost but can expose sensitive application
data to those without a true need-to-know.
• How Oracle Database Vault Works in a Multitenant Environment
To provide increased security for consolidation, you can use Oracle Database Vault with
Oracle Multitenant.
1-1
Chapter 1
What Is Oracle Database Vault?
1-2
Chapter 1
What Is Oracle Database Vault?
Figure 1-1 Oracle Database Vault Realm Blocking DBA Access to Data
ors
nd
ve
a ta
tad
me SELECT * FROM
FINANCE.VENDORS
L
/SQ
PL
DBA
Has
SELECT ANY TABLE
Privilege
1-3
Chapter 1
What Privileges Do You Need to Use Oracle Database Vault?
1-4
Chapter 1
Components of Oracle Database Vault
1-5
Chapter 1
Components of Oracle Database Vault
Oracle Database Vault provides a schema, DVSYS, which stores the database objects
needed to process Oracle data for Oracle Database Vault. This schema contains the
roles, views, accounts, functions, and other database objects that Oracle Database
Vault uses. The DVF schema contains public functions to retrieve (at run time) the
factor values set in the Oracle Database Vault access control configuration. Both of
these schemas are authenticated as schema only accounts. These accounts are
locked by default and should remain locked unless directed otherwise by Oracle
Support.
1-6
Chapter 1
How Oracle Database Vault Addresses Compliance Regulations
Related Topics
• Oracle Database Vault Schemas, Roles, and Accounts
Oracle Database Vault provides schemas that contain Database Vault objects, roles that
provide separation of duty for specific tasks, and default user accounts.
1-7
Chapter 1
How Oracle Database Vault Protects Privileged User Accounts
While most changes required by regulations such as Sarbanes-Oxley and HIPAA are
procedural in nature, the remainder may require technology investments. A common
security requirement found in regulations is stringent internal controls. The degree to
which Oracle Database Vault helps an organization achieve compliance varies with the
regulation. In general, Oracle Database Vault realms, command rules, factors and
separation of duty features, help reduce the overall security risks that regulation
provisions worldwide address.
Table 1-1 lists regulations that address potential security threats.
1-8
Chapter 1
How Oracle Database Vault Allows for Flexible Security Policies
meet the operational policies for your site. For example, you could define a rule to limit
execution of the ALTER SYSTEM statement to a specific IP address and host name.
1-9
Chapter 1
How Oracle Database Vault Addresses Database Consolidation Concerns
Application
Procurement
HR SELECT * FROM
FINANCE.CUSTOMERS
Finance
DBA
1-10
Chapter 1
How Oracle Database Vault Works in a Multitenant Environment
Vault realms, you can enforce access to applications through a trusted path, preventing
database users who have not been specifically authorized access from using powerful
privileges to look at other application data. For example, a database administrator who has
the SELECT ANY TABLE system privilege can be prevented from using that privilege to view
other application data residing in the same database.
1-11
Chapter 1
How Oracle Database Vault Works in a Multitenant Environment
CDB
Root
CDB
Common
Com
CDB DBA
HR Fin Custom
om
Realm Realm App
PDB1 PDB2 PDB3
Local Database Database Database
PDB DBA Vault Vault Vault Not
Enabled Enabled Enabled Local
PDB DBA
Related Topics
• Realms in a Multitenant Environment
In a multitenant environment, you can create a realm to protect common objects in
the application root.
• Rule Sets and Rules in a Multitenant Environment
In a multitenant environment, you can create a rule set and its associated rules in
a PDB or an application root.
• Command Rules in a Multitenant Environment
In a multitenant environment, you can create common and local command rules in
either the CDB root or the application root.
• Converting a Standalone Oracle Database to a PDB and Plugging It into a CDB
You can convert a standalone Oracle Database Release 12c or later database to a
PDB, and then plug this PDB into a CDB.
1-12
2
What to Expect After You Enable
Oracle Database Vault
When you enable Oracle Database Vault, several Oracle Database security features, such as
default user authorizations, are modified to provide stronger security restrictions.
• Initialization and Password Parameter Settings That Change
The Oracle Database Vault configuration modifies several database initialization
parameter settings to better secure your database configuration.
• How Oracle Database Vault Restricts User Authorizations
The Oracle Database configuration requires two additional administrative database
account names.
• New Database Roles to Enforce Separation of Duties
The Oracle Database Vault configuration implements the concept of separation of duty so
that you can meet regulatory, privacy and other compliance requirements.
• Privileges That Are Revoked from Existing Users and Roles
The Oracle Database Vault configuration revokes privileges from several Oracle
Database-supplied users and roles, for better separation of duty.
• Privileges That Are Prevented for Existing Users and Roles
The Oracle Database Vault configuration prevents several privileges for all users and
roles who have been granted these privileges, including users SYS and SYSTEM.
• Modified AUDIT Statement Settings for a Non-Unified Audit Environment
When you configure Oracle Database Vault and if you decide not to use unified auditing,
then Database Vault configures several AUDIT statements.
2-1
Chapter 2
Initialization and Password Parameter Settings That Change
2-2
Chapter 2
How Oracle Database Vault Restricts User Authorizations
2.4 Privileges That Are Revoked from Existing Users and Roles
The Oracle Database Vault configuration revokes privileges from several Oracle Database-
supplied users and roles, for better separation of duty.
Table 2-2 lists privileges that Oracle Database Vault revokes from the Oracle Database-
supplied users and roles. Be aware that if you disable Oracle Database Vault, these
privileges remain revoked. If your applications depend on these privileges, then grant them to
2-3
Chapter 2
Privileges That Are Revoked from Existing Users and Roles
1 To authorize users to export and import data using Oracle Data Pump, see Using Oracle Data Pump with
Oracle Database Vault.
2 To authorize users to schedule database jobs, see Using Oracle Scheduler with Oracle Database Vault.
Note:
Both the SYS and SYSTEM users retain the SELECT privilege for the
DBA_USERS_WITH_DEFPWD data dictionary view, which lists user accounts that
use default passwords. If you want other users to have access to this view,
grant them the SELECT privilege on it.
Related Topics
• Privileges of Oracle Database Vault Roles
The Oracle Database Vault roles are designed to provide the maximum benefits of
separation of duty.
• DV_ACCTMGR Database Vault Account Manager Role
The DV_ACCTMGR role is a powerful role, used for accounts management.
2-4
Chapter 2
Privileges That Are Prevented for Existing Users and Roles
2.5 Privileges That Are Prevented for Existing Users and Roles
The Oracle Database Vault configuration prevents several privileges for all users and roles
who have been granted these privileges, including users SYS and SYSTEM.
• ALTER PROFILE
• ALTER USER
• CREATE PROFILE
• CREATE USER
• DROP PROFILE
• DROP USER
For better security and to maintain separation-of-duty standards, do not enable SYS or SYSTEM
users the ability to create or manage user accounts.
Any role can be granted to user SYS, but SYS cannot use the role because no roles are
enabled in the SYS session.
Related Topics
• Oracle Database Audit Settings Created for Oracle Database Vault
When you install Oracle Database Vault, it creates several AUDIT settings in the
database.
2-5
3
Getting Started with Oracle Database Vault
Before you can start using Oracle Database Vault, you must register it with the Oracle
database.
• Manually Installing Oracle Database Vault in a Multitenant Environment
Under certain conditions, for a multitenent environment, you must manually install Oracle
Database Vault.
• Registering Oracle Database Vault with an Oracle Database
You can register Oracle Database Vault for either a non-multitenant environment or a
multitenant environment.
• Logging into Oracle Database Vault
Oracle Enterprise Manager Cloud Control (Cloud Control) provides pages for Oracle
Database Vault.
• Quick Start Tutorial: Securing a Schema from DBA Access
This tutorial shows how to create a realm around the HR schema.
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
2. If necessary, follow the instructions in Verifying That Database Vault Is Configured and
Enabled to check if Oracle Database Vault and Oracle Label Security are already
installed on this PDB.
3. Install Oracle Label Security by executing the catols.sql script.
@$ORACLE_HOME/rdbms/admin/catols.sql
Oracle Label Security must be installed before you can use Oracle Database Vault.
4. Install Oracle Database Vault by executing the catmac.sql script.
@$ORACLE_HOME/rdbms/admin/catmac.sql
3-1
Chapter 3
Registering Oracle Database Vault with an Oracle Database
5. At the Enter value for 1 prompt, enter the default tablespace for the PDB.
6. At the Enter value for 2 prompt, enter the temporary tablespace for the PDB.
After the installation is complete, you can register Oracle Database Vault.
Related Topics
• Registering Oracle Database Vault with an Oracle Database
You can register Oracle Database Vault for either a non-multitenant environment
or a multitenant environment.
3-2
Chapter 3
Registering Oracle Database Vault with an Oracle Database
require a separate license unless you begin using Oracle Label Security separately and
create Oracle Label Security policies. This procedure applies to the CDB root, application
root, and the current pluggable database (PDB), as well as to both single-instance and
Oracle Real Application Clusters (Oracle RAC) installations.
As part of the registration process, you create the Database Vault administrative accounts.
These are user accounts that are granted Database Vault DV_OWNER and DV_ACCTMGR roles. As
a safety measure, Oracle recommends that you create backups of these user accounts. If
you lose access to all of the DV_OWNER user accounts, then there is no way to recover this
role. As a result, you will be unable to modify any Database Vault roles or disable Database
Vault. You can remedy this problem by recovering the database to the last known point where
the database had possession of the Database Vault owner account.
This section explains how to register Oracle Database Vault in a non-multitenant
environment, and several ways that you can register it in a multitenant environment.
Note:
If you have upgraded from a release earlier than Oracle Database 12c, and if the
earlier Oracle Database Vault had been enabled in that earlier release, then after
the upgrade process is complete, you must enable Oracle Database Vault by using
the DBMS_MACADM.ENABLE_DV procedure.
Related Topics
• Verifying That Database Vault Is Configured and Enabled
The DBA_DV_STATUS, CDB_DV_STATUS, DBA_OLS_STATUS, and CDB_OLS_STATUS data
dictionary views verify if Oracle Database is configured and enabled.
2. Identify (or create new named user accounts if necessary) named user accounts to be
used for the Database Vault Owner (DV_OWNER role) and Database Vault Account
Manager (DV_ACCTMGR role) accounts.
Oracle strongly recommends that you create two accounts for each role. One account,
the primary named user account, will be used on a day-to-day basis and the other
account will be used as a backup account in case the password of the primary account is
lost and must be reset.
For example:
GRANT CREATE SESSION TO sec_admin_owen IDENTIFIED BY password;
GRANT CREATE SESSION TO dbv_owner_backup IDENTIFIED BY password;
GRANT CREATE SESSION TO accts_admin_ace IDENTIFIED BY password;
GRANT CREATE SESSION TO dbv_acctmgr_backup IDENTIFIED BY password;
3-3
Chapter 3
Registering Oracle Database Vault with an Oracle Database
Follow the guidelines in Oracle Database Security Guide to replace password with
a password that is secure.
3. Connect with the SYSDBA administrative privilege.
CONNECT / AS SYSDBA
Enter password: password
Do not enter the names DV_OWNER, DV_ACCTMGR, or the names of any other
Database Vault roles for these user accounts.
5. Run the utlrp.sql script to recompile invalidated objects.
@?/rdbms/admin/utlrp.sql
If the script gives you any instructions, follow them, and then run the script again. If
the script terminates abnormally without giving any instructions, run it again.
6. Connect as the backup Database Vault Owner user that you just configured.
For example:
CONNECT dbv_owner_backup
Enter password: password
10. Connect as the backup DV_OWNER user and then grant the DV_OWNER role to the
primary DV_OWNER user that you created earlier.
For example:
CONNECT dbv_owner_backup
Enter password: password
11. Connect as the backup DV_ACCTMGR user and then grant the DV_ACCTMGR role to the
primary DV_ACCTMGR user.
For example:
CONNECT dbv_acctmgr_backup
Enter password: password
3-4
Chapter 3
Registering Oracle Database Vault with an Oracle Database
13. Store the two backup account passwords in a safe location such as a privileged account
management (PAM) system in case they are needed in the future.
Related Topics
• Verifying That Database Vault Is Configured and Enabled
The DBA_DV_STATUS, CDB_DV_STATUS, DBA_OLS_STATUS, and CDB_OLS_STATUS data
dictionary views verify if Oracle Database is configured and enabled.
• Oracle Database Vault Roles
Oracle Database Vault provides default roles that are based on specific user tasks and
adhere to separation of duty concepts.
• Logging into Oracle Database Vault
Oracle Enterprise Manager Cloud Control (Cloud Control) provides pages for Oracle
Database Vault.
3.2.3 Registering Database Vault with Common Users to Manage the CDB
Root
In a multitenant environment, you can register Oracle Database Vault with a common user
who will manage the CDB root.
1. In a multitenant environment, log into the root of the database instance as a user who
has privileges to create users and grant the CREATE SESSION and SET CONTAINER
privileges.
For example:
sqlplus c##sec_admin
Enter password: password
2. Create accounts that will be used for the Database Vault Owner (DV_OWNER role) and
Database Vault Account Manager (DV_ACCTMGR role) accounts.
Oracle strongly recommends that you create two accounts for each role. One account,
the primary account, will be used on a day-to-day basis and the other account will be
used as a backup account in case the password of the primary account is lost and must
be reset.
Prepend the names of these accounts with c## or C##. For example:
GRANT CREATE SESSION, SET CONTAINER TO c##dbv_owner_root IDENTIFIED BY password
CONTAINER = ALL;
GRANT CREATE SESSION, SET CONTAINER TO c##dbv_owner_root_backup IDENTIFIED BY
password CONTAINER = ALL;
GRANT CREATE SESSION, SET CONTAINER TO c##dbv_acctmgr_root IDENTIFIED BY password
CONTAINER = ALL;
GRANT CREATE SESSION, SET CONTAINER TO c##dbv_acctmgr_root_backup IDENTIFIED BY
password CONTAINER = ALL;
Replace password with a password that is secure. See Oracle Database Security Guide
for the minimum requirements for creating passwords.
3. Connect to the root as user SYS with the SYSDBA administrative privilege
3-5
Chapter 3
Registering Oracle Database Vault with an Oracle Database
If the script provides instructions, follow them, and then run the script again. If the
script terminates abnormally without giving any instructions, run it again.
6. Connect to the root as the primary Database Vault Owner user that you just
configured.
For example:
CONNECT c##dbv_owner_root
Enter password: password
• To enable Oracle Database Vault to use strict mode, which enables Database
Vault in each PDB:
EXEC DBMS_MACADM.ENABLE_DV (strict_mode => 'y');
10. Connect as the primary DV_OWNER user and then grant the DV_OWNER role to the
backup DV_OWNER user that you created earlier.
For example:
CONNECT c##dbv_owner_root
Enter password: password
11. Connect as the primary DV_ACCTMGR user and then grant the DV_ACCTMGR role to the
backup DV_ACCTMGR user.
For example:
CONNECT c##dbv_acctmgr_root
Enter password: password
3-6
Chapter 3
Registering Oracle Database Vault with an Oracle Database
12. Store the two backup account passwords in a safe location in case they are needed in
the future.
Related Topics
• Verifying That Database Vault Is Configured and Enabled
The DBA_DV_STATUS, CDB_DV_STATUS, DBA_OLS_STATUS, and CDB_OLS_STATUS data
dictionary views verify if Oracle Database is configured and enabled.
• Oracle Database Vault Roles
Oracle Database Vault provides default roles that are based on specific user tasks and
adhere to separation of duty concepts.
• Logging into Oracle Database Vault
Oracle Enterprise Manager Cloud Control (Cloud Control) provides pages for Oracle
Database Vault.
2. If you have not already done so, then create user accounts to be used as the Database
Vault accounts.
See Step 2 under Registering Database Vault with Common Users to Manage the CDB
Root for more information about creating these accounts.
3. Ensure that you have registered Oracle Database Vault in the CDB root, as described in
Registering Database Vault with Common Users to Manage the CDB Root.
4. Connect to the PDB to which the common users will need access.
For example:
CONNECT c##sec_admin@pdb_name
Enter password: password
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
5. Grant the CREATE SESSION and SET CONTAINER privileges to the users for this PDB.
For example:
GRANT CREATE SESSION, SET CONTAINER TO c##dbv_owner_root CONTAINER = CURRENT;
GRANT CREATE SESSION, SET CONTAINER TO c##dbv_acctmgr_root CONTAINER = CURRENT;
3-7
Chapter 3
Registering Oracle Database Vault with an Oracle Database
7. While still in the PDB, configure the two primary Database Vault user accounts.
For example:
BEGIN
CONFIGURE_DV (
dvowner_uname => 'c##dbv_owner_root',
dvacctmgr_uname => 'c##dbv_acctmgr_root');
END;
/
If the script provides instructions, follow them, and then run the script again. If the
script terminates abnormally without giving any instructions, run it again.
9. Connect to the PDB as the primary Database Vault Owner user that you just
configured.
For example:
CONNECT c##dbv_owner_root@pdb_name
Enter password: password
CONNECT / AS SYSDBA
For example:
ALTER PLUGGABLE DATABASE pdb_name CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE pdb_name OPEN;
Related Topics
• Verifying That Database Vault Is Configured and Enabled
The DBA_DV_STATUS, CDB_DV_STATUS, DBA_OLS_STATUS, and CDB_OLS_STATUS data
dictionary views verify if Oracle Database is configured and enabled.
• Oracle Database Vault Roles
Oracle Database Vault provides default roles that are based on specific user tasks
and adhere to separation of duty concepts.
• Logging into Oracle Database Vault
Oracle Enterprise Manager Cloud Control (Cloud Control) provides pages for
Oracle Database Vault.
3-8
Chapter 3
Registering Oracle Database Vault with an Oracle Database
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
2. Grant the common Database Vault DV_OWNER users the CREATE SESSION and SET
CONTAINER privileges, and the appropriate Database Vault roles.
The following accounts will be the primary and the backup accounts:
GRANT CREATE SESSION, SET CONTAINER, DV_OWNER TO c##dbv_owner_root;
GRANT CREATE SESSION, SET CONTAINER, DV_OWNER TO c##dbv_owner_root_backup WITH
ADMIN OPTION;
Related Topics
• Verifying That Database Vault Is Configured and Enabled
The DBA_DV_STATUS, CDB_DV_STATUS, DBA_OLS_STATUS, and CDB_OLS_STATUS data
dictionary views verify if Oracle Database is configured and enabled.
• Oracle Database Vault Roles
Oracle Database Vault provides default roles that are based on specific user tasks and
adhere to separation of duty concepts.
• Logging into Oracle Database Vault
Oracle Enterprise Manager Cloud Control (Cloud Control) provides pages for Oracle
Database Vault.
3-9
Chapter 3
Registering Oracle Database Vault with an Oracle Database
Database users who have been granted the DV_OWNER or DV_ACCTMGR roles are
considered critical, privileged, accounts. Typically, these accounts should be
considered service accounts and exempt from password lockout requirements. Oracle
recommends that you create a custom profile that prevents the account from being
locked. In addition, you should audit failed login attempts for these Database Vault-
related accounts.
1. Log into the database instance as a user who has the CREATE PROFILE system
privilege.
• For common DV_OWNER and DV_ACCTMGR users in the root: Log in to the root of
the database instance.
• For common DV_OWNER and DV_ACCTMGR users in a PDB: Log in to the PDB in
which you created the users.
• For a non-multitenant environment: Log in to the database instance.
2. Create a profile similar to the following:
• For common DV_OWNER and DV_ACCTMGR users in the root: In the root, create
the profile similar to the following:
• For common DV_OWNER and DV_ACCTMGR users in a PDB: In the PDB, create the
profile similar to the following:
3. Update the DV_OWNER and DV_ACCTMGR user accounts to use this profile.
3-10
Chapter 3
Registering Oracle Database Vault with an Oracle Database
Related Topics
• Oracle Database SQL Language Reference
• Oracle Database Security Guide
3-11
Chapter 3
Logging into Oracle Database Vault
– If you want to find the Database Vault status of all PDBs in a multitenant
environment, as a common user with administrative privileges, then query
CDB_DV_STATUS, which provides the addition of a container ID (CON_ID) field..
• For Oracle Label Security, query the following data dictionary views, which are
similar to their Database Vault equivalent views:
– DBA_OLS_STATUS
– CDB_OLS_STATUS
3-12
Chapter 3
Quick Start Tutorial: Securing a Schema from DBA Access
• Username: Enter the name of a user who has been granted the appropriate Oracle
Database Vault role:
– Creating and propagating Database Vault policies: DV_OWNER or DV_ADMIN role,
SELECT ANY DICTIONARY privilege
– Viewing Database Vault alerts and reports: DV_OWNER, DV_ADMIN, or
DV_SECANALYST role, SELECT ANY DICTIONARY privilege
• Password: Enter your password.
• Role: Select NORMAL from the list.
• Save as: Select this check box if you want these credentials to be automatically filled
in for you the next time that this page appears. The credentials are stored in
Enterprise Manager in a secured manner. Access to these credentials depends on
the user who is currently logged in.
The Database Vault home page appears.
Related Topics
• About Oracle Database Vault Roles
Oracle Database Vault provides a set of roles that are required for managing Oracle
Database Vault.
• Using Oracle Database Vault with Oracle Enterprise Manager
Oracle Database Vault administrators can perform tasks in Oracle Enterprise Manager
Cloud Control such as propagating polices to other databases.
3-13
Chapter 3
Quick Start Tutorial: Securing a Schema from DBA Access
Before you begin this tutorial, ensure that the HR sample schema is installed. Oracle
Database Sample Schemas describes how to install the sample schemas.
1. Log into the database instance as a user who has been granted the DBA role, and
then access the HR schema.
For example:
sqlplus system
Enter password: password
3-14
Chapter 3
Quick Start Tutorial: Securing a Schema from DBA Access
CONNECT SYSTEM@my_pdb
Enter password: password
To find the available PDBs, in the CDB, query the DBA_PDBS data dictionary view. To
check the current PDB, run the show con_name command.
3. Query the HR.EMPLOYEES table as follows.
SELECT FIRST_NAME, LAST_NAME, SALARY FROM HR.EMPLOYEES WHERE ROWNUM < 10;
9 rows selected.
4. If the HR schema is locked and expired, log into the database instance as the DV_ACCTMGR
user and unlock and unexpire the account. For example:
sqlplus bea_dvacctmgr -- For a multitenant environment, sqlplus bea_dvacctmgr@hrpdb
Enter password: password
Follow the guidelines in Oracle Database Security Guide to replace password with a
password that is secure.
As you can see, SYSTEM has access to the salary information in the EMPLOYEES table of the
HR schema. This is because SYSTEM is automatically granted the DBA role, which includes
the SELECT ANY TABLE system privilege.
5. Do not exit SQL*Plus.
3-15
Chapter 3
Quick Start Tutorial: Securing a Schema from DBA Access
7. After Status, ensure that Enabled is selected so that the realm can be used.
8. Under Audit Options, ensure that Audit On Failure is selected so that you can
create an audit trial later on.
9. Click Next to display the Realm secured objects page.
10. Click the Add button and in the Add Secured Object dialog box, enter the following
information:
• Owner: Enter HR to select the HR schema.
• Object Type: Enter TABLE.
• Object Name: Enter EMPLOYEES.
11. Click OK.
The HR.EMPLOYEES table is added to the Create Realm : Realm Secured Objects
page.
12. Click Done, and then click Finish.
At this stage, you have created the realm but you have not assigned any
authorizations to it. You will take care of that later on in this tutorial.
Replace password with a password that is secure. See Oracle Database Security
Guide for the minimum requirements for creating passwords.
2. Connect as SYS with the SYSDBA privilege, and then grant SEBASTIAN the following
additional privilege.
CONNECT SYS AS SYSDBA -- Or, CONNECT SYS@hrpdb AS SYSDBA
Enter password: password
Do not exit SQL*Plus; you will need it for Step 6: Test the Realm, when you test the
realm.
3-16
Chapter 3
Quick Start Tutorial: Securing a Schema from DBA Access
Even though user SEBASTIAN has the READ ANY TABLE system privilege, he cannot query the
HR.EMPLOYEES table, because the HR Apps realm takes precedence over the READ ANY TABLE
system privilege.
1. In the Realms page of Database Vault Administrator, select the HR Apps in the list of
realms, and then click Edit.
2. Click the Next button until you reach the Realm authorizations page.
3. Click Add and then enter the following information in the Add Authorizations dialog box:
• Realm Authorization Grantee: Enter SEBASTIAN.
• Realm Authorization Type: Select Participant from the list.
• Realm Authorization Ruleset: Leave this field blank.
4. Click OK.
The Participant authorization allows the user SEBASTIAN in the HR Apps realm to manage
access, manipulate, and create objects protected by the HR Apps realm. In this case, the
HR user and SEBASTIAN are the only users allowed to view the EMPLOYEES table.
5. Click Done, and then Finish.
The SYSTEM account normally has access to all objects in the HR schema, but now that you
have safeguarded the EMPLOYEES table with Oracle Database Vault, this is no longer the case.
3-17
Chapter 3
Quick Start Tutorial: Securing a Schema from DBA Access
SYSTEM no longer has access to the salary information in the EMPLOYEES table.
(In fact, even user SYS does not have access to this table.) However, user
SEBASTIAN does have access to this information.
3. Connect as user SEBASTIAN.
CONNECT sebastian -- Or, CONNECT sebastian@hrpdb
Enter password: password
9 rows selected.
If VALUE returns TRUE, then you cannot complete this section. Go to Step 8:
Remove the Components for This Tutorial.
If unified auditing is enabled, then you must create a unified audit policy to capture
events. See Oracle Database Security Guide for information about how to create
unified audit policies for Oracle Database Vault.
3-18
Chapter 3
Quick Start Tutorial: Securing a Schema from DBA Access
2. In the Database Vault Administrator page, click Home to display the home page.
3. In the Database Vault Home page, under Reports, select Database Vault Reports.
4. In the Database Vault Reports page, select Database Vault Enforcement Audit Report.
5. From the Database Vault Audit Report list, select Realm Audit Report.
6. In the Search area, from the Command menu, select Equals and in the text field, enter
SELECT. Then click Search.
The report appears in the table that follows the Search region.
7. Click OK to exit the report.
Oracle Database Vault generates a report listing the type of violation (in this case, the SELECT
statement entered in the previous section), when and where it occurred, the login account
who tried the violation, and what the violation was.
3-19
4
Performing Privilege Analysis
to Find Privilege Use
Privilege analysis dynamically analyzes the privileges and roles that users use and do not
use.
• What Is Privilege Analysis?
Privilege analysis increases the security of your applications and database operations by
helping you to implement least privilege best practices for database roles and privileges.
• Creating and Managing Privilege Analysis Policies
You can create and manage privilege analysis policies in either SQL*Plus or in Enterprise
Manager Cloud Control.
• Creating Roles and Managing Privileges Using Cloud Control
You can create new roles using privileges found in a privilege analysis report and then
grant this role to users.
• Tutorial: Using Capture Runs to Analyze ANY Privilege Use
This tutorial demonstrates how to create capture runs to analyze the use of the READ ANY
TABLE system privilege.
• Tutorial: Analyzing Privilege Use by a User Who Has the DBA Role
This tutorial demonstrates how to analyze the privilege use of a user who has the DBA
role and performs database tuning operations.
• Privilege Analysis Policy and Report Data Dictionary Views
Oracle Database provides a set of data dictionary views that provide information about
analyzed privileges.
4-1
Chapter 4
What Is Privilege Analysis?
Note:
See Oracle Database Licensing Information for privilege analysis licensing
information.
4-2
Chapter 4
What Is Privilege Analysis?
pre-compiled database objects and run-time usage, then you must query both the
ORA$DEPENDENCY and run-time captures. For unused privileges, you only need to query with
the run-time capture name.
To find a full list of the pre-compiled objects on which privilege analysis can be used, query
the TYPE column of the ALL_DEPENDENCIES data dictionary view.
You use the DBMS_PRIVILEGE_CAPTURE PL/SQL package to manage privilege capture. You
use the data dictionary views provided by privilege analysis to analyze your privilege use.
• Role-based privilege use capture. You must provide a list of roles. If the roles in the list
are enabled in the database session, then the used privileges for the session will be
captured. You can capture privilege use for the following types of roles: Oracle default
roles, user-created roles, Code Based Access Control (CBAC) roles, and secure
application roles.
• Context-based privilege use capture. You must specify a Boolean expression only with
the SYS_CONTEXT function. The used privileges will be captured if the condition evaluates
to TRUE.
• Role- and context-based privilege use capture. You must provide both a list of roles
that are enabled and a SYS_CONTEXT Boolean expression for the condition. When any of
these roles is enabled in a session and the given context condition is satisfied, then
privilege analysis starts capturing the privilege use.
• Database-wide privilege capture. If you do not specify any type in your privilege
analysis policy, then the used privileges in the database will be captured, except those for
the user SYS. (This is also referred to as unconditional analysis, because it is turned on
without any conditions.)
Note the following restrictions:
• You can enable only one privilege analysis policy at a time. The only exception is that you
can enable a database-wide privilege analysis policy at the same time as a non-
database-wide privilege analysis policy, such as a role or context attribute-driven analysis
policy.
• You cannot analyze the privileges of the SYS user.
• Privilege analysis shows the grant paths to the privilege but it does not suggest which
grant path to keep.
• If the role, user, or object has been dropped, then the values that reflect the privilege
captures for these in the privilege analysis data dictionary views are dropped as well.
4-3
Chapter 4
What Is Privilege Analysis?
For example, to select from application data and run application procedures, the
system privileges SELECT ANY TABLE and EXECUTE ANY PROCEDURE are granted to an
application account appsys. The account appsys now can access non-application data
even if he or she does not intend to. In this situation, you can analyze the privilege
usage by user appsys, and then based on the results, revoke and grant privileges as
necessary.
4-4
Chapter 4
Creating and Managing Privilege Analysis Policies
If you are using a multitenant environment, then you can create privilege analysis policies in
either the CDB root or in individual PDBs. The privilege analysis policy applies only to the
container in which it is created, either to the privileges used within the CDB root or the
application root, or to the privileges used within a PDB. It cannot be applied globally
throughout the multitenant environment. You can grant the CAPTURE_ADMIN role locally to a
local user or a common user. You can grant the CAPTURE_ADMIN role commonly to common
users.
See Also:
Oracle Database Administrator’s Guide for more information about multitenant
container databases (CDBs)
4-5
Chapter 4
Creating and Managing Privilege Analysis Policies
Before you can do so, you must be granted the CAPTURE_ADMIN role. The
DBMS_PRIVILEGE_CAPTURE package enables you to create, enable, disable, and drop
privilege analysis policies. It also generates reports that show the privilege usage,
which you can view in DBA_* views.
See Also:
Oracle Database PL/SQL Packages and Types Reference for detailed
information about the DBMS_PRIVILEGE_CAPTURE PL/SQL package
4-6
Chapter 4
Creating and Managing Privilege Analysis Policies
However, both SYS and the user who created the policy can drop it. After you create the
policy, you must manually enable it so that it can begin to analyze privilege use. If you want to
configure privilege analysis by using Oracle Enterprise Manager Cloud Control, then ensure
that you have the latest plug-in.
4-7
Chapter 4
Creating and Managing Privilege Analysis Policies
– Context captures privileges when the condition that you specify evaluates
to TRUE. If you select this option, then the Capture Policy page displays a
Condition field. To build the condition, select the edit icon on the right of
this field to display the Policy Expression Builder dialog box.
4-8
Chapter 4
Creating and Managing Privilege Analysis Policies
– Role and Context captures privileges from one of the specified roles when the
context condition evaluates to TRUE. If you select this option, then both the list of
available roles and Condition field appear.
5. Click OK.
The new policy appears in the Policies area of the Privilege Analysis page.
6. To enable the policy so that it can begin to capture privilege use, return to the main
Privilege Analysis policy page, select the policy under Policies, and then click Start
Capture.
The Privilege Analysis: Start Capture dialog box appears.
7. Enter the following information to set the time in which the capture will begin:
• To start the privilege capture process immediately, click Immediate and then click the
OK button.
• To start the privilege capture at a later date, click Later, specify the date and time that
you want to capture process to begin, and then click OK.
The Privilege Analysis page appears. The time that you set for the policy to begin is listed
under First Start Time for the policy. If you want to modify the start time, select the policy
and click Start Capture.
After you create the privilege analysis policy, you can find it listed in the DBA_PRIV_CAPTURES
data dictionary view.
• Use the following syntax for the DBMS_PRIVILEGE_CAPTURE.CREATE_CAPTURE procedure:
DBMS_PRIVILEGE_CAPTURE.CREATE_CAPTURE(
name VARCHAR2,
description VARCHAR2 DEFAULT NULL,
type NUMBER DEFAULT DBMS_PRIVILEGE_CAPTURE.G_DATABASE,
roles ROLE_NAME_LIST DEFAULT ROLE_NAME_LIST(),
condition VARCHAR2 DEFAULT NULL);
In this specification:
• name: Specifies the name of the privilege analysis policy to be created. Ensure that this
name is unique and no more than 128 characters. You can include spaces in the name,
4-9
Chapter 4
Creating and Managing Privilege Analysis Policies
but you must enclose the name in single quotation marks whenever you refer to it.
To find the names of existing policies, query the NAME column of the
DBA_PRIV_CAPTURES view.
• description: Describes the purpose of the privilege analysis policy, up to 1024
characters in mixed-case letters. Optional.
• type: Specifies the type of capture condition. If you omit the type parameter, then
the default is DBMS_PRIVILEGE_CAPTURE.G_DATABASE. Optional.
Enter one of the following types:
– DBMS_PRIVILEGE_CAPTURE.G_DATABASE: Captures all privileges used in the
entire database, except privileges from user SYS.
– DBMS_PRIVILEGE_CAPTURE.G_ROLE: Captures privileges for the sessions that
have the roles enabled. If you enter DBMS_PRIVILEGE_CAPTURE.G_ROLE for the
type parameter, then you must also specify the roles parameter. For multiple
roles, separate each role name with a comma.
– DBMS_PRIVILEGE_CAPTURE.G_CONTEXT: Captures privileges for the sessions
that have the condition specified by the condition parameter evaluating to
TRUE. If you enter DBMS_PRIVILEGE_CAPTURE.G_CONTEXT for the type
parameter, then you must also specify the condition parameter.
– DBMS_PRIVILEGE_CAPTURE.G_ROLE_AND_CONTEXT: Captures privileges for the
sessions that have the role enabled and the context condition evaluating to
TRUE. If you enter DBMS_PRIVILEGE_CAPTURE.G_ROLE_AND_CONTEXT for the type
parameter, then you must also specify both the roles and condition
parameters.
• roles: Specifies the roles whose used privileges will be analyzed. That is, if a
privilege from one of the given roles is used, then the privilege will be analyzed.
You must specify this argument if you specify DBMS_PRIVILEGE_CAPTURE.G_ROLE or
DBMS_PRIVILEGE_CAPTURE.G_ROLE_AND_CONTEXT for the type argument. Each role
you enter must exist in the database. (You can find existing roles by querying the
DBA_ROLES data dictionary view.) For multiple roles, use varray type
role_name_list to enter the role names. You can specify up to 10 roles.
For example, to specify two roles:
roles => role_name_list('role1', 'role2'),
4-10
Chapter 4
Creating and Managing Privilege Analysis Policies
* You can add as many constant values as you need (for example, IN {constant_value1}, or
IN {constant_value1, constant_value2, constant_value3}).
Remember that after you create the privilege analysis policy, you must enable it, as described
in Enabling a Privilege Analysis Policy.
4-11
Chapter 4
Creating and Managing Privilege Analysis Policies
4-12
Chapter 4
Creating and Managing Privilege Analysis Policies
4-13
Chapter 4
Creating and Managing Privilege Analysis Policies
4-14
Chapter 4
Creating and Managing Privilege Analysis Policies
4-15
Chapter 4
Creating and Managing Privilege Analysis Policies
4-16
Chapter 4
Creating and Managing Privilege Analysis Policies
In this specification:
• name: Specifies the name of the privilege analysis policy. The DBA_PRIV_CAPTURES
data dictionary view lists the names of existing policies.
• run_name: Specifies the name for the run name for the privilege capture that must be
computed. If you omit this setting, then all runs for the given privilege capture are
computed.
• dependency: Enter Y (yes) or N (no) to specify whether the PL/SQL computation
privilege usage should be included in the report.
4-17
Chapter 4
Creating and Managing Privilege Analysis Policies
3. Query the used privileges from DBA_USED_* data dictionary views with privilege
grant paths.
4-18
Chapter 4
Creating Roles and Managing Privileges Using Cloud Control
For example:
EXEC DBMS_PRIVILEGE_CAPTURE.DISABLE_CAPTURE ('logon_users_analysis_pol');
If you had enabled the policy with a capture run, then the capture run is dropped as well.
To individually drop a capture run, you can run the DBMS_PRIVILEGE_CAPTURE.DELETE_RUN
procedure, but the policy must exist before you can run this statement.
4-19
Chapter 4
Creating Roles and Managing Privileges Using Cloud Control
– None for role, then no role that is captured in the policy will be used in the
new role.
– Customize object privileges, then a list of available used objects
privileges captured are displayed, you need to select the privileges from
the list to assign to the role.
4-20
Chapter 4
Creating Roles and Managing Privileges Using Cloud Control
The next pages that appear depend on your selections of All, None, or Customize. If
you selected all, the page displays a listing of the privileges. If you selected None, the
4-21
Chapter 4
Tutorial: Using Capture Runs to Analyze ANY Privilege Use
page is bypassed. If you selected Customize, then you can individually select the
privileges to revoke. The last page that appears is the Review page.
12. Click Save.
4-22
Chapter 4
Tutorial: Using Capture Runs to Analyze ANY Privilege Use
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
If Oracle Database Vault is not enabled, then log into the database instance as a user
who has the CREATE USER system privilege.
2. Create the following users:
CREATE USER pa_admin IDENTIFIED BY password;
CREATE USER app_user IDENTIFIED BY password;
3. Connect as a user who has the privileges to grant roles and system privileges to other
users, and who has been granted the owner authorization for the Oracle System Privilege
and Role Management realm. (User SYS has these privileges by default.)
For example:
CONNECT dba_psmith -- Or, CONNECT dba_psmith@hrpdb
Enter password: password
4-23
Chapter 4
Tutorial: Using Capture Runs to Analyze ANY Privilege Use
In SQL*Plus, a user who has been granted the DV_OWNER role can check the
authorization by querying the DBA_DV_REALM_AUTH data dictionary view. To grant
the user authorization, use the DBMS_MACADM.ADD_AUTH_TO_REALM procedure.
4. Grant the following role and privilege to the users.
GRANT CREATE SESSION, CAPTURE_ADMIN TO pa_admin;
GRANT CREATE SESSION, READ ANY TABLE TO app_user;
User pa_admin will create the privilege analysis policy that will analyze the READ
ANY TABLE query that user app_user will perform.
In this example:
• type specifies the type of capture condition that is defined by the condition
parameter, described next. In this policy, the type is a context-based condition.
• condition specifies condition using a Boolean expression that must evaluate
to TRUE for the policy to take effect. In this case, the condition checks if the
session user is app_user.
3. Enable the policy and create a capture run for it.
BEGIN
DBMS_PRIVILEGE_CAPTURE.ENABLE_CAPTURE (
name => 'ANY_priv_analysis_pol',
run_name => 'ANY_priv_pol_run_1');
END;
/
At this point, the policy is ready to start recording the actions of user app_user.
4-24
Chapter 4
Tutorial: Using Capture Runs to Analyze ANY Privilege Use
The generated results are stored in the privilege analysis data dictionary views, which are
described in Privilege Analysis Policy and Report Data Dictionary Views.
2. Enter the following commands to format the data dictionary view output:
col username format a10
col sys_priv format a16
col object_owner format a13
col object_name format a23
col run_name format a27
3. Find the system privileges that app_user used and the objects on which he used them
during the privilege analysis period.
SELECT SYS_PRIV, OBJECT_OWNER, OBJECT_NAME, RUN_NAME FROM DBA_USED_PRIVS WHERE
USERNAME = 'APP_USER';
4-25
Chapter 4
Tutorial: Using Capture Runs to Analyze ANY Privilege Use
Output similar to the following appears. The first row shows that app_user used
the READ ANY TABLE privilege on the HR.EMPLOYEES table.
SYS_PRIV OBJECT_OWNER OBJECT_NAME RUN_NAME
---------------- ------------- ----------------------- ------------------
SYSTEM PRODUCT_PRIVS ANY_PRIV_POL_RUN_1
SYS DUAL ANY_PRIV_POL_RUN_1
SYS DUAL ANY_PRIV_POL_RUN_1
CREATE SESSION ANY_PRIV_POL_RUN_1
SYS DBMS_APPLICATION_INFO ANY_PRIV_POL_RUN_1
READ ANY TABLE HR EMPLOYEES ANY_PRIV_POL_RUN_1
At this stage, the privilege analysis results remain available in the privilege analysis
data dictionary views, even if you create additional capture runs in the future.
7. Find the system privileges that app_user used and the objects on which he used
them during the privilege analysis period.
SELECT SYS_PRIV, OBJECT_OWNER, OBJECT_NAME, RUN_NAME FROM DBA_USED_PRIVS
WHERE USERNAME = 'APP_USER' ORDER BY RUN_NAME;
4-26
Chapter 4
Tutorial: Analyzing Privilege Use by a User Who Has the DBA Role
Output similar to the following appears, which now shows the results of both of the
capture runs that user pa_admin created.
SYS_PRIV OBJECT_OWNER OBJECT_NAME RUN_NAME
---------------- ------------- ----------------------- ----------------------
READ ANY TABLE HR EMPLOYEES ANY_PRIV_POL_RUN_1
SYS DUAL ANY_PRIV_POL_RUN_1
CREATE SESSION ANY_PRIV_POL_RUN_1
SYS DUAL ANY_PRIV_POL_RUN_1
SYSTEM PRODUCT_PRIVS ANY_PRIV_POL_RUN_1
SYS DBMS_APPLICATION_INFO ANY_PRIV_POL_RUN_1
SYS DUAL ANY_PRIV_POL_RUN_2
SYS DBMS_APPLICATION_INFO ANY_PRIV_POL_RUN_2
SYSTEM PRODUCT_PRIVS ANY_PRIV_POL_RUN_2
SYS DUAL ANY_PRIV_POL_RUN_2
READ ANY TABLE HR JOBS ANY_PRIV_POL_RUN_2
Any capture runs that are associated with this policy are dropped automatically when you
run the DBMS_PRIVILEGE_CAPTURE.DROP_CAPTURE procedure.
Even though in the next steps you will drop the pa_admin user, including any objects
created in this user's schema, you must manually drop the ANY_priv_analysis_pol
privilege analysis policy because this object resides in the SYS schema.
2. Connect as the user who created the user accounts. If Oracle Database Vault is enabled,
then connect as the Oracle Database Vault Account Manager.
For example:
CONNECT bea_dvacctmgr -- Or, CONNECT bea_dvacctmgr@hrpdb
Enter password: password
4-27
Chapter 4
Tutorial: Analyzing Privilege Use by a User Who Has the DBA Role
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the
current PDB, run the show con_name command.
If Oracle Database Vault is not enabled, then log into the database instance as a
user who has the CREATE USER system privilege.
2. Create the following users:
CREATE USER pa_admin IDENTIFIED BY password;
CREATE USER tjones IDENTIFIED BY password;
Follow the guidelines in Oracle Database Security Guide to replace password with
a password that is secure.
3. Connect as a user who has the privileges to grant roles and system privileges to
other users, and who has been granted the owner authorization for the Oracle
System Privilege and Role Management realm. (User SYS has these privileges by
default.)
For example:
CONNECT dba_psmith -- Or, CONNECT dba_psmith@hrpdb
Enter password: password
4-28
Chapter 4
Tutorial: Analyzing Privilege Use by a User Who Has the DBA Role
In SQL*Plus, a user who has been granted the DV_OWNER role can check the authorization
by querying the DBA_DV_REALM_AUTH data dictionary view. To grant the user authorization,
use the DBMS_MACADM.ADD_AUTH_TO_REALM procedure.
4. Grant the following roles and privileges to the users.
GRANT CREATE SESSION, CAPTURE_ADMIN TO pa_admin;
GRANT CREATE SESSION, DBA TO tjones;
User pa_admin will create the privilege analysis policy that will analyze the database
tuning operations that user tjones will perform.
If Oracle Database Vault is enabled, then log in as the Database Vault Account Manager,
who has the DV_ACCTMGR role. Ensure that you are the owner of the Oracle System
Privilege and Role Management realm.
2. Create the following privilege analysis policy:
BEGIN
DBMS_PRIVILEGE_CAPTURE.CREATE_CAPTURE(
name => 'dba_tuning_priv_analysis_pol',
description => 'Analyzes DBA tuning privilege use',
type => DBMS_PRIVILEGE_CAPTURE.G_CONTEXT,
condition => 'SYS_CONTEXT(''USERENV'', ''SESSION_USER'')=''TJONES''');
END;
/
In this example:
• type specifies the type of capture condition that is defined by the condition
parameter, described next. In this policy, the type is a context-based condition.
• condition specifies condition using a Boolean expression that must evaluate to TRUE
for the policy to take effect. In this case, the condition checks if the session user is
tjones.
3. Enable the policy.
EXEC DBMS_PRIVILEGE_CAPTURE.ENABLE_CAPTURE ('dba_tuning_priv_analysis_pol');
At this point, the policy is ready to start recording the actions of user tjones.
4-29
Chapter 4
Tutorial: Analyzing Privilege Use by a User Who Has the DBA Role
@$ORACLE_HOME/rdbms/admin/utlxplan.sql
The location of this script may vary depending on your operating system. This
script creates the PLAN_TABLE table in the tjones schema.
3. Run the following EXPLAIN PLAN SQL statement on the HR.EMPLOYEES table:
EXPLAIN PLAN
SET STATEMENT_ID = 'Raise in Tokyo'
INTO PLAN_TABLE
FOR UPDATE HR.EMPLOYEES
SET SALARY = SALARY * 1.10
WHERE DEPARTMENT_ID =
(SELECT DEPARTMENT_ID FROM HR.DEPARTMENTS WHERE LOCATION_ID = 110);
Or
@$ORACLE_HOME/rdbms/admin/utlchn1.sql
The generated results are stored in the privilege analysis data dictionary views,
which are described in Privilege Analysis Policy and Report Data Dictionary Views.
2. Enter the following commands to format the data dictionary view output:
col username format a8
col sys_priv format a18
col used_role format a20
col path format a150
col obj_priv format a10
4-30
Chapter 4
Tutorial: Analyzing Privilege Use by a User Who Has the DBA Role
3. Find the system privileges and roles that user tjones used during the privilege analysis
period.
SELECT USERNAME, SYS_PRIV, USED_ROLE, PATH
FROM DBA_USED_SYSPRIVS_PATH
WHERE USERNAME = 'TJONES'
ORDER BY 1, 2, 3;
4. Find the object privileges and roles that user tjones used during the privilege analysis
period.
col username format a9
col used_role format a10
col object_name format a22
col object_type format a12
4-31
Chapter 4
Privilege Analysis Policy and Report Data Dictionary Views
USERNAME SYS_PRIV
-------- ------------------------------
TJONES ADMINISTER ANY SQL TUNING SET
TJONES ADMINISTER DATABASE TRIGGER
TJONES ADMINISTER RESOURCE MANAGER
TJONES ADMINISTER SQL TUNING SET
TJONES ALTER ANY ASSEMBLY
TJONES ON COMMIT REFRESH
...
Even though in the next steps you will drop the pa_admin user, including any
objects created in this user's schema, you must manually drop the
dba_tuning_priv_analysis_pol privilege analysis policy because this object
resides in the SYS schema.
2. Connect as the user who created the user accounts. If Oracle Database Vault is
enabled, then connect as the Oracle Database Vault Account Manager.
For example:
CONNECT bea_dvacctmgr -- Or, CONNECT bea_dvacctmgr@hrpdb
Enter password: password
Table 4-1 Data Dictionary Views That Display Privilege Analysis Information
View Description
DBA_PRIV_CAPTURES Lists information about existing privilege analysis
policies
DBA_USED_PRIVS Lists the privileges and capture runs that have
been used for reported privilege analysis policies
DBA_UNUSED_GRANTS Lists the privilege grants that have not been used
4-32
Chapter 4
Privilege Analysis Policy and Report Data Dictionary Views
Table 4-1 (Cont.) Data Dictionary Views That Display Privilege Analysis
Information
View Description
DBA_UNUSED_PRIVS Lists the privileges and capture runs that have not
been used for reported privilege analysis policies
DBA_USED_OBJPRIVS Lists the object privileges and capture runs that
have been used for reported privilege analysis
policies. It does not include the object grant paths.
DBA_UNUSED_OBJPRIVS Lists the object privileges and capture runs that
have not been used for reported privilege analysis
policies. It does not include the object privilege
grant paths.
DBA_USED_OBJPRIVS_PATH Lists the object privileges and capture runs that
have been used for reported privilege analysis
policies. It includes the object privilege grant
paths.
DBA_UNUSED_OBJPRIVS_PATH Lists the object privileges and capture runs that
have not been used for reported privilege analysis
policies. It includes the object privilege grant
paths.
DBA_USED_SYSPRIVS Lists the system privileges and capture runs that
have been used for reported privilege analysis
policies. It does not include the system privilege
grant paths.
DBA_UNUSED_SYSPRIVS Lists the system privileges and capture runs that
have not been used for reported privilege analysis
policies. It does not include the system privilege
grant paths.
DBA_USED_SYSPRIVS_PATH Lists the system privileges and capture runs that
have been used for reported privilege analysis
policies. It includes the system privilege grant
paths.
DBA_UNUSED_SYSPRIVS_PATH Lists the system privileges and capture runs that
have not been used for reported privilege analysis
policies. It includes system privilege grant paths
DBA_USED_PUBPRIVS Lists all the privileges and capture runs for the
PUBLIC role that have been used for reported
privilege analysis policies
DBA_USED_USERPRIVS Lists the user privileges and capture runs that
have been used for reported privilege analysis
policies. It does not include the user privilege
grant paths.
DBA_UNUSED_USERPRIVS Lists the user privileges and capture runs that
have not been used for reported privilege analysis
policies. It does not include the user privilege
grant paths.
DBA_USED_USERPRIVS_PATH Lists the user privileges and capture runs that
have been used for reported privilege analysis
policies. It includes the user privilege grant paths.
4-33
Chapter 4
Privilege Analysis Policy and Report Data Dictionary Views
Table 4-1 (Cont.) Data Dictionary Views That Display Privilege Analysis
Information
View Description
DBA_UNUSED_USERPRIVS_PATH Lists the privileges and capture runs that have not
been used for reported privilege analysis policies.
It includes the user privilege grant paths.
See Also:
Oracle Database Reference for a detailed description of these data
dictionary views
4-34
5
Configuring Realms
You can create a realm around database objects to protect them, and then set authorizations
to control user access to this data.
• What Are Realms?
Realms enable you to protect database objects, including specific object types.
• Default Realms
Oracle Database Vault provides default realms, which are regular realms, not mandatory
realms.
• Creating a Realm
To enable realm protection, you create the realm and configure it to include realm-
secured objects, roles, and authorizations.
• About Realm-Secured Objects
Realm-secured objects define the territory—a set of schema and database objects and
roles—that a realm protects.
• About Realm Authorization
Realm authorizations establish the set of database accounts and roles that manage or
access objects protected in realms.
• Realm Authorizations in a Multitenant Environment
In a multitenant environment, the rules and behavior for common realm authorizations
are similar to the authorizations for other common objects.
• Modifying the Enablement Status of a Realm
You can disable or enable a realm, or set the realm to use simulation mode, from
Enterprise Manager Cloud Control.
• Deleting a Realm
You can use Enterprise Manager Cloud Control to delete realms.
• How Realms Work
When an appropriately privileged database account issues a SQL statement that affects
an object within a realm, a special set of activities occur.
• How Authorizations Work in a Realm
Realm authorizations prevent users from performing activities if the users do not have the
correct privileges.
• Access to Objects That Are Protected by a Realm
You can protect an object by a realm, but still enable access to objects that are part of
this realm-protected object.
• Example of How Realms Work
Realms can provide protection in which two users who each have the same privileges
must have separate access levels for an object.
• How Realms Affect Other Oracle Database Vault Components
Realms have no effect on factors, identities, or rule sets, but they do affect command
rules.
5-1
Chapter 5
What Are Realms?
5-2
Chapter 5
What Are Realms?
5-3
Chapter 5
What Are Realms?
• Mandatory realms can block object owners and object privileged users. In
previous releases, blocking these users could only be done by defining
complicated command rules.
• Mandatory realms provide more flexible configurations for access control.
For example, suppose you want to enable a user to access an object with certain
conditions, such as in a specific time range during the day. You cannot grant object
privileges to that user because realms do not block object privileges. You only can
grant system privileges to the user and then authorize this user to the realm with a
rule, or make a command rule on the command directly. These solutions are either
very expensive in terms of computational cost or undesirable because they entail
the excessive granting of privileges such as system privileges to the user. With a
mandatory realm, you only need to grant object privileges to the user, with a rule
for specific conditions, and then authorize this user to be a realm owner or
participant. Thus, with mandatory realms, Oracle Database Vault policies have
more flexibility without granting users excessive privileges.
• Mandatory realms add a layer of protection during patch upgrades. During a
patch upgrade, a database administrator may need to have direct access to a
realm-protected object in order to perform a patch on the object. If there are tables
that contain sensitive data, such as social security numbers, you can protect these
tables from the administrator's access with mandatory realms during the patch
upgrade. When patching is complete, and the database administrator no long
needs access to the objects, you can disable mandatory realm protection and then
re-enable the normal application realm protection so that the application protection
can return to its normal state.
• You can use mandatory realms to secure tables during runtime. During
runtime, application data can be stored in many tables. It is better to have a single
user such as a runtime schema to access these tables so that you can maintain
the integrity and correctness of the data. If the application data is scattered in
many different schemas, then schema owners and users with object privileges can
change the data if they log into the database directly. To insure that users cannot
update these tables without going through the runtime schema's procedures, you
can use mandatory realms to protect the tables so that only the authorized user's
procedures can access them. Because a regular realm does not block object
owners and object-privileged users, you can use mandatory realms to block them.
This way, only authorized users can access these tables during runtime.
• You can freeze security settings by preventing changes to configured roles.
Related Topics
• CREATE_REALM Procedure
The CREATE_REALM procedure creates a realm. In a multitenant environment, you
can create both common and local realms.
• UPDATE_REALM Procedure
The UPDATE_REALM procedure updates a realm.
5-4
Chapter 5
Default Realms
databases (PDBs) is that you can create them in one place, the application root. This way,
you can manage them centrally.
You cannot create a common realm in the CDB root.
A Database Vault common realm can be either a regular realm or a mandatory realm. The
realm protects only objects within the application root, not local objects in a PDB. The CDB
root, application root, and any affected PDBs all must be Database Vault enabled.
To configure a common realm, you must be commonly granted the DV_OWNER or DV_ADMIN
role. To grant common authorizations for a common realm, you must be in the application
root. To propagate the realm to the PDBs that are associated with the application root, you
must synchronize the application root. For example, to synchronize an application called
saas_sales_app
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Related Topics
• About Realm Authorization
Realm authorizations establish the set of database accounts and roles that manage or
access objects protected in realms.
5-5
Chapter 5
Default Realms
The owners of all three of the DVSYS, DVF, and LBACSYS schemas are owners of this
realm.
This realm protects the following objects:
• Entire schemas that are protected: DVSYS, DVF, LABACSYS
• Roles that are protected:
Related Topics
• Oracle Database Vault Schemas
The Oracle Database Vault schemas, DVSYS and DVF, support the administration
and run-time processing of Oracle Database Vault.
5-6
Chapter 5
Default Realms
Related Topics
• DV_ACCTMGR Database Vault Account Manager Role
The DV_ACCTMGR role is a powerful role, used for accounts management.
5-7
Chapter 5
Creating a Realm
You can find the full list of roles that the Oracle System Privilege and Role
Management Realm protects by executing the following query:
The authorized users of this realm are users SYS and SYSTEM.
5-8
Chapter 5
Creating a Realm
• Name: Enter a name for the realm. It can contain up to 90 characters in mixed-case.
This attribute is mandatory.
Oracle suggests that you use the name of the protected application as the realm
name (for example, hr_app for an human resources application).
• Description: Enter a brief description of the realm. The description can contain up to
1024 characters in mixed-case. This attribute is optional.
You may want to include a description for the business objective of the given
application protection and document all other security policies that compliment the
realm's protection. Also document who is authorized to the realm, for what purpose,
and any possible emergency authorizations.
• Mandatory Realm: Select this check box to create the realm as a mandatory realm.
See Mandatory Realms to Restrict User Access to Objects within a Realm for more
information about mandatory realms.
• Status: Select either Enabled, Disabled, or Simulation. This attribute is mandatory.
• Audit Options: Select one of the following:
– Audit Disabled: Does not create an audit record.
– Audit on Success: Creates an audit record for authorized activities.
– Audit on Failure: Creates an audit record when a realm violation occurs (for
example, when an unauthorized user tries to modify an object that is protected by
the realm).
– Audit on Success or Failure: Creates an audit record for any activity that
occurs in the realm, including both authorized and unauthorized activities.
In a non-unified auditing environment, Oracle Database Vault writes the audit trail to
the DVSYS.AUDIT_TRAIL$ table. See Auditing Oracle Database Vault for more
information. If you have enabled unified auditing, then this setting does not capture
audit records. Instead, you must create audit policies to capture this information, as
described in Oracle Database Security Guide. Oracle Database also provides a
default policy, ORA_DV_AUDPOL, that audits all actions that are performed on the Oracle
Database Vault DVSYS and DVF schema objects and the Oracle Label Security
LBACSYS schema objects.
5. Click Next to display the Realm secured objects page.
See About Realm-Secured Objects for conceptual information about the settings for this
page.
6. Click the Add button, and in the Add Secured Object dialog box, enter the following
information:
• Object Owner: From the list, select the name of the database schema owner. You
can enter the % character if the object you want to secure with the realm is a role.
This attribute is mandatory.
• Object Type: From the list, select the type of the database object, such as TABLE,
INDEX, or ROLE. This attribute is mandatory.
You can add as many objects of any type as you want to the realm.
By default, the Object Type box contains the % wildcard character to include all
object types for the specified Object Owner. However, it does not include roles,
which do not have specific schema owners in the database and must be specified
explicitly.
5-9
Chapter 5
Creating a Realm
• Object Name: Enter the name of the object in the database that the realm
must protect, or enter % to specify all objects (except roles) for the object
owner that you have specified. If you enter %, then it can encompass all
objects in the schema if % is also used for the Object Type setting. But if
Object Type is set to Tables, then using % for the Object Name refers to all
tables in the schema. This attribute is mandatory.
By default, the Object Name field contains the % wildcard character to
encompass the entire schema specified for Object Type and Object Owner.
Note that the % wildcard character applies to objects that do not yet exist and
currently existing objects.
If you enter % in the Object Name field, then it encompasses all objects in the
schema if you also enter % in the Object Type field. However, if you set Object
Type to a specific object type, such as Tables, then the setting of % in Object
Type refers to all objects of that type (in this case, tables) in the schema.
7. Click Next to display the Realm authorizations page.
See About Realm Authorization for conceptual information about the settings for
this page.
8. Click the Add button, and in the Add Authorizations dialog box, enter the following
information:
• Realm Authorization Grantee: From the list, select the database account or
role to whom you want to grant the realm authorization.
This list shows all accounts and roles in the system, not just accounts with
system privileges.
• Realm Authorization Type: Select either of the following settings. This
attribute is mandatory.
– Participant: This account or role can exercise system privileges to
access, manipulate, and create objects protected by the realm, provided
that these privileges have been granted using the standard Oracle
Database privilege grant process. A realm can have multiple participants.
– Owner: This account or role has the same rights as the realm participant,
plus the authorization to grant or revoke realm-secured database roles.
The realm owner can grant or revoke privileges on realm-protected
objects to other users. A realm can have multiple owners.
• Realm Authorization Rule Set: Select from the available rule sets that have
been created for your site. You can select only one rule set, but the rule set
can have multiple rules.
See Creating a Rule to Add to a Rule Set for more information about defining
rules to govern the realm authorization.
Any auditing and custom event handling associated with the rule set occurs as
part of the realm authorization processing.
9. Click Next to display the Review page.
10. In the Review page, check the settings you have created.
For example:
5-10
Chapter 5
About Realm-Secured Objects
Related Topics
• About Realm-Secured Objects
Realm-secured objects define the territory—a set of schema and database objects and
roles—that a realm protects.
• About Realm Authorization
Realm authorizations establish the set of database accounts and roles that manage or
access objects protected in realms.
• Propagating Oracle Database Vault Configurations to Other Databases
You can propagate Database Vault configurations (such as a realm configuration) to other
Database Vault-protected databases.
5-11
Chapter 5
About Realm Authorization
multiple realms, the person performing the GRANT or REVOKE operation must be the
realm owner. Schema owners can perform DML operations on objects that are
protected by multiple regular realms.
If one of the realms is a mandatory realm, then the user who wants to access the
object must be a realm owner or participant in the mandatory realm. During the
authorization checking process, the non-mandatory realms are ignored. If there
are multiple mandatory realms that protect the object, then the user who wants to
access the object must be authorized in all of the mandatory realms.
5-12
Chapter 5
Realm Authorizations in a Multitenant Environment
• A user who has been commonly granted the DV_OWNER or DV_ADMIN role can grant local
authorization to common users, common roles, local users, and local roles. The common
DV_OWNER or DV_ADMIN user can also remove local authorization from a common realm in
a PDB.
• A local Database Vault administrator can authorize locally (that is, grant local
authorizations to both local and common users) within the PDB. A common Database
Vault administrator can also grant authorizations in each PDB. A common realm
authorization can only be granted by a common Database Vault administrator in the
application root.
• The common Database Vault administrator can both add or remove local authorization to
and from a common realm from within the PDB.
• If a common user has only local authorization for a common realm, then this user cannot
access the common realm in any other PDB than this local authorization.
• A common user or a common role can have both the local authorization and the common
authorization to a common realm at the same time. Removing a common user’s local
authorization from a common realm does not affect the common user’s common
authorization. Removing a common user’s common authorization from a common realm
does not affect the common user’s local authorization.
Common Authorization for a Common Realm
The common authorization for a common realm refers to the authorization a common user or
a common role has in the application root while the authorization takes effect in every
container that is Database Vault enabled.
The rules for the local authorization for a common realm are as follows:
• A user who has been commonly granted the DV_OWNER or DV_ADMIN role can grant
common realm authorization to common users or roles in the application root. This
common Database Vault administrator can perform the removal of common
authorizations while in the application root.
• This common authorization applies to the containers that have been Database Vault
enabled in the CDB.
• If a common user is authorized to a common realm in the application root, then this user
has access to the objects protected by the common realm in the application root and any
application PDBs.
• Any rule sets that are associated with a common realm must be common rule sets. The
rules that are added to a common rule set that is associated with common authorization
cannot involve any local objects.
How the Authorization of a Realm Works in Both the Application Root and in an
Individual PDB
During the Database Vault enforcement in a container, a common realm performs the same
enforcement behaviors as the same realm when it is used locally in a PDB.
5-13
Chapter 5
Modifying the Enablement Status of a Realm
5-14
Chapter 5
How Realms Work
If yes, then go to Step 2. If no, then realms do not affect the SQL statement. Go to Step
7. If the object affected by the command is not secured in any realms, then realms do not
affect the SQL statement being attempted.
2. Is the realm a mandatory realm or regular realm?
If yes, then go to Step 4. If it is regular realm, then go to Step 3.
3. Is the database account using a system privilege to execute the SQL statement?
If yes, then go to Step 4. If no, then go to Step 6. If the session has object privileges on
the object in question for SELECT, EXECUTE, and DML statements only, then the realm
protection is not enforced. Realms protect against the use of any system privilege on
objects or roles protected by the realm. Even users with object privileges for objects that
are protected by regular realms are prevented from performing DDL operations.
Remember that if the O7_DICTIONARY_ACCESSIBILITY initialization parameter has been
set to TRUE, then non-SYS users have access to SYS schema objects. For better security,
ensure that O7_DICTIONARY_ACCESSIBILITY is set to FALSE.
4. Is the database account a realm owner or realm participant?
If yes, then go to Step 5. Otherwise, a realm violation occurs and the statement is not
allowed to succeed. If the command is a GRANT or REVOKE of a role that is protected by the
realm, or the GRANT or REVOKE of an object privilege on an object protected by the realm,
then the session must be authorized as the realm owner directly or indirectly through
roles.
5. Is the realm authorization for the database account conditionally based on a rule set?
If yes, then go to Step 6. If no, then go to Step 7.
6. Does the rule set evaluate to TRUE?
If yes, then go to Step 7. If no, then there is a realm violation, so the SQL statement is not
allowed to succeed.
7. Does a command rule prevent the command from executing?
If yes, then there is a command rule violation and the SQL statement fails. If no, then
there is no realm or command rule violation, so the command succeeds.
For example, the HR account may have the DROP ANY TABLE privilege and may be the
owner of the HR realm, but a command rule can prevent HR from dropping any tables in
the HR schema unless it is during its monthly maintenance window. Command rules apply
to the use of the ANY system privileges and object privileges and are evaluated after the
realm checks.
In addition, because a session is authorized in a realm, it does not mean the account has full
control on objects protected by the realm. Realm authorization does not implicitly grant extra
privileges to the account. The account still must have system privileges or object privileges to
access the objects. For example, an account or role may have the SELECT ANY table privilege
and be a participant in the HR realm. This means the account or the account granted the role
could query the HR.EMPLOYEES table. Being a participant in the realm does not mean the
account or role can DROP the HR.EMPLOYEES table. Oracle Database Vault does not replace the
discretionary access control model in the existing Oracle database. It functions as a layer on
top of this model for both realms and command rules.
Note the following:
5-15
Chapter 5
How Authorizations Work in a Realm
• Protecting a table in a realm does not protect the view by default. Any view that
must be protected should be added to the realm regardless of whether the view
was created before or after the table was added to the realm.
• For invoker's right procedures that access realm protected objects, the invoker of
the procedure must be authorized to the realm.
• Be aware that realm protection does not protect a table if access to the table has
been granted to PUBLIC. For example, if SELECT ON table_name is granted to
PUBLIC, then every user has access to table_name (unless the table is protected
by a mandatory realm), even if this table is protected by a realm. As a best
practice, revoke unnecessary privileges from PUBLIC.
5-16
Chapter 5
How Authorizations Work in a Realm
• Example: Unauthorized User Trying to Use the DELETE ANY TABLE Privilege
An ORA-01031: insufficient privileges error appears for unauthorized user access.
• Example: Authorized User Performing DELETE Operation
Authorized users are allowed to perform the activities for which they are authorized.
Example 5-1 shows what happens when an unauthorized user who has the CREATE ANY
TABLE system privilege tries to create a table in a realm where the HR schema is protected by
a realm.
Example 5-1 Unauthorized User Trying to Create a Table
CREATE TABLE HR.demo2 (col1 NUMBER(1));
As you can see, the attempt by the unauthorized user fails. Unauthorized use of system
privileges such as SELECT ANY TABLE, CREATE ANY TABLE, DELETE ANY TABLE, UPDATE ANY
TABLE, INSERT ANY TABLE, CREATE ANY INDEX, and others results in failure.
5.10.2.2 Example: Unauthorized User Trying to Use the DELETE ANY TABLE
Privilege
An ORA-01031: insufficient privileges error appears for unauthorized user access.
Example 5-2 shows what happens when an unauthorized database account tries to use his
DELETE ANY TABLE system privilege to delete an existing record, the database session returns
the following error.
Example 5-2 Unauthorized User Trying to Use the DELETE ANY TABLE Privilege
DELETE FROM HR.EMPLOYEES WHERE EMPNO = 8002;
Realms do not affect direct privileges on objects. For example, a user granted delete
privileges to the HR.EMPLOYEES table can successfully delete records without requiring realm
authorizations. Therefore, realms should minimally affect normal business application usage
for database accounts.
5-17
Chapter 5
Access to Objects That Are Protected by a Realm
1 row deleted.
5-18
Chapter 5
How Realms Affect Other Oracle Database Vault Components
Figure 5-1 How Authorizations Work for Realms and Realm Owners
Related Topics
• Quick Start Tutorial: Securing a Schema from DBA Access
This tutorial shows how to create a realm around the HR schema.
5-19
Chapter 5
Guidelines for Designing Realms
• A database object can belong to multiple realms and an account or role can be
authorized in multiple realms.
To provide limited access to a subset of a database schema (for example, just the
EMPLOYEES table in the HR schema), or roles protected by a realm, create a new
realm with just the minimum required objects and authorizations.
• If you want to add a role to a realm as a grantee, create a realm to protect the role.
Doing so prevents users who have been granted the GRANT ANY ROLE system
privilege, such as the SYSTEM user account, from granting the role to themselves.
• If you want to add the SYS user account to a realm authorization, you must add
user SYS explicitly and not through a role (such as the DBA role).
• Be mindful of the privileges currently allowed to a role that you plan to add as a
realm authorization.
Realm authorization of a role can be accidentally granted and not readily apparent
if an account such as SYS or SYSTEM creates a role for the first time and the Oracle
Database Vault administrator adds this role as a realm authorization. This is
because the account that creates a role is implicitly granted the role when it is
created.
• Sometimes you must temporarily relax realm protections for an administrative
task. Rather than disabling the realm, have the Security Manager (DV_ADMIN or
DV_OWNER) log in, add the named account to the authorized accounts for the realm,
and set the authorization rule set to Enabled. Then in the enabled rule set, turn on
all auditing for the rule set. You can remove the realm authorization when the
administrative task is complete.
• If you want to grant ANY privileges to new users, Oracle recommends that you add
a database administrative user to the Oracle System Privilege and Role
Management realm so that this user can grant other users ANY privileges, if they
need them. For example, using a named account to perform the GRANT of the ANY
operations enables you to audit these operations, which creates an audit trail for
accountability.
• If you drop a table, index, or role that has been protected by a realm and then
recreate it using the same name, the realm protection is not restored. You must re-
create the realm protection for the new table, index, or role. However, you can
automatically enforce protection for all future tables, indexes, and roles within a
specified schema. For example, to enforce protection for all future tables:
BEGIN
DBMS_MACADM.ADD_OBJECT_TO_REALM('realm_name', 'schema_name', '%', 'TABLE');
END;
/
• You can test the development phase of a realm by using simulation mode, which
enables the realm but writes detailed information about violations to a log file.
Related Topics
• Using Simulation Mode for Logging Realm and Command Rule Activities
Simulation mode writes the activities performed on realms and command rules to
a log file, which is accessible through a data dictionary view.
5-20
Chapter 5
How Realms Affect Performance
Related Topics
• Oracle Database Performance Tuning Guide
• Oracle Database SQL Tuning Guide
Report Purpose
Realm Audit Report Audits records generated by the realm protection and
realm authorization operations
Realm Authorization Configuration Issues Lists authorization configuration information, such as
Report incomplete or disabled rule sets, or nonexistent
grantees or owners that may affect the realm
Rule Set Configuration Issues Report Lists rule sets that do not have rules defined or
enabled, which may affect the realms that use them
Object Privilege Reports Lists object privileges that the realm affects
Privilege Management - Summary Reports Provides information about grantees and owners for a
realm
Sensitive Objects Reports Lists objects that the command rule affects
Table 5-2 lists data dictionary views that provide information about existing realms.
5-21
Chapter 5
Realm Related Reports and Data Dictionary Views
5-22
6
Configuring Rule Sets
Rule sets group one or more rules together; the rules determine whether a user can perform
an action on an object.
• What Are Rule Sets?
A rule set is a collection of one or more rules.
• Rule Sets and Rules in a Multitenant Environment
In a multitenant environment, you can create a rule set and its associated rules in a PDB
or an application root.
• Default Rules and Rule Sets from Releases Earlier Than Release 12.2
Many default rules and rule sets from earlier releases are no longer supported, but may
be in use in your current Oracle Database installation.
• Default Rule Sets
Oracle Database Vault provides a set of default rules sets that you can customize for
your needs.
• Creating a Rule Set
To create a rule set, you first create the rule set itself, and then you can edit the rule set
to associate it with one or more rules.
• Creating a Rule to Add to a Rule Set
A rule defines the behavior that you want to control; a rule set is a named collection of
rules.
• Removing Rule Set References to Oracle Database Vault Components
Before you remove a rule set, you should remove the rule set references to Oracle
Database Vault components.
• Deleting a Rule Set
You can use Enterprise Manager Cloud Control to find reference to the rule set and then
delete the rule set.
• How Rule Sets Work
Understanding how rule sets work helps to create more effective rule sets.
• Tutorial: Creating an Email Alert for Security Violations
This tutorial demonstrates how to use the UTL_MAIL PL/SQL package and an access
control list to create an email alert for security violations.
• Tutorial: Configuring Two-Person Integrity, or Dual Key Security
This tutorial demonstrates how to use Oracle Database Vault to control the authorization
of two users.
• Guidelines for Designing Rule Sets
Oracle provides guidelines for designing rule sets.
• How Rule Sets Affect Performance
The number and complexity of rules can slow database performance.
• Rule Set and Rule Related Reports and Data Dictionary Views
Oracle Database Vault provides reports and data dictionary views that are useful for
analyzing rule sets and the rules within them.
6-1
Chapter 6
What Are Rule Sets?
Related Topics
• Command Rules in a Multitenant Environment
In a multitenant environment, you can create common and local command rules in
either the CDB root or the application root.
6-2
Chapter 6
Default Rules and Rule Sets from Releases Earlier Than Release 12.2
6.3 Default Rules and Rule Sets from Releases Earlier Than
Release 12.2
Many default rules and rule sets from earlier releases are no longer supported, but may be in
use in your current Oracle Database installation.
If you use default rules and rule sets from releases earlier than Oracle Database release
12.2, Oracle Database does not remove them during an upgrade in case you have
customized them for your own use. If you customized these rules and rule sets, or use these
older default rule sets, Oracle recommends that you re-implement the customized rules and
rule sets by using the ALTER SYSTEM and ALTER SESSION command rules, and then
disable and drop the old rules and rule sets. If you have not customized these rules and rule
sets, or otherwise use them, you should drop these earlier rules and rule sets because the
same functionality is available in later default command rules.
Related Topics
• Deprecated Rules and Rule Sets
Several default rules and rule sets are no longer included in a fresh installation of Oracle
Database Vault.
6-3
Chapter 6
Default Rule Sets
6-4
Chapter 6
Creating a Rule Set
• Description: Enter a description of the functionality for the rule set. It can have up to
1024 characters in mixed-case. This attribute is optional.
You may want to document the business requirement of the rule set. For example:
Rule to limit access to SQL*Plus
• Static Rule Set: You can control how often the rule set is evaluated when it is
accessed during a user session. A static rule set is evaluated once when accessed
for the first time in a user session. After that, the evaluated value is re-used in the
6-5
Chapter 6
Creating a Rule Set
user session. On the other hand, a non-static rule set is evaluated every time it
is accessed.
• Status: Select either Enabled or Disabled to enable or disable the rule set
during run time. This attribute is mandatory.
• Evaluation Options: If you plan to assign multiple rules to a rule set, then
select one of the following settings:
– All True: All rules in the rule set must evaluate to true for the rule set itself
to evaluate to true.
– Any True: At least one rule in the rule set must evaluate to true for the
rule set itself to evaluate to true.
5. Click Next to display the Associate with Rules page.
6. Select one of the following options:
• Add Existing Rule: Double-click from the list of available rules to move them
to the Selected Rules list, and then click OK.
• Create Rule: Enter a name and WHERE clause expression that evaluates to
true or false. Click OK. See Creating a Rule to Add to a Rule Set for more
information.
7. Click Next to display the Error handling and Audit options page.
8. Enter the following information:
• Error Handling: Select either Show Error Message or Do Not Show Error
Message.
An advantage of selecting Do Not Show Error Message and then enabling
auditing is that you can track the activities of a potential intruder. The audit
report reveals the activities of the intruder, yet the intruder is unaware that you
are doing this because he or she does not see any error messages.
• Fail Code: Enter a number in the ranges of -20000 to -20999 or 20000 to
20999. The error code is displayed with the Fail Message (created next) when
the rule set evaluates to false or one of the associated rules contains an
invalid PL/SQL expression. If you omit this setting, then Oracle Database Vault
displays a generic error code.
• Fail Message: Enter a message, up to 80 characters in mixed-case, to
associate with the fail code you specified under Fail Code. The error message
is displayed when the rule set evaluates to false or one of the associated rules
contains an invalid PL/SQL expression. If you do not specify an error
message, then Oracle Database Vault displays a generic error message.
• Custom Event Handler Option: Select one of the following options to
determine when to run the Custom Event Handler Logic (created next).
– Handler Disabled: Does not run any custom event method.
– Execute On Failure: Runs the custom event method when the rule set
evaluates to false or one of the associated rules contains an invalid
PL/SQL expression.
– Execute On Success: Runs the custom event method when the rule set
evaluates to true.
You can create a custom event method to provide special processing outside
the standard Oracle Database Vault rule set auditing features. For example,
6-6
Chapter 6
Creating a Rule Set
you can use an event handler to initiate a workflow process or send event information
to an external system.
• Custom Event Handler Logic: Enter a PL/SQL expression up to 255 characters in
mixed-case. An expression may include any package procedure or standalone
procedure. You can create your own expression or use the PL/SQL interfaces
described in Oracle Database Vault Rule Set APIs.
Write the expression as a fully qualified procedure (such as schema.procedure_name).
Do not include any other form of SQL statements. If you are using application
package procedures or standalone procedures, you must provide DVSYS with the
EXECUTE privilege on the object. The procedure signature can be in one of the
following two forms:
– PROCEDURE my_ruleset_handler(p_ruleset_name IN VARCHAR2,
p_ruleset_rules IN BOOLEAN): Use this form when the name of the rule set and
its return value are required in the handler processing.
– PROCEDURE my_ruleset_handler: Use this form when the name of the rule set
and its return value are not required in the handler processing.
Be aware that you cannot use invoker's rights procedures as event handlers. Doing
so can cause the rule set evaluation to fail unexpectedly. Only use definer's rights
procedures as event handlers.
Use the following syntax:
myschema.my_ruleset_handler
• Audit Options: Select from the following options to generate an audit record for the
rule set in a non-unified auditing environment. Oracle Database Vault writes the audit
trail to the DVSYS.AUDIT_TRAIL$ table. (If you have enabled unified auditing, then this
setting does not capture audit records. Instead, you must create unified audit policies
to capture this information.)
– Audit Disabled: Does not create an audit record under any circumstances.
– Audit on Success: Creates an audit record when the rule set evaluates to true.
– Audit On Failure: Creates an audit record when the rule set evaluates to false or
one of the associated rules contains an invalid PL/SQL expression.
– Audit On Success or Failure: Creates an audit record whenever a rule set is
evaluated.
9. Click Next to display the Review page.
10. Review the settings, and if they are satisfactory, click Finish.
See Also:
• Auditing Oracle Database Vault for more information about audit records in the
DVSYS.AUDIT_TRAIL$ table
• Oracle Database Security Guide for information about creating unified audit
policies for Database Vault
6-7
Chapter 6
Creating a Rule to Add to a Rule Set
6-8
Chapter 6
Creating a Rule to Add to a Rule Set
Rule Description
Are Backup Restore Parameters Allowed Note: This default rule has been deprecated.
Checks if the current SQL statement attempts to turn on the
RECYCLEBIN parameter
Are Database File Parameters Allowed Note: This default rule has been deprecated.
Checks if the current SQL statement attempts to alter
control file related configuration
Are Dump Parameters Allowed Checks if the current SQL statement attempts to alter
initialization parameters related to the destination of a dump
Are Dest Parameters Allowed Checks if the current SQL statement attempts to alter
initialization parameters related to the size limit of a dump
Are Dump or Dest Parameters Allowed Note: This default rule has been deprecated.
Checks if the current SQL statement attempts to alter
initialization parameters related to the size limit or
destination of dump
Are Optimizer Parameters Allowed Note: This default rule has been deprecated.
Checks if the current SQL statement attempts to alter the
setting for the OPTIMIZER_SECURE_VIEW_MERGING
parameter
Are PL-SQL Parameters Allowed Note: This default rule has been deprecated.
Checks if the current SQL statement attempts to alter the
PLSQL_DEBUG initialization parameter.
Are Security Parameters Allowed Note: This default rule has been deprecated.
Checks if there is an attempt to disable the following
initialization parameters:
• AUDIT_SYS_OPERATIONS
• AUDIT_TRAIL
• AUDIT_SYSLOG_LEVEL
• SQL92_SECURITY
Note that if you have enabled unified auditing, then the
AUDIT_SYS_OPERATIONS, AUDIT_TRAIL, and
AUDIT_SYSLOG_LEVEL parameters have no effect.
This rule prevents any attempt to enable the following
parameters:
• OS_ROLES
• REMOTE_OS_ROLES
Are System Security Parameters Note: This default rule has been deprecated.
Allowed Prevents modification of the following parameters:
• O7_DICTIONARY_ACCESSIBILITY
• DYNAMIC_RLS_POLICIES
• _SYSTEM_TRIG_ENABLED
False Evaluates to FALSE
Is Alter DVSYS Allowed Note: This default rule has been deprecated.
Checks if the logged-in user can execute the ALTER USER
statement on other users successfully
Is Database Administrator Checks if a user has been granted the DBA role
6-9
Chapter 6
Creating a Rule to Add to a Rule Set
Rule Description
Is Drop User Allowed Checks if the logged in user can drop users
Is Dump of Block Allowed Checks if the dumping of blocks is allowed
Is First Day of Month Checks if the specified date is the first day of the month
Is Label Administrator Checks if the user has been granted the LBAC_DBA role
Is Last Day of Month Checks if the specified date is the last day of the month
Is _dynamic_rls_init Parameters Allowed Note: This default rule has been deprecated.
Prevent modification of the DYNAMIC_RLS_POLICIES
parameter
Is Parameter Value False Checks if a specified parameter value has been set to
FALSE
Is Parameter Value None Checks if a specified parameter value has been set to NONE
Is Parameter Value Not False Checks if a specified parameter value has been set to <>
FALSE
Is Parameter Value Not None Checks if a specified parameter value has been set to <>
NONE
Is Parameter Value Not Off Checks if a specified parameter value has been set to <>
OFF
Is Parameter Value Not On Checks if a specified parameter value has been set to <>
ON
Is Parameter Value Not True Checks if a specified parameter value has been set to <>
TRUE
Is Parameter Value Off Checks if a specified parameter value has been set to OFF
Is Parameter Value On Checks if a specified parameter value has been set to ON
Is Parameter Value True Checks if a specified parameter value has been set to TRUE
Is SYS or SYSTEM User Checks if the user is SYS or SYSTEM
Is Security Administrator Checks if a user has been granted the DV_ADMIN role
Is Security Owner Checks if a user has been granted the DV_OWNER role
Is User Manager Checks if a user has been granted the DV_ACCTMGR role
6-10
Chapter 6
Creating a Rule to Add to a Rule Set
Rule Description
Is _system_trig_enabled Parameters Note: This default rule has been deprecated.
Allowed Checks if the user tries to modify the following system
parameters, but in database recovery operations, this rule
permits these parameters to be changed.
• AUDIT_SYS_OPERATIONS: Prevents users from setting
it to FALSE
• AUDIT_TRAIL: Prevents users from setting it to NONE or
FALSE
• AUDIT_SYSLOG_LEVEL: Blocks all operations on this
parameter
• CONTROL_FILES: Blocks all operations
• OPTIMIZER_SECURE_VIEW_MERGING: Prevents users
from setting it to TRUE
• OS_ROLES: Prevents users from setting it to TRUE
• PLSQL_DEBUG: Prevents users from setting it to ON
• RECYCLEBIN: Prevents users from setting it to ON
• REMOTE_OS_ROLES: Prevents users from setting it to
TRUE
• SQL92_SECURITY: Prevents users from setting it to
FALSE
Note that if you have enabled unified auditing, then the
AUDIT_SYS_OPERATIONS, AUDIT_TRAIL, and
AUDIT_SYSLOG_LEVEL parameters have no effect.
Is o7_dictionary_accessibility Note: This default rule has been deprecated.
Parameters Allowed Checks if current SQL statement attempts to alter the
setting of the O7_DICTIONARY_ACCESSIBILITY parameter
Login User Is Object User Checks if the logged in user is the same as the user about
to be altered by the current SQL statement
No Exempt Access Policy Role Checks if the user has been granted the EXEMPT ACCESS
POLICY role or is user SYS
Not Export Session Obsolete
True Evaluates to TRUE
6-11
Chapter 6
Creating a Rule to Add to a Rule Set
Oracle suggests that you start the name with a verb and complete the name
with the purpose of the rule. For example:
Prevent non-admin access to SQL*Plus
Because rules do not have a Description field, make the name explicit but be
sure to not exceed over 90 characters.
• Rule Expression: Enter a PL/SQL expression that fits the following
requirements:
– It is valid in a SQL WHERE clause.
– It can be a freestanding and valid PL/SQL Boolean expression such as the
following:
TO_CHAR(SYSDATE,'HH24') = '12'
For example, suppose you have created the following the rule expression:
SYS_CONTEXT('USERENV','SESSION_USER') != 'TSMITH'
For the Boolean example listed earlier, you would enter the following:
SELECT TO_CHAR(SYSDATE,'HH24')FROM DUAL;
5. Click OK.
Related Topics
• Oracle Database Vault PL/SQL Rule Set Functions
Oracle Database Vault provides functions to use in rule sets to inspect the SQL
statement that the rule set protects.
• DBMS_MACADM Rule Set Procedures
The DBMS_MACADM rule set procedures enable you to configure both rule sets and
individual rules that go within these rule sets.
6-12
Chapter 6
Creating a Rule to Add to a Rule Set
6-13
Chapter 6
Removing Rule Set References to Oracle Database Vault Components
6-14
Chapter 6
How Rule Sets Work
Related Topics
• Oracle Database Vault DVF PL/SQL Factor Functions
Oracle Database Vault maintains the DVF schema functions when you use the
DBMS_MACADM PL/SQL package to manage the various factors.
• Configuring Factors
Factors allow you to create and use complex attributes through PL/SQL to make Oracle
Database Vault authorization decisions.
6-15
Chapter 6
Tutorial: Creating an Email Alert for Security Violations
If the current user is a privileged user, then the system evaluates the rule to true
without evaluating additional_rule. If the current user is not a privileged user, then
the evaluation of the rule depends on the evaluation of additional_rule.
Note:
To complete this tutorial, you must use a database that has an SMTP server.
6-16
Chapter 6
Tutorial: Creating an Email Alert for Security Violations
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
3. Install the UTL_MAIL package.
@$ORACLE_HOME/rdbms/admin/utlmail.sql
@$ORACLE_HOME/rdbms/admin/prvtmail.plb
The UTL_MAIL package enables you to manage email. See Oracle Database PL/SQL
Packages and Types Reference for more information about UTL_MAIL. However, be
aware that currently, the UTL_MAIL PL/SQL package do not support SSL servers.
4. Check the current value of the SMTP_OUT_SERVER parameter, and make a note of this
value so that you can restore it when you complete this tutorial.
For example:
SHOW PARAMETER SMTP_OUT_SERVER
Replace imap_mail_server.example.com with the name of your SMTP server, which you
can find in the account settings in your email tool. Enclose these settings in double
quotation marks. For example:
ALTER SYSTEM SET SMTP_OUT_SERVER="my_imap_mail_server.example.com"
6. Connect as SYS using the SYSOPER privilege and then restart the database.
CONNECT SYS AS SYSOPER -- Or, CONNECT SYS@hrpdb AS SYSOPER
Enter password: password
SHUTDOWN IMMEDIATE
STARTUP
6-17
Chapter 6
Tutorial: Creating an Email Alert for Security Violations
6-18
Chapter 6
Tutorial: Creating an Email Alert for Security Violations
6.10.4 Step 3: Configure an Access Control List File for Network Services
Before you can use UTL_MAIL, you must configure an access control list (ACL) to enable fine-
grained access to external network services.
For detailed information about fine-grained access to external network services, see Oracle
Database Security Guide.
1. As the DV_OWNER user, in SQL*Plus, configure the following access control setting and its
privilege definitions.
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => 'SMTP_OUT_SERVER_setting',
lower_port => 25,
ace => xs$ace_type(privilege_list => xs$name_list('smtp'),
principal_name => 'LEO_DVOWNER,
principal_type => xs_acl.ptype_db));
END;
/
In this example:
• lower_port: Enter the port number that your email tool specifies for its outgoing
server. Typically, this setting is 25. Enter this value for both the lower_port and
upper_port settings. (Currently, the UTL_MAIL package does not support SSL. If your
mail server is an SSL server, then enter 25 for the port number, even if the mail
server uses a different port number.)
• principal_name: Replace LEO_DVOWNER with the name of the DV_OWNER user.
• host: For the SMTP_OUT_SERVER_setting, enter the SMTP_OUT_SERVER setting that you
set for the SMTP_OUT_SERVER parameter in Step 1: Install and Configure the
UTL_MAIL PL/SQL Package. This setting should match exactly the setting that your
email tool specifies for its outgoing server.
2. Commit your changes to the database.
COMMIT;
6-19
Chapter 6
Tutorial: Creating an Email Alert for Security Violations
6.10.5 Step 4: Create a Rule Set and a Command Rule to Use the
Email Security Alert
To create the rule set and command rule, you can use DBMS_MACADM PL/SQL package.
Ensure that you use two single quotation marks instead of double quotation marks
for HH24, 14, and 15.
You can check the system time on your computer by issuing the following SQL
statement:
SELECT TO_CHAR(SYSDATE,'HH24') FROM DUAL;
Later on, when you are satisfied that the rule works, you can update it to a time
when your site typically performs maintenance work (for example, between 7 p.m.
and 10 p.m), as follows:
BEGIN
DBMS_MACADM.UPDATE_RULE(
rule_name => 'Restrict Access to Maintenance Period',
rule_expr => 'TO_CHAR(SYSDATE,''HH24'') BETWEEN ''16'' AND ''22''');
END;
/
6-20
Chapter 6
Tutorial: Creating an Email Alert for Security Violations
3. Add the Restrict Access to Maintenance Period rule to the ALTER TABLE Command
Security Policy rule set.
BEGIN
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name => 'ALTER TABLE Command Security Policy',
rule_name => 'Restrict Access to Maintenance Period');
END;
/
If the SCOTT account is locked and expired, then a user with the DV_ACCTMGR role can
unlock this account and create a new password as follows:
ALTER USER SCOTT ACCOUNT UNLOCK IDENTIFIED BY password;
Follow the guidelines in Oracle Database Security Guide to replace password with a
password that is secure.
2. As the user SCOTT, create a test table.
CREATE TABLE mytest (col1 number);
3. Change the system time on your computer to a time when the ALTER TABLE Command
Security Policy rule set takes place.
For example, if you set the test period time to between 2 p.m. and 3 p.m., do the
following:
UNIX: Log in as root and use the date command to set the time. For example, assuming
the date today is August 15, 2012, you would enter the following:
$ su root
Password: password
6-21
Chapter 6
Tutorial: Creating an Email Alert for Security Violations
Windows: Double-click the clock icon, which is typically at the lower right corner
of the screen. In the Date and Time Properties window, set the time to 2 p.m., and
then click OK.
4. Try altering the my_test table.
ALTER TABLE mytest ADD (col2 number);
Table altered.
SCOTT should be able to alter the mytest table during this time.
5. Reset the system time to a time outside the Restrict Access to Maintenance
Period time.
6. Log in as SCOTT and try altering the my_test table again.
CONNECT SCOTT -- Or, CONNECT SCOTT@hrpdb
Enter password: password
SCOTT cannot alter the mytest table. In a moment, you should receive an email
with the subject header Table modification attempted outside maintenance!
and with a message similar to the following:
Realm violation occurred for the ALTER TABLE Command Security Policy rule
set. The time is: Wednesday 15 AUG, 2012 14:24:25
2. In the order shown, drop the Oracle Database Vault rule components.
EXEC DBMS_MACADM.DELETE_RULE_FROM_RULE_SET('ALTER TABLE Command Security
Policy', 'Restrict Access to Maintenance Period');
EXEC DBMS_MACADM.DELETE_RULE('Restrict Access to Maintenance Period');
EXEC DBMS_MACADM.DELETE_COMMAND_RULE('ALTER TABLE', 'SCOTT', '%');
EXEC DBMS_MACADM.DELETE_RULE_SET('ALTER TABLE Command Security Policy');
6-22
Chapter 6
Tutorial: Configuring Two-Person Integrity, or Dual Key Security
5. Connect as a user who has privileges to revoke privileges from other users.
For example:
CONNECT dba_psmith -- Or, CONNECT dba_psmith@hrpdb
Enter password: password
6. Revoke the EXECUTE privilege on the UTL_TCP, UTL_SMTP, and UTL_MAIL PL/SQL packages
from the DV_OWNER user.
For example:
REVOKE EXECUTE ON UTL_TCP FROM leo_dvowner;
REVOKE EXECUTE ON UTL_SMTP FROM leo_dvowner;
REVOKE EXECUTE ON UTL_MAIL FROM leo_dvowner;
REVOKE EXECUTE ON DBMS_NETWORK_ACL_ADMIN FROM leo_dvowner;
8. Connect as SYS with the SYSOPER administrative privilege and then restart the database.
CONNECT SYS AS SYSOPER -- Or, CONNECT SYS@hrpdb AS SYSOPER
Enter password: password
SHUTDOWN IMMEDIATE
STARTUP
6-23
Chapter 6
Tutorial: Configuring Two-Person Integrity, or Dual Key Security
This feature is also called dual key security, dual key connection, and two-man rule
security. In this type of security, two users are required to authorize an action instead
of one user.
The idea is that one user provides a safety check for the other user before that user
can proceed with a task. Two-person integrity provides an additional layer of security
for actions that potentially can be dangerous. This type of scenario is often used for
tasks such as database patch updates, which is what this tutorial will demonstrate.
One user, patch_user must log into perform a database patch upgrade, but the only
way that he can do this is if his manager, patch_boss is already logged in. You will
create a function, rules, a rule set, and a command rule to control patch_user's ability
to log in.
• patch_boss acts in a supervisory role: If patch_boss is not logged in, then the
patch_user user cannot log in.
• patch_user is the user who is assigned to perform the patch upgrade. However,
for this tutorial, user patch_user does not actually perform a patch upgrade. He
only attempts to log in.
To create the users:
1. Log into the database instance as a user who has been granted the DV_ACCTMGR
role.
For example:
sqlplus bea_dvacctmgr
Enter password: password
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the
current PDB, run the show con_name command.
2. Create the following users and grant them the CREATE SESSION privilege.
GRANT CREATE SESSION TO patch_boss IDENTIFIED BY password;
GRANT CREATE SESSION TO patch_user IDENTIFIED BY password;
Follow the guidelines in Oracle Database Security Guide to replace password with
a password that is secure.
3. Connect as user SYS with the SYSDBA administrative privilege.
CONNECT SYS AS SYSDBA -- Or, CONNECT SYS@hrpdb AS SYSDBA
Enter password: password
6-24
Chapter 6
Tutorial: Configuring Two-Person Integrity, or Dual Key Security
The V_$SESSION table is the underlying table for the V$SESSION dynamic view.
In a real-world scenario, you also would log in as the DV_OWNER user and grant the
DV_PATCH_ADMIN role to user patch_user (but not to patch_boss). But because you are not
really going to perform a database patch upgrade in this tutorial, you do not need to grant this
role to user patch_user.
v_session_number number := 0;
v_allow varchar2(10) := 'TRUE';
v_deny varchar2(10) := 'FALSE';
BEGIN
SELECT COUNT(*) INTO v_session_number
FROM SYS.V_$SESSION
WHERE USERNAME = 'PATCH_BOSS'; -- Enter the user name in capital letters.
IF v_session_number > 0
THEN RETURN v_allow;
ELSE
RETURN v_deny;
END IF;
END check_boss_logged_in;
/
3. Grant the EXECUTE privilege on the check_boss_logged_in function to the DVSYS schema.
GRANT EXECUTE ON check_boss_logged_in to DVSYS;
6.11.4 Step 3: Create Rules, a Rule Set, and a Command Rule to Control
User Access
Next, you must create two rules, a rule set to which you will add them, and a command rule.
The rule set triggers the check_boss_logged_in function when user patch_user tries to logs
in to the database.
6-25
Chapter 6
Tutorial: Configuring Two-Person Integrity, or Dual Key Security
1. Connect as a user who has been granted the DV_OWNER or DV_ADMIN role.
For example:
CONNECT leo_dvowner -- Or, CONNECT leo_dvowner@hrpdb
Enter password: password
2. Create the Check if Boss Is Logged In rule, which checks that the patch_user user
is logged in to the database. In the definition, replace leo_dvowner with the name
of the DVOWNER or DV_ADMIN user who created the check_boss_logged_in function.
If the check_boss_logged_in function returns TRUE (that is, patch_boss is logged
in to another session), then patch_user can log in.
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check if Boss Is Logged In',
rule_expr => 'SYS_CONTEXT(''USERENV'',''SESSION_USER'') = ''PATCH_USER''
and leo_dvowner.check_boss_logged_in = ''TRUE'' ');
END;
/
Enter the user name, PATCH_USER, in upper-case letters, which is how the
SESSION_USER parameter stores it.
3. Create the Allow Connect for Other Database Users rule, which ensures that the
user logged in (patch_user) is not user patch_boss. It also enables all other valid
users to log in.
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Allow Connect for Other Database Users',
rule_expr => 'SYS_CONTEXT(''USERENV'',''SESSION_USER'') !=
''PATCH_USER''');
END;
/
COMMIT;
4. Create the Dual Connect for Boss and Patch rule set, and then add the two rules
to it.
BEGIN
DBMS_MACADM.CREATE_RULE_SET(
rule_set_name => 'Dual Connect for Boss and Patch',
description => 'Checks if both boss and patch users are logged
in.',
enabled => DBMS_MACUTL.G_YES,
eval_options => 2,
audit_options => DBMS_MACUTL.G_RULESET_AUDIT_FAIL,
fail_options => DBMS_MACUTL.G_RULESET_FAIL_SILENT,
fail_message =>'',
fail_code => NULL,
handler_options => DBMS_MACUTL.G_RULESET_HANDLER_OFF,
handler => ''
);
END;
/
BEGIN
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name => 'Dual Connect for Boss and Patch',
rule_name => 'Check if Boss Is Logged In'
);
6-26
Chapter 6
Tutorial: Configuring Two-Person Integrity, or Dual Key Security
END;
/
BEGIN
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name => 'Dual Connect for Boss and Patch',
rule_name => 'Allow Connect for Other Database Users'
);
END;
/
5. Create the following CONNECT command rule, which permits user patch_user to
connect to the database only if patch_boss is already logged in.
BEGIN
DBMS_MACADM.CREATE_COMMAND_RULE(
command => 'CONNECT',
rule_set_name => 'Dual Connect for Boss and Patch',
object_owner => '%',
object_name => '%',
enabled => DBMS_MACUTL.G_YES);
END;
/
COMMIT;
ERROR:
ORA-47400: Command Rule violation for CONNECT on LOGON
Enter user-name:
User patch_user cannot log in until user patch_boss is already logged in. (Do not try the
Enter user-name prompt yet.)
4. In the second shell and then log in as user patch_boss.
sqlplus patch_boss -- Or, sqlplus patch_boss@hrpdb
Enter password: password
Connected.
6-27
Chapter 6
Guidelines for Designing Rule Sets
This time, user patch_user is deemed a valid user, so now he can log in.
2. In the first shell, connect the DV_ACCTMGR user and remove the users you created.
CONNECT bea_dvacctmgr -- Or, CONNECT bea_dvacctmgr@hrpdb
Enter password: password
3. Connect as a user SYS with the SYSDBA administrative privilege and revoke the
privileges that you had granted to the DV_OWNER or DV_ADMIN user.
CONNECT SYS AS SYSDBA -- Or, CONNECT SYS@hrpdb AS SYSDBA
Enter password: password
4. Connect as the DV_OWNER or DV_ADMIN user and drop the rules, rule set, and
command rule, in the order shown.
CONNECT leo_dvowner -- Or, CONNECT leo_dvowner@hrpdb
Enter password: password
6-28
Chapter 6
How Rule Sets Affect Performance
set when the same SELECT statement occurs multiple times and if the evaluated value is
acceptable to use again, rather than evaluating the rule set each time the SELECT occurs.
To control the static evaluation of the rule set, set the is_static parameter of the
CREATE_RULE_SET or UPDATE_RULE_SET procedures of the DBMS_MACADM PL/SQL package.
See DBMS_MACADM Rule Set Procedures for more information.
• Use Oracle Database Vault factors in your rule expressions to provide reusability and
trust in the values used by your rule expressions. Factors can provide contextual
information to use in your rules expressions.
• You can use custom event handlers to extend Oracle Database Vault security policies to
integrate external systems for error handling or alerting. Using Oracle utility packages
such as UTL_TCP, UTL_HTTP, UTL_MAIL, UTL_SMTP, or DBMS_AQ can help you to achieve this
type of integration.
• Test rule sets thoroughly for various accounts and scenarios either on a test database or
on a test realm or command rule for nonsensitive data before you apply them to realms
and command rules that protect sensitive data. You can test rule expressions directly with
the following SQL statement:
SQL> SELECT SYSDATE from DUAL where rule expression
• You can nest rule expressions inside a single rule. This helps to achieve more complex
situations where you would need a logical AND for a subset of rules and a logical OR with
the rest of the rules. See the definition for the Is Corporate Network During Maintenance
rule set under Tutorial: Creating an Email Alert for Security Violations for an example.
• You cannot use invoker's rights procedures with rule expressions. Only use definer's
rights procedures with rule expressions.
6-29
Chapter 6
Rule Set and Rule Related Reports and Data Dictionary Views
See Also:
Report Description
Rule Set Configuration Issues Report Lists rule sets that have no rules defined or
enabled
Secure Application Configuration Issues Lists secure application roles that have
Report incomplete or disabled rule sets
Command Rule Configuration Issues Lists rule sets that are incomplete or disabled
Report
Table 6-3 lists data dictionary views that provide information about existing rules and
rule sets.
Table 6-3 Data Dictionary Views Used for Rules and Rule Sets
6-30
7
Configuring Command Rules
You can create command rules or use the default command rules to protect DDL and DML
statements.
• What Are Command Rules?
A command rule applies Oracle Database Vault protections with an Oracle Database
SQL statement, such as ALTER SESSION.
• Default Command Rules
Oracle Database Vault provides default command rules, based on commonly used SQL
statements.
• SQL Statements That Can Be Protected by Command Rules
You can protect a large number of SQL statements by using command rules.
• Creating a Command Rule
You can create a command rule in Oracle Database Vault Administrator.
• Modifying the Enablement Status of a Command Rule
You can enable or disable a command rule in Oracle Database Vault Administrator.
• Deleting a Command Rule
Before you delete a command rule, you can locate the various references to it by
querying the command rule-related Oracle Database Vault views.
• How Command Rules Work
Command rules follow a set of steps to check their associated components.
• Tutorial: Using a Command Rule to Control Table Creations by a User
In this tutorial, you create a simple local command rule to control whether users can
create tables in the SCOTT schema.
• Guidelines for Designing Command Rules
Oracle provides guidelines for designing command rules.
• How Command Rules Affect Performance
The performance of a command rule depends on the complexity of the rules in the rule
set associated with the command rule.
• Command Rule Related Reports and Data Dictionary View
Oracle Database Vault provides reports and a data dictionary view that are useful for
analyzing command rules.
7-1
Chapter 7
What Are Command Rules?
7-2
Chapter 7
What Are Command Rules?
You can define a command rule that uses factors for the CONNECT event to permit or deny
sessions after the usual steps–user authentication process, factor initialization, and Oracle
Label Security integration–are complete.
For example, you can configure a command rule that allows DDL statements such as CREATE
TABLE, DROP TABLE, and ALTER TABLE in the BIZAPP schema to be authorized after business
hours, but not during business hours.
You can run reports on the command rules that you create in Oracle Database Vault.
Related Topics
• Oracle Database Vault Command Rule APIs
The DBMS_MACADM PL/SQL package provides procedures for configuring command rules. .
• Configuring Rule Sets
Rule sets group one or more rules together; the rules determine whether a user can
perform an action on an object.
• SQL Statements That Can Be Protected by Command Rules
You can protect a large number of SQL statements by using command rules.
You can check a user’s roles by querying the USER_ROLE_PRIVS data dictionary view. To find
information about command rules, query the DBA_DV_COMMAND_RULE data dictionary view.
7-3
Chapter 7
What Are Command Rules?
Related Topics
• CREATE_COMMAND_RULE Procedure
The CREATE_COMMAND_RULE procedure creates a command rule and associates it
with a rule set.
• Using Simulation Mode for Logging Realm and Command Rule Activities
Simulation mode writes the activities performed on realms and command rules to
a log file, which is accessible through a data dictionary view.
7-4
Chapter 7
What Are Command Rules?
SESSION, or ARCHIVE_LOG, CHECK DATAFILES, CHECKPOINT, and SET for ALTER SYSTEM.
• DBMS_MACADM.CREATE_SESSION_EVENT creates a command rule that is specific to the
ALTER SESSION SET EVENTS SQL statement
• DBMS_MACADM_CREATE_SYSTEM_EVENT creates a command rule that is specific to the ALTER
SYSTEM SET EVENTS SQL statement.
To create these command rules, you use the appropriate Database Vault procedure to specify
the clause and if applicable, the parameter of the clause, in the creation statement. If the
ALTER SESSION or ALTER SYSTEM command rule use the SET EVENTS setting, then you
can use special parameters to specify events, components, and actions.
For example, for an ALTER SYSTEM command rule, you could specify the SECURITY clause
and its RESTRICTED SESSION parameter from the ALTER SYSTEM SQL statement. To specify
whether RESTRICTED SESSION is TRUE or FALSE, you must create a Database Vault rule and
rule set, which can test for the validity of this sequence number.
To understand how this concept works, first create the following rule and rule set, which are
designed to check if the RESTRICTED SESSION parameter is set to TRUE:
EXEC DBMS_MACADM.CREATE_RULE('RESTRICTED SESSION TRUE', 'UPPER(PARAMETER_VALUE) =
''TRUE''');
BEGIN
DBMS_MACADM.CREATE_RULE_SET(
rule_set_name => 'Check RESTRICTED SESSION for TRUE',
description => 'Checks if restricted session is true',
enabled => DBMS_MACUTL.G_YES,
eval_options => DBMS_MACUTL.G_RULESET_EVAL_ALL,
audit_options => DBMS_MACUTL.G_RULESET_AUDIT_FAIL +
DBMS_MACUTL.G_RULESET_AUDIT_SUCCESS,
fail_options => DBMS_MACUTL.G_RULESET_FAIL_SILENT,
fail_message => 'RESTRICTED SESSION is not TRUE',
fail_code => 20461,
handler_options => DBMS_MACUTL.G_RULESET_HANDLER_FAIL,
handler => '',
is_static => false);
END;
/
EXEC DBMS_MACADM.ADD_RULE_TO_RULE_SET(Check RESTRICTED SESSION for TRUE', 'RESTRICTED
SESSION TRUE');
With the rule and rule set in place, you are ready to create an ALTER SYSTEM command
rule that will check if the RESTRICTED SESSION parameter:
BEGIN
DBMS_MACADM.CREATE_COMMAND_RULE(
command => 'ALTER SYSTEM',
rule_set_name => 'Check RESTRICTED SESSION for TRUE',
object_owner => '%',
object_name => '%',
enabled => DBMS_MACUTL.G_YES,
clause_name => 'SECURITY',
parameter_name => 'RESTRICTED SESSION',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
In this example:
7-5
Chapter 7
Default Command Rules
See Also:
7-6
Chapter 7
SQL Statements That Can Be Protected by Command Rules
1 The actual SQL statement that the Can Maintain Own Account rule refers to is PASSWORD.
The following set of command rules helps you to achieve separation of duty for user
management:
• ALTER PROFILE
• ALTER USER
• CREATE PROFILE
• CREATE USER
• DROP PROFILE
• DROP USER
To grant a user the ability to use these commands, you can grant the user the role that the
rule set checks. For example, the CREATE USER command rule ensures that a user who tries
to run a CREATE USER statement has the DV_ACCTMGR role.
Note:
To find information about the default command rules, query the
DBA_DV_COMMAND_RULE data dictionary view.
7-7
Chapter 7
SQL Statements That Can Be Protected by Command Rules
See Also:
Command Rules in a Multitenant Environment for information about using
CREATE PLUGGABLE DATABASE, ALTER PLUGGABLE DATABASE, and DROP
PLUGGABLE DATABASE in a multitenant container database (CDB)
7-8
Chapter 7
Creating a Command Rule
7-9
Chapter 7
Modifying the Enablement Status of a Command Rule
If the rule set evaluates to true, then the SQL statement succeeds. If it
evaluates to false, the statement fails, and then Oracle Database Vault raises
a command rule violation. (You can track rule violations by using the
Command Rule Configuration Issues Report, discussed in Oracle Database
Vault Reports.) Any auditing and custom event handling associated with the
rule set occurs as a part of the command rule processing.
See Configuring Rule Sets , for more information about rule sets.
5. Click OK.
Related Topics
• Propagating Oracle Database Vault Configurations to Other Databases
You can propagate Database Vault configurations (such as a realm configuration)
to other Database Vault-protected databases.
7-10
Chapter 7
How Command Rules Work
Related Topics
• Oracle Database Vault Data Dictionary Views
You can find information about the Oracle Database Vault configuration settings by
querying the Database Vault-specific data dictionary views.
1. Oracle Database Vault queries all the command rules that need to be applied.
For SELECT, DDL, and DML statements, multiple command rules may apply because the
object owner and object name support wildcard notation.
You can associate rule sets with both command rules and realm authorizations. Oracle
Database Vault evaluates the realm authorization rule set first, and then it evaluates the
rule sets that apply to the command type being evaluated.
2. For each command rule that applies, Oracle Database Vault evaluates its associated rule
set.
3. If the associated rule set of any of the applicable command rules returns false or errors,
Oracle Database Vault prevents the command from executing. Otherwise, the command
is authorized for further processing. The configuration of the rule set with respect to
auditing and event handlers dictates the auditing or custom processing that occurs.
Command rules override object privileges. That is, even the owner of an object cannot
access the object if the object is protected by a command rule. You can disable either a
command rule or the rule set of a command. If you disable a command rule, then the
command rule does not perform the check it is designed to handle. If you disable a rule
set, then the rule set always evaluates to TRUE. However, if you want to disable a
command rule for a particular command, then you should disable the command rule
because the rule set may be associated with other command rules or realm
authorizations.
7-11
Chapter 7
Tutorial: Using a Command Rule to Control Table Creations by a User
To find the available pluggable databases (PDBs), query the DBA_PDBS data
dictionary view. To check the current PDB, run the show con_name command.
If the SCOTT account is locked and expired, then log in as the Database Vault
Account Manager and unlock SCOTT and create a new password. For example:
sqlplus bea_dvacctmgr --Or, sqlplus bea_dvacctmgr@hrpdb
Enter password: password
Follow the guidelines in Oracle Database Security Guide to replace password with
a password that is secure.
CONNECT SCOTT --Or, sqlplus SCOTT@hrpdb
Enter password: password
At this stage, user SCOTT can create and drop tables. Do not exit SQL*Plus yet, and
remain connected as SCOTT. You must use it later on when SCOTT tries to create
another table.
7-12
Chapter 7
Tutorial: Using a Command Rule to Control Table Creations by a User
3. Click Create.
The Create Command Rule page appears.
4. Enter the following settings:
• Command: Select CREATE TABLE
• Status: Set to Enabled so that the command rule is active.
• Applicable Object Owner: Select SCOTT.
• Applicable Object Name: Set to % so that it applies to all objects in the SCOTT
schema.
• Rule Set: Select Disabled so that no one can create tables in the SCOTT schema.
5. Click OK.
Do not exit Database Vault Administrator
Command rules take effect immediately. Right away, user SCOTT is prevented from creating
tables, even though he is still in the same user session he was in a moment ago, before you
created the CREATE TABLE command rule.
As you can see, SCOTT is no longer allowed to create tables, even in his own schema.
3. In Oracle Database Vault Administrator, do the following:
a. In the Command Rules page, select the CREATE TABLE command rule and then
click Edit.
b. In the Edit Command Rule page, select Enabled from the Rule Set list.
c. Click OK.
4. In SQL*Plus, as user SCOTT, try creating the table again.
CREATE TABLE t1 (num NUMBER);
Table created.
Now that the CREATE TABLE command rule is set to Enabled, user SCOTT is once again
permitted to create tables. (Do not exit SQL*Plus.)
7-13
Chapter 7
Guidelines for Designing Command Rules
3. If you no longer need the SCOTT account to be available, then connect as the
Database Vault Account Manager and enter the following ALTER USER statement:
CONNECT bea_dvacctmgr --Or, CONNECT bea_dvacctmgr@hrpdb
Enter password: password
7-14
Chapter 7
How Command Rules Affect Performance
environment, this setting does not work. Instead, you must create a unified audit policy.)
• When designing command rules, be careful to consider automated processes such as
backup where these procedures may be inadvertently disabled. You can account for
these tasks by creating rules that allow the command when a series of Oracle Database
Vault factors is known to be true (for example, the program being used), and the account
being used or the computer or network on which the client program is running.
• You can test the development phase of a command rule by using simulation mode, which
enables the command rule but writes detailed information about it to a log file.
Related Topics
• Using Simulation Mode for Logging Realm and Command Rule Activities
Simulation mode writes the activities performed on realms and command rules to a log
file, which is accessible through a data dictionary view.
See Also:
Report Description
Command Rule Audit Report Lists audit records generated by command rule
processing operations
7-15
Chapter 7
Command Rule Related Reports and Data Dictionary View
Report Description
Command Rule Configuration Issues Report Tracks rule violations, in addition to other
configuration issues the command rule may have
Object Privilege Reports Lists object privileges that the command rule affects
Sensitive Objects Reports Lists objects that the command rule affects
Rule Set Configuration Issues Report Lists rules sets that have no rules defined or
enabled, which may affect the command rules that
use them
You can use the DBA_DV_COMMAND_RULE data dictionary view to find the SQL statements
that are protected by command rules. See DBA_DV_COMMAND_RULE View for more
information.
7-16
8
Configuring Factors
Factors allow you to create and use complex attributes through PL/SQL to make Oracle
Database Vault authorization decisions.
• What Are Factors?
A factor is a named variable or attribute, such as a database IP address, that Oracle
Database Vault can recognize.
• Default Factors
Oracle Database Vault provides a set of default factors.
• Creating a Factor
In general, to create a factor, you first create the factor itself, and then you edit the factor
to include its identity.
• Adding an Identity to a Factor
After you create a new factor, you optionally can add an identity to it.
• Deleting a Factor
Before you delete a factor, you must remove references to the factor.
• How Factors Work
Oracle Database Vault processes factors when a session is established.
• Tutorial: Preventing Ad Hoc Tool Access to the Database
This tutorial demonstrates how to use factors to prevent ad hoc tools (such as SQL*Plus)
from accessing the database.
• Tutorial: Restricting User Activities Based on Session Data
This tutorial shows how to restrict user activities based on their session data, such as the
domain the user is using.
• Guidelines for Designing Factors
Oracle provides guidelines for designing factors.
• How Factors Affect Performance
The complexity of factors affects the performance of your Oracle database instance.
• Factor Related Reports and Data Dictionary Views
Oracle Database Vault provides reports and data dictionary views that display information
about factors and their identities.
8-1
Chapter 8
Default Factors
you can use the SYS_CONTEXT PL/SQL function to create rules on the most commonly
used factors that are readily available in the database. Such factors as Session_User,
Proxy_User, Network_Protocol, and Module are available through the SYS_CONTEXT
function.
Factors have powerful capabilities that are used in conjunction with Oracle Label
Security and for other database attributes that are not already available through
context parameters. Commonly available factors are listed in this section, but Oracle
recommends that you use the SYS_CONTEXT function in the rule definitions for these
factors. Only create and use factors that are not already available through
SYS_CONTEXT.
8-2
Chapter 8
Default Factors
you can use the CLIENT_PROGRAM_NAME attribute of SYS_CONTEXT to find the name of the
program used for the database session. After you create the custom factor, you can query its
values similar to the functions used to query the default factors.
See Oracle Database SQL Language Reference for more information about the SYS_CONTEXT
function.
You can use the default factors in your own security configurations. If you do not need them,
you can remove them. (That is, they are not needed for internal use by Oracle Database
Vault.)
The default factors are as follows:
• Authentication_Method: Is the method of authentication. In the list that follows, the type
of user is followed by the method returned:
– Password-authenticated enterprise user, local database user, user with the SYSDBA or
SYSOPER administrative privilege using the password file; proxy with user name using
password: PASSWORD
– Kerberos-authenticated enterprise user or external user (with no administrative
privileges): KERBEROS
– Kerberos-authenticated enterprise user (with administrative privileges):
KERBEROS_GLOBAL
– Kerberos-authenticated external user (with administrative privileges):
KERBEROS_EXTERNAL
– SSL-authenticated enterprise or external user (with no administrative privileges): SSL
– SSL-authenticated enterprise user (with administrative privileges): SSL_GLOBAL
– SSL-authenticated external user (with administrative privileges): SSL_EXTERNAL
– Radius-authenticated external user: RADIUS
– OS-authenticated external user, or user with the SYSDBA or SYSOPER administrative
privilege: OS
– Proxy with certificate, DN, or username without using password: NONE
– Background process (job queue slave process): JOB
– Parallel Query Slave process: PQ_SLAVE
For non-administrative connections, you can use the Identification_Type factor to
distinguish between external and enterprise users when the authentication method is
PASSWORD, KERBEROS, or SSL. For administrative connections, the Authentication_Method
factor is sufficient for the PASSWORD, SSL_EXTERNAL, and SSL_GLOBAL authentication
methods.
• Client_IP: Is the IP address of the machine from which the client is connected.
• Database_Domain: Is the domain of the database as specified in the DB_DOMAIN
initialization parameter.
• Database_Hostname: Is the host name of the computer on which the instance is
running.
• Database_Instance: Is the instance identification number of the current instance.
• Database_IP: Is the IP address of the computer on which the instance is running.
8-3
Chapter 8
Default Factors
For example:
AMERICAN_AMERICA.WE8MSWIN1252
Refer to Oracle Database Globalization Support Guide for more information about
languages, territories, and character sets.
• Machine: Is the host name for the database client that established the current
session. If you must find out whether the computer was used for a client or server
8-4
Chapter 8
Creating a Factor
session, then you can compare this setting with the Database_Hostname factor to make
the determination.
• Network_Protocol: Is the network protocol being used for communication, as specified
in the PROTOCOL=protocol portion of the connect string.
• Proxy_Enterprise_Identity: Is the Oracle Internet Directory DN when the proxy user is
an enterprise user.
• Proxy_User: Is the name of the database user who opened the current session on
behalf of SESSION_USER.
• Session_User: Is the database user name by which the current user is authenticated.
This value remains the same throughout the session.
8-5
Chapter 8
Creating a Factor
4. Starting with the General page, enter the following information, clicking Next to go
to each subsequent page, and then clicking Done and Finish when the factor
definition is complete.
• Completing the General Page for Factor Creation
• Configurations Page for Factor Creation
• Options Page of Factor Creation
• Creating and Configuring a Factor Identity
8-6
Chapter 8
Creating a Factor
You can find the factors that are associated with a particular factor type by querying
the DBA_DV_FACTOR data dictionary view. For example:
SELECT NAME FROM DBA_DV_FACTOR
WHERE FACTOR_TYPE_NAME='Authentication Method';
8-7
Chapter 8
Creating a Factor
to_char(sysdate,'yyyy-mm-dd')
On December 15, 2015, the By Method option would return the following
value:
2015-12-15
This allows the identifier for a factor to be accessed globally from within the Oracle
database (using PL/SQL, SQL, Oracle Virtual Private Database, triggers, and so on).
For example, in SQL*Plus:
CONNECT leo_dvowner
Enter password: password
F$DATABASE_IP
8-8
Chapter 8
Creating a Factor
-------------------------------------------------------------
192.0.2.1
You can also use the GET_FACTOR function to find the identity of a factor that is made available
for public access. For example:
SELECT GET_FACTOR('DATABASE_IP') FROM DUAL;
Related Topics
• Adding an Identity to a Factor
After you create a new factor, you optionally can add an identity to it.
• Factor Related Reports and Data Dictionary Views
Oracle Database Vault provides reports and data dictionary views that display information
about factors and their identities.
8.3.3.4 Setting the Oracle Label Security Labeling Information for a Factor
Under Factor Labeling, you must select how you want the factor identity to retrieve an Oracle
Label Security (OLS) label.
This setting applies if you plan to use the Oracle Label Security integration. This attribute is
mandatory if you want to use an OLS label.
• In the Configurations page, under Factor Labeling, enter the following information:
– By Self: Labels the identities for the factor directly from the labels associated with an
Oracle Label Security policy.
– By Factors: If there are multiple child factor labels, then Oracle Database Vault
merges the labels by using the Oracle Label Security algorithm that is associated
with the applicable Oracle Label Security policy. For each applicable Oracle Label
Security policy, a factor identity can have an assigned label.
8-9
Chapter 8
Creating a Factor
Related Topics
• Integrating Oracle Database Vault with Oracle Label Security
You can integrate Oracle Database Vault with Oracle Label Security, and check
the integration with reports and data dictionary views.
8-10
Chapter 8
Creating a Factor
If the method is evaluated to false for the value being retrieved or to be assigned, then the
factor identity is set to null. This optional feature provides an additional level of assurance
that the factor is properly retrieved and set. This field can have up to 255 characters in mixed-
case.
You can include any package function or standalone function in the expression. Ensure that
the expression is a fully qualified function, such as schema.function_name. Do not include
complete SQL statements. If you are using application packages or functions, then you must
provide DVSYS with the EXECUTE privilege on the object.
• In the Configurations page, under Validation method, create a function that uses any of
the following formats:
– FUNCTION IS_VALID RETURN BOOLEAN
In this form, you can use the DVF.F$factor_name function inside the function logic.
This is more appropriate for factors that are evaluated by session.
– FUNCTION IS_VALID(p_factor_value VARCHAR2) RETURN BOOLEAN
In this form, the factor value is passed to the validation function directly. This is more
appropriate for factors that are evaluated by access. It is also valid for factors
evaluated by session.
Related Topics
• DBMS_MACADM Factor Procedures and Functions
The DBMS_MACADM PL/SQL package provides procedures and functions to configure
factors.
• Oracle Database Vault Run-Time PL/SQL Procedures and Functions
Oracle Database Vault provides procedural interfaces to administer Database Vault
security options and manage Database Vault security enforcements.
• Oracle Database Vault DVF PL/SQL Factor Functions
Oracle Database Vault maintains the DVF schema functions when you use the
DBMS_MACADM PL/SQL package to manage the various factors.
• Oracle Database Vault Utility APIs
Oracle Database Vault provides a set of utility APIs in the DBMS_MACUTL PL/SQL package.
8-11
Chapter 8
Creating a Factor
Then you can create an assignment rule for the GEO_STATE factor to allow or
disallow the setting of the GEO_STATE factor based on other factors or rule
expressions.
Related Topics
• Configuring Rule Sets
Rule sets group one or more rules together; the rules determine whether a user
can perform an action on an object.
• How Factors Are Set
You can assign a factor identity at any time during a database session, but only if
the factor assignment rule set evaluates to true.
8-12
Chapter 8
Adding an Identity to a Factor
An advantage of selecting Do Not Show Error Message and then enabling auditing
is that you can track the activities of a potential intruder. The audit report reveals the
activities of the intruder, yet the intruder is unaware that you are doing this because
he or she does not see any error messages.
After you have created a new factor, you are ready to configure its identity. To do so, edit the
factor and then add its identity.
If you have enabled unified auditing, then this setting does not capture audit records. Instead,
you can create audit policies to capture this information, as described in Oracle Database
Security Guide.
You can use the Factor Audit Report to display the generated audit records. (See Factor
Related Reports and Data Dictionary Views for more information.) In addition, you can select
multiple audit options at a time. Each option is converted to a bit mask and added to
determine the aggregate behavior. Note that there is little performance impact in auditing,
unless the factor has errors.
8-13
Chapter 8
Adding an Identity to a Factor
For example, suppose you have created a factor named Network. You can create the
following identities for the Network factor:
8-14
Chapter 8
Adding an Identity to a Factor
Or, you can use a SELECT statement on the DBA_DV_IDENTITY data dictionary view to find trust
levels for the Network factor greater than or equal to 5:
SELECT VALUE, TRUST_LEVEL FROM DBA_DV_IDENTITY
WHERE TRUST_LEVEL >= 5
AND FACTOR_NAME='Network'
In the preceding example, Network factor identity for VPN is trusted (value equals 5), and the
identity for the INTRANET domain is 10, which implies a greater trust.
Related Topics
• Oracle Database Vault Realm APIs
The DBMS_MACADM PL/SQL package enables you to configure Oracle Database Vault
realms.
See Also:
Oracle Label Security Administrator’s Guide for more information about labels
8-15
Chapter 8
Adding an Identity to a Factor
1. In the Select Identities page of the Create Factor pages, select Add New Identity.
The Add New Identity window appears.
8-16
Chapter 8
Adding an Identity to a Factor
8-17
Chapter 8
Adding an Identity to a Factor
Related Topics
• Tutorial: Restricting User Activities Based on Session Data
This tutorial shows how to restrict user activities based on their session data, such
as the domain the user is using.
8-18
Chapter 8
Deleting a Factor
For example, consider a scenario where the Contributing Factor to the Factor
Network is set to Client_IP, the Operator is set to Between, the Min Value is set to
192.0.2.1 and the Max Value is set to 192.0.2.24. This means that whenever the
client IP address lies in the specified address range of 192.0.2.1 to 192.0.2.24, the
parent factor evaluates to a predefined identity (for example, INTRANET).
f. Click OK to exit the Add New Identity Mapping window.
g. Click OK to exit the Add New Identity and Mapping window.
4. Click Done, and then click Finish.
Repeat this process to add more contributing factors for a parent factor identity. For example,
you can configure the Network factor to resolve to a value ACCOUNTING-SENSITIVE, when
the Program factor resolves to "Oracle General Ledger" and the Client_IP is in between
192.0.2.1 and 192.0.2.24. So, if an authorized accounting financial application program,
running on a client with IP address 192.0.2.12 accesses the database, then the Network
factor is resolved to ACCOUNTING-SENSITIVE. A database session with the
ACCOUNTING-SENSITIVE Network value would have more access privileges than one with
the INTRANET Network value.
8-19
Chapter 8
How Factors Work
8-20
Chapter 8
How Factors Work
then Oracle Database Vault evaluates the rule set. If the rule set evaluates to false or results
in an error, then the session is terminated. Oracle Database Vault executes any auditing or
call handlers associated with the rule set before the session is terminated.
Note:
Be careful about associating command rules with the CONNECT event, because you
can inadvertently lock out other users from of the database. In general, if you create
a command rule for CONNECT, set its evaluation option of the associated rule set to
Any True.
If you do inadvertently lock out users, then you should temporarily disable Oracle
Database Vault, disable the CONNECT command rule, reenable Oracle Database
Vault, and then fix the factor code that is causing the problem. If the Test Fails
provides an example of how to accomplish this.
To find a listing of available factors, query the DBA_DV_FACTOR data dictionary view, described
in DBA_DV_FACTOR View.
Example 8-1 shows an example of using the GET_FACTOR function.
You can use the factor values retrieved from the DVF factor function or the GET_FACTOR in the
following ways:
• Oracle Database Vault rule expressions
• Custom application code that is available to all database sessions in an Oracle Database
Vault environment
Oracle Database Vault DVF PL/SQL Factor Functions describes DVF factor functions in detail.
If you had set the factor evaluation to By Session, then Oracle Database Vault retrieves the
value from the session context established, as described under How Factors Are Processed
When a Session Is Established.
If you had set the factor evaluation to By Access, then Oracle Database Vault performs Step
2 through Step 5 (or Step 6), as described under How Factors Are Processed When a
Session Is Established, whenever the factor is retrieved.
If you had defined error options for the factor and if an error occurs, then Oracle Database
Vault displays the error message.
8-21
Chapter 8
Tutorial: Preventing Ad Hoc Tool Access to the Database
Applications that can execute Oracle PL/SQL functions can use this procedure (for
example, applications written using Oracle Data Provider for .NET (ODP.NET)).
This concept is similar to the standard Oracle DBMS_SESSION.SET_IDENTIFIER
procedure with an added feature that a rule set controls when a factor value can be
set. If the rule set evaluates to true, Steps 2 through 5 under How Factors Are
Processed When a Session Is Established occur.
If you have not associated a assignment rule set for the factor or if the rule set returns
false (or returns errors), then Oracle Database Vault sends an error message if you
attempt to set the factor using the SET_FACTOR function.
8-22
Chapter 8
Tutorial: Preventing Ad Hoc Tool Access to the Database
See Also:
Oracle Database SQL Language Reference for more information about the
SYS_CONTEXT function.
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
2. Check the status of the HR account.
SELECT USERNAME, ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME = 'HR';
8-23
Chapter 8
Tutorial: Preventing Ad Hoc Tool Access to the Database
3. If the HR account is expired and locked, then enter the following statement to make
it active:
ALTER USER HR ACCOUNT UNLOCK IDENTIFIED BY password;
Follow the guidelines in Oracle Database Security Guide to replace password with
a password that is secure.
4. Repeat these steps for the OE account.
1. Connect as a user who has been granted the DV_OWNER or DV_ADMIN role.
For example:
CONNECT leo_dvowner --Or, CONNECT leo_dvowner@hrpdb
Enter password: password
In this specification:
• factor_type_name specifies that this is an application-based factor.
• get_expr defines the expression for the factor. This expression calls the
SYS_CONTEXT function, using the USERENV namespace and
CLIENT_PROGRAM_NAME attribute, to find the programs that are logged into the
Oracle database.
• identify_by identifies the factor by method.
• labeled_by labels the identities for the factor directly from the labels
associated with an Oracle Label Security policy (default).
• eval_options evaluates the factor when the database session is created.
• audit_options audits if get_expr returns an error.
• fail_silently does not show any error messages for the factor.
8-24
Chapter 8
Tutorial: Preventing Ad Hoc Tool Access to the Database
In this specification:
• fail_options enables an error message, set by fail_message, and error code, set
by fail_code, to appear if there are errors.
• is_static evaluates the rule set once during the user session. After that, the value is
re-used.
2. Find the exact settings for the computer on which you want to apply the policy, based on
what the CLIENT_PROGRAM_NAME attribute will return.
SELECT SYS_CONTEXT('USERENV', 'CLIENT_PROGRAM_NAME') FROM DUAL;
For this tutorial, the name of the computer is nemosity. The (TN V1-V3) output refers to
the version of the TNS connector.
3. Create the following rules.
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Prevent Apps Schemas Access to SQL*Plus',
rule_expr =>'UPPER (DVF.F$CLIENT_PROG_NAME) != ''SQLPLUS@NEMOSITY (TNS V1-V3)''
AND DVF.F$SESSION_USER IN (''HR'', ''OE'')');
END;
/
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Allow Non-Apps Schemas Access to SQL*Plus',
rule_expr =>'DVF.F$SESSION_USER NOT IN (''HR'', ''OE'')');
END;
/
8-25
Chapter 8
Tutorial: Preventing Ad Hoc Tool Access to the Database
The rules translate to the following: "Prevent users HR and OE from logging into
SQL*Plus, but allow other users access."
4. Add the rules to the Limit SQL*Plus Access rule set.
BEGIN
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name => 'Limit SQL*Plus Access',
rule_name => 'Prevent Apps Schemas Access to SQL*Plus',
rule_order => 1);
END;
/
BEGIN
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name => 'Limit SQL*Plus Access',
rule_name => 'Allow Non-Apps Schemas Access to SQL*Plus',
rule_order => 1);
END;
/
This command rule also applies to logging into SQL*Plus from the command line or
other tools your site may use to access SQL*Plus.
• Create the CONNECT command rule as follows:
BEGIN
DBMS_MACADM.CREATE_COMMAND_RULE(
command => 'CONNECT',
rule_set_name => 'Limit SQL*Plus Access',
object_owner => '%',
object_name => '%',
enabled => DBMS_MACUTL.G_YES);
END;
/
In this specification:
• rule_set_name associates the Limit SQL*Plus Access rule set with the CONNECT
command rule.
• object_owner is set to % so that the command rule applies to all users.
• object_name is set to % so that the command rule applies to all objects.
• enabled enables the command rule so that it can be used right away.
8-26
Chapter 8
Tutorial: Preventing Ad Hoc Tool Access to the Database
User SYSTEM should be able to log into the database instance. So should SYS, the
Database Vault Owner account, and the Database Vault Account Manager account.
Even though you have disabled Oracle Database Vault, you still can use its PL/SQL
packages and Database Vault Administrator.
3. Check the policy components for any errors and then correct them. Recreate the
CONNECT command rule, and then test it.
8-27
Chapter 8
Tutorial: Restricting User Activities Based on Session Data
5. If necessary, as a user who has been granted the DBV_ACCTMGR role, lock the HR
and OE accounts.
CONNECT bea_dvacctmgr --Or, CONNECT amalcolumn_dbacctmgr@hrpdb
Enter password: password
8-28
Chapter 8
Tutorial: Restricting User Activities Based on Session Data
• Ensure that the administrator is accessing the database from the correct IP address.
• Limit the database access to the standard business hours of the administrator.
This type of configuration is useful for restricting different types of administrators: not only
local, internal administrators, but offshore and contract administrators as well.
In this tutorial, you modify the Domain factor to include identities for a secure and non-secure
network access, which are based on the IP address of the computer the administrator is
using. If the administrator tries to perform an action outside the standard working hours or
from a different IP address, then Oracle Database Vault prevents him from doing so.
Follow the guidelines in Oracle Database Security Guide to replace password with a
password that is secure.
In a multitenant environment, you must connect to the appropriate pluggable database
(PDB).
For example:
sqlplus bea_dvacctmgr@hrpdb
Enter password: password
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
2. Connect as a user who privileges to grant the CREATE SESSION privilege and the DBA role,
and then grant user mwaldron these privileges. This user must also be authorized as an
owner of the Oracle System Privilege and Role Management realm.
For example:
CONNECT dba_psmith -- Or, CONNECT dba_psmith@hrpdb
Enter password: password
8-29
Chapter 8
Tutorial: Restricting User Activities Based on Session Data
3. Select the Show Oracle defined Factors check box to display the default factors.
4. Select the Domain factor and then select Edit.
The Domain factor will be the parent factor.
5. Click the Next button until you reach the Identities page.
6. Select the Add New Identity button.
7. In the Identity tab of the Add New Identity and Mapping page, enter the following
information:
• Value: Enter HIGHLY SECURE INTERNAL NETWORK
• Trust Level: Select Very Trusted
8. Click OK.
9. Repeat these steps to create a second identity called NOT SECURE, and then set its
trust level to Untrusted.
8.8.4 Step 3: Map the Domain Factor Identities to the Client_IP Factor
After you have added identities to the domain factory, you can map them to the
Client_IP factor.
The Client_IP factor is a default factor.
1. In Identities page, select the HIGHLY SECURE INTERNAL NETWORK identity
and then select Edit.
2. In the Add New Identity and Mapping window, select the Map Identity subpage.
3. Select the Map Identity tab, and then select Add Mapping.
4. In the Add New Identity Mapping page, enter the following information:
• Child Factor: Select Client_IP to be the child factor.
• Operator: Select Equal.
8-30
Chapter 8
Tutorial: Restricting User Activities Based on Session Data
• Min Value: Enter the IP address for the Virtual Machine (for example, 192.0.2.12).
(This is the computer that user mwaldron uses. For this tutorial, you can enter the IP
address of your own computer. If you are using Microsoft Windows, use the IP
address assigned to the Loopback Adapter.)
• Max Value: Leave this field empty.
5. Click OK, and then click OK again to return to the Identities page.
6. Create the following two identity maps for the NOT SECURE identity, by editing this
identity:
The identity maps in the NOT SECURE identity are in a range of IP addresses outside
the IP address that user mwaldron uses (192.0.2.12). The IP addresses here must be in
any range outside mwaldron's IP address.
This identity mapping creates the following condition: If the user logs in from the correct
IP address, then Oracle Database Vault decides that the connection is secure, through
the HIGHLY SECURE INTERNAL NETWORK identity. However, if the user logs in from
an IP address that is less than 192.0.2.5 or greater than 192.0.2.20, then the connection
is deemed not secure, through the NO SECURE identity.
7. Click OK.
8. Click Done, and then click Finish.
9. Test the factor identities.
First, in SQL*Plus, connect as user mwaldron but do not specify a database instance.
CONNECT mwaldron -- Or, CONNECT mwaldron@hrpdb
Enter password: password
Next:
SELECT DVF.F$DOMAIN FROM DUAL;
Because user mwaldron is not connecting directly to the database instance, Oracle
Database Vault does not recognize the IP address from which he is connecting. In this
case, Oracle Database uses the IPC protocol to perform the connection, which sets the
IP value to null. Therefore, the identity for this connection is set to NOT SECURE.
Now connect to SQL*Plus by specifying the database instance (for example, orcl), and
then check the factor identities again:
8-31
Chapter 8
Tutorial: Restricting User Activities Based on Session Data
CONNECT mwaldron@orcl
Enter password: password
Next:
SELECT DVF.F$DOMAIN FROM DUAL;
Now that user mwaldron is connecting to the orcl database instance, his IP
address is recognized. This is because the database uses the TCP protocol, so
now the host IP value can be populated appropriately. Because the IP address is
within the correct range, the factor identity is set to HIGHLY SECURE INTERNAL
NETWORK.
8.8.5 Step 4: Create a Rule Set to Set the Hours and Select the Factor
Identity
You must create a rule set to work with the factor that you modified.
1. In the Administration page, under Database Vault Components, select Rule Sets.
2. In the Rule Sets page, select Create.
3. In the Create Rule Set page, enter the following settings:
• Name: Enter Internal DBA Standard Working Hours.
• Status: Select Enabled.
• Evaluation Options: Select All True.
Leave the remaining settings at their defaults.
4. Click Next to display the Associate with Rule page.
5. Select Create Rule.
6. In the Create Rule window, enter the following settings:
• Name: Internal DBA
• Expression: DVF.F$SESSION_USER='MWALDRON'
(When you create an expression with a user name, enter the user name in
upper case letters, because that is how the database stores user names.)
7. Click OK.
8. Use the Create Rule page to create the following additional rules:
• Name: Internal Network Only
8-32
Chapter 8
Tutorial: Restricting User Activities Based on Session Data
8.8.6 Step 5: Create a Command Rule That Uses the Rule Set
You must create a command rule that uses the rule set that you created.
1. In the Administration page, select Command Rules.
2. In the Command Rules page, select Create.
3. In the Create Command Rule page, enter the following settings:
• Command: Select CREATE TABLE from the list.
• Status: Select Enabled.
• Applicable Object Owner: Ensure it is set to % (the default).
• Applicable Object Name: Ensure it is set to % (the default).
• Evaluating Rule Set: Select Internal DBA Standard Working Hours from the list.
4. Click OK.
Windows: Double-click the clock icon, which is typically at the lower right corner of the
screen. In the Date and Time Properties window, set the time to 9 p.m., and then click
OK.
2. In SQL*Plus, connect as user mwaldron and try to create a table. In the following, replace
orcl with the name of your database instance.
CONNECT mwaldron@orcl
Enter password: password
8-33
Chapter 8
Tutorial: Restricting User Activities Based on Session Data
Because user mwaldron is create a table outside working hours, Database Vault
prevents him.
3. Reset the system time back to the local time.
4. In SQL*Plus, as user mwaldron, try to create the table again.
CREATE TABLE TEST (num number);
Table created.
Now that user mwaldron is working during his local hours and from the IP address
associated with the HIGHLY SECURE INTERNAL NETWORK identity, he can
create tables.
5. Reconnect as user mwaldron but without adding the database instance name to
the connection command, and then try to create the table again.
CONNECT mwaldron -- Or, CONNECT mwaldron@hrpdb
Enter password: password
Even though user mwaldron is trying to create a table during the correct time, he
cannot because is not directly logged in to the orcl database instance. Oracle
Database Vault deems him to be using the NOT SECURE identity, and then
denies him access.
8-34
Chapter 8
Guidelines for Designing Factors
Select Rules in the Administration page. In the Rules page, select the Internal DBA,
Internal Network Only, Week Day, and Week Day Working Hours rules, and then select
Delete. Select Yes in the Confirmation window.
5. Remove the HIGHLY SECURE INTERNAL NETWORK and NOT SECURE factor
identities from the Domain factor.
In the Administration page and select Factors. Select the Domain factor, select Edit.
Click Next until you reach the Identities page. Select the HIGHLY SECURE INTERNAL
NETWORK and NOT SECURE factor identities and click Remove to remove each one.
(Hold the Control key down to select multiple items.) In the Confirmation window, select
Yes. Click Done, and then click Finish.
8-35
Chapter 8
How Factors Affect Performance
See Also:
Report Description
Factor Audit Report Audits factors (for example, to find factors that
failed to be evaluated)
8-36
Chapter 8
Factor Related Reports and Data Dictionary Views
Report Description
Factor Configuration Issues Report Lists configuration issues, such as disabled or
incomplete rule sets, or to audit issues that may
affect the factor
Factor Without Identities Report Lists factors that have had no identities assigned
yet
Identity Configuration Issues Report Lists factors that have invalid label identities or no
map for the identity
Rule Set Configuration Issues Report Lists rule sets that have no rules defined or
enabled, which may affect the factors that use
them
Table 8-2 lists data dictionary views that provide information about existing factors and factor
identities.
Table 8-2 Data Dictionary Views Used for Factors and Factor Identities
8-37
9
Configuring Secure Application Roles
for Oracle Database Vault
Secure application roles enable you to control how much access users have to an
application.
• What Are Secure Application Roles in Oracle Database Vault?
In Oracle Database Vault, you can create a secure application role that you enable with
an Oracle Database Vault rule set.
• Creating an Oracle Database Vault Secure Application Role
You can create a Database Vault secure application role in Database Vault Administrator.
• Enabling Oracle Database Secure Application Roles to Work with Oracle Database Vault
You can modify an existing secure application role only if it has been created in Oracle
Database Vault.
• Security for Oracle Database Vault Secure Application Roles
Users who have database administrative privileges may try to use the DROP ROLE
statement to delete Oracle Database Vault secure application roles.
• Deleting an Oracle Database Vault Secure Application Role
You can delete Oracle Database Vault secure application roles in Oracle Database Vault
Administrator.
• How Oracle Database Vault Secure Application Roles Work
The process flow for an Oracle Database Vault secure application role begins after you
create and set the secure application role.
• Tutorial: Granting Access with Database Vault Secure Application Roles
This tutorial demonstrates how to create a secure application role to control user access
to the OE.ORDERS table during work hours.
• How Secure Application Roles Affect Performance
You can check system performance by Oracle Enterprise Manager Cloud Control.
• Secure Application Role Related Reports and Data Dictionary View
Oracle Database Vault provides reports and a data dictionary view that you can use to
analyze Oracle Database Vault secure application roles.
9-1
Chapter 9
Creating an Oracle Database Vault Secure Application Role
In a multitenant environment, you only can create a secure application role in a PDB,
not in the CDB root or the application root.
The advantage of basing database access for a role on a rule set is that you can store
database security policies in one central place, as opposed to storing them in all your
applications. Basing the role on a rule set provides a consistent and flexible method to
enforce the security policies that the role provides. In this way, if you must update the
security policy for the application role, you do it in one place, the rule set. Furthermore,
no matter how the user connects to the database, the result is the same, because the
rule set is bound to the role. All you need to do is to create the role and then associate
it with a rule set. The associated rule set validates the user who is trying to enable the
role.
Related Topics
• Oracle Database Vault Secure Application Role APIs
The DBMS_MACADM and DBMS_MACSEC_ROLES PL/SQL packages manage Database
Vault secure application roles.
5. In the Create Secure Application Role page, enter the following settings:
9-2
Chapter 9
Enabling Oracle Database Secure Application Roles to Work with Oracle Database Vault
• Role Name: Enter the name using no more than 30 characters, with no spaces.
Ensure that this name follows the standard Oracle naming conventions for role
creation using the CREATE ROLE statement, described in Oracle Database SQL
Language Reference. This attribute is mandatory.
• Status: Select either Enabled or Disabled to enable or disable the secure
application role during run time. This attribute is mandatory.
– Enabled: Enables the role to be available for use. That is, users are allowed to
call the DBMS_MACSEC_ROLES.SET_ROLE function to try to enable the role. Note that
whether or not the role will be enabled depends on the evaluation result of the
associated rule set.
– Disabled: Disables the role from being available for use. The
DBMS_MACSEC_ROLES.SET_ROLE function will not be able to enable the role.
• Rule Set: From the list, select the rule set that you want to associate with the secure
application role. This attribute is mandatory.
When calling DBMS_MACSEC_ROLES.SET_ROLE, if the rule set evaluates to true, then
Oracle Database Vault enables the role for the database session. If the rule set
evaluates to false, then the role is not enabled.
6. Click OK.
Related Topics
• Configuring Rule Sets
Rule sets group one or more rules together; the rules determine whether a user can
perform an action on an object.
• SET_ROLE Procedure
The SET_ROLE procedure issues the SET ROLE PL/SQL statement for specified roles.
• Propagating Oracle Database Vault Configurations to Other Databases
You can propagate Database Vault configurations (such as a realm configuration) to other
Database Vault-protected databases.
2. Create a new secure application role in Oracle Database Vault and then grant the
existing role to the secure application role.
For example:
GRANT myExistingDBrole TO myDVrole;
9-3
Chapter 9
Security for Oracle Database Vault Secure Application Roles
9-4
Chapter 9
How Oracle Database Vault Secure Application Roles Work
9-5
Chapter 9
Tutorial: Granting Access with Database Vault Secure Application Roles
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the
current PDB, run the show con_name command.
2. Create the following user accounts:
GRANT CREATE SESSION TO eabel IDENTIFIED BY password;
GRANT CREATE SESSION TO ahutton IDENTIFIED BY password;
GRANT CREATE SESSION TO ldoran IDENTIFIED BY password;
Follow the guidelines in Oracle Database Security Guide to replace password with
a password that is secure.
3. If the OE account is locked and expired, unlock it and assign it a new password.
ALTER USER OE ACCOUNT UNLOCK IDENTIFIED BY password;
9-6
Chapter 9
Tutorial: Granting Access with Database Vault Secure Application Roles
1. Log in to Oracle Database Vault Administrator from Cloud Control as a user who has
been granted the DV_OWNER or DV_ADMIN role and the SELECT ANY DICTIONARY privilege.
Logging into Oracle Database Vault explains how to log in.
2. In the Administration page, select Rule Sets.
The Rule Sets page appears.
3. Click Create.
The Create Rule Set page appears.
4. Enter the following information:
• Name: Enter Can Modify Orders.
• Description: Enter Rule set to control who can modify orders in the
OE.ORDERS table.
• Status: Select Enabled.
• Evaluation Options: Select All True.
5. Leave the remaining settings and their defaults, and then click Next to go to the
Associate with Rules page.
6. Click Create Rule and in the Create Rule dialog box, enter the following settings:
• Name: Check IP Address
• Expression: DVF.F$CLIENT_IP = 'your_IP_address'
For the Check IP Address rule, replace your_IP_address with the IP address for your
computer. In a real-world scenario, you would create an expression that includes all the
IP addresses for the users who should be allowed access.
This rule uses the default factor Client_IP. If this factor has been removed, then you can
use the following rule expression instead:
UPPER(SYS_CONTEXT('USERENV','IP_ADDRESS')) = 'your_IP_address'
7. Click OK.
8. Click Create Rule again and in the Create Rule dialog box, enter the following settings:
• Name: Check Session User
• Expression: DVF.F$SESSION_USER IN ('EABEL','AHUTTON')
This rule uses the default factor Session_User. If this factor have been removed or
modified, you can use the following rule expression instead:
UPPER(SYS_CONTEXT('USERENV','SESSION_USER')) IN ('EABEL','AHUTTON')
9. Click OK.
10. Click Done, then click Finish.
9-7
Chapter 9
Tutorial: Granting Access with Database Vault Secure Application Roles
2. Grant the SELECT privilege to the ORDERS_MGMT Database Vault Secure application
role.
GRANT SELECT ON ORDERS TO ORDERS_MGMT;
Typically, you would embed this call in the application that the user logs in to.
3. Select from the OE.ORDERS table.
SELECT COUNT(*) FROM OE.ORDERS;
9-8
Chapter 9
Tutorial: Granting Access with Database Vault Secure Application Roles
Because user eabel is logging directly into the database from the correct IP address and
is listed as a valid session user, she can select from the OE.ORDERS table. If user ahutton
logs in to SQL*Plus in the same manner, she also can select from the OE.ORDERS table.
4. Reconnect as user eabel without specifying the database instance, and then try to select
from the OE.ORDERS table again.
CONNECT eabel
Enter password: password
EXEC DBMS_MACSEC_ROLES.SET_ROLE('ORDERS_MGMT');
Next:
SELECT COUNT(*) FROM OE.ORDERS;
Even though user eabel is a valid user, she has violated the Check IP Address rule in the
rule set, so she cannot enable the ORDERS_MGMT role. The only way for the IP address to
be recognized is to connect by specifying the database instance, as user eabel did in
Step 1. (For an explanation about how this works, see Step 9 in Step 3: Map the Domain
Factor Identities to the Client_IP Factor, in Configuring Factors.)
5. Connect as user ldoran.
CONNECT ldoran -- Or, CONNECT ldoran@hrpdb
Enter password: password
Because user ldoran is not a valid user, she cannot enable the ORDERS_MGMT role.
Therefore, she cannot select from the OE.ORDERS table.
9-9
Chapter 9
How Secure Application Roles Affect Performance
2. Delete the ORDERS_MGMT secure application role: From the Secure Application
Roles page, select the ORDERS_MGMT secure application role, and then click Delete,
and then Yes in the Confirmation dialog box.
3. Select the Rule Sets page, select the Can Modify Orders rule set, and then click
Delete.
4. In the Confirmation dialog box, select Yes to remove the rule set.
5. Select the Rules page, select the Check IP Address and Check Session User
rules, and then select Delete. Select Yes in the Confirmation box.
Hold the Control key down to select multiple rules.
6. In SQL*Plus, connect as the Database Vault Account Manager and drop the users.
For example:
CONNECT bea_dvacctmgr -- Or, CONNECT bea_dvacctmgr@hrpdb
Enter password: password
See Also:
9-10
Chapter 9
Secure Application Role Related Reports and Data Dictionary View
Report Description
Secure Application Role Audit Report Lists audit records generated by the Oracle
Database Vault secure application role-enabling
operation.
To generate this type of audit record, enable
auditing for the rule set associated with the role.
Secure Application Configuration Issues Report Lists secure application roles that have
nonexistent database roles, or incomplete or
disabled rule sets
Rule Set Configuration Issues Report Lists rule sets that have no rules defined or
enabled, which may affect the secure application
roles that use them
Powerful Database Accounts and Roles Reports Provides information about powerful database
accounts and roles
You can use the DBA_DV_ROLE data dictionary view to find the Oracle Database Vault secure
application roles used in privilege management. See DBA_DV_ROLE View for more
information.
9-11
10
Configuring Oracle Database Vault Policies
You can use Oracle Database Vault policies to implement frequently used realm and
command rule settings.
• What Are Database Vault Policies?
An Oracle Database Vault policy groups local realms and command rules into a named
policy that you can enable or disable as necessary.
• Default Oracle Database Vault Policies
Oracle Database Vault provides two default policies that you can use to better secure
user accounts and system privileges.
• Creating an Oracle Database Policy
To create an Oracle Database Vault policy, you create a container policy that specifies the
realms and command rules that encompass the policy.
• Modifying an Oracle Database Vault Policy
You can use Enterprise Manager Cloud Control to modify an Oracle Database Vault
policy.
• Deleting an Oracle Database Vault Policy
You can use Enterprise Manager Cloud Control to delete Oracle Database Vault policies.
• Related Data Dictionary Views
Oracle Database Vault provides data dictionary views that are useful for analyzing
Database Vault policies.
10-1
Chapter 10
What Are Database Vault Policies?
administrator to manage adding users to a realm for this application and for enabling
or disabling the policy. If there is only one primary application, then it can be used for
manageability where a user can enable, disable, or simulate (use simulation mode) all
related objects with one command rather than issuing a command for each included
Database Vault object.
How the enablement of the individual realms and command rules works depends on
how you set the policy state of the policy, as follows:
• Full enabled mode (DBMS_MACADM.G_ENABLED) sets the policy to take precedence
over the individual enablement settings of the associated realms and command
rules. For example, if the associated objects of a policy are individually disabled,
then they will be enabled if the policy is enabled. (Conversely, you can set
DBMS_MACADM.G_PARTIAL to allow the embedded security objects to set their own
enabled, disabled, or simulation mode.)
• Partial enabled mode (DBMS_MACADM.G_PARTIAL) enables the associated realms
and command rules to have different status settings (ENABLED, DISABLED, and
SIMULATION). The other policy status choices force all associated controls to the
same status dictated by the policy. Setting the policy status to partial allows each
realm and command rule to change status as required.
• Simulation mode (DBMS_MACACM.G.SIMULATION) enables the policy but writes
violations to realms or command rules to a designated log table with information
about the type of violation, such as a user name or the SQL statement that was
used. Simulation forces every security object in the policy to be in simulation
mode.
• Disabled mode (DBMS_MACADM.G_DISABLED) disables the policy after you create it.
In general, to create a Database Vault policy, you perform the following steps:
1. Create the necessary realms and command rules to use in the policy.
2. Create the Database Vault policy.
You can use the DBMS_MACADM.CREATE_POLICY procedure to create the policy.
3. Add one or more realms to the policy.
You can use the DBMS_MACADM.ADD_REALM_TO_POLICY procedure to add realms to
the policy.
4. Add one or more command rules to the policy.
You can use the DBMS_MACADM.ADD_CMD_TO_POLICY procedure to add command
rules to the policy.
5. Add one or more database users as owners of the policy.
You can use the DBMS_MACADM.ADD_OWNER_TO_POLICY procedure to add users to
the policy. Afterward, grant this user the DV_POLICY_OWNER role. This user will be
able to perform a limited set of tasks: changing the policy state, adding or
removing authorization from a realm, and having the SELECT privilege for a set of
the DVSYS.POLICY_OWNER* data dictionary views. By default, the DVOWNER user owns
the policy.
After the policy is created, it can be used right away.
This section explains how to configure policies by using the Oracle Database Vault
Administrator pages in Oracle Enterprise Manager Cloud Control. To configure policies
10-2
Chapter 10
Default Oracle Database Vault Policies
by using the PL/SQL interfaces and packages provided by Oracle Database Vault, you must
use the DBMS_MACADM PL/SQL package.
Related Topics
• Default Oracle Database Vault Policies
Oracle Database Vault provides two default policies that you can use to better secure
user accounts and system privileges.
• Oracle Database Vault Policy APIs
You can use the DBMS_MACADM PL/SQL package to manage Oracle Database Vault
policies.
• DV_POLICY_OWNER Database Vault Owner Role
The DV_POLICY_OWNER role enables database users to manage to a limited degree Oracle
Database Vault policies.
Related Topics
• DBA_DV_POLICY_OBJECT View
The DBA_DV_POLICY_OBJECT data dictionary view lists information about the objects that
are protected by Oracle Database Vault policies in the current database instance.
10-3
Chapter 10
Creating an Oracle Database Policy
4. In the Policies page, click Create to display the Create Policy page.
10-4
Chapter 10
Creating an Oracle Database Policy
5. In the Create Policy page, under General, enter the following settings:
• Name: Enter a policy name, up to 128 characters.
• Description: Enter a description of the policy, up to 4000 characters.
• Status: Select from the following:
– Enabled enables the policy after you create it.
– Disabled disables the policy after you create it.
– Simulation sets the policy to simulation mode. In simulation mode, any violations
to realms or command rules used in the policy are logged in a designated log
table with sufficient information to describe the error, such as the user name or
SQL statement used.
– Partial enables the enforcement state of realms or command rules associated
with the policy to be changed individually.
6. Under Realms, click Add to select a realm to add to the policy. Then click OK.
7. Under Command Rules, click Add to select a command rule to add to the policy. Then
click OK.
8. Under Owners, click Add to add an owner to the policy. Then click OK.
9. Click Next.
10. In the Review page, click Finish.
11. So that the Database Vault policy owner can query policy related views and execute the
allowed procedures, grant this user the DV_POLICY_OWNER role.
For example:
10-5
Chapter 10
Modifying an Oracle Database Vault Policy
Table 10-1 Data Dictionary Views Used for Oracle Database Vault Policies
10-6
Chapter 10
Related Data Dictionary Views
Table 10-1 (Cont.) Data Dictionary Views Used for Oracle Database Vault
Policies
10-7
11
Using Simulation Mode for Logging Realm
and Command Rule Activities
Simulation mode writes the activities performed on realms and command rules to a log file,
which is accessible through a data dictionary view.
• About Simulation Mode
Simulation mode enables you to capture a record of errors during the development phase
of a realm or command rule.
• Simulation Mode Use Cases
Simulation mode is useful for testing a development configuration of new realms and
command rules.
• Tutorial: Tracking Violations to a Realm Using Simulation Mode
This tutorial shows how to create a realm that uses simulation mode and then test
violations to the realm.
At this stage, SQL statements that violate realms or command rules are still able to execute,
but these activities are recorded to the DBA_DV_SIMULATION_LOG data dictionary view. For
example, the following query finds violations against the HR Apps realm:
SELECT USERNAME, COMMAND, SQLTEXT, VIOLATION_TYPE FROM DBA_DV_SIMULATION_LOG WHERE
REALM_NAME = "HR APPS";
11-1
Chapter 11
Simulation Mode Use Cases
After you have completed testing the realm or command rule, a user who has been
granted the DV_ADMIN or DV_OWNER role can clear the DBA_DV_SIMULATION_LOG data
dictionary view by deleting the contents of the underlying table of this view,
DVSYS.SIMULATION_LOG$.
For example:
DELETE FROM DVSYS.SIMULATION_LOG$;
Or:
DELETE FROM DVSYS.SIMULATION_LOG$ WHERE COMMAND = 'SELECT';
11-2
Chapter 11
Tutorial: Tracking Violations to a Realm Using Simulation Mode
3. Run applications and development operations from the normal IP addresses that will
be used.
4. Check the simulation log file for both authorized users and system context
information that you can use to create trusted paths.
5. Create the trusted paths, and then add the authorized users.
6. Clear the simulation log and run the application and development operation tasks
again.
7. After a period of time, review the simulation log. If all the controls were updated
correctly, then the simulation log is empty. Log entries in the simulation mode indicate
additional changes that you need to make to the realm and rule sets or the log
entries may indicate a malicious use.
11-3
Chapter 11
Tutorial: Tracking Violations to a Realm Using Simulation Mode
will then be able to make limited changes to the policy without needing the DV_OWNER or
DV_ADMIN role.
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the
current PDB, run the show con_name command.
2. Create the following users and grant them the CREATE SESSION privilege.
GRANT CREATE SESSION TO psmith IDENTIFIED BY password;
GRANT CREATE SESSION TO tjones_dba IDENTIFIED BY password;
GRANT CREATE SESSION TO smavris IDENTIFIED BY password;
Follow the guidelines in Oracle Database Security Guide to replace password with
a password that is secure.
3. Connect as a user who has been granted the DV_OWNER role.
For example:
CONNECT leo_dvowner -- Or, leo_dvowner@hrpdb
Enter password: password
4. Grant user psmith the DV_POLICY_OWNER role, which enables psmith to manage
Database Vault policies.
GRANT DV_POLICY_OWNER TO psmith;
11-4
Chapter 11
Tutorial: Tracking Violations to a Realm Using Simulation Mode
At this stage, the users have all been created and granted the appropriate privileges.
BEGIN
DBMS_MACADM.ADD_OBJECT_TO_REALM(
realm_name => 'HR.EMPLOYEES_realm',
object_owner => 'HR',
object_name => 'EMPLOYEES',
object_type => 'TABLE');
END;
/
3. Create the HR.EMPLOYEES_pol Database Vault policy and set it to be in simulation mode.
These procedures create the HR.EMPLOYEES_pol policy, add the realm that was just
created to the policy, and then add user psmith as the owner of the policy.
BEGIN
DBMS_MACADM.CREATE_POLICY(
policy_name => 'HR.EMPLOYEES_pol',
description => 'Policy to protect HR.EMPLOYEES',
policy_state => DBMS_MACADM.G_SIMULATION);
END;
/
BEGIN
DBMS_MACADM.ADD_REALM_TO_POLICY(
policy_name => 'HR.EMPLOYEES_pol',
realm_name => 'HR.EMPLOYEES_realm');
END;
/
BEGIN
11-5
Chapter 11
Tutorial: Tracking Violations to a Realm Using Simulation Mode
DBMS_MACADM.ADD_OWNER_TO_POLICY(
policy_name => 'HR.EMPLOYEES_pol',
owner_name => 'PSMITH');
END;
/
1 row updated.
11-6
Chapter 11
Tutorial: Tracking Violations to a Realm Using Simulation Mode
TJONES_DBA
UPDATE HR.EMPLOYEES SET SALARY = SALARY / 2 WHERE EMAIL = 'SMAVRIS'
Realm Violation
The output indicates that user tjones_dba has committed two offences: first, he looked at
another employee’s salary, and not only that, he cut it in half. The violation type is a realm
violation. The query by smavris was not captured because she legitimately can look at her
salary.
11-7
Chapter 11
Tutorial: Tracking Violations to a Realm Using Simulation Mode
The policy, now enabled, enables the realm to protect the HR.EMPLOYEES table.
smavris’s salary can shrink no more.
You first must remove the policy before you can drop its contents.
3. Remove the HR.EMPLOYEES_realm realm.
EXEC DBMS_MACADM.DELETE_REALM('HR.EMPLOYEES_realm');
11-8
12
Integrating Oracle Database Vault with
Other Oracle Products
You can integrate Oracle Database Vault with other Oracle products, such as Oracle
Enterprise User Security.
• Integrating Oracle Database Vault with Enterprise User Security
You can integrate Oracle Database Vault with Oracle Enterprise User Security.
• Integrating Oracle Database Vault with Transparent Data Encryption
Transparent Data Encryption complements Oracle Database Vault in that it provides data
protection when the data leaves the secure perimeter of the database.
• Attaching Factors to an Oracle Virtual Private Database
You can attach factors to an Oracle Virtual Private Database.
• Integrating Oracle Database Vault with Oracle Label Security
You can integrate Oracle Database Vault with Oracle Label Security, and check the
integration with reports and data dictionary views.
• Integrating Oracle Database Vault with Oracle Data Guard
An Oracle Database Vault-Oracle Data Guard integration requires first, the primary
database configuration, then the standby database configration.
• Registering Oracle Internet Directory Using Oracle Database Configuration Asssitant
You can use Oracle Internet Directory in an Oracle Database Vault-enabled database.
12-1
Chapter 12
Integrating Oracle Database Vault with Enterprise User Security
See Also:
Oracle Database Enterprise User Security Administrator's Guide for more
information about Enterprise User Security
12-2
Chapter 12
Integrating Oracle Database Vault with Enterprise User Security
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
3. Create a global role for the DV_OWNER role and a global role for the DV_ACCTMGR role.
For example:
CREATE ROLE g_dv_owner IDENTIFIED GLOBALLY;
CREATE ROLE g_dv_acctmgr IDENTIFIED GLOBALLY;
9. Temporarily grant the DV_ACCTMGR user who will import the Database Vault users into OID
the CREATE TABLE privilege and the SELECT_CATALOG_ROLE role.
GRANT CREATE TABLE, SELECT_CATALOG_ROLE TO dbv_acctmgr;
10. From the command line, run the User Migration Utility (UMU) to import the Database Vault
accounts into Oracle Internet Directory (OID).
The following example imports the Database Vault accounts leo_dvowner and
bea_dvacctmgr into OID. The DV_ACCTMGR user is specified for the DBADMIN setting.
$ORACLE_HOME/rdbms/bin/umu PHASE=ONE
DBADMIN=dbv_acctmgr:password
ENTADMIN=cn=jane_ent_admin,dc=example,dc=com:password
USERS= LIST
DBLOCATION=example.com:7777:orcl
DIRLOCATION=example.com:636
USERSLIST=leo_dvowner:bea_dvacctmgr
MAPSCHEMA=PRIVATE
CONTEXT=CONTEXT="c=Users, c=us"
KREALM=EXAMPLE.COM
$ORACLE_HOME/rdbms/bin/umu PHASE=TWO
12-3
Chapter 12
Integrating Oracle Database Vault with Transparent Data Encryption
DBADMIN=dbv_acctmgr:password
ENTADMIN=cn=jane_ent_admin,dc=example,dc=com:password
DBLOCATION=example.com:7777:orcl
DIRLOCATION=example.com:636
See Also:
Oracle Database Enterprise User Security Administrator's Guide for detailed
information about the User Migration Utility
12-4
Chapter 12
Attaching Factors to an Oracle Virtual Private Database
Sensitive
data remains
encrypted on backup
files
See Also:
Oracle Database Advanced Security Guide for detailed information about
Transparent Data Encryption
See Also:
Oracle Database Security Guide Oracle Database Security Guide for more
information about Oracle Virtual Private Database
12-5
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
• Requirements for Using Oracle Database Vault with Oracle Label Security
You must fulfill specific requirements in place before you use Oracle Database
Vault with Oracle Label Security.
• Using Oracle Database Vault Factors with Oracle Label Security Policies
To enhance security, you can integrate Oracle Database Vault factors with Oracle
Label Security policies.
• Tutorial: Integrating Oracle Database Vault with Oracle Label Security
An Oracle Database Vault-Oracle Label Security integration can grant different
levels of access to two administrative users who have the same privileges.
• Related Reports and Data Dictionary Views
Oracle Database Vault provides reports and data dictionary views that list
information about the Oracle Database Vault-Oracle Label Security integration.
12-6
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
See Also:
12.4.2 Requirements for Using Oracle Database Vault with Oracle Label
Security
You must fulfill specific requirements in place before you use Oracle Database Vault with
Oracle Label Security.
• Oracle Label Security is licensed separately. Ensure that you have purchased a license
to use it.
• Before you install Oracle Database Vault, you must have already installed Oracle Label
Security.
• The installation process for Oracle Label Security creates the LBACSYS user account. As a
user who has been granted the DV_ACCTMGR role, unlock this account and grant it a new
password. For example:
sqlplus bea_dvacctmgr -- Or, sqlplus bea_dvacctmgr@hrpdb for a PDB
Enter password: password
Follow the guidelines in Oracle Database Security Guide to replace password with a
password that is secure.
• If you plan to use the LBACSYS user account in Oracle Enterprise Manager, then log into
Enterprise Manager as user SYS with the SYSDBA administrative privilege, and grant this
user the SELECT ANY DICTIONARY and SELECT_CATALOG_ROLE system privileges.
• Ensure that you have the appropriate Oracle Label Security policies defined. For more
information, see Oracle Label Security Administrator’s Guide.
• If you plan to integrate an Oracle Label Security policy with a Database Vault policy, then
ensure that the policy name for Oracle Label Security is less than 24 characters. You can
check the names of Oracle Label Security policies by querying the POLICY_NAME column
of the ALL_SA_POLICIES data dictionary view.
12-7
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
12.4.3.1 About Using Oracle Database Vault Factors with Oracle Label Security
Policies
And Oracle Database Vault-Oracle Label Security integration enables you to control
the maximum security clearance for a database session.
Oracle Database Vault controls the maximum security clearance for a database
session by merging the maximum allowable data for each label in a database session
by merging the labels of Oracle Database Vault factors that are associated to an
Oracle Label Security policy.
In brief, a label acts as an identifier for the access privileges of a database table row. A
policy is a name associated with the labels, rules, and authorizations that govern
access to table rows.
See Also:
Oracle Label Security Administrator’s Guide for more information about row
labels and policies
12-8
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
an owner for the realm you plan to use. See About Realm Authorization for more
information.
3. Authorize the schema owner (on which the label security policy has been applied) as
either a realm participant or a realm owner.
4. In the Administration page, under Database Vault Components, click OLS Integration.
12-9
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
Note:
If you do not associate an Oracle Label Security policy with factors, then
Oracle Database Vault maintains the default Oracle Label Security behavior
for the policy.
12-10
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
sqlplus bea_dvacctmgr
Enter password: password
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the current
PDB, run the show con_name command.
2. Create the following local users:
GRANT CREATE SESSION TO mdale IDENTIFIED BY password CONTAINER = CURRENT;
GRANT CREATE SESSION TO jsmith IDENTIFIED BY password CONTAINER = CURRENT;
Follow the guidelines in Oracle Database Security Guide to replace password with a
password that is secure.
3. Connect as a user who can grant system privileges and who has been granted the owner
authorization for the Oracle System Privilege and Role Management realm, and then
grant administrative privileges to users mdale and jsmith.
CONNECT dba_psmith -- Or, CONNECT dba_psmith@hrpdb
Enter password: password
At this stage, users mdale and jsmith have identical administrative privileges.
If user LBACSYS is locked and expired, connect as the Database Vault Account Manager,
unlock and unexpire the LBACSYS account, and then log back in as LBACSYS.
For example:
CONNECT bea_dvacctmgr -- Or, CONNECT bea_dvaccmgr@hrpdb
Enter password: password
CONNECT LBACSYS
Enter password: password
12-11
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
EXEC SA_COMPONENTS.CREATE_LEVEL('PRIVACY',2000,'S','SENSITIVE');
EXEC SA_COMPONENTS.CREATE_LEVEL('PRIVACY',1000,'C','CONFIDENTIAL');
User mdale is granted the more sensitive label, Sensitive, which includes the PII
compartment. User jsmith gets the Confidential label, which is less sensitive.
12.4.4.4 Step 3: Create Oracle Database Vault Rules to Control the OLS
Authorization
After you create the Oracle Label Security policy, you can create Database Vault rules
to work with it.
1. Connect to SQL*Plus as the Database Vault Owner.
For example:
CONNECT leo_dvowner -- Or, CONNECT leo_dvowner@hrpdb
Enter password: password
Ensure that you use single quotes, as shown in this example, and not double
quotes.
4. Add the Check OLS Factor rule to the PII Rule Set.
EXEC DBMS_MACADM.ADD_RULE_TO_RULE_SET('PII Rule Set', 'Check OLS Factor');
12.4.4.5 Step 4: Update the ALTER SYSTEM Command Rule to Use the Rule
Set
Before the rule set can be used, you must update the ALTER SYSTEM command rule,
which is a default command rule.
1. As the Database Vault Owner, check the current value of the ALTER SYSTEM
command rule, which is one of the default command rules when you install Oracle
Database Vault.
SELECT * FROM DBA_DV_COMMAND_RULE WHERE COMMAND = 'ALTER SYSTEM';
2. Make a note of these settings so that you can revert them to their original values
later on.
12-12
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
In a default installation, the ALTER SYSTEM command rule uses the Allow Fine Grained
Control of System Parameters rule set, and is enabled.
3. Update the ALTER SYSTEM command rule to be associated with the PII Rule Set.
EXEC DBMS_MACADM.UPDATE_COMMAND_RULE('ALTER SYSTEM', 'PII Rule Set', '%', '%',
'Y');
This command adds the PII Rule Set to the ALTER SYSTEM command rule, applies it to
all object owners and object names, and enables the command rule.
Make a note of this setting, so that you can revert it to its original setting later on.
3. As user mdale, use the ALTER SYSTEM statement to modify the CPU_COUNT parameter.
ALTER SYSTEM SET CPU_COUNT = 4;
System altered.
Because user mdale was assigned the Sensitive label with the PII compartment, he can
use the ALTER SYSTEM statement to modify the AUDIT_TRAIL system parameter.
4. Set the CPU_COUNT parameter back to its original value.
For example:
ALTER SYSTEM SET CPU_COUNT = 2;
5. Log in as user jsmith and then issue the same ALTER SYSTEM statement:
CONNECT jsmith -- Or, CONNECT jsmith@hrpdb
Enter password: password
Because user jsmith was assigned only the Confidential label, he cannot perform the
ALTER SYSTEM statement.
12-13
Chapter 12
Integrating Oracle Database Vault with Oracle Label Security
1. Connect as the Oracle Label Security administrator and remove the label policy
and its components.
CONNECT LBACSYS -- Or, CONNECT LBACSYS@hrpdb
Enter password: password
2. Connect as the Oracle Database Vault Owner and issue the following commands
in the order shown, to set the ALTER SYSTEM command rule back to its previous
setting and remove the rule set.
For example:
CONNECT leo_dvowner
Enter password: password
3. Connect as the Database Vault Account Manager and remove users mdale and
jsmith.
CONNECT bea_dvacctmgr -- Or, CONNECT bea_dvacctmgr@hrpdb
Enter password: password
Table 12-1 Reports Related to Database Vault and Oracle Label Security
Integration
Report Description
Factor Configuration Issues Report Lists factors in which the Oracle Label Security
policy does not exist.
Identity Configuration Issues Report Lists invalid label identities (the Oracle Label
Security label for this identity has been removed
and no longer exists).
Security Policy Exemption Report Lists accounts and roles that have the EXEMPT
ACCESS POLICY system privilege granted to
them. Accounts that have this privilege can
bypass all Virtual Private Database policy filters
and any Oracle Label Security policies that use
Oracle Virtual Private Database indirectly.
12-14
Chapter 12
Integrating Oracle Database Vault with Oracle Data Guard
Table 12-2 lists data dictionary views that provide information about existing Oracle Label
Security policies used with Oracle Database Vault.
Table 12-2 Data Dictionary Views Used for Oracle Label Security
3. Register (that is, configure and enable) Oracle Database Vault on the primary server.
By default, Oracle Database Vault is installed as part of Oracle Database. You can check
the registration status by querying the DBA_DV_STATUS data dictionary view.
12-15
Chapter 12
Integrating Oracle Database Vault with Oracle Data Guard
4. Log into the database instance as user SYS with the SYSDBA administrative
privilege.
sqlplus sys as sysdba
Enter password: password
6. Run the ALTER SYSTEM statement on each database instance to set the
parameters as shown in Step 5.
7. Restart each database instance.
CONNECT SYS AS SYSOPER
Enter password: password
SHUTDOWN IMMEDIATE
STARTUP
Related Topics
• Getting Started with Oracle Database Vault
Before you can start using Oracle Database Vault, you must register it with the
Oracle database.
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the
current PDB, run the show con_name command.
3. Mount a standby database instance.
ALTER DATABASE MOUNT STANDBY DATABASE;
12-16
Chapter 12
Integrating Oracle Database Vault with Oracle Data Guard
8. If you are using Data Guard Broker, then from the command line, re-enable the
configuration.
dgmgrl sys
Enter password: password
This command applies the changes to the physical standby database made by the Oracle
Database Vault installation on the primary database.
9. Repeat the physical standby installation process on each physical standby database. For
example, if there are three physical standby databases, then run these procedures or
each standby database.
12-17
Chapter 12
Registering Oracle Internet Directory Using Oracle Database Configuration Asssitant
12-18
13
DBA Operations in an
Oracle Database Vault Environment
Database administrators can perform operations in an Oracle Database Vault environment,
such as using Database Vault with products such as Oracle Data Pump.
• Performing DDL Operations in Oracle Database Vault
Data Definition Language (DDL) operations in Oracle Database Vault can be affected by
situations such as schema ownership and patch upgrades.
• Using Oracle Database Vault with Oracle Enterprise Manager
Oracle Database Vault administrators can perform tasks in Oracle Enterprise Manager
Cloud Control such as propagating polices to other databases.
• Using Oracle Data Pump with Oracle Database Vault
Database administrators can authorize Oracle Data Pump users to work in a Database
Vault environment.
• Using Oracle Scheduler with Oracle Database Vault
Users who are responsible for scheduling database jobs must have Oracle Database
Vault-specific authorization.
• Using Information Lifecycle Management with Oracle Database Vault
Users who perform Information Lifecycle Management operations on an Oracle Database
Vault-enabled database must be granted authorization to perform these operations.
• Executing Preprocessor Programs with Oracle Database Vault
Users who execute preprocessor programs through external tables must have Oracle
Database Vault-specific authorization.
• Oracle Recovery Manager and Oracle Database Vault
You can use Recovery Manager (RMAN) in an Oracle Database Vault environment.
• Privileges for Using Oracle Streams with Oracle Database Vault
If you want to use Oracle Streams in an Oracle Database Vault environment, then you
must have the correct privileges.
• Privileges for Using XStream with Oracle Database Vault
If you want to use XStream in an Oracle Database Vault environment, then you must
have the appropriate privileges.
• Privileges for Using Oracle GoldenGate with Oracle Database Vault
If you want to use Oracle GoldenGate in an Oracle Database Vault environment, then
you must have the appropriate privileges.
• Using Data Masking in an Oracle Database Vault Environment
You must have the correct authorization to perform data masking in an Oracle Database
Vault environment.
• Converting a Standalone Oracle Database to a PDB and Plugging It into a CDB
You can convert a standalone Oracle Database Release 12c or later database to a PDB,
and then plug this PDB into a CDB.
13-1
Chapter 13
Performing DDL Operations in Oracle Database Vault
If Oracle Database Vault is upgraded from a previous release older than Oracle
Database 21c, then the default DDL authorization of (%, %) may exist, and it would
enable users to perform DDL operations on any schema without explicit DDL
authorizations. For better security, Oracle recommends that you remove the default
DDL authorization by running DBMS_MACADM.UNAUTHORIZE_DDL('%', '%') and grant
required DDL authorizations only to users who need to perform DDL operations.
13-2
Chapter 13
Using Oracle Database Vault with Oracle Enterprise Manager
Related Topics
• AUTHORIZE_DDL Procedure
The AUTHORIZE_DDL procedure grants a user authorization to execute Data Definition
Language (DDL) statements on the specified schema.
Related Topics
• AUTHORIZE_DDL Procedure
The AUTHORIZE_DDL procedure grants a user authorization to execute Data Definition
Language (DDL) statements on the specified schema.
13-3
Chapter 13
Using Oracle Database Vault with Oracle Enterprise Manager
2. In the Database Vault home page, under Database Vault Policy Propagation,
select Database Vault Policy Propagation.
The Available Policies area in the Policy Propagation subpage lists a summary of
the Oracle Database Vault configurations that were created for the current
database: that is, configurations that were created for realms, command rules, rule
sets, and secure application roles. It does not list the Oracle Database Vault
policies that were introduced in Oracle Database release 12c (12.2). From here,
you can propagate these configurations to another database.
3. Under Available Policies, select each configuration that you want to propagate to
another database.
13-4
Chapter 13
Using Oracle Database Vault with Oracle Enterprise Manager
Any changes made to the seeded realms, command rules, rule sets, and so on will not be
propagated to the destination databases. Only custom-created data are propagated.
• Restore on failure: If the propagation operations encounters errors, then the
propagation is rolled back. That is, the original policies on the destination database
are restored. If you do not select this option, then the policy propagation on the
destination database continues and ignores any errors.
• Skip propagation if user defined policies exist: If the destination databases
already have the user-defined configurations, then the propagation operation is not
attempted. If you do not select this option, then regardless of whether user-defined
policies exist on the destination database, all the existing configurations are cleared,
and the configurations from the source database are applied to the destination
database.
• Propagate Enterprise Manager metric thresholds for database vault metrics: If
the source database has Oracle Database Vault metric thresholds set, then these
thresholds are also propagated to the destination databases. If you do not select this
option, then only configurations are propagated and not the Oracle Database Vault
thresholds.
8. Click the OK button.
9. In the Confirmation window, click OK.
A message indicating success or failure appears. If the propagation succeeds, then the
configurations are active right away in their destination databases.
13.2.2 Enterprise Manager Cloud Control Alerts for Oracle Database Vault
Policies
To view Oracle Database Vault alerts, you must be granted the DV_OWNER, DV_ADMIN, or
DV_SECANALYST role.
13-5
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
Related Topics
• Oracle Database Vault Reports
Oracle Database Vault provides reports that track activities, such as the Database
Vault configuration settings.
In an Oracle Database Vault environment, the DBSNMP user account is granted the
DV_MONITOR role. (The DBSNMP user can change his or her own password directly,
without having to have the DV_MONITOR role revoked first.)
1. Log into the database instance using an account that has been granted the
DV_OWNER role.
2. Revoke the DV_MONITOR role from the DBSNMP user account.
3. Connect as a user who has been granted the DV_ACCTMGR role and then change
the DBSNMP user account password.
4. Connect as the DV_OWNER user and then grant the DV_MONITOR role back to the
DBSNMP user account.
13-6
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
• Authorizing Users for Data Pump Regular Export and Import Operations
You can use different authorization types for administrators who perform Oracle Data
Pump export and import operations in a Database Vault environment.
• Authorizing Users for Data Pump Transportable Export and Import Operations
You can grant authorization levels for users who must perform Oracle Data Pump
transportable operations.
• Guidelines for Exporting or Importing Data in a Database Vault Environment
After you grant the Oracle Data Pump database administrator the proper authorization,
this user can perform any export or import operations that are necessary.
13.3.1 About Using Oracle Data Pump with Oracle Database Vault
Database administrators who use Oracle Data Pump in an Database Vault environment must
have Database Vault-specific authorization to export and import data.
They must have these privileges in addition to the standard Oracle Data Pump privileges. If
these users want to perform Oracle Data Pump transportable tablespace operations, then
they must have special authorization. You can check a user's authorizations for using Data
Pump in an Oracle Database Vault environment by querying the DBA_DV_DATAPUMP_AUTH data
dictionary view.
See Also:
• Oracle Database Utilities for detailed information about Oracle Data Pump
• Oracle Database Administrator’s Guide for more information about
transportable tablespaces
• DBA_DV_DATAPUMP_AUTH View
13.3.2 Authorizing Users for Data Pump Regular Export and Import
Operations
You can use different authorization types for administrators who perform Oracle Data Pump
export and import operations in a Database Vault environment.
• About Authorizing Users for Oracle Data Pump Regular Operations
Users who have Oracle Data Pump authorization can perform regular Oracle Data Pump
operations in a Database Vault environment.
• Levels of Database Vault Authorization for Oracle Data Pump Regular Operations
Oracle Database Vault provides several levels of authorization required for Oracle Data
Pump regular operations in a Database Vault environment.
• Authorizing Users for Oracle Data Pump Regular Operations in Database Vault
You can authorize a database administrator to use Data Pump for regular operations in
an Oracle Database Vault environment.
• Revoking Oracle Data Pump Authorization from Users
You can revoke authorization from the database administrator who is using Oracle Data
Pump for regular operations.
13-7
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
13.3.2.1 About Authorizing Users for Oracle Data Pump Regular Operations
Users who have Oracle Data Pump authorization can perform regular Oracle Data
Pump operations in a Database Vault environment.
Full level Data Pump authorization enables these users to perform transportable
export and import operations as well.
See Also:
Authorizing Users for Data Pump Transportable Export and Import
Operations if you want the user only to perform transportable export and
import operations
13.3.2.2 Levels of Database Vault Authorization for Oracle Data Pump Regular
Operations
Oracle Database Vault provides several levels of authorization required for Oracle
Data Pump regular operations in a Database Vault environment.
Table 13-1 describes these levels.
Table 13-1 Levels of Authorization for Oracle Data Pump Regular Operations
1 The BECOME USER privilege is part of the IMP_FULL_DATABASE role by default, but in an Oracle
Database Vault environment, this privilege is revoked.
13-8
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
13.3.2.3 Authorizing Users for Oracle Data Pump Regular Operations in Database
Vault
You can authorize a database administrator to use Data Pump for regular operations in an
Oracle Database Vault environment.
1. Log into the database instance as a user who has been granted the DV_OWNER or
DV_ADMIN role.
2. Ensure that the user to whom you want to grant authorization has been granted the
EXP_FULL_DATABASE and IMP_FULL_DATABASE roles, which are required for using Oracle
Data Pump.
SELECT GRANTEE, GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE LIKE '%FULL%';
3. Grant this user Oracle Database Vault authorization for Oracle Data Pump regular
operations.
For example, to authorize the Data Pump user DP_MGR to export and import objects for
the database table EMPLOYEES:
EXEC DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('DP_MGR', 'HR', 'EMPLOYEES');
To restrict DP_MGR's activities to a specific schema, you would enter the following
procedure:
EXEC DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('DP_MGR', 'HR');
To authorize the Data Pump user DP_MGR to export and import objects for the entire
database, enter the following:
EXEC DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('DP_MGR');
After you run the DBMS_MACADM.AUTHORIZE_DATAPUMP_USER procedure, you can check the
user's authorization by querying the DBA_DV_DATAPUMP_AUTH data dictionary view.
4. If the user must export the entire database, then grant the user the DV_OWNER role.
GRANT DV_OWNER TO DP_MGR;
Related Topics
• AUTHORIZE_DATAPUMP_USER Procedure
The AUTHORIZE_DATAPUMP_USER procedure authorizes a user to perform Oracle Data
Pump operations when Oracle Database Vault is enabled.
• DBA_DV_DATAPUMP_AUTH View
The DBA_DV_DATAPUMP_AUTH data dictionary view lists the authorizations for using Oracle
Data Pump in an Oracle Database Vault environment.
13-9
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
2. Query the DBA_DV_DATAPUMP_AUTH data dictionary view to find the users who have
been granted Oracle Data Pump authorizations.
SELECT GRANTEE, SCHEMA, OBJECT FROM DBA_DV_DATAPUMP_AUTH;
3. Use the information you gathered from the preceding step to build the
DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER command.
For example:
EXEC DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER('DP_MGR', 'HR', 'EMPLOYEES');
Related Topics
• UNAUTHORIZE_DATAPUMP_USER Procedure
The UNAUTHORIZE_DATAPUMP_USER procedure revokes the authorization that was
granted by the AUTHORIZE_DATAPUMP_USER procedure.
• DBA_DV_DATAPUMP_AUTH View
The DBA_DV_DATAPUMP_AUTH data dictionary view lists the authorizations for using
Oracle Data Pump in an Oracle Database Vault environment.
13-10
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
If you want users to only have the authorization to perform transportable export and import
operations, then you must grant users the correct authorization, based on their tasks.
See Also:
Authorizing Users for Data Pump Regular Export and Import Operations if your
users must have Oracle Data Pump authorization to perform regular operations in a
Database Vault environment
Table 13-2 Levels of Authorization for Oracle Data Pump Transporatable Operations
13-11
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
Table 13-2 (Cont.) Levels of Authorization for Oracle Data Pump Transporatable Operations
13-12
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
4. If the user must have Database Vault-specific transportable tablespace authorization only,
then grant this user this authorization.
For example:
EXEC DBMS_MACADM.AUTHORIZE_TTS_USER('DP_MGR', 'HR_TS');
5. If the user who wants to perform a transportable import operation wants to use a network
link to perform the operation, then grant this user the DV_DATAPUMP_NETWORK_LINK role.
For example:
GRANT DV_DATAPUMP_NETWORK_LINK TO DP_MGR;
6. If the user wants to transportable export or use a network link to transportable import the
entire database, then grant this user the DV_OWNER role.
GRANT DV_OWNER TO DP_MGR;
Related Topics
• AUTHORIZE_TTS_USER Procedure
The AUTHORIZE_TTS_USER procedure authorizes a user to perform Oracle Data Pump
transportable tablespace operations for a tablespace when Oracle Database Vault is
enabled.
• AUTHORIZE_DATAPUMP_USER Procedure
The AUTHORIZE_DATAPUMP_USER procedure authorizes a user to perform Oracle Data
Pump operations when Oracle Database Vault is enabled.
• DV_DATAPUMP_NETWORK_LINK Data Pump Network Link Role
The DV_DATAPUMP_NETWORK_LINK role is used for Data Pump import operations.
2. Query the DBA_DV_TTS_AUTH data dictionary view to find the users who have been granted
Oracle Data Pump authorizations.
SELECT GRANTEE, TSNAME FROM DBA_DV_TTS_AUTH;
3. Use the information you gathered from the preceding step to build the
DBMS_MACADM.UNAUTHORIZE_TTS_USER statement.
For example:
EXEC DBMS_MACADM.UNUTHORIZE_TTS_USER('DP_MGR', 'HR_TS');
4. If the user had transportable exported or used a network link to transportable import the
contents of an entire database, then revoke the full database level Oracle Data Pump
authorization.
For example:
13-13
Chapter 13
Using Oracle Data Pump with Oracle Database Vault
EXEC DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER('DP_MGR');
5. If the user who had performed a transportable import operation used a network
link to perform the operation, then revoke the DV_DATAPUMP_NETWORK_LINK role
from this user.
For example:
REVOKE DV_DATAPUMP_NETWORK_LINK FROM DP_MGR;
Related Topics
• UNAUTHORIZE_TTS_USER Procedure
The UNAUTHORIZE_TTS_USER procedure removes from authorization users who had
previously been granted the authorization to perform Oracle Data Pump
transportable tablespace operations.
• UNAUTHORIZE_DATAPUMP_USER Procedure
The UNAUTHORIZE_DATAPUMP_USER procedure revokes the authorization that was
granted by the AUTHORIZE_DATAPUMP_USER procedure.
• DV_DATAPUMP_NETWORK_LINK Data Pump Network Link Role
The DV_DATAPUMP_NETWORK_LINK role is used for Data Pump import operations.
13-14
Chapter 13
Using Oracle Scheduler with Oracle Database Vault
See Also:
Oracle Database Utilities for detailed information about Oracle Data Pump
13-15
Chapter 13
Using Oracle Scheduler with Oracle Database Vault
Database Vault realm or command rule protected object, then you must grant this
user Database Vault-specific authorization by using the
DBMS_MACADM.AUTHORIZE_SCHEDULER_USER procedure. This authorization applies to
both background and foreground jobs. For background jobs, the authorization
applies to the last user who created or modified the job. In addition, ensure that
the schema owner (the protected schema in which the job is created) authorized to
the realm.
Later on, you can revoke this authorization by using the
DBMS_MACADM.UNAUTHORIZE_SCHEDULER_USER procedure. If the schema is not
protected by a realm, then you do not need to run the
DBMS_MACADM.AUTHORIZE_SCHEDULER_USER procedure for the user.
Related Topics
• About Realm Authorization
Realm authorizations establish the set of database accounts and roles that
manage or access objects protected in realms.
4. Ensure that the user has been authorized by querying the DBA_DV_JOB_AUTH data
dictionary view as follows:
SELECT GRANTEE,SCHEMA FROM DBA_DV_JOB_AUTH WHERE GRANTEE = 'user_name';
13-16
Chapter 13
Using Information Lifecycle Management with Oracle Database Vault
Related Topics
• AUTHORIZE_SCHEDULER_USER Procedure
The AUTHORIZE_SCHEDULER_USER procedure grants a user authorization to schedule
database jobs when Oracle Database Vault is enabled.
• DBA_DV_JOB_AUTH View
The DBA_DV_JOB_AUTH data dictionary view lists the authorizations for using Oracle
Scheduler in an Oracle Database Vault environment.
2. Use the information you gathered from the preceding step to build the
DBMS_MACADM.UNAUTHORIZE_SCHEDULER_USER command.
For example:
EXEC DBMS_MACADM.UNAUTHORIZE_SCHEDULER_USER('JOB_MGR');
Ensure that this unauthorization complements the original authorization action. In other
words, if you originally gave job_mgr authorization over the entire database, then the
following command will not work:
EXEC DBMS_MACADM.UNAUTHORIZE_SCHEDULER_USER('JOB_MGR', 'HR');
Related Topics
• UNAUTHORIZE_SCHEDULER_USER Procedure
The UNAUTHORIZE_SCHEDULER_USER procedure revokes the authorization that was granted
by the AUTHORIZE_SCHEDULER_USER procedure.
13-17
Chapter 13
Using Information Lifecycle Management with Oracle Database Vault
If you wanted to grant user psmith ILM authorizations for the entire database, you
would enter a procedure similar to the following:
EXEC DBMS_MACADM.AUTHORIZE_MAINTENANCE_USER ('PSMITH', '%', '%', '%', '%');
Related Topics
• AUTHORIZE_MAINTENANCE_USER Procedure
The AUTHORIZE_MAINTENANCE_USER procedure grants a user authorization to
perform Information Lifecycle Management (ILM) operations in an Oracle
Database Vault environment.
13-18
Chapter 13
Executing Preprocessor Programs with Oracle Database Vault
• DBA_DV_MAINTENANCE_AUTH View
The DBA_DV_MAINTENANCE_AUTH data dictionary view provides information about the
configuration of Oracle Database Vault authorizations to use Information Life
Management (ILM) features.
Related Topics
• DBA_DV_MAINTENANCE_AUTH View
The DBA_DV_MAINTENANCE_AUTH data dictionary view provides information about the
configuration of Oracle Database Vault authorizations to use Information Life
Management (ILM) features.
• UNAUTHORIZE_MAINTENANCE_USER Procedure
The UNAUTHORIZE_MAINTENANCE_USER procedure revokes privileges from users who have
been granted authorization to perform Information Lifecycle Management (ILM)
operations in an Oracle Database Vault environment.
13-19
Chapter 13
Oracle Recovery Manager and Oracle Database Vault
3. Query the DBA_DV_PREPROCESSOR_AUTH data dictionary view to ensure that the user
is no longer authorized.
13-20
Chapter 13
Privileges for Using Oracle Streams with Oracle Database Vault
The functionality of RMAN with Oracle Database Vault is almost the same as its functionality
in a standard Oracle Database environment. However, be aware that the RMAN recover table
and table partitions features do not work with realm-protected tables when you attempt an
export operation. To perform an export operation, you must perform a full table recovery and
then have a Database Vault authorized user perform the export of the real-protected
protected table.
Be aware that the RMAN recover table and table partitions features do not work with realm-
protected tables when you attempt to recover the table. To recover the table, you must
perform a full database recovery and then have a Database Vault authorized user perform the
export of the realm-protected table to import into the existing database.
Related Topics
• Oracle Database Backup and Recovery User’s Guide
• Oracle Database Backup and Recovery Reference
Related Topics
• DV_STREAMS_ADMIN Oracle Streams Configuration Role
The DV_STREAMS_ADMIN role is used with Oracle Streams.
• ADD_AUTH_TO_REALM Procedure
The ADD_AUTH_TO_REALM procedure authorizes a user or role to access a realm as an
owner or a participant. In a multitenant environment, you can authenticate both common
and local realms.
13-21
Chapter 13
Privileges for Using Oracle GoldenGate with Oracle Database Vault
Related Topics
• DV_XSTREAM_ADMIN XStream Administrative Role
The DV_XSTREAM_ADMIN role is used for Oracle XStream.
• ADD_AUTH_TO_REALM Procedure
The ADD_AUTH_TO_REALM procedure authorizes a user or role to access a realm as
an owner or a participant. In a multitenant environment, you can authenticate both
common and local realms.
• The user must be granted the DV_ACCTMGR role before this user can create users
on the replicated side.
• The user must perform extract operations in triggerless mode before attempting to
perform procedural replication.
• Before users can apply changes to any tables that are protected by a realm, they
must be authorized to have access to that realm. For example:
EXEC DBMS_MACADM.ADD_AUTH_TO_REALM('realm_name','username');
• The SYS user must be authorized to perform Data Definition Language (DDL)
operations in the SYSTEM schema, as follows:
EXECUTE DVSYS.DBMS_MACADM.AUTHORIZE_DDL('SYS', 'SYSTEM');
13-22
Chapter 13
Using Data Masking in an Oracle Database Vault Environment
Note:
Oracle GoldenGate queries, updates, and manages objects in the SYS, SYSTEM and
GoldenGate-related schemas. If any of the schemas are protected by an Oracle
Database Vault realm, then the GoldenGate Extract operation can fail. Oracle
Database Vault protects dictionary related objects with the Oracle Default
Component Protection Realm and recommends that you do not protect default
schemas, such as SYS and SYSTEM, with any custom Oracle Database Vault realms
or custom Oracle Database Vault command rules.
Related Topics
• DV_GOLDENGATE_ADMIN GoldenGate Administrative Role
The DV_GOLDENGATE_ADMIN role is used with Oracle GoldenGate.
• DV_GOLDENGATE_REDO_ACCESS GoldenGate Redo Log Role
The DV_GOLDENGATE_REDO_ACCESS role is used with Oracle GoldenGate.
• ADD_AUTH_TO_REALM Procedure
The ADD_AUTH_TO_REALM procedure authorizes a user or role to access a realm as an
owner or a participant. In a multitenant environment, you can authenticate both common
and local realms.
13-23
Chapter 13
Using Data Masking in an Oracle Database Vault Environment
Vault, users must have additional privileges. This section describes three ways that
you can use to enable users to mask data in Database Vault-protected objects.
If users do not have the correct privileges, then the following errors can occur while
creating the masking definition or when the job is executing:
ORA-47400: Command Rule violation for string on string
13-24
Chapter 13
Using Data Masking in an Oracle Database Vault Environment
The following example shows how to grant user DBA_JSMITH authorization for the
HR.EMPLOYEES table, which is protected by a realm called Business Apps Realm:
BEGIN
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name => 'Business Apps Realm',
grantee => 'DBA_JSMITH',
auth_options => DBMS_MACUTL.G_REALM_AUTH_PARTICIPANT;
END;
/
13-25
Chapter 13
Converting a Standalone Oracle Database to a PDB and Plugging It into a CDB
sqlplus c##sec_admin
Enter password: password
3. In the root, connect as user SYS with the SYSOPER system privilege.
For example:
SHUTDOWN IMMEDIATE
STARTUP MOUNT
ALTER DATABASE OPEN READ ONLY
5. Connect to the Database Vault-enabled database as a user who has the DV_OWNER
role.
For example:
CONNECT sec_admin@pdb_name
13-26
Chapter 13
Converting a Standalone Oracle Database to a PDB and Plugging It into a CDB
SET SERVEROUTPUT ON
DECLARE
compatible CONSTANT VARCHAR2(3) :=
CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
pdb_descr_file => '/disk1/usr/dv_db_pdb.xml',
store_report => TRUE)
WHEN TRUE THEN 'YES'
ELSE 'NO'
END;
BEGIN
DBMS_OUTPUT.PUT_LINE(compatible);
END;
/
If the output is YES, then the PDB is compatible, and you can continue with the next step.
If the output is NO, then the PDB is not compatible. You can check the
PDB_PLUG_IN_VIOLATIONS temporary table to see why it is not compatible.
8. Create an XML file that describes the PDB.
For example:
BEGIN
DBMS_PDB.DESCRIBE(
pdb_descr_file => '/disk1/oracle/dv_db.xml');
END;
/
9. Run the CREATE PLUGGABLE DATABASE statement, and specify the XML file in the USING
clause. Specify other clauses when they are required.
For example:
13-27
Chapter 13
Using the ORADEBUG Utility with Oracle Database Vault
10. Connect to the PDB that you just created as user SYS with the SYSDBA
administrative privilege.
@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
EXECUTE DBMS_PDB.SYNC_PDB;
14. Connect to the root as a user who has been granted the DV_OWNER role.
sqlplus c##sec_admin
Enter password: password
15. Revoke the DV_PATCH_ADMIN role from user SYS with CONTAINER = CURRENT.
16. Connect to the legacy Database Vault-enabled database as user SYS with the
SYSOPER system privilege.
For example:
SHUTDOWN IMMMEDIATE
STARUP
13-28
Chapter 13
Performing Patch Operations in an Oracle Database Vault Environment
unified auditing environment, ORADBUG commands are mandatorily audited. This control does
not apply to a privileged OS user, which is the OS user with the same OS user ID as the
Oracle server process. This exception is made because such a user can completely control
and examine the Oracle process using other means (for example, with a debugger).
1. Log into the database instance as a user who has been granted the DV_OWNER or
DV_ADMIN role.
2. If necessary, find out if ORADEBUG is already disabled or enabled.
SELECT * FROM DBA_DV_ORADEBUG;
Related Topics
• DBA_DV_ORADEBUG View
The DBA_DV_ORADEBUG data dictionary view indicates whether users can use the ORADEBUG
utility in an Oracle Database Vault environment.
• DISABLE_ORADEBUG Procedure
The DISABLE_ORADEBUG procedure disables the use of the ORADEBUG utility in an Oracle
Database Vault environment.
• ENABLE_ORADEBUG Procedure
The ENABLE_ORADEBUG procedure enables the use of the ORADEBUG utility in an Oracle
Database Vault environment.
In a multitenant environment, you must log in to the appropriate PDB. For example:
CONNECT sec_admin@pdb_name
Enter password: password
To find the available PDBs, query the PDB_NAME column of the DBA_PDBS data dictionary
view. To check the current container, run the show con_name command
2. Temporarily grant the SYS user the DV_PATCH_ADMIN role.
GRANT DV_PATCH_ADMIN TO SYS;
13-29
Chapter 13
Performing Patch Operations in an Oracle Database Vault Environment
3. After the SYS user has performed the patch operation, carefully following the
instructions in the patch readme file, then revoke DV_PATCH_ADMIN from user SYS.
REVOKE DV_PATCH_ADMIN FROM SYS;
13-30
14
Oracle Database Vault Schemas, Roles,
and Accounts
Oracle Database Vault provides schemas that contain Database Vault objects, roles that
provide separation of duty for specific tasks, and default user accounts.
• Oracle Database Vault Schemas
The Oracle Database Vault schemas, DVSYS and DVF, support the administration and run-
time processing of Oracle Database Vault.
• Oracle Database Vault Roles
Oracle Database Vault provides default roles that are based on specific user tasks and
adhere to separation of duty concepts.
• Oracle Database Vault Accounts Created During Registration
You must create accounts for the Oracle Database Vault Owner and Oracle Database
Vault Account Manager during the registration process.
• Backup Oracle Database Vault Accounts
As a best practice, you should maintain backup accounts for the DV_OWNER and
DV_ACCTMGR roles.
These objects store Oracle Database Vault configuration information and support the
administration and run-time processing of Oracle Database Vault.
In a default installation, the DVSYS schema is locked. The DVSYS schema also owns the
AUDIT_TRAIL$ table.
14-1
Chapter 14
Oracle Database Vault Schemas
Oracle Database Vault secures the DVSYS schema by using a protected schema
design. A protected schema design guards the schema against improper use of
system privileges (for example, SELECT ANY TABLE, CREATE ANY VIEW, or DROP ANY).
Oracle Database Vault protects and secures the DVSYS schema in the following ways:
• The DVSYS protected schema and its administrative roles cannot be dropped. By
default, the DVSYS account is locked.
• By default, users cannot directly log into the DVSYS account. To control the ability of
users to directly log into this account, you can run the
DBMS_MACADM.DISABLE_DV_DICTIONARY_ACCTS procedure to prevent users from
logging in and the DBMS_MACADM.ENABLE_DV_DICTIONARY_ACCTS procedure to allow
users to log in.
• Statements such as CREATE USER, ALTER USER, DROP USER, CREATE PROFILE, ALTER
PROFILE, and DROP PROFILE can only be issued by a user with the DV_ACCTMGR
role. A user logged in with the SYSDBA administrative privilege can issue these
statements only if it is allowed to do so by modifying the Can Maintain Accounts/
Profiles rule set.
• The powerful ANY system privileges for database definition language (DDL) and
data manipulation language (DML) commands are blocked in the protected
schema. This means that the objects in the DVSYS schema must be created by the
schema account itself. Also, access to the schema objects must be authorized
through object privilege grants.
• Object privileges in the DVSYS schema can only be granted to Database Vault
administrative roles in the schema. This means that users can access the
protected schema only through predefined administrative roles.
• Only the protected schema account DVSYS can issue ALTER ROLE statements on
Database Vault predefined administrative roles of the schema. Oracle Database
Vault Roles describes Oracle Database Vault predefined administrative roles in
detail.
• The SYS.DBMS_SYS_SQL.PARSE_AS_USER procedure cannot be used to run SQL
statements on behalf of the protected schema DVSYS.
Note:
Database users can grant additional object privileges and roles to the Oracle
Database Vault administrative roles (DV_ADMIN and DV_OWNER, for example)
provided they have sufficient privileges to do so.
14-2
Chapter 14
Oracle Database Vault Roles
In a multitenant environment, the DVF user cannot switch to other containers using the ALTER
SESSION statement.
By default, users cannot directly log into the DVF account. To control the ability of users to
directly log into this account, you can run the DBMS_MACADM.DISABLE_DV_DICTIONARY_ACCTS
procedure to prevent users from logging in and the
DBMS_MACADM.ENABLE_DV_DICTIONARY_ACCTS procedure to allow users to log in.
14-3
Chapter 14
Oracle Database Vault Roles
14-4
Chapter 14
Oracle Database Vault Roles
Note:
You can grant additional object privileges and roles to the Oracle Database Vault
roles to extend their scope of privileges. For example, a user logged in with the
SYSDBA administrative privilege can grant object privileges to an Oracle Database
Vault role as long as the object is not in the DVSYS schema or realm.
See Also:
14-5
Chapter 14
Oracle Database Vault Roles
• DV_AUDIT_CLEANUP (on some Database Vault tables and views; can perform
SELECT statements on the AUDIT_TRAIL$ table, and the DV$ENFORCEMENT_AUDIT
and DV$CONFIGURATION_AUDIT views)
• DV_MONITOR
• DV_OWNER
• DV_POLICY_OWNER (on some DBMS_MACADM procedures and on POLICY_OWNER* views
only)
• DV_SECANALYST (on some Database Vault views: DV_SECANALYST can query DVSYS
schema objects through Oracle Database Vault-supplied views)
Roles that are denied this privilege:
• DV_ACCTMGR
• DV_PUBLIC
• DV_REALM_OWNER
• DV_REALM_RESOURCE
14-6
Chapter 14
Oracle Database Vault Roles
• DV_MONITOR
• DV_OWNER
• DV_POLICY_OWNER
• DV_PUBLIC
• DV_SECANALYST
• DV_REALM_OWNER
• DV_REALM_RESOURCE
14-7
Chapter 14
Oracle Database Vault Roles
14-8
Chapter 14
Oracle Database Vault Roles
• DV_ADMIN
• DV_AUDIT_CLEANUP
• DV_POLICY_OWNER
• DV_PUBLIC
• DV_REALM_OWNER
• DV_REALM_RESOURCE
14-9
Chapter 14
Oracle Database Vault Roles
14-10
Chapter 14
Oracle Database Vault Roles
1. From Cloud Control, log into Oracle Database Vault Administrator as a user who has
been granted the DV_OWNER role and the SELECT ANY DICTIONARY privilege..
Logging into Oracle Database Vault explains how to log in.
Refer to the role descriptions to find the requirements for who can grant roles to other
users.
2. In the Administration page, under Database Vault Components, click Database Vault
Role Management.
The Database Vault Role Management page appears.
14-11
Chapter 14
Oracle Database Vault Roles
• To grant different roles or modify role grants for a user or role listed in the
Database Vault Role Management page, select the user or role, click Edit, and
then modify the role grants as necessary. Then click OK.
This role also provides privileges for monitoring Oracle Database Vault. It is created
when you install Oracle Database Vault, and has the most privileges on the DVSYS
schema. It also has the DV_ADMIN role.
To find the full list of system and object privileges associated with the DV_OWNER role,
you can log into the database instance and enter the following queries:
SELECT TABLE_NAME, OWNER, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE =
'DV_OWNER';
SELECT PRIVILEGE FROM DBA_SYS_PRIVS WHERE GRANTEE = 'DV_OWNER';
When you install and register Oracle Database Vault, the DV_OWNER account is created.
The user who is granted this role is also granted the ADMIN option and can grant any
14-12
Chapter 14
Oracle Database Vault Roles
Oracle Database Vault roles (except DV_ACCTMGR) to any account. Users granted this role also
can run Oracle Database Vault reports and monitor Oracle Database Vault.
Tip:
Oracle strongly recommends that you create separate, named account for the
DV_OWNER user. This way, if the user is no longer available (for example, he or she
left the company), then you can easily recreate this user account and then grant this
user the DV_OWNER role.
The account granted this role can revoke any granted Database Vault role from another
account. Accounts such as SYS or SYSTEM, with the GRANT ANY ROLE system privilege alone
(directly granted or indirectly granted using a role) do not have the right to grant or revoke the
DV_OWNER role to or from any other database account. Note also that a user with the DV_OWNER
role cannot grant or revoke the DV_ACCTMGR role.
Managing Password Changes for Users Who Have the DV_OWNER Role
Before you can change the password for another user who has been granted the DV_OWNER
role, you must revoke the DV_OWNER role from that user account.
However, be cautious about revoking the DV_OWNER role. At least one user on your site must
have this role granted. If another DV_OWNER user has been granted this role and needs to have
his or her password changed, then you can temporarily revoke DV_OWNER from that user. Note
also that if you have been granted the DV_OWNER role, then you can change your own
password without having to revoke the role from yourself.
To change the DV_OWNER user password:
1. Log into the database instance using an account that has been granted the DV_OWNER
role.
2. Revoke the DV_OWNER role from the user account whose password needs to change.
3. Connect as a user who has been granted the DV_ACCTMGR role and then change the
password for this user.
4. Connect as the DV_OWNER user and then grant the DV_OWNER role back to the user whose
password you changed.
14-13
Chapter 14
Oracle Database Vault Roles
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for
activities such as installing Oracle Database optional products or features.
These packages are the underlying interface for the Database Vault Administrator user
interface in Oracle Enterprise Manager Cloud Control.
DV_ADMIN also has the capabilities provided by the DV_SECANALYST role, which allow
the user to run Oracle Database Vault reports and monitor Oracle Database Vault.
During installation, the DV_ADMIN role is granted to the DV_OWNER role with the ADMIN
OPTION.
In addition, the DV_ADMIN role provides the SELECT privilege on the DBA_DV_POLICY,
DBA_DV_POLICY_OWNER, and DBA_DV_POLICY_OBJECT data dictionary views.
To find the full list of system and object privileges associated with the DV_ADMIN role,
log into the database instance with sufficient privileges and then enter the following
queries:
SELECT TABLE_NAME, OWNER, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE =
'DV_ADMIN';
SELECT PRIVILEGE FROM DBA_SYS_PRIVS WHERE GRANTEE = 'DV_ADMIN';
The user with the DV_OWNER role can grant or revoke this role to and from any database
account.
Managing Password Changes for Users Who Have the DV_ADMIN Role
Before you can change the password for a user who has been granted the DV_ADMIN
role, you must revoke the DV_ADMIN role from this account.
If you have been granted the DV_ADMIN role, then you can change your own password
without having to revoke the role from yourself.
To change the DV_ADMIN user password:
1. Log into the database instance using an account that has been granted the
DV_OWNER role.
2. Revoke the DV_ADMIN role from the user account whose password needs to
change.
14-14
Chapter 14
Oracle Database Vault Roles
3. Connect as a user who has been granted the DV_ACCTMGR role and then change the
password for this user.
4. Connect as the DV_OWNER user and then grant the DV_ADMIN role back to the user whose
password you changed.
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
The DV_MONITOR role enables the Oracle Enterprise Manager Cloud Control agent to monitor
Oracle Database Vault for attempted violations and configuration issues with realm or
command rule definitions.
This role enables Cloud Control to read and propagate realm definitions and command rule
definitions between databases.
In addition, the DV_MONITOR role provides the SELECT privilege on the DBA_DV_POLICY,
DBA_DV_POLICY_OWNER, and DBA_DV_POLICY_OBJECT data dictionary views.
To find the full list of DV_MONITOR object privileges, log into the database instance with
sufficient (such as DV_OWNER) privileges and then enter the following query:
SELECT TABLE_NAME, OWNER, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE = 'DV_MONITOR';
Only a user who has been granted the DV_OWNER role can grant or revoke the DV_MONITOR role
to another user.
14-15
Chapter 14
Oracle Database Vault Roles
Related Topics
• Monitoring Oracle Database Vault
You can monitor Oracle Database Vault by checking for violations to the Database
Vault configurations and by tracking changes to policies.
• Auditing Oracle Database Vault
You can audit activities in Oracle Database Vault, such as changes to policy
configurations.
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for
activities such as installing Oracle Database optional products or features.
Use the DV_SECANALYST role to run Oracle Database Vault reports and monitor Oracle
Database Vault.
This role is also used for database-related reports. In addition, this role enables you to
check the DVSYS configuration by querying the DVSYS views described in Oracle
Database Vault Data Dictionary Views.
14-16
Chapter 14
Oracle Database Vault Roles
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
Note:
This feature has been updated in Oracle Database 12c release 1 (12.1.0.2).
Grant the DV_AUDIT_CLEANUP role to any user who is responsible for purging the Database
Vault audit trail in a non-unified auditing environment.
Archiving and Purging the Oracle Database Vault Audit Trail explains how to use this role to
complete a purge operation.
Only a user who has been granted the DV_OWNER role can grant or revoke the
DV_AUDIT_CLEANUP role to another user.
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
14-17
Chapter 14
Oracle Database Vault Roles
To find the full list of DV_DATAPUMP_NETWORK_LINK object privileges, log into the
database instance with sufficient privileges and then enter the following query:
SELECT TABLE_NAME, OWNER, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE =
'DV_DATAPUMP_NETWORK_LINK';
Be aware that the DV_DATAPUMP_NETWORK_LINK role does not provide a sufficient set of
database privileges to conduct NETWORK_LINK transportable Data Pump import
operation. Rather, the DV_DATAPUMP_NETWORK_LINK role is an additional requirement
(that is, in addition to the privileges that Oracle Data Pump currently requires) for
database administrators to conduct NETWORK_LINK transportable Data Pump import
operations in an Oracle Database Vault environment.
Grant the DV_STREAMS_ADMIN role to any user who is responsible for configuring Oracle
Streams in an Oracle Database Vault environment.
14-18
Chapter 14
Oracle Database Vault Roles
To find the full list of DV_STREAMS_ADMIN object privileges, log into the database instance with
sufficient privileges and then enter the following query:
SELECT TABLE_NAME, OWNER, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE =
'DV_STREAMS_ADMIN';
Be aware that the DV_STREAMS_ADMIN role does not provide a sufficient set of database
privileges for configuring Oracle Streams. Rather, the DV_STREAMS_ADMIN role is an additional
requirement (that is, in addition to the privileges that Oracle Streams currently requires) for
database administrators to configure Oracle Streams in an Oracle Database Vault
environment.
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
Grant the DV_XSTREAM_ADMIN role to any user who is responsible for configuring Oracle
XStream in an Oracle Database Vault environment.
This enables the management of XStream processes to be tightly controlled by Database
Vault, but does not change or restrict the way an administrator would normally configure
XStream.
Be aware that the DV_XSTREAM_ADMIN role does not provide a sufficient set of database
privileges for configuring XStream. Rather, the DV_XSTREAM_ADMIN role is an additional
14-19
Chapter 14
Oracle Database Vault Roles
requirement (that is, in addition to the privileges that XStream currently requires) for
database administrators to configure XStream in an Oracle Database Vault
environment.
Grant theto any user who is responsible for configuring Oracle GoldenGate in an
Oracle Database Vault environment.
This enables the management of Oracle GoldenGate processes to be tightly controlled
by Database Vault, but does not change or restrict the way an administrator would
normally configure Oracle GoldenGate.
Be aware that the DV_GOLDENGATE_ADMIN role does not provide a sufficient set of
database privileges for configuring Oracle GoldenGate. Rather, the
DV_GOLDENGATE_ADMIN role is an additional requirement (that is, in addition to the
privileges that Oracle GoldenGate currently requires) for database administrators to
configure Oracle GoldenGate in an Oracle Database Vault environment.
14-20
Chapter 14
Oracle Database Vault Roles
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
• Privileges for Using Oracle GoldenGate with Oracle Database Vault
If you want to use Oracle GoldenGate in an Oracle Database Vault environment, then
you must have the appropriate privileges.
Grant the DV_GOLDENGATE_REDO_ACCESS role to any user who is responsible for using the
Oracle GoldenGate TRANLOGOPTIONS DBLOGREADER method to access redo logs in an Oracle
Database Vault environment.
This enables the management of Oracle GoldenGate processes to be tightly controlled by
Database Vault, but does not change or restrict the way an administrator would normally
configure Oracle GoldenGate.
Be aware that the DV_GOLDENGATE_REDO_ACCESS role does not provide a sufficient set of
database privileges for configuring Oracle GoldenGate. Rather, the
DV_GOLDENGATE_REDO_ACCESS role is an additional requirement (that is, in addition to the
privileges that Oracle GoldenGate currently requires) for database administrators to configure
Oracle Streams in an Oracle Database Vault environment.
Only users who have been granted the DV_OWNER role can grant or revoke the
DV_GOLDENGATE_REDO_ACCESS role to or from other users.
14-21
Chapter 14
Oracle Database Vault Roles
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for
activities such as installing Oracle Database optional products or features.
• Privileges for Using Oracle GoldenGate with Oracle Database Vault
If you want to use Oracle GoldenGate in an Oracle Database Vault environment,
then you must have the appropriate privileges.
In order to generate all Database Vault-related audit records in accordance with the
audit policies specified in the Database Vault metadata as well as Database Vault
unified audit policies, execute the DBMS_MACADM.ENABLE_DV_PATCH_ADMIN_AUDIT
procedure as a user who has been granted the DV_ADMIN role before using the
DV_PATCH_ADMIN role.
The DV_PATCH_ADMIN role a special Database Vault role that does not have any object
or system privilege. It is designed to allow the database administrator or the user SYS
to patch Database Vault enabled databases (for example, applying a database patch
without disabling Database Vault). It also enables the database administrator to create
users, because some patches may require the need to create new schemas.
14-22
Chapter 14
Oracle Database Vault Roles
See Also:
• Oracle Database Security Guide for information about creating unified audit
policies
• Disabling and Enabling Oracle Database Vault
Use the DV_ACCTMGR role to create and maintain database accounts and database profiles. In
this manual, the example DV_ACCTMGR role is assigned to a user named bea_dvacctmgr.
This user also can grant the CREATE SESSION privilege to other users. However, a person who
has been granted the DV_ACCTMGR role cannot perform the following operations:
To find the full list of system and object privileges associated with the DV_ACCTMGR role, log
into the database instance with sufficient privileges and then enter the following queries:
SELECT TABLE_NAME, OWNER, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE = 'DV_ACCTMGR';
SELECT PRIVILEGE FROM DBA_SYS_PRIVS WHERE GRANTEE = 'DV_ACCTMGR';
14-23
Chapter 14
Oracle Database Vault Roles
Tips:
• If you want the DV_ACCTMGR user to be able to grant or revoke the ANY
privileges for other users, then log in as user SYS with the SYSDBA
privilege and grant this user the GRANT ANY PRIVILEGE and REVOKE ANY
PRIVILEGE privileges. Then add this user to the Oracle System Privilege
and Role Management Realm as an owner.
• Oracle strongly recommends that you create a separate, named account
for the DV_ACCTMGR user. This way, if this user forgets his or her
password, you can log in as the original DV_ACCTMGR account and reset
the user's password. Otherwise, you must disable Oracle Database
Vault, log in as SYS or SYSTEM to recreate the password, and then re-
enable Database Vault.
Use the DV_REALM_OWNER role to manage database objects in multiple schemas that
define a realm.
Grant this role to the database account who is responsible for managing one or more
schema database accounts within a realm and the roles associated with the realm.
14-24
Chapter 14
Oracle Database Vault Roles
However, before this user can exercise these privileges, you must make this user either a
participant or an owner for the realm. See About Realm Authorization for instructions.
There are no object privileges granted to the DV_REALM_OWNER role, but it does have some
system privileges. To find the full list of DV_REALM_OWNER system privileges, log into the
database instance with sufficient privileges and enter the following query:
SELECT PRIVILEGE FROM DBA_SYS_PRIVS WHERE GRANTEE = 'DV_REALM_OWNER';
If you want to attach this role to a specific realm, then you must assign it to an account or
business-related role, then authorize that account or role in the realm.
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
Use the DV_REALM_RESOURCE role for operations such as creating tables, views, triggers,
synonyms, and other objects that a realm would typically use.
There are no object privileges granted to the DV_REALM_RESOURCE role, but it does have some
system privileges. To find the full list of DV_REALM_RESOURCE system privileges, log into the
database instance with sufficient privileges and enter the following query:
SELECT PRIVILEGE FROM DBA_SYS_PRIVS WHERE GRANTEE = 'DV_REALM_RESOURCE';
Though this role has powerful system privileges, it does not have any Oracle Database Vault
roles such as the DV_OWNER or DV_ADMIN roles.
14-25
Chapter 14
Oracle Database Vault Roles
The DV_POLICY_OWNER role does not have any system privileges. To find the full list of
object privileges that are associated with the DV_POLICY_OWNER role, you can log into
the database instance enter the following query:
14-26
Chapter 14
Oracle Database Vault Accounts Created During Registration
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
The DV_PUBLIC role is still created during installation, but it is not granted any roles or
privileges. All privileges that were granted to DV_PUBLIC in previous releases are now granted
directly to the PUBLIC role.
14-27
Chapter 14
Oracle Database Vault Accounts Created During Registration
You can create different database accounts to implement the separation of duties
requirements for Oracle Database Vault. Table 14-2 lists some model database
accounts that can act as a guide. (The accounts listed in Table 14-2 serve as a guide
to implementing Oracle Database Vault roles. These are not actual accounts that are
created during installation.)
14-28
Chapter 14
Backup Oracle Database Vault Accounts
Related Topics
• Configuring Oracle Database Vault Accounts as Enterprise User Accounts
You can configure existing Oracle Database Vault user accounts as enterprise user
accounts.
• Backup Oracle Database Vault Accounts
As a best practice, you should maintain backup accounts for the DV_OWNER and
DV_ACCTMGR roles.
14-29
Chapter 14
Backup Oracle Database Vault Accounts
Because of the strong separation of duty that Oracle Database Vault implements, loss
of access to the DV_OWNER account will force you to rebuild the database. The SYS
account cannot override the DV_OWNER account
Related Topics
• Resetting Oracle Database Vault Account Passwords
Backup accounts can help you reset lost passwords for users who have been
granted the DV_OWNER and DV_ACCTMGR roles.
14-30
15
Oracle Database Vault Realm APIs
The DBMS_MACADM PL/SQL package enables you to configure Oracle Database Vault realms.
Only users who have been granted the DV_OWNER or DV_ADMIN role can use these procedures.
For constants that you can use with these procedures, see Table 21-1 for more information.
• ADD_AUTH_TO_REALM Procedure
The ADD_AUTH_TO_REALM procedure authorizes a user or role to access a realm as an
owner or a participant. In a multitenant environment, you can authenticate both common
and local realms.
• ADD_OBJECT_TO_REALM Procedure
The ADD_OBJECT_TO_REALM procedure registers a set of objects for realm protection.
• CREATE_REALM Procedure
The CREATE_REALM procedure creates a realm. In a multitenant environment, you can
create both common and local realms.
• DELETE_AUTH_FROM_REALM Procedure
The DELETE_AUTH_FROM_REALM procedure removes the authorization of a user or role to
access a realm.
• DELETE_OBJECT_FROM_REALM Procedure
The DELETE_OBJECT_FROM_REALM procedure removes a set of objects from realm
protection.
• DELETE_REALM Procedure
The DELETE_REALM procedure deletes a realm, including its related configuration
information that specifies who is authorized and what objects are protected.
• DELETE_REALM_CASCADE Procedure
The DELETE_REALM_CASCADE procedure deletes a realm, including its related Database
Vault configuration information that specifies who is authorized and the objects that are
protected.
• RENAME_REALM Procedure
The RENAME_REALM procedure renames a realm; the name change takes effect
everywhere the realm is used.
• UPDATE_REALM Procedure
The UPDATE_REALM procedure updates a realm.
• UPDATE_REALM_AUTH Procedure
The UPDATE_REALM_AUTH procedure updates the authorization of a user or role to access
a realm.
15-1
Chapter 15
ADD_AUTH_TO_REALM Procedure
For detailed information about realm authorization, see About Realm Authorization.
Optionally, you can specify a rule set that must be checked before allowing the
authorization to be enabled.
Syntax
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name IN VARCHAR2,
grantee IN VARCHAR2,
rule_set_name IN VARCHAR2,
auth_options IN NUMBER
auth_scope IN NUMBER DEFAULT);
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
grantee User or role name to authorize as an owner or a participant.
To find the existing users and roles in the current database instance, query
the DBA_USERS and DBA_ROLES views, described in Oracle Database
Reference.
To find the authorization of a particular user or role, query the
DVA_DV_REALM_AUTH view, described in DBA_DV_REALM_AUTH View.
To find existing secure application roles used in privilege management,
query the DBA_DV_ROLE view. Both are described in Oracle Database
Vault Data Dictionary Views.
rule_set_name Optional. The rule set to check during runtime. The realm authorization is
enabled only if the rule set evaluates to TRUE.
To find the available rule sets, query the DBA_DV_RULE_SET view,
described in DBA_DV_RULE_SET_RULE View.
auth_options Optional. Specify one of the following options to authorize the realm:
• DBMS_MACUTL.G_REALM_AUTH_PARTICIPANT: Participant. This
account or role provides system or direct privileges to access,
manipulate, and create objects protected by the realm, provided these
rights have been granted using the standard Oracle Database
privilege grant process. (Default)
• DBMS_MACUTL.G_REALM_AUTH_OWNER: Owner. This account or role
has the same authorization as the realm participant, plus the
authorization to grant or revoke realm-secured roles and privileges on
realm-protected objects.
The audit_options parameter applies to traditional auditing only. If you
have enabled unified auditing, then create a unified audit policy instead of
using audit_options.
See About Realm Authorization for more information on participants and
owners.
15-2
Chapter 15
ADD_AUTH_TO_REALM Procedure
Parameter Description
auth_scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) to authorize the realm locally in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) to authorize the realm in the
application root
Examples
The following example authorizes user SYSADM as a participant in the Performance Statistics
Realm. Because the default is to authorize the user as a participant, the auth_options
parameter can be omitted.
BEGIN
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name => 'Performance Statistics Realm',
grantee => 'SYSADM');
END;
/
This example sets user SYSADM as the owner of the Performance Statistics Realm.
BEGIN
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name => 'Performance Statistics Realm',
grantee => 'SYSADM',
auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER);
END;
/
The next example triggers the Check Conf Access rule set before allowing user SYSADM to act
as the owner of the Performance Statistics Realm.
BEGIN
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name => 'Performance Statistics Realm',
grantee => 'SYSADM',
rule_set_name => 'Check Conf Access',
auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER);
END;
/
This example shows how to commonly grant the common user C##HR_ADMIN access to the
common realm HR Statistics Realm. The user running this procedure must be in the CDB
root, and the rule set must be a common rule set residing in the application root.
BEGIN
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name => 'HR Statistics Realm',
grantee => 'C##HR_ADMIN',
rule_set_name => 'Check Access',
auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER,
auth_scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
15-3
Chapter 15
ADD_OBJECT_TO_REALM Procedure
This example shows how to locally grant the common user C##HR_CLERK access to the
common realm HR Statistics Realm. The user running this procedure must be in the
same PDB in which the authorization applies. To find the existing PDBs query the
DBA_PDBS data dictionary view. The rule set must be a local rule set.
BEGIN
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name => 'HR Statistics Realm',
grantee => 'C##HR_CLERK',
rule_set_name => 'Check Access',
auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER,
auth_scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
Syntax
DBMS_MACADM.ADD_OBJECT_TO_REALM(
realm_name IN VARCHAR2,
object_owner IN VARCHAR2,
object_name IN VARCHAR2,
object_type IN VARCHAR2);
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
object_owner The owner of the object that is being added to the realm. If you add a
role to a realm, the object owner of the role is shown as % (for all),
because roles do not have owners.
To find the available users, query the DBA_USERS view, described in
Oracle Database Reference.
To find the authorization of a particular user or role, query the
DVA_DV_REALM_AUTH view, described in DBA_DV_REALM_AUTH View.
object_name Object name. (The wildcard % is allowed. See "Object Name" under
About Realm-Secured Objects for exceptions to the wildcard %.) You
can also use the DBMS_MACUTL.G_ALL_OBJECT constant.
To find the available objects, query the ALL_OBJECTS view, described in
Oracle Database Reference.
To find objects that are secured by existing realms, query the
DBA_DV_REALM_OBJECT view, described in DBA_DV_REALM_OBJECT
View.
object_type Object type, such as TABLE, INDEX, or ROLE. (The wildcard % is
allowed. See "Object Types" under About Realm-Secured Objects for
exceptions to the wildcard %.)
You can also use the DBMS_MACUTL.G_ALL_OBJECT constant.
15-4
Chapter 15
CREATE_REALM Procedure
Example
BEGIN
DBMS_MACADM.ADD_OBJECT_TO_REALM(
realm_name => 'Performance Statistics Realm',
object_owner => '%',
object_name => 'GATHER_SYSTEM_STATISTICS',
object_type => 'ROLE');
END;
/
Syntax
DBMS_MACADM.CREATE_REALM(
realm_name IN VARCHAR2,
description IN VARCHAR2,
enabled IN VARCHAR2,
audit_options IN NUMBER,
realm_type IN NUMBER DEFAULT,
realm_scope IN NUMBER DEFAULT
pl_sql_stack IN BOOLEAN DEFAULT);
Parameters
Parameter Description
realm_name Realm name, up to 128 characters in mixed-case.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
description Description of the purpose of the realm, up to 1024 characters in mixed-case.
enabled Specify one of the following options to set the status of the realm:
• DBMS_MACUTL.G_YES or ‘y’ to enable realm checking (default)
• DBMS_MACUTL.G_NO or ‘n’ to disable all realm checking, including the
capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
15-5
Chapter 15
CREATE_REALM Procedure
Parameter Description
audit_options Specify one of the following options to audit the realm:
• DBMS_MACUTL.G_REALM_AUDIT_OFF: Disables auditing for the realm
(default)
• DBMS_MACUTL.G_REALM_AUDIT_FAIL: Creates an audit record when a
realm violation occurs (for example, when an unauthorized user tries to
modify an object that is protected by the realm)
• DBMS_MACUTL.G_REALM_AUDIT_SUCCESS: Creates an audit record for
authorized activities on objects protected by the realm
• DBMS_MACUTL.G_REALM_AUDIT_FAIL +
DBMS_MACUTL.G_REALM_AUDIT_SUCCESS: Creates an audit record for
both authorized and unauthorized activities on objects protected by the
realm
The audit_options parameter applies to traditional auditing only. If you
have enabled unified auditing, then create a unified audit policy instead of
using audit_options.
realm_type Specify one of the following options:
• 0: Disables mandatory realm checking.
• 1: Enables mandatory realm checking for realm objects. Only realm
owners or realm participants will have access to objects in a realm.
Object owners and object-privileged users who are not realm owners or
participants will have no access.
See also Mandatory Realms to Restrict User Access to Objects within a
Realm for more information about mandatory realms.
realm_scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the realm must be local in the
current PDB.
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the realm must be in the
application root. This setting duplicates the realm in all of the associated
PDBs.
If you create the common realm in an application root and want it visible to
the associated PDBs, then you must synchronize the application. For
example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
pl_sql_stack When simulation mode is enabled, specifies whether to record the PL/SQL
stack for failed operations. Enter TRUE to record the PL/SQL stack, FALSE to
not record. The default is FALSE.
Examples
The following example shows how to create a realm that is enabled, has auditing set
to track both failed and successful access, uses mandatory realm checking, and
records the PL/SQL stack.
BEGIN
DBMS_MACADM.CREATE_REALM(
realm_name => 'Performance Statistics Realm',
description => 'Realm to measure performance',
enabled => DBMS_MACUTL.G_YES,
15-6
Chapter 15
DELETE_AUTH_FROM_REALM Procedure
This example shows how to create a variation of the preceding example, but as a common
realm located in the application root. The user who creates this realm must be a common
user and must execute the procedure in the CDB root.
BEGIN
DBMS_MACADM.CREATE_REALM(
realm_name => 'Performance Statistics Realm',
description => 'Realm to measure performance',
enabled => DBMS_MACUTL.G_YES,
audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL + DBMS_MACUTL.G_REALM_AUDIT_SUCCESS,
realm_type => 1,
realm_scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
This example shows how to create a local version n of the preceding example. The user who
creates this realm must be in the PDB in which the realm will reside. To find existing PDBs,
query the DBA_PDBS data dictionary view.
BEGIN
DBMS_MACADM.CREATE_REALM(
realm_name => 'Performance Statistics Realm',
description => 'Realm to measure performance',
enabled => DBMS_MACUTL.G_YES,
audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL + DBMS_MACUTL.G_REALM_AUDIT_SUCCESS,
realm_type => 1,
realm_scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
See Also:
Example 21-1
Syntax
DBMS_MACADM.DELETE_AUTH_FROM_REALM(
realm_name IN VARCHAR2,
grantee IN VARCHAR2,
auth_scope IN NUMBER DEFAULT);
15-7
Chapter 15
DELETE_OBJECT_FROM_REALM Procedure
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View
grantee User or role name.
To find the authorization of a particular user or role, query the
DVA_DV_REALM_AUTH view, described in DBA_DV_REALM_AUTH View.
auth_scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the realm was authorized locally
in the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2 if the realm was authorized in the
application root
Example
BEGIN
DBMS_MACADM.DELETE_AUTH_FROM_REALM(
realm_name => 'Performance Statistics Realm',
grantee => 'PSMITH',
auth_scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
Syntax
DBMS_MACADM.DELETE_OBJECT_FROM_REALM(
realm_name IN VARCHAR2,
object_owner IN VARCHAR2,
object_name IN VARCHAR2,
object_type IN VARCHAR2);
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
15-8
Chapter 15
DELETE_REALM Procedure
Parameter Description
object_owner The owner of the object that was added to the realm.
To find the available users, query the DBA_USERS view, described in
Oracle Database Reference.
object_name Object name. (The wildcard % is allowed. See "Object Name" under
About Realm-Secured Objects for exceptions to the wildcard %.) You
can also use the DBMS_MACUTL.G_ALL_OBJECT constant.
To find objects that are secured by existing realms, query the
DBA_DV_REALM_OBJECT view, described in DBA_DV_REALM_OBJECT
View.
object_type Object type, such as TABLE, INDEX, or ROLE. (The wildcard % is
allowed. See "Object Types" under About Realm-Secured Objects for
exceptions to the wildcard %.)
You can also use the DBMS_MACUTL.G_ALL_OBJECT constant.
Example
BEGIN
DBMS_MACADM.DELETE_OBJECT_FROM_REALM(
realm_name => 'Performance Statistics Realm',
object_owner => 'SYS',
object_name => 'GATHER_SYSTEM_STATISTICS',
object_type => 'ROLE');
END;
/
Syntax
DBMS_MACADM.DELETE_REALM(
realm_name IN VARCHAR2);
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
15-9
Chapter 15
DELETE_REALM_CASCADE Procedure
Example
EXEC DBMS_MACADM.DELETE_REALM('Performance Statistics Realm');
It does not delete the actual database objects or users. This procedure works the
same as the DELETE_REALM procedure. (In previous releases, these procedures were
different, but now they are the same. Both are retained for earlier compatibility.) To find
a listing of the realm-related objects, query the DBA_DV_REALM view. To find its
authorizations, query DBA_DV_REALM_AUTH. Both are described under Oracle Database
Vault Data Dictionary Views.
Syntax
DBMS_MACADM.DELETE_REALM_CASCADE(
realm_name IN VARCHAR2);
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
Example
EXEC DBMS_MACADM.DELETE_REALM_CASCADE('Performance Statistics Realm');
Syntax
DBMS_MACADM.RENAME_REALM(
realm_name IN VARCHAR2,
new_name IN VARCHAR2);
15-10
Chapter 15
UPDATE_REALM Procedure
Parameters
Parameter Description
realm_name Current realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
new_name New realm name, up to 128 characters in mixed-case.
Example
BEGIN
DBMS_MACADM.RENAME_REALM(
realm_name => 'Performance Statistics Realm',
new_name => 'Sector 2 Performance Statistics Realm');
END;
/
To find information about the current settings for a realm, query the DVSYS.DV$REALM view,
described in DVSYS.DV$REALM View.
Syntax
DBMS_MACADM.UPDATE_REALM(
realm_name IN VARCHAR2,
description IN VARCHAR2,
enabled IN VARCHAR2,
audit_options IN NUMBER DEFAULT NULL,
realm_type IN NUMBER DEFAULT NULL
pl_sql_stack IN BOOLEAN DEFAULT NULL);
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
description Description of the purpose of the realm, up to 1024 characters in mixed-case.
15-11
Chapter 15
UPDATE_REALM Procedure
Parameter Description
enabled Specify one of the following options to set the status of the realm:
• DBMS_MACUTL.G_YES or ‘y’ to enable realm checking
• DBMS_MACUTL.G_NO or ‘n’ to disable all realm checking, including the
capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
The default for enabled is the previously set value, which you can find by
querying the DBA_DV_REALM data dictionary view.
audit_options Specify one of the following options to audit the realm:
• DBMS_MACUTL.G_REALM_AUDIT_OFF: Disables auditing for the realm
• DBMS_MACUTL.G_REALM_AUDIT_FAIL: Creates an audit record when a
realm violation occurs (for example, when an unauthorized user tries to
modify an object that is protected by the realm
• DBMS_MACUTL.G_REALM_AUDIT_SUCCESS: Creates an audit record for
authorized activities on objects protected by the realm.
• DBMS_MACUTL.G_REALM_AUDIT_FAIL +
DBMS_MACUTL.G_REALM_AUDIT_SUCCESS: Creates an audit record for
both authorized and unauthorized activities on objects protected by the
realm
The default for audit_options is the previously set value, which you can find
by querying the DBA_DV_REALM data dictionary view.
The audit_options parameter applies to traditional auditing only. If you have
enabled unified auditing, then create a unified audit policy instead of using
audit_options.
realm_type If you do not specify the realm_type parameter, then Oracle Database Vault
does not update the current realm_type setting.
Specify one of the following options:
• 0: Sets the realm to be a regular realm, which does not have mandatory
realm checking.
• 1: Enables mandatory realm checking for realm objects. Only realm
owners or realm participants will have access to objects in a realm. Object
owners and object-privileged users who are not realm owners or
participants will have no access.
See also Mandatory Realms to Restrict User Access to Objects within a Realm
for more information about mandatory realms.
pl_sql_stack When simulation mode is enabled, indicates whether the PL/SQL stack has
been recorded for failed operations. TRUE indicates that the PL/SQL stack has
been recorded; FALSE indicates that the PL/SQL stack has not been recorded.
Example
BEGIN
DBMS_MACADM.UPDATE_REALM(
realm_name => 'Sector 2 Performance Statistics Realm',
description => 'Realm to measure performance for Sector 2 applications',
enabled => DBMS_MACUTL.G_YES,
audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL +
DBMS_MACUTL.G_REALM_AUDIT_SUCCESS),
realm_type => 1);
15-12
Chapter 15
UPDATE_REALM_AUTH Procedure
END;
/
Syntax
DBMS_MACADM.UPDATE_REALM_AUTH(
realm_name IN VARCHAR2,
grantee IN VARCHAR2,
rule_set_name IN VARCHAR2,
auth_options IN NUMBER,
auth_scope IN NUMBER DEFAULT);
Parameters
Parameter Description
realm_name Realm name.
To find the existing realms in the current database instance, query the
DBA_DV_REALM view, described in DBA_DV_REALM View.
grantee User or role name.
To find the available users and roles in the current database instance, query the
DBA_USERS and DBA_ROLES views, described in Oracle Database Reference.
To find the authorization of a particular user or role, query the
DVA_DV_REALM_AUTH view, described in DBA_DV_REALM_AUTH View.
To find existing secure application roles used in privilege management, query
the DBA_DV_ROLE view, described in DBA_DV_ROLE View.
rule_set_name Optional. A rule set to check during runtime. The realm authorization is enabled
only if the rule set evaluates to TRUE.
To find the available rule sets, query the DBA_DV_RULE_SET view. To find rules
that are associated with the rule sets, query the DBA_DB_RULE_SET_RULE view.
Both are described in Oracle Database Vault Data Dictionary Views.
auth_options Optional. Specify one of the following options to authorize the realm:
• DBMS_MACUTL.G_REALM_AUTH_PARTICIPANT: Participant. This account or
role provides system or direct privileges to access, manipulate, and create
objects protected by the realm, provided these rights have been granted
using the standard Oracle Database privilege grant process.
• DBMS_MACUTL.G_REALM_AUTH_OWNER: Owner. This account or role has the
same authorization as the realm participant, plus the authorization to grant
or revoke realm-secured roles and privileges on realm-protected objects. A
realm can have multiple owners.
The default for auth_options value is the previously set value, which you can
find by querying the DBA_DV_REALM_AUTH data dictionary view.
The audit_options parameter applies to traditional auditing only. If you have
enabled unified auditing, then create a unified audit policy instead of using
audit_options.
15-13
Chapter 15
UPDATE_REALM_AUTH Procedure
Parameter Description
realm_auth For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the realm is authorized locally in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the realm is authorized in the
application root
Example
BEGIN
DBMS_MACADM.UPDATE_REALM_AUTH(
realm_name => 'Sector 2 Performance Statistics Realm',
grantee => 'SYSADM',
rule_set_name => 'Check Conf Access',
auth_options => DBMS_MACUTL.G_REALM_AUTH_OWNER);
END;
/
15-14
16
Oracle Database Vault Rule Set APIs
You can use the DBMS_MACADM PL/SQL package and a set of Oracle Database Vault rule
functions to manage rule sets.
• DBMS_MACADM Rule Set Procedures
The DBMS_MACADM rule set procedures enable you to configure both rule sets and
individual rules that go within these rule sets.
• Oracle Database Vault PL/SQL Rule Set Functions
Oracle Database Vault provides functions to use in rule sets to inspect the SQL
statement that the rule set protects.
• ADD_RULE_TO_RULE_SET Procedure
The ADD_RULE_TO_RULE_SET procedure adds rule to a rule set; you can enable having the
rule checked when the rule set is evaluated.
• CREATE_RULE Procedure
The CREATE_RULE procedure creates a rule, which afterwards, can be added to a rule set.
• CREATE_RULE_SET Procedure
The CREATE_RULE_SET procedure creates a rule set.
• DELETE_RULE Procedure
The DELETE_RULE procedure deletes a rule.
• DELETE_RULE_FROM_RULE_SET Procedure
The DELETE_RULE_FROM_RULE_SET procedure deletes a rule from a rule set.
• DELETE_RULE_SET Procedure
The DELETE_RULE_SET procedure deletes a rule set.
• RENAME_RULE Procedure
The RENAME_RULE procedure renames a rule and causes the name change to take effect
everywhere the rule is used
• RENAME_RULE_SET Procedure
The RENAME_RULE_SET procedure renames a rule set and causes the name change to
take effect everywhere the rule set is used.
• UPDATE_RULE Procedure
The UPDATE_RULE procedure updates a rule.
• UPDATE_RULE_SET Procedure
The UPDATE_RULE_SET procedure updates a rule set.
16-1
Chapter 16
DBMS_MACADM Rule Set Procedures
Related Topics
• Configuring Rule Sets
Rule sets group one or more rules together; the rules determine whether a user
can perform an action on an object.
• Oracle Database Vault Utility APIs
Oracle Database Vault provides a set of utility APIs in the DBMS_MACUTL PL/SQL
package.
Syntax
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name IN VARCHAR2,
rule_name IN VARCHAR2,
rule_order IN NUMBER,
enabled IN VARCHAR2,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_set_name Rule set name.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
rule_name Rule to add to the rule set.
To find existing rules, query the DBA_DV_RULE view, described in
DBA_DV_RULE View.
To find rules that have been associated with rule sets, use
DBA_DV_RULE_SET_RULE, described in DBA_DV_RULE View.
rule_order Does not apply to this release, but you must include a value for the
ADD_RULE_TO_RULE_SET procedure to work. Enter 1.
enabled Optional. Determines whether the rule should be checked when the rule
set is evaluated. Possible values are:
• DBMS_MACUTL.G_YES (default). Enables the rule to be checked
during the rule set evaluation.
• DBMS_MACUTL.G_NO Prevents the rule from being checked during the
rule set evaluation.
See Table 21-1 for more information.
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the rule and rule set are
local in the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the rule and rule set are in
the application root
16-2
Chapter 16
DBMS_MACADM Rule Set Procedures
Examples
The following example adds a rule to a rule set, and by omitting the enabled parameter,
automatically enables the rule to be checked when the rule set is evaluated.
BEGIN
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name => 'Limit_DBA_Access',
rule_name => 'Restrict DROP TABLE operations',
rule_order => 1);
END;
/
This example adds the rule to the rule set but disables rule checking.
BEGIN
DBMS_MACADM.ADD_RULE_TO_RULE_SET(
rule_set_name => 'Limit_DBA_Access',
rule_name => 'Check UPDATE operations',
rule_order => 1,
enabled => DBMS_MACUTL.G_NO);
END;
/
In a multitenant environment, you can create both common and local rules.
Syntax
DBMS_MACADM.CREATE_RULE(
rule_name IN VARCHAR2,
rule_expr IN VARCHAR2
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_name Rule name, up to 128 characters in mixed-case. Spaces are allowed.
To find existing rules in the current database instance, query the
DBA_DV_RULE view, described in DBA_DV_RULE View.
To find rules that have been associated with rule sets, query
DBA_DV_RULE_SET_RULE, described in DBA_DV_RULE_SET_RULE View.
rule_expr PL/SQL BOOLEAN expression.
If the expression contains quotation marks, do not use double quotation
marks. Instead, use two single quotation marks. Enclose the entire expression
within single quotation marks. For example:
'TO_CHAR(SYSDATE,''HH24'') = ''12'''
16-3
Chapter 16
DBMS_MACADM Rule Set Procedures
Parameter Description
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the rule is local in the current
PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the rule is in the application
root
Examples
The following example shows how to create a local rule expression that checks if the
current session user is SYSADM. The user running this procedure must be in the same
PDB in which the rule and its rule set reside. To find the existing PDBs, query the
DBA_PDBS data dictionary view. The rule and rule set must be local.
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check UPDATE operations',
rule_expr =>'SYS_CONTEXT(''USERENV'',''SESSION_USER'') = ''SYSADM''',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
This example shows how to create a rule expression that uses the public standalone
function OLS_LABEL_DOMINATES to find if the session label of the hr_ols_pol Oracle
Label Security policy dominates or is equal to the hs label. The value 0 indicates if it is
false. (To check if it is equal, you would specify 1.)
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check OLS Factor',
rule_expr => 'OLS_LABEL_DOMINATES(''hr_ols_pol'', ''hs'') = 1');
END;
/
After you create a rule set, you can use the CREATE_RULE and ADD_RULE_TO_RULE_SET
procedures to create and add rules to the rule set.
16-4
Chapter 16
DBMS_MACADM Rule Set Procedures
Syntax
DBMS_MACADM.CREATE_RULE_SET(
rule_set_name IN VARCHAR2,
description IN VARCHAR2,
enabled IN VARCHAR2,
eval_options IN NUMBER,
audit_options IN NUMBER,
fail_options IN NUMBER,
fail_message IN VARCHAR2,
fail_code IN NUMBER,
handler_options IN NUMBER,
handler IN VARCHAR2,
is_static IN BOOLEAN DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_set_name Rule set name, up to 128 characters in mixed-case. Spaces are allowed.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
description Description of the purpose of the rule set, up to 1024 characters in mixed-case.
enabled DBMS_MACUTL.G_YES (Yes) enables the rule set; DBMS_MACUTL.G_NO (No)
disables it. The default is DBMS_MACUTL.G_YES.
eval_options If you plan to assign multiple rules to the rule set, enter one of the following
settings:
• DBMS_MACUTL.G_RULESET_EVAL_ALL: All rules in the rule set must
evaluate to true for the rule set itself to evaluate to true (default).
• DBMS_MACUTL.G_RULESET_EVAL_ANY: At least one rule in the rule set
must evaluate to true for the rule set itself to evaluate to true.
audit_options Select one of the following settings:
• DBMS_MACUTL.G_RULESET_AUDIT_OFF: Disables auditing for the rule set
(default)
• DBMS_MACUTL.G_RULESET_AUDIT_FAIL: Creates an audit record when a
rule set violation occurs
• DBMS_MACUTL.G_RULESET_AUDIT_SUCCESS: Creates an audit record for
a successful rule set evaluation
• DBMS_MACUTL.G_RULESET_AUDIT_FAIL +
DBMS_MACUTL.G_RULESET_AUDIT_SUCCESS: Creates an audit record for
both successful and failed rule set evaluations
The audit_options parameter applies to traditional auditing only. If you have
enabled unified auditing, then create a unified audit policy instead of using
audit_options.
fail_options Options for reporting errors:
• DBMS_MACUTL.G_RULESET_FAIL_SHOW: Shows an error message
(default)
• DBMS_MACUTL.G_RULESET_FAIL_SILENT: Does not show an error
message
16-5
Chapter 16
DBMS_MACADM Rule Set Procedures
Parameter Description
fail_message Enter an error message for failure, up to 80 characters in mixed-case, to
associate with the fail code you specify for fail_code.
fail_code Enter a number in the range of -20000 to -20999 or 20000 to 20999 to
associate with the fail_message parameter.
handler_options Select one of the following settings:
• DBMS_MACUTL.G_RULESET_HANDLER_OFF: Disables error handling
(default)
• DBMS_MACUTL.G_RULESET_HANDLER_FAIL: Calls handler on rule set
failure
• DBMS_MACUTL.G_RULESET_HANDLER_SUCCESS: Calls handler on rule set
success
handler Name of the PL/SQL function or procedure that defines the custom event
handler logic.
is_static Optional. Determines how often a rule set is evaluated when it is accessed.
The default is FALSE.
• TRUE: The rule set is evaluated once during the user session. After that,
the value is re-used.
• FALSE: The rule set is evaluated every time.
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the rule set is to be local in the
current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the rule set is to be in the
application root
Examples
The following example creates a rule set that is enabled, is set so that at least one rule
must evaluate to true for the rule set itself to evaluate to true, and audits both failed
and successful attempts. It does not show error messages but uses the fail code
20461 to track failures. It also uses a handler to send email alerts to the appropriate
users if their are violations to the rule set.
BEGIN
DBMS_MACADM.CREATE_RULE_SET(
rule_set_name => 'Limit_DBA_Access',
description => 'DBA access through predefined processes',
enabled => DBMS_MACUTL.G_YES,
eval_options => DBMS_MACUTL.G_RULESET_EVAL_ANY,
audit_options => DBMS_MACUTL.G_RULESET_AUDIT_FAIL +
DBMS_MACUTL.G_RULESET_AUDIT_SUCCESS,
fail_options => DBMS_MACUTL.G_RULESET_FAIL_SILENT,
fail_message => '',
fail_code => 20461,
handler_options => DBMS_MACUTL.G_RULESET_HANDLER_FAIL,
handler => 'dbavowner.email_alert',
is_static => TRUE);
END;
/
16-6
Chapter 16
DBMS_MACADM Rule Set Procedures
This rule set uses no fail messages or fail codes, nor does it use any handlers. This rule set
will be in the application root of a multitenant environment, so the user running this procedure
must be in the application root. Any rules or command rules that are associated with this rule
set must be common.
BEGIN
DBMS_MACADM.CREATE_RULE_SET(
rule_set_name => 'Check_HR_Access',
description => 'Checks for failed access attempts to the HR schema',
enabled => DBMS_MACUTL.G_YES,
eval_options => DBMS_MACUTL.G_RULESET_EVAL_ANY,
audit_options => DBMS_MACUTL.G_RULESET_AUDIT_FAIL,
fail_options => DBMS_MACUTL.G_RULESET_FAIL_SILENT,
fail_message => '',
fail_code => '',
handler_options => DBMS_MACUTL.G_RULESET_HANDLER_OFF,
handler => '',
is_static => TRUE,
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
This rule set is a local version of the preceding rule set. The user who creates this rule set
must be in the PDB in which this rule set will reside. To find the existing PDBs, query the
DBA_PDBS data dictionary view. Any rules or command rules that are associated with this rule
set must be local.
BEGIN
DBMS_MACADM.CREATE_RULE_SET(
rule_set_name => 'Check_HR_Access',
description => 'Checks for failed access attempts to the HR schema',
enabled => DBMS_MACUTL.G_YES,
eval_options => DBMS_MACUTL.G_RULESET_EVAL_ANY,
audit_options => DBMS_MACUTL.G_RULESET_AUDIT_FAIL,
fail_options => DBMS_MACUTL.G_RULESET_FAIL_SILENT,
fail_message => '',
fail_code => '',
handler_options => DBMS_MACUTL.G_RULESET_HANDLER_OFF,
handler => '',
is_static => TRUE,
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
See Also:
Example 21-2
16-7
Chapter 16
DBMS_MACADM Rule Set Procedures
Syntax
DBMS_MACADM.DELETE_RULE(
rule_name IN VARCHAR2);
Parameter
Parameter Description
rule_name Rule name.
To find existing rules in the current database instance, query the
DBA_DV_RULE view, described in DBA_DV_RULE View.
To find rules that have been associated with rule sets, query
DBA_DV_RULE_SET_RULE, described in DBA_DV_RULE_SET_RULE
View.
Example
EXEC DBMS_MACADM.DELETE_RULE('Check UPDATE operations');
Syntax
DBMS_MACADM.DELETE_RULE_FROM_RULE_SET(
rule_set_name IN VARCHAR2,
rule_name IN VARCHAR2);
Parameters
Parameter Description
rule_set_name Rule set name.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
rule_name Rule to remove from the rule set.
To find existing rules in the current database instance, query the
DBA_DV_RULE view, described in DBA_DV_RULE View.
To find rules that have been associated with rule sets, query
DBA_DV_RULE_SET_RULE, described in DBA_DV_RULE_SET_RULE
View.
16-8
Chapter 16
DBMS_MACADM Rule Set Procedures
Example
BEGIN
DBMS_MACADM.DELETE_RULE_FROM_RULE_SET(
rule_set_name => 'Limit_DBA_Access',
rule_name => 'Check UPDATE operations');
END;
/
Syntax
DBMS_MACADM.DELETE_RULE_SET(
rule_set_name IN VARCHAR2);
Parameters
Parameter Description
rule_set_name Rule set name.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
Example
EXEC DBMS_MACADM.DELETE_RULE_SET('Limit_DBA_Access');
Syntax
DBMS_MACADM.RENAME_RULE(
rule_name IN VARCHAR2,
new_name IN VARCHAR2,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_name Current rule name.
To find existing rules in the current database instance, query the DBA_DV_RULE
view, described in DBA_DV_RULE View.
To find rules that have been associated with rule sets, query
DBA_DV_RULE_SET_RULE, described in DBA_DV_RULE_SET_RULE View.
16-9
Chapter 16
DBMS_MACADM Rule Set Procedures
Parameter Description
new_name New rule name, up to 128 characters in mixed-case.
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the rule is local in the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the rule is in the application root
Example
BEGIN
DBMS_MACADM.RENAME_RULE(
rule_name => 'Check UPDATE operations',
new_name => 'Check Sector 2 Processes');
END;
/
Syntax
DBMS_MACADM.RENAME_RULE_SET(
rule_set_name IN VARCHAR2,
new_name IN VARCHAR2,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_set_name Current rule set name.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
new_name New rule set name, up to 128 characters in mixed-case. Spaces are
allowed.
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the rule set is local in the
current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the rule set is in the
application root
Example
BEGIN
DBMS_MACADM.RENAME_RULE_SET(
rule_set_name => 'Limit_DBA_Access',
16-10
Chapter 16
DBMS_MACADM Rule Set Procedures
Syntax
DBMS_MACADM.UPDATE_RULE(
rule_name IN VARCHAR2,
rule_expr IN VARCHAR2);
Parameters
Parameter Description
rule_name Rule name.
To find existing rules in the current database instance, query the DBA_DV_RULE
view, described in DBA_DV_RULE View.
To find rules that have been associated with rule sets, query
DBA_DV_RULE_SET_RULE, described in DBA_DV_RULE_SET_RULE View.
rule_expr PL/SQL BOOLEAN expression.
If the expression contains quotation marks, do not use double quotation marks.
Instead, use two single quotation marks. Enclose the entire expression within
single quotation marks. For example:
'TO_CHAR(SYSDATE,''HH24'') = ''12'''
Example
BEGIN
DBMS_MACADM.UPDATE_RULE(
rule_name => 'Check UPDATE operations',
rule_expr =>'SYS_CONTEXT(''USERENV'',''SESSION_USER'') = ''SYSADM'' AND
(
UPPER(SYS_CONTEXT(''USERENV'',''MODULE'')) LIKE ''APPSRVR%'' OR
UPPER(SYS_CONTEXT(''USERENV'',''MODULE'')) LIKE ''DBAPP%'' )'
);
END;
/
Syntax
DBMS_MACADM.UPDATE_RULE_SET(
rule_set_name IN VARCHAR2,
description IN VARCHAR2,
16-11
Chapter 16
DBMS_MACADM Rule Set Procedures
enabled IN VARCHAR2,
eval_options IN NUMBER,
audit_options IN NUMBER,
fail_options IN NUMBER,
fail_message IN VARCHAR2,
fail_code IN NUMBER,
handler_options IN NUMBER,
handler IN VARCHAR2,
is_static IN BOOLEAN DEFAULT);
Parameters
Parameter Description
rule_set_name Rule set name.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
description Description of the purpose of the rule set, up to 1024 characters in
mixed-case.
enabled DBMS_MACUTL.G_YES (Yes) enables rule set checking;
DBMS_MACUTL.G_NO (No) disables it.
The default for the enabled setting is the previously set value, which
you can find by querying the DBA_DV_RULE_SET data dictionary view.
eval_options If you plan to assign multiple rules to the rule set, enter one of the
following settings:
• DBMS_MACUTL.G_RULESET_EVAL_ALL: All rules in the rule set must
evaluate to true for the rule set itself to evaluate to true.
• DBMS_MACUTL.G_RULESET_EVAL_ANY: At least one rule in the rule
set must evaluate to true for the rule set itself to evaluate to true.
The default for eval_options is the previously set value, which you can
find by querying the DBA_DV_RULE_SET data dictionary view.
audit_options Select one of the following settings:
• DBMS_MACUTL.G_RULESET_AUDIT_OFF: Disables auditing for the
rule set
• DBMS_MACUTL.G_RULESET_AUDIT_FAIL: Creates an audit record
when a rule set violation occurs
• DBMS_MACUTL.G_RULESET_AUDIT_SUCCESS: Creates an audit
record for a successful rule set evaluation
• DBMS_MACUTL.G_RULESET_AUDIT_FAIL +
DBMS_MACUTL.G_RULESET_AUDIT_SUCCESS: Creates an audit
record for both successful and failed rule set evaluations
The default for audit_options is the previously set value, which you
can find by querying the DBA_DV_RULE_SET data dictionary view.
fail_options Options for reporting errors:
• DBMS_MACUTL.G_RULESET_FAIL_SHOW: Shows an error message.
• DBMS_MACUTL.G_RULESET_FAIL_SILENT: Does not show an error
message.
The default for fail_options is the previously set value, which you can
find by querying the DBA_DV_RULE_SET data dictionary view.
fail_message Error message for failure, up to 80 characters in mixed-case, to
associate with the fail code you specify for fail_code.
16-12
Chapter 16
Oracle Database Vault PL/SQL Rule Set Functions
Parameter Description
fail_code Enter a number in the range of -20000 to -20999 or 20000 to 20999 to
associate with the fail_message parameter.
handler_options Select one of the following settings:
• DBMS_MACUTL.G_RULESET_HANDLER_OFF: Disables error handling.
• DBMS_MACUTL.G_RULESET_HANDLER_FAIL: Call handler on rule
set failure.
• DBMS_MACUTL.G_RULESET_HANDLER_SUCCESS: Call handler on
rule set success.
The default for handler_options is the previously set value, which you
can find by querying the DBA_DV_RULE_SET data dictionary view.
handler Name of the PL/SQL function or procedure that defines the custom
event handler logic.
is_static Optional. Determines how often a rule set is evaluated when it is
accessed by a SQL statement. The default is FALSE.
• TRUE: The rule set is evaluated once during the user session. After
that, the value is re-used.
• FALSE: The rule set evaluated each time a SQL statement
accesses it.
Example
BEGIN
DBMS_MACADM.UPDATE_RULE_SET(
rule_set_name => 'Limit_DBA_Access',
description => 'DBA access through predefined processes',
enabled => DBMS_MACUTL.G_YES,
eval_options => DBMS_MACUTL.G_RULESET_EVAL_ANY,
audit_options => DBMS_MACUTL.G_RULESET_AUDIT_FAIL,
fail_options => DBMS_MACUTL.G_RULESET_FAIL_SHOW,
fail_message => 'Access denied!',
fail_code => 20900,
handler_options => DBMS_MACUTL.G_RULESET_HANDLER_OFF,
handler => '',
is_static = TRUE);
END;
/
16-13
Chapter 16
Oracle Database Vault PL/SQL Rule Set Functions
• DV_DATABASE_NAME Function
The DV_DATABASE_NAME function returns the database name, in VARCHAR2 data
type.
• DV_DICT_OBJ_TYPE Function
The DV_DICT_OBJ_TYPE function returns the type of the dictionary object on which
the database operation occurred.
• DV_DICT_OBJ_OWNER Function
The DV_DICT_OBJ_OWNER function returns the name of the owner of the dictionary
object on which the database operation occurred.
• DV_DICT_OBJ_NAME Function
The DV_DICT_OBJ_NAME function returns the name of the dictionary object on which
the database operation occurred.
• DV_SQL_TEXT Function
The DV_SQL_TEXT function returns the first 4000 characters of SQL text of the
database statement used in the operation.
The event name is the same as that in the syntax of the SQL statement (for example,
INSERT, CREATE.) The return type is VARCHAR2.
Syntax
DV_SYSEVENT ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Get System Event Firing the Maintenance Rule Set',
rule_expr => 'DV_SYSEVENT = ''CREATE''');
END;
/
Syntax
DV_LOGIN_USER ()
RETURN VARCHAR2;
Parameters
None
16-14
Chapter 16
Oracle Database Vault PL/SQL Rule Set Functions
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Session User Name',
rule_expr => 'DV_LOGIN_USER = ''SEBASTIAN''');
END;
/
Syntax
DV_INSTANCE_NUM ()
RETURN NUMBER;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Database Instance Number',
rule_expr => 'DV_INSTANCE_NUM BETWEEN 6 AND 9');
END;
/
Syntax
DV_DATABASE_NAME ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Database Name',
rule_expr => 'DV_DATABASE_NAME = ''ORCL''');
END;
/
16-15
Chapter 16
Oracle Database Vault PL/SQL Rule Set Functions
Syntax
DV_DICT_OBJ_TYPE ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Dictionary Object Type',
rule_expr => 'DV_DICT_OBJ_TYPE IN (''TABLE'', ''VIEW'')');
END;
/
Syntax
DV_DICT_OBJ_OWNER ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Dictionary Object Owner',
rule_expr => 'DV_DICT_OBJ_OWNER = ''JSMITH''');
END;
/
16-16
Chapter 16
Oracle Database Vault PL/SQL Rule Set Functions
Syntax
DV_DICT_OBJ_NAME ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Dictionary Object Name',
rule_expr => 'DV_DICT_OBJ_NAME = ''SALES''');
END;
/
Syntax
DV_SQL_TEXT ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check SQL Text',
rule_expr => 'DV_SQL_TEXT = ''SELECT SALARY FROM HR.EMPLOYEES''');
END;
/
16-17
17
Oracle Database Vault Command Rule APIs
The DBMS_MACADM PL/SQL package provides procedures for configuring command rules. .
Only users who have been granted the DV_OWNER or DV_ADMIN role can use these procedures.
• CREATE_COMMAND_RULE Procedure
The CREATE_COMMAND_RULE procedure creates a command rule and associates it with a
rule set.
• CREATE_CONNECT_COMMAND_RULE Procedure
The CREATE_CONNECT_COMMAND_RULE procedure creates a CONNECT command rule that
you can associate with a user and a rule set.
• CREATE_SESSION_EVENT_CMD_RULE Procedure
The CREATE_SESSION_EVENT_CMD_RULE procedure creates a command rule that you can
associate with session events, based on the ALTER SESSION statement.
• CREATE_SYSTEM_EVENT_CMD_RULE Procedure
The CREATE_SYSTEM_EVENT_CMD_RULE procedure creates a command rule that you can
associate with system events, based on the ALTER SYSTEM statement.
• DELETE_COMMAND_RULE Procedure
The DELETE_COMMAND_RULE procedure drops a command rule declaration.
• DELETE_CONNECT_COMMAND_RULE Procedure
The DELETE_CONNECT_COMMAND_RULE procedure deletes a CONNECT command rule that
had been created with the CREATE_CONNECT_COMMAND_RULE procedure.
• DELETE_SESSION_EVENT_CMD_RULE Procedure
The DELETE_SESSION_EVENT_CMD_RULE procedure deletes a session command rule that
was associated with events.
• DELETE_SYSTEM_EVENT_CMD_RULE Procedure
The DELETE_SYSTEM_EVENT_CMD_RULE procedure deletes a system command rule that
was associated with events.
• UPDATE_COMMAND_RULE Procedure
The UPDATE_COMMAND_RULE procedure updates a command rule declaration.
• UPDATE_CONNECT_COMMAND_RULE Procedure
The UPDATE_CONNECT_COMMAND_RULE procedure updates a CONNECT command rule that
had been created with the CREATE_CONNECT_COMMAND_RULE procedure.
• UPDATE_SESSION_EVENT_CMD_RULE Procedure
The UPDATE_SESSION_EVENT_CMD_RULE procedure updates a session event command
rule, based on the ALTER SESSION statement.
• UPDATE_SYSTEM_EVENT_CMD_RULE Procedure
The UPDATE_SYSTEM_EVENT_CMD_RULE procedure updates a system event command rule,
based on the ALTER SYSTEM statement.
17-1
Chapter 17
CREATE_COMMAND_RULE Procedure
Related Topics
• Configuring Command Rules
You can create command rules or use the default command rules to protect DDL
and DML statements.
• Oracle Database Vault Utility APIs
Oracle Database Vault provides a set of utility APIs in the DBMS_MACUTL PL/SQL
package.
Syntax
DBMS_MACADM.CREATE_COMMAND_RULE(
command IN VARCHAR2,
rule_set_name IN VARCHAR2,
object_owner IN VARCHAR2,
object_name IN VARCHAR2,
enabled IN VARCHAR2,
privilege_scope IN NUMBER,
clause_name IN VARCHAR2,
parameter_name IN VARCHAR2,
event_name IN VARCHAR2,
component_name IN VARCHAR2,
action_name IN VARCHAR2,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
command SQL statement to protect.
See also the following:
• Default Command Rules for information about default command rules
• DBA_DV_COMMAND_RULE View for a listing of existing command
rules
• SQL Statements That Can Be Protected by Command Rules for a
listing of available SQL statements that you can use
rule_set_name Name of rule set to associate with this command rule.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
17-2
Chapter 17
CREATE_COMMAND_RULE Procedure
Parameter Description
object_owner Database schema to which this command rule will apply. The wildcard % is
allowed, except for the SELECT, INSERT, UPDATE, DELETE, and EXECUTE
statements.
To find the available users, query the DBA_USERS view, described in
Oracle Database Reference.
See also "Object Owner" in Creating a Command Rule for more
information.
object_name Object to be protected by the command rule. (The wildcard % is allowed.
See "Object Name" in Creating a Command Rule for more information
about objects protected by command rules.)
To find the available objects, query the ALL_OBJECTS view, described in
Oracle Database Reference.
enabled Specify one of the following options to set the status of the command rule:
• DBMS_MACUTL.G_YES or ‘y’ (Yes) to enable the command rule
(default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule, including
the capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
privilege_scope Obsolete parameter
clause_name A clause from the SQL statement that was used to create the command
rule. For example, a command rule for the ALTER SESSION SQL
statement could have the SET clause as the clause_name parameter.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
parameter_name A parameter from the clause_name parameter. For example, for an
ALTER SESSION command rule, you could set parameter_name to
EVENTS if the clause_name is SET.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
event_name An event that the command rule defines. For example, suppose an ALTER
SESSION command rule uses SET for the clause_name and EVENTS as
the parameter_name. The event_name could be set to TRACE if you
want to track trace events.
Applies only to ALTER SYSTEM and ALTER SESSION command rules that
have the parameter parameter set to EVENTS.
component_name A component of the event_name setting. For example, for a TRACE event,
the component_name could be GCS.
Applies only to ALTER SYSTEM and ALTER SESSION command rules that
have the parameter parameter set to EVENTS.
action_name An action of the component_name setting.
Applies only to ALTER SYSTEM and ALTER SESSION command rules that
have the parameter parameter set to EVENTS.
17-3
Chapter 17
CREATE_COMMAND_RULE Procedure
Parameter Description
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
If you create the common command rule in an application root and want it
visible to the associated PDBs, then you must synchronize the application.
For example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
17-4
Chapter 17
CREATE_COMMAND_RULE Procedure
17-5
Chapter 17
CREATE_COMMAND_RULE Procedure
Examples
The following example shows how to create a simple command rule for the SELECT
statement on the OE.ORDERS table. This command rule uses no command rules.
BEGIN
DBMS_MACADM.CREATE_COMMAND_RULE(
command => 'SELECT',
rule_set_name => 'Check User Role',
object_owner => 'OE',
object_name => 'ORDERS',
enabled => DBMS_MACUTL.G_YES);
END;
/
17-6
Chapter 17
CREATE_COMMAND_RULE Procedure
END;
/
In this example:
• rule_set_name: The ALTER SESSION SQL statement ERROR_ON_OVERLAP_TIME session
parameter must be set to either TRUE or FALSE. You can create a rule set that checks if
this setting. For example, for the rule:
EXEC DBMS_MACADM.CREATE_RULE('RULE_TRUE', 'UPPER(PARAMETER_VALUE) = ''TRUE''');
The rule set that is used with this rule can be similar to the following:
BEGIN
DBMS_MACADM.CREATE_RULE_SET(
rule_set_name => 'Test ERROR_ON_OVERLAP_TIME',
description => 'Checks if the ERROR_ON_OVERLAP_TIME setting is TRUE or
FALSE',
enabled => DBMS_MACUTL.G_YES,
eval_options => DBMS_MACUTL.G_RULESET_EVAL_ALL,
audit_options => DBMS_MACUTL.G_RULESET_AUDIT_FAIL +
DBMS_MACUTL.G_RULESET_AUDIT_SUCCESS,
fail_options => DBMS_MACUTL.G_RULESET_FAIL_SILENT,
fail_message => 'false error on overlaptime',
fail_code => 20461,
handler_options => DBMS_MACUTL.G_RULESET_HANDLER_FAIL,
handler => '',
is_static => false);
END;
/
EXEC DBMS_MACADM.ADD_RULE_TO_RULE_SET('Test ERROR_ON_OVERLAP_TIME', 'RULE_TRUE');
• object_owner and object_name must be set to % for ALTER SESSION and ALTER SYSTEM
command rules.
• enabled uses the DBMS_MACUTL.G_YES constant to enable the command rule when it is
created.
• clause_name sets the ALTER SESSION command rule to use the SET clause of the ALTER
SESSION PL/SQL statement.
• parameter_name is set to the ERROR_ON_OVERLAP_TIME parameter of the SET clause.
• scope uses the DBMS_MACUTL.G_SCOPE_COMMON constant to set the command rule to be a
common command rule. This command rule will be in the application root of a multitenant
environment, so the user running this procedure must be in the CDB root. Any rules or
rule sets that are associated with this command rule must be common.
If you were creating the command rule locally, you would set scope to
DBMS_MACUTL.G_SCOPE_LOCAL. In that case, the user who runs this procedure must be in
the PDB in which the command rule will reside. To find the existing PDBs, you can query
the DBA_PDBS data dictionary view. Any rules or rule sets that are associated with this
command rule must be local.
ALTER SYSTEM Command Rule Using the CHECKPOINT Clause
This example shows how to create an ALTER SYSTEM command rule that users the
CHECKPOINT clause. To have the command rule test for the CHECKPOINT setting, you must
create a rule set and rule, similar to the ALTER SESSION command rule in the previous
example. In this example, the parameter setting is not specified because the CHECKPOINT
setting does not have parameters.
17-7
Chapter 17
CREATE_CONNECT_COMMAND_RULE Procedure
BEGIN
DBMS_MACADM.CREATE_COMMAND_RULE(
command => 'ALTER SYSTEM',
rule_set_name => 'Test CHECKPOINT Setting',
object_owner => '%',
object_name => '%',
enabled => DBMS_MACUTL.G_YES,
clause_name => 'CHECKPOINT',
parameter_name => '',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
See also ALTER SESSION and ALTER SYSTEM Command Rules for conceptual
information about this topic.
Syntax
DBMS_MACADM.CREATE_CONNECT_COMMAND_RULE(
user_name IN VARCHAR2,
rule_set_name IN VARCHAR2,
enabled IN VARCHAR2,
scope IN NUMBER DEFAULT);
17-8
Chapter 17
CREATE_CONNECT_COMMAND_RULE Procedure
Parameters
Parameter Description
user_name User to whom the CONNECT command rule will apply. If you enter the %
wildcard, then the CONNECT command rule will be applied to every database
user.
In a multitenant environment, if you execute this procedure in the root, then
specifying % applies to all common users. If you run the procedure in a PDB,
then it applies to all local and common users who have access to this PDB. If
there are two command rules, one common and one local, and they both apply
to the same object, then both must evaluate successfully for the operation to
succeed.
In a multitenant environment, ensure that this user is common if the CONNECT
command rule is common, and local or common if the CONNECT command
rule is local.
To find existing database users in the current instance, query the DBA_USERS
view, described in Oracle Database Reference.
rule_set_name Name of rule set to associate with this command rule. In a multitenant
environment, ensure that this rule set is common if the CONNECT command
rule is common, and local if the CONNECT command rule is local.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
enabled Specify one of the following options to set the status of the command rule:
• DBMS_MACUTL.G_YES or ‘y’ (Yes) to enable the command rule (default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule, including the
capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in the
current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
If you create the common CONNECT command rule in an application root and
want it visible to the associated PDBs, then you must synchronize the
application. For example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Examples
The following example shows how to create a common CONNECT command rule in a
multitenant environment. This command rule will be in the CDB root, so the user who runs
this procedure must be in the CDB root. Any user names or rule sets that are associated with
this command rule must be common.
BEGIN
DBMS_MACADM.CREATE_CONNECT_COMMAND_RULE(
rule_set_name => 'Allow Sessions',
user_name => 'C##HR_ADMIN',
17-9
Chapter 17
CREATE_SESSION_EVENT_CMD_RULE Procedure
This example is a local version of the preceding example. The user who runs this
procedure must be in the PDB in which the local CONNECT command rule will reside.
To find the existing PDBs, query the DBA_PDBS data dictionary view. Any rule sets that
are associated with this command rule must be local. The user can be either common
or local.
BEGIN
DBMS_MACADM.CREATE_CONNECT_COMMAND_RULE(
rule_set_name => 'Allow Sessions',
user_name => 'PSMITH',
enabled => DBMS_MACUTL.G_SIMULATION,
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
In a multitenant environment, you can create both session event common and local
command rules.
Syntax
DBMS_MACADM.CREATE_SESSION_EVENT_CMD_RULE(
rule_set_name IN VARCHAR2,
enabled IN VARCHAR2,
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_set_name Name of the rule set to associate with the command rule. In a
multitenant environment, ensure that this rule set is common if the
session event command rule is common, and local if the command
rule is local.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
17-10
Chapter 17
CREATE_SESSION_EVENT_CMD_RULE Procedure
Parameter Description
enabled Specify one of the following options to set the status of the command
rule:
• DBMS_MACUTL.G_YES or ‘y’ (Yes) to enable the command rule
(default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule,
including the capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements
to execute but capture violations in the simulation log
event_name An event that the command rule defines. This setting enables the
command rule to correspond with an ALTER SESSION SET EVENTS
event_name statement. For example, to track trace events, you
would set event_name to TRACE.
component_name A component of the event_name setting. Example settings are DV,
OLS, or GCS.
You can find valid component names by issuing ORADEBUG DOC
COMPONENT RDBMS as user SYS. The output displays parent and child
components, which you can use for the component_name setting.
For example, both XS (parent) and XSSESSION (child of XS) are valid
component names. If you select the parent component, then the
command rule applies to it and the child components.
action_name An action of the component_name setting
scope For a multitenant environment, determines how to execute this
procedure. The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is
local in the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in
the application root
If you create the common command rule in an application root and
want it visible to the associated PDBs, then you must synchronize the
application. For example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Examples
The following example shows how to create a common session event command rule in a
multitenant environment. This command rule will be in the application root, so the user
running this procedure must be in the CDB root. Any user names or rule sets that are
associated with this command rule must be common.
BEGIN
DBMS_MACADM.CREATE_SESSION_EVENT_CMD_RULE(
rule_set_name => 'Allow Sessions',
event_name => 'TRACE',
component_name => 'DV',
action_name => 'CURSORTRACE',
enabled => DBMS_MACUTL.G_SIMULATION,
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
17-11
Chapter 17
CREATE_SYSTEM_EVENT_CMD_RULE Procedure
This example shows how to create a session event for the 47998 trace event.
BEGIN
DBMS_MACADM.CREATE_SESSION_EVENT_CMD_RULE(
rule_set_name => 'Allow Sessions',
event_name => '47998',
enabled => 'y',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
In a multitenant environment, you can create both ALTER SYSTEM common and local
command rules.
Syntax
DBMS_MACADM.CREATE_SYSTEM_EVENT_CMD_RULE(
rule_set_name IN VARCHAR2,
enabled IN VARCHAR2,
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_set_name Name of the rule set to associate with the command rule. In a
multitenant environment, ensure that this rule set is common if the
system event command rule is common, and local if the command
rule is local.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
event_name An event that the command rule defines. This setting enables the
command rule to correspond to an ALTER SYSTEM SET EVENTS
event_name statement. For example, to track trace events, you would
set event_name to TRACE.
component_name A component of the event_name setting. Example settings are DV,
OLS, or GCS.
You can find valid component names by issuing ORADEBUG DOC
COMPONENT RDBMS as user SYS. The output displays parent and child
components, which you can use for the component_name setting. For
example, both XS (parent) and XSSESSION (child of XS) are valid
component names. If you select the parent component, then the
command rule applies to it and the child components.
action_name An action of the component_name setting
17-12
Chapter 17
DELETE_COMMAND_RULE Procedure
Parameter Description
enabled Specify one of the following options to set the status of the command
rule:
• DBMS_MACUTL.G_YES or ‘y’ to enable the command rule
(default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule,
including the capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements
to execute but capture violations in the simulation log
scope For a multitenant environment, determines how to execute this
procedure. The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is
local in the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in
the application root
If you create the common command rule in an application root and
want it visible to the associated PDBs, then you must synchronize the
application. For example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Example
The following example shows how to create a common system event command rule in a
multitenant environment. This command rule will be in the application root, so the user
running this procedure must be in the CDB root. Any user names or rule sets that are
associated with this command rule must be common.
BEGIN
DBMS_MACADM.CREATE_SYSTEM_EVENT_CMD_RULE(
rule_set_name => 'Enabled',
event_name => 'TRACE',
component_name => 'GSIPC',
action_name => 'HEAPDUMP',
enabled => DBMS_MACUTL.G_YES,
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
Syntax
DBMS_MACADM.DELETE_COMMAND_RULE(
command IN VARCHAR2,
object_owner IN VARCHAR2,
object_name IN VARCHAR2,
clause_name IN VARCHAR2,
parameter_name IN VARCHAR2 DEFAULT,
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
17-13
Chapter 17
DELETE_COMMAND_RULE Procedure
Parameters
Parameter Description
command SQL statement the command rule protects.
To find available command rules, query the DBA_DV_COMMAND_RULE view,
described in DBA_DV_COMMAND_RULE View
object_owner Database schema to which this command rule applies.
To find the available users in the current database instance, query the
DBA_USERS view, described in Oracle Database Reference.
object_name Object name. The wildcard % is allowed.
To find the available objects in the current database instance, query the
ALL_OBJECTS view, described in Oracle Database Reference.
clause_name A clause from the SQL statement that was used to create the command
rule.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
parameter_name A parameter from the clause_name parameter.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
event_name An event that the command rule defines.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
component_name A component of the event_name setting.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
action_name An action of the component_name setting.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
Examples
When you drop a command rule, you must omit the rule_set_name and enabled
parameters, and ensure that the rest of the parameters match the settings that were
used the last time the command rule was updated. You can check the most recent
settings by querying the DBA_DV_COMMAND_RULE data dictionary view.
17-14
Chapter 17
DELETE_CONNECT_COMMAND_RULE Procedure
END;
/
To drop this command rule, use the most of same parameters as shown here, but omit
rule_set_name and enabled.
BEGIN
DBMS_MACADM.DELETE_COMMAND_RULE(
command => 'SELECT',
object_owner => 'OE',
object_name => 'ORDERS',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
The following example shows how to delete an ALTER SESSION command rule.
BEGIN
DBMS_MACADM.DELETE_COMMAND_RULE(
command => 'ALTER SESSION',
object_owner => '%',
object_name => '%',
clause_name => 'SET',
parameter_name => 'EVENTS',
event_name => 'TRACE',
component_name => 'GCS',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
Syntax
DBMS_MACADM.DELETE_CONNECT_COMMAND_RULE(
user_name IN VARCHAR2,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
user_name User to whom the CONNECT command rule applied.
To find this user, query the OBJECT_OWNER field of the DBA_DV_COMMAND_RULE
view.
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in the
current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
17-15
Chapter 17
DELETE_SESSION_EVENT_CMD_RULE Procedure
Example
BEGIN
DBMS_MACADM.DELETE_CONNECT_COMMAND_RULE(
user_name => 'PSMITH',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
Syntax
DBMS_MACADM.DELETE_SESSION_EVENT_CMD_RULE(
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
event_name An event that the session event command rule defines.
DBA_DV_COMMAND_RULE View for a information about existing
command rules
component_name A component of the event_name setting
action_name An action of the component_name setting
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
Example
The following example shows how to delete a common session event command rule in
the application root a multitenant environment. The user running this procedure must
be a common user in the CDB root. When you specify the parameters, ensure that
they match exactly the parameters that were used the last time the command rule was
updated. To find the current settings of the command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
BEGIN
DBMS_MACADM.DELETE_SESSION_EVENT_CMD_RULE(
event_name => '47999',
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
17-16
Chapter 17
DELETE_SYSTEM_EVENT_CMD_RULE Procedure
Syntax
DBMS_MACADM.DELETE_SYSTEM_EVENT_CMD_RULE(
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
event_name An event that the system event command rule defines.
See DBA_DV_COMMAND_RULE View for a information about existing
command rules.
component_name A component of the event_name setting
action_name An action of the component_name setting
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in the
current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
Examples
The following example shows how to delete a common system event command rule in the
application root of a multitenant environment. The user running this procedure must be a
common user in the CDB root. When you specify the parameters, ensure that they match
exactly the parameters that were used the last time the command rule was updated. To find
the current settings of the command rule, query the DBA_DV_COMMAND_RULE view, described in
DBA_DV_COMMAND_RULE View
BEGIN
DBMS_MACADM.DELETE_SYSTEM_EVENT_CMD_RULE(
event_name => 'TRACE',
component_name => 'DV',
action_name => '',
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
In a multitenant environment, you can update both common and local command rules.
17-17
Chapter 17
UPDATE_COMMAND_RULE Procedure
Syntax
DBMS_MACADM.UPDATE_COMMAND_RULE(
command IN VARCHAR2,
rule_set_name IN VARCHAR2,
object_owner IN VARCHAR2,
object_name IN VARCHAR2,
enabled IN VARCHAR2,
privilege_scope IN NUMBER,
clause_name IN VARCHAR2,
parameter_name IN VARCHAR2 DEFAULT,
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
command Command rule to update
See also the following:
• SQL Statements That Can Be Protected by Command Rules for a
listing of available SQL statements that you can use
• DBA_DV_COMMAND_RULE View for a information about existing
command rules
rule_set_name Name of rule set to associate with this command rule.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in Oracle Database Vault Data
Dictionary Views.
object_owner Database schema to which this command rule applies.
To find the available users, query the DBA_USERS view, described in
Oracle Database Reference. See also "Object Owner" in Creating a
Command Rule for more information.
object_name Object name. (The wildcard % is allowed. See "Object Name" in Creating
a Command Rule for more information about objects protected by
command rules.)
To find the available objects, query the ALL_OBJECTS view, described in
Oracle Database Reference.
enabled Specify one of the following options to set the status of the command
rule:
• DBMS_MACUTL.G_YES or ‘y’ to enable the command rule (default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule, including
the capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
privilege_scope Obsolete parameter
clause_name A clause from the SQL statement that was used to create the command
rule. For example, a command rule for the ALTER SESSION SQL
statement could have the SET clause as the clause_name parameter.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
17-18
Chapter 17
UPDATE_COMMAND_RULE Procedure
Parameter Description
parameter_name A parameter from the clause_name parameter. For example, for an
ALTER SESSION command rule, you could set parameter_name to
EVENTS if the clause_name is SET.
Applies only to command rules for ALTER SYSTEM and ALTER SESSION.
event_name An event that the command rule defines. For example, for an ALTER
SESSION command rule that uses SET for the clause_name and EVENTS
as the parameter_name, then the event_name could be set to TRACE.
Applies only to ALTER SYSTEM and ALTER SESSION command rules that
have the parameter parameter set to events.
component_name A component of the event_name setting. For example, for a TRACE event,
the component_name could be GCS.
Applies only to ALTER SYSTEM and ALTER SESSION command rules that
have the parameter parameter set to events.
action_name An action of the component_name setting. For example, if
component_name is set to GCS, then the action_name setting could be
DISK HIGH.
Applies only to ALTER SYSTEM and ALTER SESSION command rules that
have the parameter parameter set to events.
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
If you update the common command rule in an application root and want
it visible to the associated PDBs, then you must synchronize the
application. For example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Examples
The following example shows how to create a simple command rule that protects the
HR.EMPLOYEES schema.
BEGIN
DBMS_MACADM.UPDATE_COMMAND_RULE(
command => 'SELECT',
rule_set_name => 'Enabled',
object_owner => 'HR',
object_name => 'EMPLOYEES',
enabled => DBMS_MACUTL.G_SIMULATION,
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
This example shows how to update a more complex command rule, which is based on the
ALTER SESSION SQL statement.
17-19
Chapter 17
UPDATE_CONNECT_COMMAND_RULE Procedure
BEGIN
DBMS_MACADM.UPDATE_COMMAND_RULE(
command => 'ALTER SESSION',
rule_set_name => 'Enabled',
object_owner => '%',
object_name => '%',
enabled => 's',
clause_name => 'SET',
parameter_name => 'EVENTS',
event_name => 'TRACE',
component_name => 'GCS',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
Syntax
DBMS_MACADM.CREATE_UPDATE_CONNECT_COMMAND_RULE(
user_name IN VARCHAR2,
rule_set_name IN VARCHAR2,
enabled IN VARCHAR2,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
user_name User to whom the CONNECT command rule will apply. If you enter the %
wildcard, then the CONNECT command rule will be applied to every
database user.
In a multitenant environment, if you execute this procedure in the root,
then specifying % applies to all common users. If you run the procedure in
a PDB, then it applies to all local and common users who have access to
this PDB. If there are two command rules, one common and one local,
and they both apply to the same object, then both must evaluate
successfully for the operation to succeed.
In a multitenant environment, ensure that this user is common if the
CONNECT command rule is common, and local or common if the
CONNECT command rule is local.
To find existing command rules, query the DBA_DV_COMMAND_RULE view,
described in DBA_DV_COMMAND_RULE View.
To find existing database users in the current instance, query the
DBA_USERS view, described in Oracle Database Reference.
rule_set_name Name of rule set to associate with this command rule. In a multitenant
environment, ensure that this rule set is common if the CONNECT
command rule is common, and local if the CONNECT command rule is
local.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
17-20
Chapter 17
UPDATE_SESSION_EVENT_CMD_RULE Procedure
Parameter Description
enabled Specify one of the following options to set the status of the command rule:
• DBMS_MACUTL.G_YES or ‘y’ to enable the command rule (default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule, including
the capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
If you update the common command rule in an application root and want it
visible to the associated PDBs, then you must synchronize the application.
For example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Example
BEGIN
DBMS_MACADM.UPDATE_CONNECT_COMMAND_RULE(
rule_set_name => 'Allow Sessions',
user_name => 'PSMITH',
enabled => 'DBMS_MACUTL.G_YES',
scope => DBMS_MACUTL.G_SCOPE_LOCAL);
END;
/
In a multitenant environment, you can update both common and local session event
command rules.
Syntax
DBMS_MACADM.UPDATE_SESSION_EVENT_CMD_RULE(
rule_set_name IN VARCHAR2,
enabled IN VARCHAR2,
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
17-21
Chapter 17
UPDATE_SESSION_EVENT_CMD_RULE Procedure
Parameters
Parameter Description
rule_set_name Name of the rule set to associate with the command rule. In a multitenant
environment, ensure that this rule set is common if the session event
command rule is common, and local if the command rule is local.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
enabled Specify one of the following options to set the status of the command rule:
• DBMS_MACUTL.G_YES or ‘y’ to enable the command rule (default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule, including
the capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
event_name An event that the command rule defines. This setting enables the
command rule to correspond with an ALTER SESSION SET EVENTS
event_name statement. For example, to track trace events, you would set
event_name to TRACE.
component_name A component of the event_name setting. Example settings are DV, OLS,
or GCS.
You can find valid component names by issuing ORADEBUG DOC
COMPONENT RDBMS as user SYS. The output displays parent and child
components, which you can use for the component_name setting. For
example, both XS (parent) and XSSESSION (child of XS) are valid
component names. If you select the parent component, then the
command rule applies to it and the child components.
action_name An action of the component_name setting
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
If you update the common command rule in an application root and want it
visible to the associated PDBs, then you must synchronize the application.
For example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Example
The following example shows how to update a common session event command rule
in a multitenant environment. This command rule is in the application root, so the user
running this procedure must be in the CDB root. Any user names or rule sets that are
associated with this command rule must be common.
BEGIN
DBMS_MACADM.UPDATE_SESSION_EVENT_CMD_RULE(
rule_set_name => 'Allow Sessions',
event_name => '47999',
17-22
Chapter 17
UPDATE_SYSTEM_EVENT_CMD_RULE Procedure
In a multitenant environment, you can update both common and local session event
command rules.
Syntax
DBMS_MACADM.UPDATE_SYSTEM_EVENT_CMD_RULE(
rule_set_name IN VARCHAR2,
enabled IN VARCHAR2,
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
rule_set_name Name of the rule set to associate with the command rule. In a multitenant
environment, ensure that this rule set is common if the system event command
rule is common, and local if the command rule is local.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
enabled Specify one of the following options to set the status of the command rule:
• DBMS_MACUTL.G_YES or ‘y’ to enable the command rule (default)
• DBMS_MACUTL.G_NO or ‘n’ to disable the command rule, including the
capture of violations in the simulation log
• DBMS_MACUTL.G_SIMULATION or ‘s’ to enable SQL statements to
execute but capture violations in the simulation log
event_name An event that the command rule defines. This setting enables the command rule
to correspond to an ALTER SYSTEM SET EVENTS event_name statement. For
example, to track trace events, you would set event_name to TRACE.
component_name A component of the event_name setting. Example settings are DV, OLS, or GCS.
You can find valid component names by issuing ORADEBUG DOC COMPONENT
RDBMS as user SYS. The output displays parent and child components, which
you can use for the component_name setting. For example, both XS (parent)
and XSSESSION (child of XS) are valid component names. If you select the
parent component, then the command rule applies to it and the child
components.
action_name An action of the component_name setting
17-23
Chapter 17
UPDATE_SYSTEM_EVENT_CMD_RULE Procedure
Parameter Description
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in the
current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
If you update the common command rule in an application root and want it
visible to the associated PDBs, then you must synchronize the application. For
example:
ALTER PLUGGABLE DATABASE APPLICATION saas_sales_app SYNC;
Example
The following example shows how to update a common system event command rule
in a multitenant environment. This command rule is in the application root, so the user
running this procedure must be in the CDB root. Any user names or rule sets that are
associated with this command rule must be common.
BEGIN
DBMS_MACADM.UPDATE_SYSTEM_EVENT_CMD_RULE(
rule_set_name => 'Disabled',
event_name => 'TRACE',
component_name => 'DV',
enabled => 'n',
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
17-24
18
Oracle Database Vault Factor APIs
The DBMS_MACADM PL/SQL package has factor-related Oracle Database Vault rule procedures
and functions, and DVF has functions to manage factors.
Only users who have been granted the DV_OWNER or DV_ADMIN role can use these procedures
and functions.
• ADD_FACTOR_LINK Procedure
The ADD_FACTOR_LINK procedure specifies a parent-child relationship for two factors.
• ADD_POLICY_FACTOR Procedure
The ADD_POLICY_FACTOR procedure specifies that the label for a factor contributes to the
Oracle Label Security label for a policy.
• CHANGE_IDENTITY_FACTOR Procedure
The CHANGE_IDENTITY_FACTOR procedure associates an identity with a different factor.
• CHANGE_IDENTITY_VALUE Procedure
The CHANGE_IDENTITY_FACTOR procedure updates the value of an identity.
• CREATE_DOMAIN_IDENTITY Procedure
The CREATE_DOMAIN_IDENTITY procedure is used for Oracle Real Application Clusters
(Oracle RAC) and Oracle Label Security.
• CREATE_FACTOR Procedure
The CREATE_FACTOR procedure creates a factor.
• CREATE_FACTOR_TYPE Procedure
The CREATE_FACTOR_TYPE procedure creates a user-defined factor type.
• CREATE_IDENTITY Procedure
The CREATE_IDENTITY procedure assigns an identity and an associated trust level for a
given factor.
• CREATE_IDENTITY_MAP Procedure
The CREATE_IDENTITY_MAP procedure defines tests that can derive the identity of a factor
from the value of linked child factors (subfactors).
18-1
Chapter 18
DBMS_MACADM Factor Procedures and Functions
• DELETE_FACTOR Procedure
The DELETE_FACTOR procedure deletes a factor.
• DELETE_FACTOR_LINK Procedure
The DELETE_FACTOR_LINK procedure removes a parent-child relationship for two
factors.
• DELETE_FACTOR_TYPE Procedure
The DELETE_FACTOR_TYPE procedure deletes a factor type.
• DELETE_IDENTITY Procedure
The DELETE_IDENTITY procedure removes an identity from an existing factor.
• DELETE_IDENTITY_MAP Procedure
The DELETE_IDENTITY_MAP procedure removes an identity map for a factor.
• DROP_DOMAIN_IDENTITY Procedure
The DROP_DOMAIN_IDENTITY procedure removes an Oracle Real Application
Clusters database node from a domain.
• GET_SESSION_INFO Function
The GET_SESSION_INFO function returns information from the SYS.V_$SESSION
system table for the current session.
• GET_INSTANCE_INFO Function
The GET_INSTANCE_INFO function returns information from the SYS.V_$INSTANCE
system table about the current database instance.
• RENAME_FACTOR Procedure
The RENAME_FACTOR procedure renames a factor; the name change takes effect
everywhere the factor is used.
• RENAME_FACTOR_TYPE Procedure
The RENAME_FACTOR procedure renames a factor type; the name change takes
effect everywhere the factor type is used.
• UPDATE_FACTOR Procedure
The UPDATE_FACTOR procedure updates the description of a factor type.
• UPDATE_FACTOR_TYPE Procedure
The UPDATE_FACTOR_TYPE procedure updates a factor type.
• UPDATE_IDENTITY Procedure
The UPDATE_IDENTITY procedure updates the trust level of a factor identity.
Related Topics
• Configuring Factors
Factors allow you to create and use complex attributes through PL/SQL to make
Oracle Database Vault authorization decisions.
• Oracle Database Vault Utility APIs
Oracle Database Vault provides a set of utility APIs in the DBMS_MACUTL PL/SQL
package.
18-2
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Syntax
DBMS_MACADM.ADD_FACTOR_LINK(
parent_factor_name IN VARCHAR2,
child_factor_name IN VARCHAR2,
label_indicator IN VARCHAR2);
Parameters
Parameter Description
parent_factor_name Parent factor name.
To find existing parent and child factors in the current database
instance, query the DBA_DV_FACTOR_LINK view, described in
DBA_DV_FACTOR_LINK View.
child_factor_name Child factor name.
label_indicator Indicates that the child factor being linked to the parent factor
contributes to the label of the parent factor in an Oracle Label
Security integration. Specify either DBMS_MACUTL.G_YES (for Yes) or
DBMS_MACUTL.G_NO (for No).
To find the Oracle Label Security policies and labels associated with
factors, query the following views, described in Oracle Database Vault
Data Dictionary Views:
• DBA_DV_MAC_POLICY: Lists Oracle Label Security policies
defined in the current database instance.
• DBA_DV_MAC_POLICY_FACTOR: Lists the factors that are
associated with Oracle Label Security policies for the current
database instance.
• DBA_DV_POLICY_LABEL: Lists the Oracle Label Security label for
each factor identifier in the DBA_DV_IDENTITY view for each
policy.
Example
BEGIN
DBMS_MACADM.ADD_FACTOR_LINK(
parent_factor_name => 'HQ_ClientID',
child_factor_name => 'Div1_ClientID',
label_indicator => DBMS_MACUTL.G_YES);
END;
/
18-3
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Syntax
DBMS_MACADM.ADD_POLICY_FACTOR(
policy_name IN VARCHAR2,
factor_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Oracle Label Security policy name.
To find the policies defined in the current database instance, query the
DBA_DV_MAC_POLICY view, described in DBA_DV_MAC_POLICY View.
To find factors that are associated with Oracle Label Security policies,
query DBA_DV_MAC_POLICY_FACTOR, described in
DBA_DV_MAC_POLICY View.
factor_name Factor name.
To find existing factors, query the DBA_DV_FACTOR view, described in
DBA_DV_FACTOR View.
Example
BEGIN
DBMS_MACADM.ADD_POLICY_FACTOR(
policy_name => 'AccessData',
factor_name => 'Sector2_ClientID');
END;
/
Syntax
DBMS_MACADM.CHANGE_IDENTITY_FACTOR(
factor_name IN VARCHAR2,
value IN VARCHAR2,
new_factor_name IN VARCHAR2);
18-4
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameters
Parameter Description
factor_name Current factor name.
To find existing factors, query the DBA_DV_FACTOR view, described in
DBA_DV_FACTOR View.
value Value of the identity to update.
To find existing identities for each factor in the current database instance,
query the DBA_DV_IDENTITY view, described in DBA_DV_IDENTITY View.
To find current identity mappings, query the DBA_DV_IDENTITY_MAP view,
described in DBA_DV_IDENTITY_MAP View.
new_factor_name Name of the factor to associate with the identity, which you can find by
querying the DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
Example
BEGIN
DBMS_MACADM.CHANGE_IDENTITY_FACTOR(
factor_name => 'Sector2_ClientID',
value => 'intranet',
new_factor_name => 'Sector4_ClientID');
END;
/
Syntax
DBMS_MACADM.CHANGE_IDENTITY_VALUE(
factor_name IN VARCHAR2,
value IN VARCHAR2,
new_value IN VARCHAR2);
Parameters
Parameter Description
factor_name Factor name.
To find existing factors, query the DBA_DV_FACTOR view, described in
DBA_DV_FACTOR View.
value Current value associated with the identity.
To find existing identities for each factor in the current database instance, query
the DBA_DV_IDENTITY view, described in DBA_DV_FACTOR View.
To find current identity mappings, query the DBA_DV_IDENTITY_MAP view,
described in DBA_DV_IDENTITY_MAP View.
new_value New identity value, up to 1024 characters in mixed-case.
18-5
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Example
BEGIN
DBMS_MACADM.CHANGE_IDENTITY_VALUE(
factor_name => 'Sector2_ClientID',
value => 'remote',
new_value => 'intranet');
END;
/
Syntax
DBMS_MACADM.CREATE_DOMAIN_IDENTITY(
domain_name IN VARCHAR2,
domain_host IN VARCHAR2,
policy_name IN VARCHAR2 DEFAULT NULL,
domain_label IN VARCHAR2 DEFAULT NULL);
Parameters
Parameter Description
domain_name Name of the domain to which to add the host.
To find the logical location of the database within the network structure
within a distributed database system, run the DVF.F$DATABASE_DOMAIN
function, described in Oracle Database Vault DVF PL/SQL Factor
Functions.
domain_host Oracle Real Application Clusters host name being added to the domain.
To find host name of a database, run the DVF.F$DATABASE_HOSTNAME
function, described in Oracle Database Vault DVF PL/SQL Factor
Functions.
policy_name Oracle Label Security policy name. If you omit the policy name, then the
domain is not associated with any policy.
To find the available policies, query the DBA_DV_MAC_POLICY view,
described in DBA_DV_MAC_POLICY View.
domain_label Name of the domain to which to add the Oracle Label Security policy.
Examples
BEGIN
DBMS_MACADM.CREATE_DOMAIN_IDENTITY(
domain_name => 'example',
domain_host => 'mydom_host',
policy_name => 'AccessData',
domain_label => 'sensitive');
18-6
Chapter 18
DBMS_MACADM Factor Procedures and Functions
END;
/
After you create a factor, you can give it an identity by using the CREATE_IDENTITY procedure,
described in CREATE_IDENTITY Procedure.
Syntax
DBMS_MACADM.CREATE_FACTOR(
factor_name IN VARCHAR2,
factor_type_name IN VARCHAR2,
description IN VARCHAR2,
rule_set_name IN VARCHAR2,
get_expr IN VARCHAR2,
validate_expr IN VARCHAR2,
identify_by IN NUMBER,
labeled_by IN NUMBER,
eval_options IN NUMBER,
audit_options IN NUMBER,
fail_options IN NUMBER);
Parameters
Parameter Description
factor_name Factor name, up to 128 characters in mixed-case, without spaces.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
factor_type_name Type of the factor, up to 128 characters in mixed-case, without spaces.
To find existing factor types, query the DBA_DV_FACTOR_TYPE view,
described in DBA_DV_FACTOR_TYPE View.
description Description of the purpose of the factor, up to 1024 characters in mixed-
case.
rule_set_name Rule set name if you want to use a rule set to control when and how a factor
identity is set.
To find existing rule sets, query the DBA_DV_RULE_SET view, described in
Oracle Database Vault Data Dictionary Views. See also Assigning a Rule
Set to a Factor for more information about assigning rule sets to factors.
get_expr Valid PL/SQL expression that retrieves the identity of a factor. It can use up
to 255 characters in mixed-case. See Setting the Retrieval Method for a
Factor for more information. See also the audit_options parameter.
validate_expr Name of the procedure to validate the factor. This is a valid PL/SQL
expression that returns a Boolean value (TRUE or FALSE) to validate the
identity of the factor. See Setting the Validation Method for a Factor for more
information.
18-7
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameter Description
identify_by Options for determining the identity of a factor, based on the expression set
for the get_expr parameter:
• DBMS_MACUTL.G_IDENTIFY_BY_CONSTANT: By constant
• DBMS_MACUTL.G_IDENTIFY_BY_METHOD: By method
• DBMS_MACUTL.G_IDENTIFY_BY_FACTOR: By factor
• DBMS_MACUTL.G_IDENTIFY_BY_CONTEXT: By context
See Setting the Factor Identification Information for more information.
labeled_by Options for labeling the factor:
• DBMS_MACUTL.G_LABELED_BY_SELF: Labels the identities for the
factor directly from the labels associated with an Oracle Label Security
policy (default)
• DBMS_MACUTL.G_LABELED_BY_FACTORS: Derives the factor identity
label from the labels of its child factor identities.
See Setting the Oracle Label Security Labeling Information for a Factor for
more information.
eval_options Options for evaluating the factor when the user logs on:
• DBMS_MACUTL.G_EVAL_ON_SESSION: When the database session is
created (default)
• DBMS_MACUTL.G_EVAL_ON_ACCESS: Each time the factor is accessed
• DBMS_MACUTL.G_EVAL_ON_STARTUP: On start-up
See Setting the Evaluation Information for a Factor for more information.
audit_options Options for auditing the factor if you want to generate a custom Oracle
Database Vault audit record.
• DBMS_MACUTL.G_AUDIT_OFF: Disables auditing.
• DBMS_MACUTL.G_AUDIT_ALWAYS: Always audits.
• DBMS_MACUTL.G_AUDIT_ON_GET_ERROR: Audits if get_expr returns
an error.
• DBMS_MACUTL.G_AUDIT_ON_GET_NULL: Audits if get_expr is null.
• DBMS_MACUTL.G_AUDIT_ON_VALIDATE_ERROR: Audits if the validation
procedure returns an error.
• DBMS_MACUTL.G_AUDIT_ON_VALIDATE_FALSE: Audits if the validation
procedure is false.
• DBMS_MACUTL.G_AUDIT_ON_TRUST_LEVEL_NULL: Audits if there is no
trust level set.
• DBMS_MACUTL.G_AUDIT_ON_TRUST_LEVEL_NEG: Audits if the trust
level is negative.
The audit_options parameter applies to traditional auditing only. If you
have enabled unified auditing, then create a unified audit policy instead of
using audit_options.
See Setting Audit Options for a Factor for more information.
fail_options Options for reporting factor errors:
• DBMS_MACUTL.G_FAIL_WITH_MESSAGE: Shows an error message
(default)
• DBMS_MACUTL.G_FAIL_SILENTLY: Does not show an error message
See Setting Error Options for a Factor for more information.
18-8
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Example
BEGIN
DBMS_MACADM.CREATE_FACTOR(
factor_name => 'Sector2_DB',
factor_type_name => 'Instance',
description => ' ',
rule_set_name => 'Limit_DBA_Access',
get_expr => 'UPPER(SYS_CONTEXT(''USERENV'',''DB_NAME''))',
validate_expr => 'dbavowner.check_db_access',
identify_by => DBMS_MACUTL.G_IDENTIFY_BY_METHOD,
labeled_by => DBMS_MACUTL.G_LABELED_BY_SELF,
eval_options => DBMS_MACUTL.G_EVAL_ON_SESSION,
audit_options => DBMS_MACUTL.G_AUDIT_OFF,
fail_options => DBMS_MACUTL.G_FAIL_SILENTLY);
END;
/
Syntax
DBMS_MACADM.CREATE_FACTOR_TYPE(
name IN VARCHAR2,
description IN VARCHAR2);
Parameters
Parameter Description
name Factor type name, up to 128 characters in mixed-case, without spaces.
To find existing factor types, query the DBA_DV_FACTOR_TYPE view, described
in DBA_DV_FACTOR_TYPE View.
description Description of the purpose of the factor type, up to 1024 characters in mixed-
case.
Example
BEGIN
DBMS_MACADM.CREATE_FACTOR_TYPE(
name => 'Sector2Instance',
description => 'Checks DB instances used in Sector 2');
END;
/
18-9
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Syntax
DBMS_MACADM.CREATE_IDENTITY(
factor_name IN VARCHAR2,
value IN VARCHAR2,
trust_level IN NUMBER);
Parameters
Parameter Description
factor_name Factor name.
To find existing factors, query the DBA_DV_FACTOR view, described in
DBA_DV_FACTOR View.
value The actual value of the factor, up to 1024 characters in mixed-case. For
example, the identity of an IP_Address factor could be the IP address of
192.0.2.12.
trust_level Number that indicates the magnitude of trust relative to other identities for
the same factor. In general, the higher the trust level number is set, the
greater the trust. A trust level of 10 indicates "very trusted." Negative trust
levels are not trusted.
See Creating and Configuring a Factor Identity for more information about
trust levels and label security.
Example
BEGIN
DBMS_MACADM.CREATE_IDENTITY(
factor_name => 'Sector2_ClientID',
value => 'intranet',
trust_level => 5);
END;
/
Syntax
DBMS_MACADM.CREATE_IDENTITY_MAP(
identity_factor_name IN VARCHAR2,
identity_factor_value IN VARCHAR2,
parent_factor_name IN VARCHAR2,
child_factor_name IN VARCHAR2,
operation IN VARCHAR2,
operand1 IN VARCHAR2,
operand2 IN VARCHAR2);
18-10
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameters
Parameter Description
identity_factor_name Factor the identity map is for.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
identity_factor_value Value the factor assumes if the identity map evaluates to TRUE.
To find existing factor identities, query the DBA_DV_IDENTITY view,
described in DBA_DV_IDENTITY View.
To find current factor identity mappings, use
DBA_DV_IDENTITY_MAP, described in DBA_DV_IDENTITY_MAP
View.
parent_factor_name The parent factor link to which the map is related.
To find existing parent-child factor mappings, query the
DBA_DV_IDENTITY_MAP view, described in
DBA_DV_IDENTITY_MAP View.
child_factor_name The child factor link to which the map is related.
operation Relational operator for the identity map (for example, <, >, =, and
so on).
operand1 Left operand for the relational operator; refers to the low value you
enter.
operand2 Right operand for the relational operator; refers to the high value
you enter.
Example
BEGIN
DBMS_MACADM.CREATE_IDENTITY_MAP(
identity_factor_name => 'Sector2_ClientID',
identity_factor_value => 'intranet',
parent_factor_name => 'HQ_ClientID',
child_factor_name => 'Div1_ClientID',
operation => '<',
operand1 => '192.0.2.50',
operand2 => '192.0.2.100');
END;
/
Syntax
DBMS_MACADM.DELETE_FACTOR(
factor_name IN VARCHAR2);
18-11
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameters
Parameter Description
factor_name Factor name.
To find existing factors in the current database instance, query
the DBA_DV_FACTOR view, described in DBA_DV_FACTOR
View.
Example
EXEC DBMS_MACADM.DELETE_FACTOR('Sector2_ClientID');
Syntax
DBMS_MACADM.DELETE_FACTOR_LINK(
parent_factor_name IN VARCHAR2,
child_factor_name IN VARCHAR2);
Parameters
Parameter Description
parent_factor_name Factor name.
To find factors that are used in parent-child mappings in the current
database instance, query the DBA_DV_FACTOR_LINK view,
described in DBA_DV_FACTOR_LINK View.
child_factor_name Factor name
Example
BEGIN
DBMS_MACADM.DELETE_FACTOR_LINK(
parent_factor_name => 'HQ_ClientID',
child_factor_name => 'Div1_ClientID');
END;
/
Syntax
DBMS_MACADM.DELETE_FACTOR_TYPE(
name IN VARCHAR2);
18-12
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameters
Parameter Description
name Factor type name.
To find existing factor types, query the DBA_DV_FACTOR_TYPE view, described in
DBA_DV_FACTOR_TYPE View.
Example
EXEC DBMS_MACADM.DELETE_FACTOR_TYPE('Sector2Instance');
Syntax
DBMS_MACADM.DELETE_IDENTITY(
factor_name IN VARCHAR2,
value IN VARCHAR2);
Parameters
Parameter Description
factor_name Factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
value Identity value associated with the factor.
To find the identities for each factor in the current database instance,
query the DBA_DV_IDENTITY view, described in DBA_DV_IDENTITY
View.
Example
BEGIN
DBMS_MACADM.DELETE_IDENTITY(
factor_name => 'Sector2_ClientID',
value => 'intranet');
END;
/
18-13
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Syntax
DBMS_MACADM.DELETE_IDENTITY_MAP(
identity_factor_name IN VARCHAR2,
identity_factor_value IN VARCHAR2,
parent_factor_name IN VARCHAR2,
child_factor_name IN VARCHAR2,
operation IN VARCHAR2,
operand1 IN VARCHAR2,
operand2 IN VARCHAR2);
Parameters
Parameter Description
identity_factor_name Factor the identity map is for.
To find existing factors in the current database instance, query
the DBA_DV_FACTOR view, described in DBA_DV_FACTOR
View.
identity_factor_value Value the factor assumes if the identity map evaluates to
TRUE.
To find existing factor identities, query the DBA_DV_IDENTITY
view, described in DBA_DV_IDENTITY View.
To find current factor identity mappings, query
DBA_DV_IDENTITY_MAP, described in
DBA_DV_IDENTITY_MAP View.
parent_factor_name The parent factor link to which the map is related.
To find existing parent-child factors, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR_LINK
View.
child_factor_name The child factor to which the map is related.
operation Relational operator for the identity map (for example, <, >, =,
and so on).
operand1 Left (low value) operand for the relational operator.
operand2 Right (high value) operand for the relational operator.
Example
BEGIN
DBMS_MACADM.DELETE_IDENTITY_MAP(
identity_factor_name => 'Sector2_ClientID',
identity_factor_value => 'intranet',
parent_factor_name => 'HQ_ClientID',
child_factor_name => 'Div1_ClientID',
operation => '<',
operand1 => '192.0.2.10',
operand2 => '192.0.2.15');
18-14
Chapter 18
DBMS_MACADM Factor Procedures and Functions
END;
/
Syntax
DBMS_MACADM.DROP_DOMAIN_IDENTITY(
domain_name IN VARCHAR2,
domain_host IN VARCHAR2);
Parameters
Parameter Description
domain_name Name of the domain to which the host was added.
To find the domain of a database as specified by the DB_DOMAIN initialization
parameter, run the DVF.F$DATABASE_DOMAIN function, described in
F$DATABASE_DOMAIN Function.
domain_host Oracle Real Application Clusters host name being that was added to the
domain.
To find the host name for a specified database, run the
DVF.F$DATABASE_HOSTNAME function, described in F$DATABASE_NAME
Function.
Example
BEGIN
DBMS_MACADM.DROP_DOMAIN_IDENTITY(
domain_name => 'example',
domain_host => 'mydom_host');
END;
/
Syntax
DBMS_MACADM.GET_SESSION_INFO(
p_parameter IN VARCHAR2)
RETURN VARCHAR2;
18-15
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameters
Parameter Description
p_parameter Column name in the SYS.V_$SESSION system table.
Example
DECLARE
session_var varchar2 := null;
BEGIN
session_var = DBMS_MACADM.GET_SESSION_INFO('PROCESS');
END;
/
Syntax
DBMS_MACADM.GET_INSTANCE_INFO(
p_parameter IN VARCHAR2)
RETURN VARCHAR2;
Parameters
Parameter Description
p_parameter Column name in the SYS.V_$INSTANCE system table
Example
DECLARE
instance_var varchar2 := null;
BEGIN
instance_var = DBMS_MACADM.GET_INSTANCE_INFO('INSTANCE_NAME');
END;
/
18-16
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Syntax
DBMS_MACADM.RENAME_FACTOR(
factor_name IN VARCHAR2,
new_factor_name IN VARCHAR2);
Parameters
Parameter Description
factor_name Current factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
new_factor_name New factor name, up to 128 characters in mixed-case, without spaces.
Example
BEGIN
DBMS_MACADM.RENAME_FACTOR(
factor_name => 'Sector2_ClientID',
new_factor_name => 'Sector2_Clients');
END;
/
Syntax
DBMS_MACADM.RENAME_FACTOR_TYPE(
old_name IN VARCHAR2,
new_name IN VARCHAR2);
Parameters
Parameter Description
old_name Current factor type name.
To find existing factor types in the current database instance, query the
DBA_DV_FACTOR_TYPE view, described in DBA_DV_FACTOR_TYPE View.
new_name New factor type name, up to 128 characters in mixed-case, without spaces.
18-17
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Example
BEGIN
DBMS_MACADM.RENAME_FACTOR_TYPE(
old_name => 'Sector2Instance',
new_name => 'Sector2DBInstance');
END;
/
Syntax
DBMS_MACADM.UPDATE_FACTOR(
factor_name IN VARCHAR2,
factor_type_name IN VARCHAR2,
description IN VARCHAR2,
rule_set_name IN VARCHAR2,
get_expr IN VARCHAR2,
validate_expr IN VARCHAR2,
identify_by IN NUMBER,
labeled_by IN NUMBER,
eval_options IN NUMBER,
audit_options IN NUMBER,
fail_options IN NUMBER);
Parameters
Parameter Description
factor_name Factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
factor_type_name Factor type name.
To find existing factor types, query the DBA_DV_FACTOR_TYPE view,
described in DBA_DV_FACTOR_TYPE View.
description Description of the purpose of the factor, up to 1024 characters in
mixed-case.
rule_set_name Name of the rule set used to control when and how a factor identity
is set.
To find existing rule sets, query the DBA_DV_RULE_SET view,
described in DBA_DV_RULE_SET View.
See also Assigning a Rule Set to a Factor for more information
about assigning rule sets to factors.
get_expr Valid PL/SQL expression that retrieves the identity of a factor. It can
use up to 255 characters in mixed-case. See Setting the Retrieval
Method for a Factor for more information. See also the
audit_options parameter.
18-18
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameter Description
validate_expr Name of the procedure to validate factor. This is a valid PL/SQL
expression that returns a Boolean value (TRUE or FALSE) to validate
the identity of the factor. See Setting the Validation Method for a
Factor for more information.
identify_by Options for determining the identity of a factor, based on the
expression set for the get_expr parameter:
• DBMS_MACUTL.G_IDENTIFY_BY_CONSTANT: By constant
• DBMS_MACUTL.G_IDENTIFY_BY_METHOD: By method
• DBMS_MACUTL.G_IDENTIFY_BY_FACTOR: By factor
• DBMS_MACUTL.G_IDENTIFY_BY_CONTEXT: By context
See Setting the Factor Identification Information for more
information.
labeled_by Options for labeling the factor:
• DBMS_MACUTL.G_LABELED_BY_SELF: Labels the identities for
the factor directly from the labels associated with an Oracle
Label Security policy
• DBMS_MACUTL.G_LABELED_BY_FACTORS: Derives the factor
identity label from the labels of its child factor identities.
The default for labeled_by is the previously set value, which you
can find by querying the DBA_DV_FACTOR data dictionary view.
See Setting the Oracle Label Security Labeling Information for a
Factor for more information.
eval_options Options for evaluating the factor when the user logs on:
• DBMS_MACUTL.G_EVAL_ON_SESSION: When the database
session is created
• DBMS_MACUTL.G_EVAL_ON_ACCESS: Each time the factor is
accessed
• DBMS_MACUTL.G_EVAL_ON_STARTUP: On start-up
The default for eval_options is the previously set value, which you
can find by querying the DBA_DV_FACTOR data dictionary view.
See Setting the Evaluation Information for a Factor for more
information.
18-19
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Parameter Description
audit_options Options for auditing the factor if you want to generate a custom
Oracle Database Vault audit record.
• DBMS_MACUTL.G_AUDIT_OFF: Disables auditing.
• DBMS_MACUTL.G_AUDIT_ALWAYS: Always audits.
• DBMS_MACUTL.G_AUDIT_ON_GET_ERROR: Audits if get_expr
returns an error.
• DBMS_MACUTL.G_AUDIT_ON_GET_NULL: Audits if get_expr is
null.
• DBMS_MACUTL.G_AUDIT_ON_VALIDATE_ERROR: Audits if the
validation procedure returns an error.
• DBMS_MACUTL.G_AUDIT_ON_VALIDATE_FALSE: Audits if the
validation procedure is false.
• DBMS_MACUTL.G_AUDIT_ON_TRUST_LEVEL_NULL: Audits if
there is no trust level set.
• DBMS_MACUTL.G_AUDIT_ON_TRUST_LEVEL_NEG: Audits if the
trust level is negative.
The default for audit_options is the previously set value, which
you can find by querying the DBA_DV_FACTOR data dictionary view.
The audit_options parameter applies to traditional auditing only. If
you have enabled unified auditing, then create a unified audit policy
instead of using audit_options.
See Setting Audit Options for a Factor for more information.
fail_options Options for reporting factor errors:
• DBMS_MACUTL.G_FAIL_WITH_MESSAGE: Shows an error
message.
• DBMS_MACUTL.G_FAIL_SILENTLY: Does not show an error
message.
The default for fail_options is the previously set value, which you
can find by querying the DBA_DV_FACTOR data dictionary view.
See Setting Error Options for a Factor for more information.
Example
BEGIN
DBMS_MACADM.UPDATE_FACTOR(
factor_name => 'Sector2_DB',
factor_type_name => 'Instance',
description => ' ',
rule_set_name => 'Limit_DBA_Access',
get_expr => 'UPPER(SYS_CONTEXT(''USERENV'',''DB_NAME''))',
validate_expr => 'dbavowner.check_db_access',
identify_by => DBMS_MACUTL.G_IDENTIFY_BY_METHOD,
labeled_by => DBMS_MACUTL.G_LABELED_BY_SELF,
eval_options => DBMS_MACUTL.G_EVAL_ON_ACCESS,
audit_options => DBMS_MACUTL.G_AUDIT_ALWAYS,
fail_options => DBMS_MACUTL.G_FAIL_WITH_MESSAGE);
END;
/
18-20
Chapter 18
DBMS_MACADM Factor Procedures and Functions
Syntax
DBMS_MACADM.UPDATE_FACTOR_TYPE(
name IN VARCHAR2,
description IN VARCHAR2);
Parameters
Parameter Description
name Factor type name.
To find existing factor types in the current database instance, query the
DBA_DV_FACTOR_TYPE view, described in DBA_DV_FACTOR_TYPE View.
description Description of the purpose of the factor type, up to 1024 characters in mixed
case.
Example
BEGIN
DBMS_MACADM.UPDATE_FACTOR_TYPE(
name => 'Sector2DBInstance',
description => 'Checks DB instances used in Sector 2');
END;
/
Syntax
DBMS_MACADM.UPDATE_IDENTITY(
factor_name IN VARCHAR2,
value IN VARCHAR2,
trust_level IN NUMBER);
Parameters
Parameter Description
factor_name Factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
To find factors that have identities, query DBA_DV_IDENTITY, described in
DBA_DV_IDENTITY View.
18-21
Chapter 18
Oracle Database Vault Run-Time PL/SQL Procedures and Functions
Parameter Description
value New factor identity, up to 1024 characters in mixed-case. For example, the
identity of an IP_Address factor could be the IP address of 192.0.2.12.
trust_level Number that indicates the magnitude of trust relative to other identities for the
same factor. In general, the higher the trust level number is set, the greater the
trust. A trust level of 10 indicates "very trusted." Negative trust levels are not
trusted.
See Creating and Configuring a Factor Identity for more information about trust
levels and label security.
Example
BEGIN
DBMS_MACADM.UPDATE_IDENTITY(
factor_name => 'Sector2_ClientID',
value => 'intranet',
trust_level => 10);
END;
/
18-22
Chapter 18
Oracle Database Vault Run-Time PL/SQL Procedures and Functions
• ROLE_IS_ENABLED Function
The ROLE_IS_ENABLED function returns a boolean value that specifies whether a database
role has been enabled. The return type is BOOLEAN.
Syntax
SET_FACTOR(
p_factor IN VARCHAR2,
p_value IN VARCHAR2);
Parameters
Parameter Description
p_factor Factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR data dictionary view, described in DBA_DV_FACTOR View.
p_value Identity value, up to 1024 characters in mixed case.
To find the identities for each factor in the current database instance, query the
DBA_DV_IDENTITY data dictionary view, described in DBA_DV_IDENTITY View.
Example
EXECUTE SET_FACTOR(''Sector2_ClientID'', ''identity'');
18-23
Chapter 18
Oracle Database Vault Run-Time PL/SQL Procedures and Functions
This function enables the F$ functions in the DVF schema. This function is available (to
execute) to the general database account population.
Syntax
GET_FACTOR(
p_factor IN VARCHAR2)
RETURN VARCHAR2;
Parameter
Parameter Description
p_factor Factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR data dictionary view, described in DBA_DV_FACTOR
View.
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Get Client ID Factor Identity',
rule_expr => 'GET_FACTOR(''Sector2_ClientID'')');
END;
/
The function returns a label that is merged with the maximum session label for the
policy if the policy is configured with Oracle Label Security. The function is available (to
execute) to the general database population.
Syntax
GET_FACTOR_LABEL(
p_factor IN VARCHAR2,
p_policy_name IN VARCHAR2)
RETURN VARCHAR2;
18-24
Chapter 18
Oracle Database Vault Run-Time PL/SQL Procedures and Functions
Parameters
Parameter Description
p_factor Factor name.
To find the available factors in the current database instance, query the
DBA_DV_FACTOR data dictionary view. To find factors that are associated with
Oracle Label Security policies, use DBA_DV_MAC_POLICY_FACTOR.
See DBA_DV_FACTOR View and DBA_DV_MAC_POLICY_FACTOR View.
p_policy_name Oracle Label Security policy name.
Use the following data dictionary views to find information about policies and
factors in the current database instance:
• DBA_DV_MAC_POLICY: Lists Oracle Label Security policies defined in the
current database instance. See DBA_DV_MAC_POLICY View.
• DBA_DV_MAC_POLICY_FACTOR: Lists the factors that are associated with
Oracle Label Security policies for the current database instance. See
DBA_DV_MAC_POLICY_FACTOR View.
• DBA_DV_POLICY_LABEL: Lists the Oracle Label Security label for each
factor identifier in the DBA_DV_IDENTITY view for each policy. See
DBA_DV_POLICY_LABEL View.
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Get the ClientID Factor Label',
rule_expr => 'GET_FACTOR_LABEL(''Sector2_ClientID'', ''Access Locations'')');
END;
/
This function is available (to execute) to the general database account population. See
Creating and Configuring a Factor Identity for a listing of the available trust levels.
Syntax
GET_TRUST_LEVEL(
p_factor IN VARCHAR2)
RETURN VARCHAR2;
18-25
Chapter 18
Oracle Database Vault Run-Time PL/SQL Procedures and Functions
Parameter
Parameter Description
p_factor Factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR data dictionary view, described in DBA_DV_FACTOR
View.
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Get Client ID Trust Level',
rule_expr => 'GET_TRUST_LEVEL(''Sector2_ClientID'')');
END;
/
This function is available (to execute) to the general database account population. See
Creating and Configuring a Factor Identity for a listing of the available trust levels.
Syntax
GET_TRUST_LEVEL_FOR_IDENTITY(
p_factor IN VARCHAR2,
p_identity IN VARCHAR2)
RETURN VARCHAR2;
Parameters
Parameter Description
p_factor Factor name.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
p_identity Identity value.
To find the identities for each factor in the current database instance, use
the DBA_DV_IDENTITY data dictionary view, described in
DBA_DV_IDENTITY View.
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Get Client ID Identity Trust Level',
rule_expr => 'GET_TRUST_LEVEL_FOR_IDENTITY(''Sector2_ClientID'',
18-26
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
''identity'')');
END;
/
This function is available (to execute) to the general database account population.
Syntax
ROLE_IS_ENABLED(
p_role IN VARCHAR2)
RETURN BOOLEAN;
Parameter
Parameter Description
p_role Database role name to check.
To find existing roles, use the following data dictionary views:
• DBA_ROLES: Finds available roles in the current database instance. See
Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular role. See
DBA_DV_REALM View.
• DBA_DV_ROLE: Finds existing secure application roles used in privilege
management. See DBA_DV_ROLE View.
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check if SYSADM Role Is Enabled',
rule_expr => 'ROLE_IS_ENABLED(''SYSADM'')');
END;
/
18-27
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
• F$DATABASE_DOMAIN Function
The F$DATABASE_DOMAIN function returns the domain of the database as specified
in the DB_DOMAIN initialization parameter, in VARCHAR2 data type.
• F$DATABASE_HOSTNAME Function
The F$DATABASE_HOSTNAME function returns the host name of the computer on
which the instance is running, in VARCHAR2 data type.
• F$DATABASE_INSTANCE Function
The F$DATABASE_INSTANCE function returns the instance identification number of
the current database instance, in VARCHAR2 data type.
• F$DATABASE_IP Function
The F$DATABASE_IP function returns the IP address of the computer on which the
database instance is running, in VARCHAR2 data type.
• F$DATABASE_NAME Function
The F$DATABASE_NAME function returns the name of the database as specified in
the DB_NAME initialization parameter, in VARCHAR2 data type.
• F$DOMAIN Function
The F$DOMAIN function returns a named collection of physical, configuration, or
implementation-specific factors in the run-time environment (for example, a
networked IT environment or subset of it) that operates at a specific sensitivity
level. The return type is VARCHAR2.
• F$ENTERPRISE_IDENTITY Function
The F$ENTERPRISE_IDENTITY function returns the enterprise-wide identity for a
user, in VARCHAR2 data type.
• F$IDENTIFICATION_TYPE Function
The F$IDENTIFICATION_TYPE function returns the way the schema of a user was
created in the database. Specifically, it reflects the IDENTIFIED clause in the
CREATE/ALTER USER syntax. The return type is VARCHAR2.
• F$LANG Function
The F$LANG function returns the ISO abbreviation for the language name, a shorter
form than the existing LANGUAGE parameter, for the session of the user. The return
type is VARCHAR2.
• F$LANGUAGE Function
The F$LANGUAGE function returns the language and territory currently used by a
user session, along with the database character set. The return type is VARCHAR2.
• F$MACHINE Function
The F$MACHINE function returns the computer (host) name for the database client
that established the database session. The return type is VARCHAR2.
• F$NETWORK_PROTOCOL Function
The F$NETWORK_PROTOCOL function returns the network protocol being used for
communication, as specified in the PROTOCOL=protocol portion of the connect
string. The return type is VARCHAR2.
• F$PROXY_ENTERPRISE_IDENTITY Function
The F$PROXY_ENTERPRISE_IDENTITY function returns the Oracle Internet Directory
distinguished name (DN) when the proxy user is an enterprise user. The return
type is VARCHAR2.
18-28
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
• F$SESSION_USER Function
The F$SESSION_USER function returns the database user name by which the current user
is authenticated. This value remains the same throughout the session. The return type is
VARCHAR2.
To find the value of a factor function, select from the DUAL system table. For example:
SELECT DVF.F$SESSION_USER FROM DUAL;
F$SESSION_USER
------------------------------------------------
LEO_DVOWNER
The name of the factor itself is case-insensitive. For example, the following statements return
the same result
select dvf.f$session_user from dual;
18-29
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
Syntax
DVF.F$AUTHENTICATION_METHOD ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check SSL Authentication Method',
rule_expr => 'DVF.F$AUTHENTICATION_METHOD = ''SSL''');
END;
/
Syntax
DVF.F$CLIENT_IP ()
RETURN VARCHAR2;
Parameters
None
Example
The following example shows how to use DVF.F$CLIENT_IP in a rule creation
statement. Note that you can only enter one IP address, not a range of IP addresses.
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Client IP Address',
rule_expr => 'DVF.F$CLIENT_IP = ''192.0.2.10''');
END;
/
18-30
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
Syntax
DVF.F$DATABASE_DOMAIN ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Client Database Domain',
rule_expr => 'DVF.F$DATABASE_DOMAIN NOT IN (''EXAMPLE'', ''YOURDOMAIN'')');
END;
/
Syntax
DVF.F$DATABASE_HOSTNAME ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Host Name',
rule_expr => 'DVF.F$DATABASE_HOSTNAME IN (''SHOBEEN'', ''MAU'')');
END;
/
Syntax
DVF.F$DATABASE_INSTANCE ()
RETURN VARCHAR2;
18-31
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Database Instance ID',
rule_expr => 'DVF.F$DATABASE_INSTANCE = ''SALES_DB''');
END;
/
Syntax
DVF.F$DATABASE_IP ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Database IP address',
rule_expr => 'DVF.F$DATABASE_IP = ''192.0.2.5''');
END;
/
Syntax
DVF.F$DATABASE_NAME ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Database DB_NAME Name',
rule_expr => 'DVF.F$DATABASE_NAME = ''ORCL''');
END;
/
18-32
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
You can identify a domain using factors such as host name, IP address, and database
instance names of the Oracle Database Vault nodes in a secure access path to the database.
Each domain can be uniquely determined using a combination of the factor identifiers that
identify the domain. You can use these identifying factors and possibly additional factors to
define the Maximum Security Label within the domain. This restricts data access and
commands, depending on the physical factors about the Oracle Database Vault session.
Example domains of interest may be Corporate Sensitive, Internal Public, Partners, and
Customers.
Syntax
DVF.F$DOMAIN ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Domain',
rule_expr => 'DVF.F$DOMAIN = ''EXAMPLE.COM''');
END;
/
18-33
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
Syntax
DVF.F$ENTERPRISE_IDENTITY ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check User Enterprise Identity',
rule_expr => 'DVF.F$ENTERPRISE_IDENTITY NOT IN (''JSMITH'', ''TSMITH'')');
END;
/
In the list that follows, the syntax used during schema creation is followed by the
identification type returned:
• IDENTIFIED BY password: LOCAL
• IDENTIFIED EXTERNALLY: EXTERNAL
• IDENTIFIED GLOBALLY: GLOBAL SHARED
• IDENTIFIED GLOBALLY AS DN: GLOBAL PRIVATE
Syntax
DVF.F$IDENTIFICATION_TYPE ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check User Schema Creation Type',
rule_expr => 'DVF.F$IDENTIFICATION_TYPE = ''GLOBAL SHARED''');
END;
/
18-34
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
See Oracle Database Globalization Support Guide for a listing of supported languages for
Oracle Database.
Syntax
DVF.F$LANG ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check ISO Abbreviated Language Name',
rule_expr => 'DVF.F$LANG IN (''EN'', ''DE'', ''FR'')');
END;
/
See Oracle Database Globalization Support Guide for a listing of supported languages and
territories for Oracle Database.
Syntax
DVF.F$LANGUAGE ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Session Language and Territory',
rule_expr => 'DVF.F$LANGUAGE = ''AMERICAN_AMERICA.WE8ISO8859P1''');
END;
/
18-35
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
Syntax
DVF.F$MACHINE ()
RETURN VARCHAR2;
Parameter
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Client Computer Host Name',
rule_expr => 'DVF.F$MACHINE NOT IN (''SHOBEEN'', ''SEBASTIAN'')');
END;
/
Syntax
DVF.F$NETWORK_PROTOCOL ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Network Protocol',
rule_expr => 'DVF.F$NETWORK_PROTOCOL = ''TCP''');
END;
/
Syntax
DVF.F$PROXY_ENTERPRISE_IDENTITY ()
RETURN VARCHAR2;
18-36
Chapter 18
Oracle Database Vault DVF PL/SQL Factor Functions
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Get OID DN of Enterprise User',
rule_expr => 'DVF.F$PROXY_ENTERPRISE_IDENTITY = ''cn=Provisioning Admins''');
END;
/
Syntax
DVF.F$SESSION_USER ()
RETURN VARCHAR2;
Parameters
None
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Check Database User Name',
rule_expr => 'DVF.F$SESSION_USER IN (''JSMITH'', ''TSMITH'')');
END;
/
18-37
19
Oracle Database Vault
Secure Application Role APIs
The DBMS_MACADM and DBMS_MACSEC_ROLES PL/SQL packages manage Database Vault secure
application roles.
• DBMS_MACADM Secure Application Role Procedures
The DBMS_MACADM package creates, renames, assigns, unassigns, updates, and deletes
Oracle Database Vault secure application roles.
• DBMS_MACSEC_ROLES Secure Application Role Procedure and Function
The DBMS_MACSEC_ROLES package checks the authorization for users and sets Oracle
Database Vault secure application roles.
Related Topics
• Configuring Secure Application Roles for Oracle Database Vault
Secure application roles enable you to control how much access users have to an
application.
• Oracle Database Vault Utility APIs
Oracle Database Vault provides a set of utility APIs in the DBMS_MACUTL PL/SQL package.
Syntax
DBMS_MACADM.CREATE_ROLE(
role_name IN VARCHAR2,
enabled IN VARCHAR2,
rule_set_name IN VARCHAR2);
19-1
Chapter 19
DBMS_MACADM Secure Application Role Procedures
Parameters
Parameter Description
role_name Role name, up to 128 characters, with no spaces. In a multitenant
environment, prepend the role name with c## or C##.
To find existing secure application roles in the current database instance,
query the DBA_DV_ROLE view, described in DBA_DV_ROLE View.
enabled DBMS_MACUTL.G_YES (Yes) makes the role available for enabling;
DBMS_MACUTL.G_NO (No) prevents the role from being enabled. The
default is DBMS_MACUTL.G_YES.
rule_set_name Name of rule set to determine whether this secure application can be
enabled.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
Example
BEGIN
DBMS_MACADM.CREATE_ROLE(
role_name => 'Sector2_APP_MGR',
enabled => DBMS_MACUTL.G_YES,
rule_set_name => 'Check App2 Access');
END;
/
Syntax
DBMS_MACADM.DELETE_ROLE(
role_name IN VARCHAR2);
Parameters
Parameter Description
role_name Role name.
To find existing secure application roles in the current database instance,
query the DBA_DV_ROLE view, described in DBA_DV_ROLE View.
Example
EXEC DBMS_MACADM.DELETE_ROLE('SECT2_APP_MGR');
19-2
Chapter 19
DBMS_MACADM Secure Application Role Procedures
Syntax
DBMS_MACADM.RENAME_ROLE(
role_name IN VARCHAR2,
new_role_name IN VARCHAR2);
Parameters
Parameter Description
role_name Current role name.
To find existing secure application roles in the current database instance, query
the DBA_DV_ROLE view, described in DBA_DV_ROLE View.
new_role_name Role name, up to 128 characters, with no spaces. In a multitenant environment,
prepend the role name with c## or C##.
Example
BEGIN
DBMS_MACADM.RENAME_ROLE(
role_name => 'SECT2_APP_MGR',
new_role_name => 'SECT2_SYSADMIN');
END;
/
Syntax
DBMS_MACADM.UPDATE_ROLE(
role_name IN VARCHAR2,
enabled IN VARCHAR2,
rule_set_name IN VARCHAR2);
Parameters
Parameter Description
role_name Role name.
To find existing secure application roles in the current database instance, query
the DBA_DV_ROLE view, described in DBA_DV_ROLE View.
19-3
Chapter 19
DBMS_MACSEC_ROLES Secure Application Role Procedure and Function
Parameter Description
enabled DBMS_MACUTL.G_YES (Yes) makes the role available for enabling;
DBMS_MACUTL.G_NO (No) prevents the role from being enabled.
The default for enabled is the previously set value, which you can find by
querying the DBA_DV_ROLE data dictionary view.
rule_set_name Name of rule set to determine whether this secure application can be enabled.
To find existing rule sets in the current database instance, query the
DBA_DV_RULE_SET view, described in DBA_DV_RULE_SET View.
Example
BEGIN
DBMS_MACADM.UPDATE_ROLE(
role_name => 'SECT2_SYSADMIN',
enabled => DBMS_MACUTL.G_YES,
rule_set_name => 'System Access Controls');
END;
/
• CAN_SET_ROLE Function
The CAN_SET_ROLE function checks if the user invoking the method is authorized to
use an Oracle Database Vault secure application role.
• SET_ROLE Procedure
The SET_ROLE procedure issues the SET ROLE PL/SQL statement for specified
roles.
Syntax
DBMS_MACSEC_ROLES.CAN_SET_ROLE(
p_role IN VARCHAR2)
RETURN BOOLEAN;
19-4
Chapter 19
DBMS_MACSEC_ROLES Secure Application Role Procedure and Function
Parameters
Parameter Description
p_role Role name.
To find existing secure application roles in the current database instance, query the
DBA_DV_ROLE view, described in DBA_DV_ROLE View.
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACSEC_ROLES.CAN_SET_ROLE('SECTOR2_APP_MGR')
THEN DBMS_OUTPUT.PUT_LINE('''SECTOR2_APP_MGR'' can be enabled.');
END IF;
END;
/
This procedure includes both Oracle Database Vault secure application roles and regular
Oracle Database roles in its checking process.
This procedure sets an Oracle Database Vault secure application role only if the rule set that
is associated with the role evaluates to true. Before SET ROLE is issued, the CAN_SET_ROLE
method is called to check the rule set associated with the role. Run-time rule set behavior
such as auditing, failure processing, and event handling occur during this process.
The SET_ROLE procedure is available to the general database account population.
Syntax
DBMS_MACSEC_ROLES.SET_ROLE(
p_role IN VARCHAR2);
Parameters
Parameter Description
p_role Role names. You can enter multiple roles, separated by commas (,), including
secure application roles and regular roles.
To find existing secure application roles in the current database instance, query the
DBA_DV_ROLE view, described in DBA_DV_ROLE View.
To find all of the existing roles in the database, query the DBA_ROLES data dictionary
view, described in Oracle Database Reference.
Example
EXEC DBMS_MACSEC_ROLES.SET_ROLE('SECTOR2_APP_MGR, APPS_MGR');
19-5
Chapter 19
DBMS_MACSEC_ROLES Secure Application Role Procedure and Function
You can enter the name of the role in any case (for example, Sector2_APP_MGR).
19-6
20
Oracle Database Vault
Oracle Label Security APIs
You can use the DBMS_MACADM PL/SQL package to manage Oracle Label Security labels and
policies in Oracle Database Vault.
• CREATE_MAC_POLICY Procedure
The CREATE_MAC_POLICY procedure specifies the algorithm to merge labels when
computing the label for a factor, or the Oracle Label Security Session label.
• CREATE_POLICY_LABEL Procedure
The CREATE_POLICY_LABEL procedure labels an identity within an Oracle Label Security
policy.
• DELETE_MAC_POLICY_CASCADE Procedure
The DELETE_MAC_POLICY_CASCADE procedure deletes all Oracle Database Vault objects
related to an Oracle Label Security policy.
• DELETE_POLICY_FACTOR Procedure
The DELETE_POLICY_FACTOR procedure removes the factor from contributing to the Oracle
Label Security label.
• DELETE_POLICY_LABEL Procedure
The DELETE_POLICY_LABEL procedure removes the label from an identity within an Oracle
Label Security policy.
• UPDATE_MAC_POLICY Procedure
The UPDATE_MAC_POLICY procedure specifies the algorithm to merge labels when
computing the label for a factor, or the Oracle Label Security Session label.
Related Topics
• Integrating Oracle Database Vault with Other Oracle Products
You can integrate Oracle Database Vault with other Oracle products, such as Oracle
Enterprise User Security.
• Oracle Database Vault Utility APIs
Oracle Database Vault provides a set of utility APIs in the DBMS_MACUTL PL/SQL package.
Syntax
DBMS_MACADM.CREATE_MAC_POLICY(
policy_name IN VARCHAR2,
algorithm IN VARCHAR2);
20-1
Chapter 20
CREATE_MAC_POLICY Procedure
Parameters
Parameter Description
policy_name Name of an existing policy.
To find existing policies in the current database instance, query the
DBA_DV_MAC_POLICY view, described in DBA_DV_MAC_POLICY View.
algorithm Merge algorithm for cases when Oracle Label Security has merged two
labels. Enter the code listed in Table 20-2 that corresponds to the merge
algorithm you want. For example, enter HUU to if you want to select the
Maximum Level/Union/Union merge algorithm.
Code Value
HUU Maximum Level/Union/Union
HIU Maximum Level/Intersection/Union
HMU Maximum Level/Minus/Union
HNU Maximum Level/Null/Union
HUI Maximum Level/Union/Intersection
HII Maximum Level/Intersection/Intersection
HMI Maximum Level/Minus/Intersection
HNI Maximum Level/Null/Intersection
HUM Maximum Level/Union/Minus
HIM Maximum Level/Intersection/Minus
HMM Maximum Level/Minus/Minus
HNM Maximum Level/Null/Minus
HUN Maximum Level/Union/Null
HIN Maximum Level/Intersection/Null
HMN Maximum Level/Minus/Null
HNN Maximum Level/Null/Null
LUU Minimum Level/Union/Union
LIU Minimum Level/Intersection/Union
LMU Minimum Level/Minus/Union
LNU Minimum Level/Null/Union
LUI Minimum Level/Union/Intersection
LII Minimum Level/Intersection/Intersection
LMI Minimum Level/Minus/Intersection
LNI Minimum Level/Null/Intersection
LUM Minimum Level/Union/Minus
20-2
Chapter 20
CREATE_POLICY_LABEL Procedure
Code Value
LIM Minimum Level/Intersection/Minus
LMM Minimum Level/Minus/Minus
LNM Minimum Level/Null/Minus
LUN Minimum Level/Union/Null
LIN Minimum Level/Intersection/Null
LMN Minimum Level/Minus/Null
LNN Minimum Level/Null/Null
Example
BEGIN
DBMS_MACADM.CREATE_MAC_POLICY(
policy_name => 'Access Locations',
algorithm => 'HUU');
END;
/
Syntax
DBMS_MACADM.CREATE_POLICY_LABEL(
identity_factor_name IN VARCHAR2,
identity_factor_value IN VARCHAR2,
policy_name IN VARCHAR2,
label IN VARCHAR2);
Parameters
Parameter Description
identity_factor_name Name of the factor being labeled.
To find existing factors in the current database instance, query the
DBA_DV_FACTOR view, described in DBA_DV_FACTOR View.
To find factors that are associated with Oracle Label Security policies,
use DBA_DV_MAC_POLICY_FACTOR, described in
DBA_DV_MAC_POLICY_FACTOR View.
identity_factor_value Value of identity for the factor being labeled.
To find the identities of existing factors in the current database
instance, query the DBA_DV_IDENTITY view, described in
DBA_DV_IDENTITY View.
20-3
Chapter 20
DELETE_MAC_POLICY_CASCADE Procedure
Parameter Description
policy_name Name of an existing policy.
To find existing policies in the current database instance, query the
DBA_DV_MAC_POLICY view, described in DBA_DV_MAC_POLICY
View.
label Oracle Label Security label name.
To find existing policy labels for factor identifiers, query the
DBA_DV_POLICY_LABEL view, described in
DBA_DV_POLICY_LABEL View.
Example
BEGIN
DBMS_MACADM.CREATE_POLICY_LABEL(
identity_factor_name => 'App_Host_Name',
identity_factor_value => 'Sect2_Fin_Apps',
policy_name => 'Access Locations',
label => 'Sensitive');
END;
/
Syntax
DBMS_MACADM.DELETE_MAC_POLICY_CASCADE(
policy_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Name of an existing policy.
To find existing policies in the current database instance, query
the DBA_DV_MAC_POLICY view, described in
DBA_DV_MAC_POLICY View.
Example
EXEC DBMS_MACADM.DELETE_MAC_POLICY_CASCADE('Access Locations');
20-4
Chapter 20
DELETE_POLICY_FACTOR Procedure
Syntax
DBMS_MACADM.DELETE_POLICY_FACTOR(
policy_name IN VARCHAR2,
factor_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Name of an existing policy.
To find existing policies in the current database instance, query the
DBA_DV_MAC_POLICY view, described in DBA_DV_MAC_POLICY View.
factor_name Name of factor associated with the Oracle Label Security label.
To find factors that are associated with Oracle Label Security policies, query
DBA_DV_MAC_POLICY_FACTOR, described in
DBA_DV_MAC_POLICY_FACTOR View.
Example
BEGIN
DBMS_MACADM.DELETE_POLICY_FACTOR(
policy_name => 'Access Locations',
factor_name => 'App_Host_Name');
END;
/
Syntax
DBMS_MACADM.DELETE_POLICY_LABEL(
identity_factor_name IN VARCHAR2,
identity_factor_value IN VARCHAR2,
policy_name IN VARCHAR2,
label IN VARCHAR2);
20-5
Chapter 20
UPDATE_MAC_POLICY Procedure
Parameters
Parameter Description
identity_factor_name Name of the factor that was labeled.
To find existing factors in the current database instance that
are associated with Oracle Label Security policies, query
DBA_DV_MAC_POLICY_FACTOR, described in
DBA_DV_MAC_POLICY_FACTOR View.
identity_factor_value Value of identity for the factor that was labeled.
To find the identities of existing factors in the current database
instance, query the DBA_DV_IDENTITY view, described in
DBA_DV_IDENTITY View.
policy_name Name of an existing policy.
To find existing policies in the current database instance, query
the DBA_DV_MAC_POLICY view, described in
DBA_DV_MAC_POLICY View.
label Oracle Label Security label name.
To find existing policy labels for factor identifiers, query the
DBA_DV_POLICY_LABEL view, described in
DBA_DV_POLICY_LABEL View.
Example
BEGIN
DBMS_MACADM.DELETE_POLICY_LABEL(
identity_factor_name => 'App_Host_Name',
identity_factor_value => 'Sect2_Fin_Apps',
policy_name => 'Access Locations',
label => 'Sensitive');
END;
/
Syntax
DBMS_MACADM.UPDATE_MAC_POLICY(
policy_name IN VARCHAR2,
algorithm IN VARCHAR2);
20-6
Chapter 20
UPDATE_MAC_POLICY Procedure
Parameters
Parameter Description
policy_name Name of an existing policy.
To find existing policies in the current database instance, query the
DBA_DV_MAC_POLICY view, described in DBA_DV_MAC_POLICY
View.
algorithm Merge algorithm for cases when Oracle Label Security has merged
two labels. See Table 20-2 for listing of the available algorithms.
Example
BEGIN
DBMS_MACADM.UPDATE_MAC_POLICY(
policy_name => 'Access Locations',
algorithm => 'LUI');
END;
/
20-7
21
Oracle Database Vault Utility APIs
Oracle Database Vault provides a set of utility APIs in the DBMS_MACUTL PL/SQL package.
• DBMS_MACUTL Constants
You can use a set of constants, available in the DBMS_MACUTL PL/SQL package.
• DBMS_MACUTL Package Procedures and Functions
The DBMS_MACUTL PL/SQL package can perform tasks such as finding a time value or
whether a user has the the appropriate privileges.
Many of these constants have equivalents in the Oracle Database Vault package. For
example, the enabled parameter, which is available in several procedures, can accept either
Y (for Yes) or the constant G_YES. Choosing one over the other is a matter of personal
preference. They both have the same result.
21-1
Chapter 21
DBMS_MACUTL Constants
21-2
Chapter 21
DBMS_MACUTL Constants
21-3
Chapter 21
DBMS_MACUTL Constants
21-4
Chapter 21
DBMS_MACUTL Constants
21-5
Chapter 21
DBMS_MACUTL Package Procedures and Functions
END;
/
21-6
Chapter 21
DBMS_MACUTL Package Procedures and Functions
• GET_MONTH Function
The GET_MONTH function returns the month in Oracle MM (month) format (01–12), in a
NUMBER value.
• GET_YEAR Function
The GET_YEAR function returns the year in Oracle YYYY (year) format (0001–9999), in a
NUMBER value.
• IS_ALPHA Function
The IS_ALPHA function returns a BOOLEAN value indicating if a character is alphabetic.
• IS_DIGIT Function
The IS_DIGIT function checks returns a BOOLEAN value indicating if a character is
numeric.
• IS_DVSYS_OWNER Function
The IS_DVSYS_OWNER function returns a BOOLEAN value indicating if a user is authorized to
manage the Oracle Database Vault configuration.
• IS_OLS_INSTALLED Function
The IS_OLS_INSTALLED function returns a BOOLEAN value indicating if Oracle Label
Security is installed.
• IS_OLS_INSTALLED_VARCHAR Function
The IS_OLS_INSTALLED_VARCHAR function returns a BOOLEAN value indicating if Oracle
Label Security is installed.
• USER_HAS_OBJECT_PRIVILEGE Function
The USER_HAS_OBJECT_PRIVILEGE function returns a BOOLEAN value indicating if user or
role can access an object through a single specified object privilege grant.
• USER_HAS_ROLE Function
The USER_HAS_ROLE function returns a BOOLEAN value indicating if a user has a role
privilege, directly or indirectly (through another role).
• USER_HAS_ROLE_VARCHAR Function
The USER_HAS_ROLE_VARCHAR function returns a VARCHAR2 value indicating if a user has a
role privilege, directly or indirectly (through another role).
• USER_HAS_SYSTEM_PRIVILEGE Function
The USER_HAS_SYSTEM_PRIVILEGE function returns a BOOLEAN value indicating if a user
has a system privilege, directly or indirectly (through a role).
• ROLE_GRANTED_ENABLED_VARCHAR Function
The ROLE_GRANTED_ENABLED_VARCHAR function returns a VARCHAR2 value indicating the
role grant and enablement status of a user.
Syntax
DBMS_MACUTL.CHECK_DVSYS_DML_ALLOWED(
p_user IN VARCHAR2 DEFAULT USER);
21-7
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameter
Parameter Description
p_user User to check.
To find existing users in the current database instance, query the following
views:
• DBA_USERS: Finds available users for the current database instance.
See Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or
role. See DBA_DV_REALM_AUTH View.
• DBA_DV_ROLE: Finds existing secure application roles used in
privilege management. See DBA_DV_ROLE View.
Example
User SYSTEM fails the check:
EXEC DBMS_MACUTL.CHECK_DVSYS_DML_ALLOWED('system');
ERROR at line 1:
ORA-47920: Authorization failed for user system to perform this operation
ORA-06512: at "DBMS_MACUTL", line 23
ORA-06512: at "DBMS_MACUTL", line 372
ORA-06512: at "DBMS_MACUTL", line 508
ORA-06512: at "DBMS_MACUTL", line 572
ORA-06512: at line 1
User leo_dvowner, who has the DV_OWNER role, passes the check:
EXEC DBMS_MACUTL.CHECK_DVSYS_DML_ALLOWED('leo_dvowner');
Syntax
DBMS_MACUTL.GET_CODE_VALUE(
p_code_group IN VARCHAR2,
p_code IN VARCHAR2)
RETURN VARCHAR2;
21-8
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameters
Parameter Description
p_code_group Code group (for example, AUDIT_EVENTS or BOOLEAN).
To find available code groups in the current database instance, query the
DBA_DV_CODE view, described in DBA_DV_CODE View.
p_code ID of the code.
This ID is listed when you run the DBA_DV_CODE view.
Example
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'Get Label Algorithm for Maximum Level/Union/Null',
rule_expr => 'DBMS_MACUTL.GET_CODE_VALUE(''LABEL_ALG'', ''HUN'') = ''Union''');
END;
/
Syntax
DBMS_MACUTL.GET_SECOND(
p_date IN DATE DEFAULT SYSDATE)
RETURN NUMBER;
Parameter
Parameter Description
p_date Date in SS format (for example, 59).
If you do not specify a date, then Oracle Database Vault uses the Oracle Database
SYSDATE function to retrieve the current date and time set for the operating system
on which the database resides.
Example
SET SERVEROUTPUT ON
DECLARE
seconds number;
BEGIN
seconds := DBMS_MACUTL.GET_SECOND(TO_DATE('03-APR-2009 6:56 PM',
'dd-mon-yyyy hh:mi PM'));
DBMS_OUTPUT.PUT_LINE('Seconds: '||seconds);
21-9
Chapter 21
DBMS_MACUTL Package Procedures and Functions
END;
/
This example, which uses a fixed date and time, returns the following:
Seconds: 56
Syntax
DBMS_MACUTL.GET_MINUTE(
p_date IN DATE DEFAULT SYSDATE)
RETURN NUMBER;
Parameter
Parameter Description
p_date Date in MI format (for example, 30, as in 2:30).
If you do not specify a date, then Oracle Database Vault uses the Oracle
Database SYSDATE function to retrieve the current date and time set for the
operating system on which the database resides.
Example
SET SERVEROUTPUT ON
DECLARE
minute number;
BEGIN
minute := DBMS_MACUTL.GET_MINUTE(SYSDATE);
DBMS_OUTPUT.PUT_LINE('Minute: '||minute);
END;
/
Syntax
DBMS_MACUTL.GET_HOUR(
p_date IN DATE DEFAULT SYSDATE)
RETURN NUMBER;
21-10
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameter
Parameter Description
p_date Date in HH24 format (for example, 14 for 2:00 p.m.)
If you do not specify a date, then Oracle Database Vault uses the Oracle Database
SYSDATE function to retrieve the current date and time set for the operating system
on which the database resides.
Example
SET SERVEROUTPUT ON
DECLARE
hours number;
BEGIN
hours := DBMS_MACUTL.GET_HOUR(SYSDATE);
DBMS_OUTPUT.PUT_LINE('Hour: '||hours);
END;
/
Syntax
DBMS_MACUTL.GET_DAY(
p_date IN DATE DEFAULT SYSDATE)
RETURN NUMBER;
Parameter
Parameter Description
p_date Date in DD format (for example, 01 for the first day of the month).
If you do not specify a date, then Oracle Database Vault uses the Oracle Database
SYSDATE function to retrieve the current date and time set for the operating system
on which the database resides.
Example
SET SERVEROUTPUT ON
DECLARE
day number;
BEGIN
day := DBMS_MACUTL.GET_DAY(SYSDATE);
21-11
Chapter 21
DBMS_MACUTL Package Procedures and Functions
DBMS_OUTPUT.PUT_LINE('Day: '||day);
END;
/
Syntax
DBMS_MACUTL.GET_MONTH(
p_date IN DATE DEFAULT SYSDATE)
RETURN NUMBER;
Parameter
Parameter Description
p_date Date in MM format (for example, 08 for the month of August).
If you do not specify a date, then Oracle Database Vault uses the Oracle
Database SYSDATE function to retrieve the current date and time set for the
operating system on which the database resides.
Example
SET SERVEROUTPUT ON
DECLARE
month number;
BEGIN
month := DBMS_MACUTL.GET_MONTH(SYSDATE);
DBMS_OUTPUT.PUT_LINE('Month: '||month);
END;
/
21-12
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Syntax
DBMS_MACUTL.GET_YEAR(
p_date IN DATE DEFAULT SYSDATE)
RETURN NUMBER;
Parameter
Parameter Description
p_date Date in YYYY format (for example, 1984).
If you do not specify a date, then Oracle Database Vault uses the SYSDATE function
to retrieve the current date and time set for the operating system on which the
database resides.
Example
SET SERVEROUTPUT ON
DECLARE
year number;
BEGIN
year := DBMS_MACUTL.GET_YEAR(SYSDATE);
DBMS_OUTPUT.PUT_LINE('Year: '||year);
END;
/
Syntax
DBMS_MACUTL.IS_ALPHA(
c IN VARCHAR2)
RETURN BOOLEAN;
Parameter
Parameter Description
c String with one character
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACUTL.IS_ALPHA('z')
THEN DBMS_OUTPUT.PUT_LINE('The alphabetic character was found');
ELSE
DBMS_OUTPUT.PUT_LINE('No alphabetic characters today.');
END IF;
21-13
Chapter 21
DBMS_MACUTL Package Procedures and Functions
END;
/
Syntax
DBMS_MACUTL.IS_DIGIT(
c IN VARCHAR2)
RETURN BOOLEAN;
Parameter
Parameter Description
c String with one character
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACUTL.IS_DIGIT('7')
THEN DBMS_OUTPUT.PUT_LINE('The numeric character was found');
ELSE
DBMS_OUTPUT.PUT_LINE('No numeric characters today.');
END IF;
END;
/
Syntax
DBMS_MACUTL.IS_DVSYS_OWNER(
p_user IN VARCHAR2 DEFAULT USER)
RETURN BOOLEAN;
21-14
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameter
Parameter Description
p_user User to check.
To find existing users, query the following views:
• DBA_USERS: Finds available users for the current database instance. See
Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or role.
See DBA_DV_REALM_AUTH View.
• DBA_DV_ROLE: Finds existing secure application roles used in privilege
management. See DBA_DV_ROLE View.
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACUTL.IS_DVSYS_OWNER('PSMITH')
THEN DBMS_OUTPUT.PUT_LINE('PSMITH is authorized to manage Database Vault.');
ELSE
DBMS_OUTPUT.PUT_LINE('PSMITH is not authorized to manage Database Vault.');
END IF;
END;
/
Syntax
DBMS_MACUTL.IS_OLS_INSTALLED()
RETURN BOOLEAN;
Parameters
None
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACUTL.IS_OLS_INSTALLED()
THEN DBMS_OUTPUT.PUT_LINE('OLS is installed');
ELSE
DBMS_OUTPUT.PUT_LINE('OLS is not installed');
END IF;
END;
/
21-15
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Syntax
DBMS_MACUTL.IS_OLS_INSTALLED_VARCHAR()
RETURN VARCHAR2;
Parameters
None
Example
See IS_OLS_INSTALLED Function for an example.
Syntax
DBMS_MACUTL.USER_HAS_OBJECT_PRIVILEGE(
p_user VARCHAR2,
p_object_owner VARCHAR2,
p_object_name VARCHAR2,
p_privilege VARCHAR2)
RETURNS BOOLEAN;
Parameters
Parameter Description
p_user User or role to check.
To find existing users, query they following views:
• DBA_USERS: Finds available users for the current database
instance. See Oracle Database Reference.
• DBA_ROLES: Finds available roles in the current database
instance. See Oracle Database Reference.
• DVA_DV_REALM_AUTH: Finds the authorization of a particular user
or role. See DBA_DV_REALM_AUTH View.
• DBA_DV_ROLE: Finds existing secure application roles used in
privilege management. See DBA_DV_ROLE View.
21-16
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameter Description
p_object_owner Object owner, such as a schema.
To find the available users, query they DBA_USERS view, described in
Oracle Database Reference.
To find the authorization of a particular user, query they
DVA_DV_REALM_AUTH view.
p_object_name Object name, such as a table within the schema specified in the
p_object_owner parameter.
To find the available objects, query the ALL_OBJECTS view, described
in Oracle Database Reference.
To find objects that are secured by existing realms, query they
DBA_DV_REALM_OBJECT view.
p_privilege Object privilege, such as, UPDATE.
To find privileges for a database account excluding PUBLIC privileges,
query they DBA_DV_USER_PRIVS view.
To find all privileges for a database account, query the
DBA_DV_USER_PRIVS_ALL. view
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACUTL.USER_HAS_OBJECT_PRIVILEGE(
'SECTOR2_APP_MGR', 'OE', 'ORDERS', 'UPDATE')
THEN DBMS_OUTPUT.PUT_LINE('SECTOR2_APP_MGR has the UPDATE privilege for the
OE.ORDERS table');
ELSE
DBMS_OUTPUT.PUT_LINE('SECTOR2_APP_MGR does not have the UPDATE privilege for the
OE.ORDERS table.');
END IF;
END;
/
Syntax
DBMS_MACUTL.USER_HAS_ROLE(
p_role IN VARCHAR2,
p_user IN VARCHAR2 DEFAULT USER)
RETURN BOOLEAN;
21-17
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameters
Parameter Description
p_role Role privilege to check.
To find existing roles, query the following views:
• DBA_ROLES: Finds available roles in the current database instance.
See Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or
role. See DBA_DV_REALM_AUTH View.
• DBA_DV_ROLE: Finds existing secure application roles used in
privilege management. See DBA_DV_ROLE View.
p_user User to check.
To find existing users, query the following views:
• DBA_USERS: Finds available users for the current database instance.
See Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or
role. See DBA_DV_REALM_AUTH View.
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACUTL.USER_HAS_ROLE('SECTOR2_APP_MGR', 'PSMITH')
THEN DBMS_OUTPUT.PUT_LINE('User PSMITH has the SECTOR2_APP_MGR role');
ELSE
DBMS_OUTPUT.PUT_LINE('User PSMITH does not have the SECTOR2_APP_MGR role.');
END IF;
END;
/
Syntax
DBMS_MACUTL.USER_HAS_ROLE_VARCHAR(
p_role IN VARCHAR2,
p_user IN VARCHAR2 DEFAULT USER)
RETURN VARCHAR2;
21-18
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameters
Parameter Description
p_role Role to check.
To find existing roles, query the following views:
• DBA_ROLES: Finds available roles in the current database instance. See
Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or role.
See DBA_DV_REALM_AUTH View.
• DBA_DV_ROLE: Finds existing secure application roles used in privilege
management. See DBA_DV_ROLE View.
p_user User to check.
To find existing users, query the following views:
• DBA_USERS: Finds available users for the current database instance. See
Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or role.
See DBA_DV_REALM_AUTH View.
Syntax
DBMS_MACUTL.USER_HAS_SYSTEM_PRIVILEGE(
p_privilege IN VARCHAR2,
p_user IN VARCHAR2 DEFAULT USER)
RETURN BOOLEAN;
Parameters
Parameter Description
p_privilege System privilege to check for.
To find privileges for a database account excluding PUBLIC privileges, query
the DBA_DV_USER_PRIVS view, described in DBA_DV_USER_PRIVS View.
To find all privileges for a database account, use DBA_DV_USER_PRIVS_ALL,
described in DBA_DV_USER_PRIVS_ALL View.
p_user User to check.
To find existing users, query the following views:
• DBA_USERS: Finds available users for the current database instance. See
Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or role.
See DBA_DV_REALM_AUTH View.
21-19
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Example
SET SERVEROUTPUT ON
BEGIN
IF DBMS_MACUTL.USER_HAS_SYSTEM_PRIVILEGE('EXECUTE', 'PSMITH')
THEN DBMS_OUTPUT.PUT_LINE('User PSMITH has the EXECUTE ANY PRIVILEGE
privilege.');
ELSE
DBMS_OUTPUT.PUT_LINE('User PSMITH does not have the EXECUTE ANY PRIVILEGE
privilege.');
END IF;
END;
/
Syntax
DBMS_MACUTL.ROLE_GRANTED_ENABLED_VARCHAR(
p_role IN VARCHAR2,
p_user IN VARCHAR2 DEFAULT USER,
p_profile IN NUMBER(38) DEFAULT 1,
p_scope IN VARCHAR2 DEFAULT LOCAL)
RETURN VARCHAR2;
Parameters
Parameter Description
p_role Role to check.
To find existing roles, query the following views:
• DBA_ROLES: Finds available roles in the current database instance.
See Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or
role. See DBA_DV_REALM_AUTH View.
• DBA_DV_ROLE: Finds existing secure application roles used in
privilege management. See DBA_DV_ROLE View.
21-20
Chapter 21
DBMS_MACUTL Package Procedures and Functions
Parameter Description
p_user User to check. If you want to use ROLE_GRANTED_ENABLED_VARCHAR
function as part of a rule evaluation, then you cannot set p_user to
CURRENT_USER when ROLE_GRANTED_ENABLED_VARCHAR is being
evaluated as an Oracle Database Vault rule. Instead, you can use the
SYS_CONTEXT function USERENV namespace SESSION_USER to
represent the login user.
To find existing users, query the following views:
• DBA_USERS: Finds available users for the current database instance.
See Oracle Database Reference.
• DBA_DV_REALM_AUTH: Finds the authorization of a particular user or
role. See DBA_DV_REALM_AUTH View.
p_profile If you are using privilege analysis and the role being checked is used,
then specify 1 so that privilege analysis can capture the usage of the
role. Otherwise, enter 0.
p_scope Specify either COMMON for a commonly granted role, or LOCAL for a locally
granted role.
Example
This example shows how to use the DBMS_MACUTL.ROLE_GRANTED_ENABLED_VARCHAR function
in a command rule to check if the logged in user has the enabled role of EMPLOYEE.
BEGIN
DBMS_MACADM.CREATE_RULE(
rule_name => 'does role exist',
rule_expr => 'DVSYS.DBMS_MACUTL.ROLE_GRANTED_ENABLED_VARCHAR(''EMPLOYEE'',''"''||
dvsys.dv_login_user||''"'') = ''Y''');
END;
/
21-21
22
Oracle Database Vault
General Administrative APIs
The DBMS_MACADM PL/SQL package and the CONFIGURE_DV standalone procedure enable you
to you perform general maintenance tasks.
• DBMS_MACADM General System Maintenance Procedures
The DBMS_MACADM PL/SQL package general system maintenance procedures perform
tasks such as authorizing users or adding new language to Oracle Database Vault.
• CONFIGURE_DV General System Maintenance Procedure
The CONFIGURE_DV procedure configures the initial two Oracle Database user accounts,
which are granted the DV_OWNER and DV_ACCTMGR roles, respectively.
22-1
Chapter 22
DBMS_MACADM General System Maintenance Procedures
• AUTHORIZE_TTS_USER Procedure
The AUTHORIZE_TTS_USER procedure authorizes a user to perform Oracle Data
Pump transportable tablespace operations for a tablespace when Oracle
Database Vault is enabled.
• UNAUTHORIZE_DATAPUMP_USER Procedure
The UNAUTHORIZE_DATAPUMP_USER procedure revokes the authorization that was
granted by the AUTHORIZE_DATAPUMP_USER procedure.
• UNAUTHORIZE_DDL Procedure
The UNAUTHORIZE_DDL procedure revokes authorization from a user who was
granted authorization to execute DDL statements through the
DBMS_MACDM.AUTHORIZE_DDL procedure.
• UNAUTHORIZE_DIAGNOSTIC_ADMIN Procedure
The UNAUTHORIZE_DIAGNOSTIC_ADMIN procedure revokes authorization from a user
who was authorized with the DBMS_MACADM.AUTHORIZE_DIAGNOSTIC_ADMIN
procedure to query diagnostic views and tables.
• UNAUTHORIZE_MAINTENANCE_USER Procedure
The UNAUTHORIZE_MAINTENANCE_USER procedure revokes privileges from users
who have been granted authorization to perform Information Lifecycle
Management (ILM) operations in an Oracle Database Vault environment.
• UNAUTHORIZE_PROXY_USER Procedure
The UNAUTHORIZE_PROXY_USER procedure revokes authorization from a user who
was granted proxy authorization from the DBMS_MACADM.AUTHORIZE_PROXY_USER
procedure.
• UNAUTHORIZE_SCHEDULER_USER Procedure
The UNAUTHORIZE_SCHEDULER_USER procedure revokes the authorization that was
granted by the AUTHORIZE_SCHEDULER_USER procedure.
• UNAUTHORIZE_TTS_USER Procedure
The UNAUTHORIZE_TTS_USER procedure removes from authorization users who had
previously been granted the authorization to perform Oracle Data Pump
transportable tablespace operations.
• DISABLE_DV Procedure
The DISABLE_DV procedure disables Oracle Database Vault.
• DISABLE_DV_DICTIONARY_ACCTS Procedure
The DISABLE_DV_DICTIONARY_ACCTS procedure prevents any user from logging
into the database as the DVSYS or DVF schema user.
• DISABLE_DV_PATCH_ADMIN_AUDIT Procedure
The DISABLE_DV_PATCH_ADMIN_AUDIT procedure disables realm, command rule,
and rule set auditing of the actions by users who have the DV_PATCH_ADMIN role.
• DISABLE_ORADEBUG Procedure
The DISABLE_ORADEBUG procedure disables the use of the ORADEBUG utility in an
Oracle Database Vault environment.
• ENABLE_DV Procedure
The ENABLE_DV procedure enables Oracle Database Vault and Oracle Label
Security.
• ENABLE_DV_PATCH_ADMIN_AUDIT Procedure
The ENABLE_DV_PATCH_ADMIN_AUDIT procedure enables realm, command rule, and
rule set auditing of the actions by users who have the DV_PATCH_ADMIN role.
22-2
Chapter 22
DBMS_MACADM General System Maintenance Procedures
• ENABLE_DV_DICTIONARY_ACCTS Procedure
The ENABLE_DV_DICTIONARY_ACCTS procedure enables users to log into the database as
the DVSYS or DVF user.
• ENABLE_ORADEBUG Procedure
The ENABLE_ORADEBUG procedure enables the use of the ORADEBUG utility in an Oracle
Database Vault environment.
Syntax
DBMS_MACADM.ADD_NLS_DATA(
language IN VARCHAR );
Parameters
Parameter Description
language Enter one of the following settings. (This parameter is case insensitive.)
• ENGLISH
• GERMAN
• SPANISH
• FRENCH
• ITALIAN
• JAPANESE
• KOREAN
• BRAZILIAN PORTUGUESE
• SIMPLIFIED CHINESE
• TRADITIONAL CHINESE
Examples
EXEC DBMS_MACADM.ADD_NLS_DATA('french');
See Authorizing Users for Oracle Data Pump Regular Operations in Database Vault for full
usage information, including the levels of additional authorization the user must have to use
Oracle Data Pump in an Oracle Database Vault environment.
Syntax
DBMS_MACADM.AUTHORIZE_DATAPUMP_USER(
user_name IN VARCHAR2,
22-3
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Parameters
Parameter Description
user_name Name of the Oracle Data Pump user to whom you want to grant
authorization.
To find a list of users who have privileges to use Oracle Data Pump (that
is, the EXP_FULL_DATABASE and IMP_FULL_DATABASE roles), query the
DBA_ROLE_PRIVS data dictionary view as follows:
SELECT GRANTEE, GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE
GRANTED_ROLE LIKE '%FULL%'
schema_name Name of the database schema that the Oracle Data Pump user must
export or import. If you omit this parameter, then the user is granted global
authorization to export and import any schema in the database. In this
case, ensure the user has been granted the DV_OWNER role.
table_name Name of the table within the schema specified by the schema_name
parameter. If you omit this parameter, then the user you specified can
export and import all tables within the schema specified by the
schema_name parameter.
Examples
EXEC DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('DP_MGR');
Syntax
DBMS_MACADM.AUTHORIZE_DDL(
user_name IN VARCHAR2,
schema_name IN VARCHAR2);
22-4
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Parameters
Parameter Description
user_name Name of the user to whom you want to grant DDL authorization.
schema_name Name of the database schema in which the user wants to perform the DDL
statements. Enter % to specify all schemas.
Examples
The following example enables user psmith to execute DDL statements in any schema:
EXEC DBMS_MACADM.AUTHORIZE_DDL('psmith', '%');
This example enables user psmith to execute DDL statements in the HR schema only.
EXEC DBMS_MACADM.AUTHORIZE_DDL('psmith', 'HR');
Related Topics
• Performing DDL Operations in Oracle Database Vault
Data Definition Language (DDL) operations in Oracle Database Vault can be affected by
situations such as schema ownership and patch upgrades.
Without this authorization, when a user queries these tables and views, no values are
returned.
Syntax
DBMS_MACADM.AUTHORIZE_DIAGNOSTIC_ADMIN(
uname IN VARCHAR2);
Parameters
Parameter Description
uname Name of the user to whom you want to grant authorization.
22-5
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Example
EXEC DBMS_MACADM.AUTHORIZE_DIAGNOSTIC_ADMIN('PFITCH');
Syntax
DBMS_MACADM.AUTHORIZE_MAINTENANCE_USER(
uname IN VARCHAR2,
sname IN VARCHAR2 DEFAULT NULL,
objname IN VARCHAR2 DEFAULT NULL,
objtype IN VARCHAR2 DEFAULT NULL,
action IN VARCHAR2 DEFAULT NULL);
Parameters
Parameter Description
uname Name of the user to whom you want to grant authorization
sname Name of the database schema for which the maintenance operations are
to be performed. Enter % to specify all schemas.
objname Name of the object (such as the name of a table) in the schema that is
specified in the sname parameter for which maintenance operations are to
be performed
objtype Type of the objname object, such as table, index, tablespace, and so
on
action Maintenance action. Enter ilm for Information Lifecycle Management
Example
The following example enables user psmith to have Database Vault authorization to
manage ILM features for the HR.EMPLOYEES table:
BEGIN
DBMS_MACADM.AUTHORIZE_MAINTENANCE_USER (
uname => 'psmith',
sname => 'HR',
objname => 'EMPLOYEES',
objtype => 'TABLE',
action => 'ILM');
END;
/
22-6
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Related Topics
• Using Information Lifecycle Management with Oracle Database Vault
Users who perform Information Lifecycle Management operations on an Oracle Database
Vault-enabled database must be granted authorization to perform these operations.
To find information about users who have been granted this authorization, query the
DBA_DV_PROXY_AUTH view.
Syntax
DBMS_MACADM.AUTHORIZE_PROXY_USER(
proxy_user IN VARCHAR2,
user_name IN VARCHAR2);
Parameters
Parameter Description
proxy_user Name of the proxy user.
user_name Name of the database user who will be proxied by the proxy_user user. Enter
% to specify all users.
Examples
The following example enables proxy user preston to proxy all users:
EXEC DBMS_MACADM.AUTHORIZE_PROXY_USER('preston', '%');
This example enables proxy user preston to proxy database user dkent only.
EXEC DBMS_MACADM.AUTHORIZE_PROXY_USER('preston', 'dkent');
22-7
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Syntax
DBMS_MACADM.AUTHORIZE_SCHEDULER_USER(
user_name IN VARCHAR2,
schema_name IN VARCHAR2 DEFAULT NULL);
Parameters
Parameter Description
user_name Name of the user to whom you want to grant authorization.
To find a list of users who have privileges to schedule jobs, query the
DBA_SYS_PRIVS data dictionary view. See Step 2 in Granting a Job
Scheduling Administrator Authorization for Database Vault.
schema_name Name of the database schema for which a job will be scheduled. If you
omit this parameter, then the user is granted global authorization to
schedule a job for any schema in the database.
Examples
The following example authorizes the user JOB_MGR to run a job under any schema.
EXEC DBMS_MACADM.AUTHORIZE_SCHEDULER_USER('JOB_MGR');
This example authorizes user JOB_MGR to run a job under the HR schema only.
EXEC DBMS_MACADM.AUTHORIZE_SCHEDULER_USER('JOB_MGR', 'HR');
Authorizing Users for Oracle Data Pump Regular Operations in Database Vault
describes full usage information, including the levels of additional authorization the
user must have to use Oracle Data Pump to conduct transportable operations in an
Oracle Database Vault environment.
Syntax
DBMS_MACADM.AUTHORIZE_TTS_USER(
uname IN VARCHAR2,
tsname IN VARCHAR2);
22-8
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Parameters
Parameter Description
uname Name of the user who you want to authorize to perform Oracle Data
Pump transportable tablespace operations.
To find a list of users and their current privileges, query the
DBA_SYS_PRIVS data dictionary view.
tsname Name of the tablespace in which the uname user is to perform the
transportable tablespace operation.
To find a list of tablespaces, query the DBA_TABLESPACES data
dictionary view.
Example
EXEC DBMS_MACADM.AUTHORIZE_TTS_USER('PSMITH', 'HR_TS');
When you run this procedure, ensure that its settings correspond exactly to the equivalent
AUTHORIZE_DATAPUMP_USER procedure.
For example, the following two procedures will work because the parameters are consistent:
EXEC DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('DP_MGR');
EXEC DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER('DP_MGR');
However, because the parameters in the following procedures are not consistent, the
UNAUTHORIZE_DATAPUMP_USER procedure will not work:
EXEC DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('JSMITH');
Syntax
DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER(
user_name IN VARCHAR2,
schema_name IN VARCHAR2 DEFAULT NULL,
table_name IN VARCHAR2 DEFAULT NULL);
22-9
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Parameters
Parameter Description
user_name Name of the Oracle Data Pump user from whom you want to
revoke authorization.
To find a list of users and authorizations from the
AUTHORIZE_DATAPUMP_USER procedure, query the
DBA_DV_DATAPUMP_AUTH data dictionary view as follows:
SELECT * FROM DBA_DV_DATAPUMP_AUTH;
schema_name Name of the database schema that the Oracle Data Pump user
is authorized to export or import.
table_name Name of the table within the schema specified by the schema
name parameter.
Examples
EXEC DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER('JSMITH');
Syntax
DBMS_MACADM.UNAUTHORIZE_DDL(
user_name IN VARCHAR2,
schema_name IN VARCHAR2);
Parameters
Parameter Description
user_name Name of the user from whom you want to revoke DDL authorization.
schema_name Name of the database schema in which the user wants to perform the
DDL statements. Enter % specify all schemas.
22-10
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Examples
The following example revokes DDL statement execution authorization from user psmith for
all schemas:
EXEC DBMS_MACADM.UNAUTHORIZE_DDL('psmith', '%');
This example revokes DDL statement execution authorization from user psmith for the HR
schema only.
EXEC DBMS_MACADM.UNAUTHORIZE_DDL('psmith', 'HR');
Related Topics
• Performing DDL Operations in Oracle Database Vault
Data Definition Language (DDL) operations in Oracle Database Vault can be affected by
situations such as schema ownership and patch upgrades.
Without this authorization, when a user queries these tables and views, no values are
returned.
Syntax
DBMS_MACADM.UNAUTHORIZE_DIAGNOSTIC_ADMIN(
uname IN VARCHAR2);
Parameters
Parameter Description
uname Name of the user from whom you want to revoke authorization.
Example
EXEC DBMS_MACADM.UNAUTHORIZE_DIAGNOSTIC_ADMIN('PFITCH');
22-11
Chapter 22
DBMS_MACADM General System Maintenance Procedures
When you run this procedure, ensure that its settings correspond exactly to the
equivalent AUTHORIZE_MAINTENANCE_USER procedure.
For example, the following two procedures will work because the parameter settings
correspond:
EXEC DBMS_MACADM.AUTHORIZE_MAINTENANCE_USER('psmith', 'OE', 'ORDERS', 'TABLE',
'ILM');
EXEC DBMS_MACADM.UNAUTHORIZE_MAINTENANCE_USER('psmith', 'OE', 'ORDERS', 'TABLE',
'ILM');
However, these two statements will fail because the settings do not correspond:
EXEC DBMS_MACADM.AUTHORIZE_MAINTENANCE_USER('psmith', 'OE', 'ORDERS', 'TABLE',
'ILM');
Syntax
DBMS_MACADM.UNAUTHORIZE_MAINTENANCE_USER(
uname IN VARCHAR2,
sname IN VARCHAR2 DEFAULT NULL,
objname IN VARCHAR2 DEFAULT NULL,
objtype IN VARCHAR2 DEFAULT NULL,
action IN VARCHAR2 DEFAULT NULL);
Parameters
Parameter Description
uname Name of the user from whom you want to revoke authorization
sname Name of the database schema for which the maintenance operations are
performed. Enter % to specify all schemas.
objname Name of the object (such as the name of a table) in the schema that is
specified in the sname parameter for which maintenance operations are
performed
objtype Type of the objname object, such as table, index, tablespace, and so
on
action Maintenance action. Enter ilm for Information Lifecycle Management
Example
The following example revokes privileges from Database Vault user psmith so that she
can no longer perform ILM operations in any HR schema objects:
22-12
Chapter 22
DBMS_MACADM General System Maintenance Procedures
BEGIN
DBMS_MACADM.UNAUTHORIZE_MAINTENANCE_USER (
uname => 'psmith',
sname => 'HR',
objname => 'EMPLOYEES',
objtype => 'TABLE',
action => 'ILM');
END;
/
Related Topics
• Using Information Lifecycle Management with Oracle Database Vault
Users who perform Information Lifecycle Management operations on an Oracle Database
Vault-enabled database must be granted authorization to perform these operations.
Syntax
DBMS_MACADM.UNAUTHORIZE_PROXY_USER(
proxy_user IN VARCHAR2,
user_name IN VARCHAR2);
Parameters
Parameter Description
proxy_user Name of the proxy user.
user_name Name of the database user who was proxied by the proxy_user user. Enter %
to specify all users.
Examples
The following example revokes proxy authorization from user preston for proxying all users:
DBMS_MACADM.UNAUTHORIZE_PROXY_USER('preston', '%');
This example revokes proxy authorization from user preston for proxying database user
psmith only.
EXEC DBMS_MACADM.UNAUTHORIZE_PROXY_USER('preston', 'psmith');
When you run this procedure, ensure that its settings correspond exactly to the equivalent
AUTHORIZE_SCHEDULER_USER procedure. For example, the following two procedures will work
because the parameters are consistent:
22-13
Chapter 22
DBMS_MACADM General System Maintenance Procedures
EXEC DBMS_MACADM.AUTHORIZE_SCHEDULER_USER('JOB_MGR');
EXEC DBMS_MACADM.UNAUTHORIZE_SCHEDULER_USER('JOB_MGR');
However, because the parameters in the following procedures are not consistent, the
UNAUTHORIZE_SCHEDULER_USER procedure will not work:
EXEC DBMS_MACADM.AUTHORIZE_SCHEDULER_USER('JOB_MGR');
Syntax
DBMS_MACADM.UNAUTHORIZE_SCHEDULER_USER
user_name IN VARCHAR2,
schema_name IN VARCHAR2 DEFAULT NULL);
Parameters
Parameter Description
user_name Name of the job scheduling user from whom you want to revoke
authorization.
To find a list of users and authorizations from the
AUTHORIZE_SCHEDULER_USER procedure, query the
DBA_DV_JOB_AUTH data dictionary view as follows:
SELECT * FROM DBA_DV_JOB_AUTH;
schema_name Name of the database schema for which the user is authorized
to schedule jobs.
Examples
EXEC DBMS_MACADM.UNAUTHORIZE_SCHEDULER_USER('JOB_MGR');
Syntax
DBMS_MACADM.UNAUTHORIZE_TTS_USER
uname IN VARCHAR2,
tsname IN VARCHAR2);
22-14
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Parameters
Parameter Description
uname Name of the user who you want to remove from being authorized to
perform Oracle Data Pump transportable tablespace operations.
To find a list of users and their current privileges, query the
DBA_SYS_PRIVS data dictionary view.
tsname Name of the tablespace that is used in the transportable tablespace
operation.
To find a list of tablespaces, query the DBA_TABLESPACES data
dictionary view.
Example
EXEC DBMS_MACADM.UNAUTHORIZE_TTS_USER('PSMITH', 'HR_TS');
After you run this procedure, you must restart the database.
Syntax
DBMS_MACADM.DISABLE_DV;
Parameters
None
Example
EXEC DBMS_MACADM.DISABLE_DV;
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities
such as installing Oracle Database optional products or features.
By default these two accounts are locked. Only a user who has been granted the DV_OWNER
role can execute this procedure. To find the status of whether users can log into DVSYS and
DVF, query the DBA_DV_DICTIONARY_ACCTS data dictionary view. For stronger security, run this
procedure to better protect the DVSYS and DVF schemas. The disablement takes place
immediately, so you do not need to restart the database after running this procedure.
22-15
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Syntax
DBMS_MACADM.DISABLE_DV_DICTIONARY_ACCTS;
Parameters
None
Example
EXEC DBMS_MACADM.DISABLE_DV_DICTIONARY_ACCTS;
Related Topics
• Archiving and Purging the Oracle Database Vault Audit Trail
If you have not migrated to unified auditing, you should periodically archive and
purge the Oracle Database Vault audit trail.
This procedure disables the successful actions of this user, not the failed actions. You
should run this procedure after the DV_PATCH_ADMIN user has completed database
patch operation. To find if auditing is enabled or not, query the DBA_DV_PATCH_AUDIT
data dictionary view.
Syntax
DBMS_MACADM.DISABLE_DV_PATCH_ADMIN_AUDIT;
Parameters
None
Example
EXEC DBMS_MACADM.DISABLE_DV_PATCH_ADMIN_AUDIT;
Related Topics
• DV_PATCH_ADMIN Database Vault Database Patch Role
The DV_PATCH_ADMIN role is used for patching operations.
• ENABLE_DV_PATCH_ADMIN_AUDIT Procedure
The ENABLE_DV_PATCH_ADMIN_AUDIT procedure enables realm, command rule, and
rule set auditing of the actions by users who have the DV_PATCH_ADMIN role.
22-16
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Syntax
DBMS_MACADM.DISABLE_ORADEBUG;
Parameters
None
Example
EXEC DBMS_MACADM.DISABLE_ORADEBUG;
Related Topics
• Using the ORADEBUG Utility with Oracle Database Vault
The ORADEBUG utility is used primarily by Oracle Support to diagnose problems that may
arise with an Oracle database.
If you want to run DBMS_MACADM.ENABLE_DV in an application container, then you must run it in
the application container outside of application actions.
After you run this procedure, you must restart the database.
Syntax
DBMS_MACADM.ENABLE_DV(
strict_mode IN VARCHAR2 DEFAULT);
Parameters
Parameter Description
strict_mode In a multitenant environment, specifies one of the following modes:
• n specifies regular mode, which allows the PDBs to be Database
Vault enabled or disabled. (Default)
• y specifies strict mode, which puts the PDBs that have not been
Database Vault-enabled in restricted mode, until you enable
Database Vault in them and then restart the PDB.
To apply this setting to all PDBs in the multitenant environment, run
the DBMS_MACADM.ENABLE_DV procedure in the CDB root. To apply it
to all PDBs in an application container, run the procedure in the
application root.
In a non-multitenant environment, omit this parameter.
Examples
The following example enables Oracle Database Vault in regular mode.
EXEC DBMS_MACADM.ENABLE_DV;
This example enables Oracle Database Vault in strict mode in a multitenant environment.
22-17
Chapter 22
DBMS_MACADM General System Maintenance Procedures
Related Topics
• Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for
activities such as installing Oracle Database optional products or features.
This procedure is designed to audit these users' actions during a patch upgrade. To
find if this auditing is enabled or not, query the DBA_DV_PATCH_AUDIT data dictionary
view.
Syntax
DBMS_MACADM.ENABLE_DV_PATCH_ADMIN_AUDIT;
Parameters
None
Example
EXEC DBMS_MACADM.ENABLE_DV_PATCH_ADMIN_AUDIT;
Related Topics
• DV_PATCH_ADMIN Database Vault Database Patch Role
The DV_PATCH_ADMIN role is used for patching operations.
• DISABLE_DV_PATCH_ADMIN_AUDIT Procedure
The DISABLE_DV_PATCH_ADMIN_AUDIT procedure disables realm, command rule,
and rule set auditing of the actions by users who have the DV_PATCH_ADMIN role.
Only a user who has been granted the DV_OWNER role can execute this procedure. To
find the status of whether users can log into DVSYS and DVF, query the
DBA_DV_DICTIONARY_ACCTS data dictionary view. For stronger security, only run this
procedure when you need to better protect the DVSYS and DVF schemas. The
enablement takes place immediately, so you do not need to restart the database after
running this procedure.
Syntax
DBMS_MACADM.ENABLE_DV_DICTIONARY_ACCTS;
22-18
Chapter 22
CONFIGURE_DV General System Maintenance Procedure
Parameters
None
Example
EXEC DBMS_MACADM.ENABLE_DV_DICTIONARY_ACCTS;
Related Topics
• Archiving and Purging the Oracle Database Vault Audit Trail
If you have not migrated to unified auditing, you should periodically archive and purge the
Oracle Database Vault audit trail.
Syntax
DBMS_MACADM.ENABLE_ORADEBUG;
Parameters
None
Example
EXEC DBMS_MACADM.ENABLE_ORADEBUG;
Related Topics
• Using the ORADEBUG Utility with Oracle Database Vault
The ORADEBUG utility is used primarily by Oracle Support to diagnose problems that may
arise with an Oracle database.
You can check the status of this configuration by querying the DBA_DV_STATUS data dictionary
view. Before you run the CONFIGURE_DV procedure, you must create the two user accounts
and grant them the CREATE SESSION privilege. The accounts can be either local or common. If
you create common user accounts, then the Database Vault roles that are granted to these
users apply to the current pluggable database (PDB) only. You then refer to these user
accounts for the CONFIGURE_DV procedure.
The CONFIGURE_DV procedure resides in the SYS schema. Oracle provides a synonym,
DVSYS.CONFIGURE_DV, so that any existing Oracle Database Vault configuration scripts that
you may have created in previous releases will continue to work in this release.
22-19
Chapter 22
CONFIGURE_DV General System Maintenance Procedure
You only can run the CONFIGURE_DV procedure once, when you are ready to register
Oracle Database Vault with an Oracle database. After you run this procedure, you
must run utlrp.sql script and then DBMS_MACADM.ENABLE_DV to complete the
registration process. Oracle strongly recommends that for better security, you use the
two accounts you create here as back-up accounts and then create additional
accounts for every day use. See Backup Oracle Database Vault Accounts for
guidance.
When you run the CONFIGURE_DV procedure, it checks the DVSYS schema for problems
such as missing tables or packages. If it finds problems, then it raises an ORA-47500
Database Vault cannot be configured error. If this happens, then you must deinstall
and then reinstall Oracle Database Vault.
Together, the CONFIGURE_DV and DBMS_MACADM.ENABLE_DV procedures, and the and
utlrp.sql script, are designed to be a command-line alternative to using Oracle
Database Configuration Assistant (DBCA) to register Oracle Database Vault with an
Oracle database.
You must run the CONFIGURE_DV procedure as user SYS. Registering Oracle Database
Vault with an Oracle Database describes the process that you would use.
Syntax
CONFIGURE_DV
dvowner_uname IN VARCHAR2,
dvacctmgr_uname IN VARCHAR2;
Parameters
Parameter Description
dvowner_uname Name of the user who will be the Database Vault Owner. This
user will be granted the DV_OWNER role.
dvacctmgr_uname Name of the user who will be the Database Vault Account
Manager. This user will be granted the DV_ACCTMGR role. If you
omit this setting, the user specified by the dvowner_uname
parameter is made the Database Vault Account Manager and
granted the DV_ACCTMGR role.
Example
CREATE USER dbv_owner IDENTIFIED BY password CONTAINER = CURRENT;
CREATE USER dbv_acctmgr IDENTIFIED BY password CONTAINER = CURRENT;
GRANT CREATE SESSION TO dbv_owner, dbv_acctmgr;
BEGIN
CONFIGURE_DV (
dvowner_uname => 'dbv_owner',
dvacctmgr_uname => 'dbv_acctmgr');
END;
/
22-20
Chapter 22
CONFIGURE_DV General System Maintenance Procedure
Related Topics
• Deinstalling Oracle Database Vault
You can remove Oracle Database Vault from an Oracle Database installation, for both to
both single-instance and Oracle RAC installations.
• Reinstalling Oracle Database Vault
You can reinstall Oracle Database Vault by using Database Configuration Assistant and
afterward, register Database Vault.
22-21
23
Oracle Database Vault Policy APIs
You can use the DBMS_MACADM PL/SQL package to manage Oracle Database Vault policies.
Only users who have been granted the DV_OWNER or DV_ADMIN role can use these procedures.
• ADD_CMD_RULE_TO_POLICY Procedure
The ADD_COMMAND_RULE_TO_POLICY procedure enables you to add an existing command
rule to an Oracle Database Vault policy.
• ADD_OWNER_TO_POLICY Procedure
The ADD_OWNER_TO_POLICY procedure enables you to add an existing database user to an
Oracle Database Vault policy as an owner.
• ADD_REALM_TO_POLICY Procedure
The ADD_REALM_TO_POLICY procedure enables you to add an existing realm to an Oracle
Database Vault policy.
• CREATE_POLICY Procedure
The CREATE_POLICY procedure enables you to create an Oracle Database Vault policy.
• DELETE_CMD_RULE_FROM_POLICY Procedure
The DELETE_CMD_RULE_FROM_POLICY procedure enables you to remove an existing
command rule from an Oracle Database Vault policy.
• DELETE_OWNER_FROM_POLICY Procedure
The DELETE_OWNER_FROM_POLICY procedure enables you to remove an owner from an
Oracle Database Vault policy.
• DELETE_REALM_FROM_POLICY Procedure
The DELETE_REALM_FROM_POLICY procedure enables you to remove an existing realm
from an Oracle Database Vault policy.
• DROP_POLICY Procedure
The DROP_POLICY procedure enables you to drop an existing Oracle Database Vault
policy.
• RENAME_POLICY Procedure
The UPDATE_POLICY_DESCRIPTION procedure enables you to rename an existing Oracle
Database Vault policy.
• UPDATE_POLICY_DESCRIPTION Procedure
The UPDATE_POLICY_DESCRIPTION procedure enables you to update the description field
in an Oracle Database Vault policy.
• UPDATE_POLICY_STATE Procedure
The UPDATE_POLICY_STATE procedure enables you to update the policy_state field in an
Oracle Database Vault policy.
Related Topics
• Configuring Oracle Database Vault Policies
You can use Oracle Database Vault policies to implement frequently used realm and
command rule settings.
23-1
Chapter 23
ADD_CMD_RULE_TO_POLICY Procedure
Syntax
DBMS_MACADM.ADD_CMD_RULE_TO_POLICY(
policy_name IN VARCHAR2,
command IN VARCHAR2,
object_owner IN VARCHAR2,
object_name IN VARCHAR2,
clause_name IN VARCHAR2 DEFAULT,
parameter_name IN VARCHAR2 DEFAULT,
event_name IN VARCHAR2 DEFAULT,
component_name IN VARCHAR2 DEFAULT,
action_name IN VARCHAR2 DEFAULT,
scope IN NUMBER DEFAULT);
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current
database instance, query the DBA_DV_POLICY view, described in
DBA_DV_POLICY View.
command Command rule name
To find existing Database Vault command rules in the current database
instance, query the DBA_DV_COMMAND_RULE view, described in
DBA_DV_COMMAND_RULE View.
object_owner Database schema to which the command rule applies
To find existing object owners for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE
View
object_name Object to be protected by the command rule
To find existing objects for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE
View
clause_name For ALTER SYSTEM and ALTER SESSION command rules, a clause from
the SQL statement that was used to create the command rule
To find existing clauses for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE
View
23-2
Chapter 23
ADD_CMD_RULE_TO_POLICY Procedure
Parameter Description
parameter_name For ALTER SYSTEM and ALTER SESSION command rules, a parameter
from the clause_name parameter.
To find existing parameters for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE
View
event_name For ALTER SYSTEM and ALTER SESSION command rules, an event that
the command rule defines
To find existing event names for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE
View
component_name A component of the event_name setting
To find existing component names for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE
View
action_name An action of the component_name setting.
To find existing action names for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE
View
scope For a multitenant environment, determines how to execute this procedure.
The default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in
the current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule applies
to all the PDBs
Example
The following example shows how to add a common command rule to a Database Vault
policy. This command rule is in the application root of a multitenant environment, so the user
running this procedure must be in the application root or the CDB root. Any rules or rule sets
that are associated with this command rule must be common.
BEGIN
DBMS_MACADM.ADD_CMD_RULE_TO_POLICY(
policy_name => 'HR_DV_Policy',
command => 'ALTER SESSION',
object_owner => '%',
object_name => '%',
clause_name => 'PARALLEL DDL',
parameter_name => '',
event_name => '',
action_name => '',
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
23-3
Chapter 23
ADD_OWNER_TO_POLICY Procedure
Syntax
DBMS_MACADM.ADD_OWNER_TO_POLICY(
policy_name IN VARCHAR2,
owner_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current
database instance, query the DBA_DV_POLICY view, described in
DBA_DV_POLICY View.
owner_name User name. To find existing database users (not roles) in the current
instance, query the DBA_USERS view, described in Oracle Database
Reference. To find existing policy owners, query the
DBA_DV_POLICY_OWNER view, described in DBA_DV_POLICY_OWNER
View.
Example
BEGIN
DBMS_MACADM.ADD_OWNER_TO_POLICY(
policy_name => 'HR_DV_Policy',
owner_name => 'PSMITH');
END;
/
Syntax
DBMS_MACADM.ADD_REALM_TO_POLICY(
policy_name IN VARCHAR2,
realm_name IN VARCHAR2);
23-4
Chapter 23
CREATE_POLICY Procedure
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current database
instance, query the DBA_DV_POLICY view.
realm_name Realm name. To find existing Database Vault realms in the current database
instance.
Example
BEGIN
DBMS_MACADM.ADD_REALM_TO_POLICY(
policy_name => 'HR_DV_Policy',
realm_name => 'HR Realm');
END;
/
After you create the policy, you must add at least one realm and one command rule to the
policy. Optionally, you can set these realms and command rules to be enforced individually or
use the enforcement that the policy uses.
An owner for the policy is not required, but if you do not assign an owner to the policy, a user
who has been granted the DV_OWNER or DV_ADMIN role must administer the policy.
After you create the policy, use the following procedures to complete the policy definition:
• ADD_REALM_TO_POLICY adds realms to the policy.
• ADD_CMD_RULE_TO_POLICY adds command rules to the policy.
• ADD_OWNER_TO_POLICY enables the specified database users to manage the policy.
Syntax
DBMS_MACADM.CREATE_POLICY(
policy_name IN VARCHAR2,
description IN VARCHAR2 DEFAULT,
policy_state IN NUMBER,
pl_sql_stack IN BOOLEAN DEFAULT);
Parameters
Parameter Description
policy_name Policy name, up to 128 characters in mixed case
To find existing policies in the current database instance, query the
DBA_DV_POLICY view, described in DBA_DV_POLICY View.
23-5
Chapter 23
DELETE_CMD_RULE_FROM_POLICY Procedure
Parameter Description
description Description of the purpose of the policy, up to 4000 characters in mixed-case.
policy_state Specifies how the policy is enabled. Possible values are:
• DBMS_MACADM.G_ENABLED (1), which enables the policy after you create it
• DBMS_MACADM.G_DISABLED (0), which disables the policy after you create
it
• DBMS_MACADM.G_SIMULATION (2), which sets the policy to simulation
mode. In simulation mode, any violations to realms or command rules used
in the policy are logged in a designated log table with sufficient information
to describe the error, such as the user name or SQL statement used.
• DBMS_MACADM.G_PARTIAL (3), which sets the policy to partial mode. In
partial mode, the enforcement state of realms or command rules
associated with the policy can be changed individually.
See About Simulation Mode for more information about simulation mode
pl_sql_stack When simulation mode is enabled, specifies whether to record the PL/SQL
stack for failed operations. Enter TRUE to record the PL/SQL stack, FALSE to
not record.
Example
The following example creates a policy that uses the partial state and enables the
capture of the PL/SQL stack. Later on, when a realm or a command rule is added to
this policy, their enforcement state will be able to be changed individually.
BEGIN
DBMS_MACADM.CREATE_POLICY(
policy_name => 'HR_DV_Policy',
description => 'Policy to protect the HR schema',
policy_state => DBMS_MACADM.G_ENABLED,
pl_sql_stack => TRUE);
END;
/
Syntax
DBMS_MACADM.DELETE_CMD_RULE_FROM_POLICY(
policy_name IN VARCHAR2,
command IN VARCHAR2,
object_owner IN VARCHAR2,
object_name IN VARCHAR2,
clause_name IN VARCHAR2 DEFAULT,
23-6
Chapter 23
DELETE_CMD_RULE_FROM_POLICY Procedure
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current database
instance, query the DBA_DV_POLICY view, described in DBA_DV_POLICY
View.
command Command rule name
To find existing Database Vault command rules in the current database
instance, query the DBA_DV_COMMAND_RULE view, described in
DBA_DV_COMMAND_RULE View.
object_owner Database schema to which the command rule applies
To find existing object owners for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
object_name Object to be protected by the command rule
To find existing objects for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
clause_name For ALTER SYSTEM and ALTER SESSION command rules, a clause from the
SQL statement that was used to create the command rule
To find existing clauses for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
parameter_name For ALTER SYSTEM and ALTER SESSION command rules, a parameter from
the clause_name parameter.
To find existing parameters for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
event_name For ALTER SYSTEM and ALTER SESSION command rules, an event that the
command rule defines
To find existing event names for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
component_name A component of the event_name setting
To find existing component names for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
action_name An action of the component_name setting.
To find existing action names for this command rule, query the
DBA_DV_COMMAND_RULE view, described in DBA_DV_COMMAND_RULE View
scope For a multitenant environment, determines how to execute this procedure. The
default is local. Options are as follows:
• DBMS_MACUTL.G_SCOPE_LOCAL (or 1) if the command rule is local in the
current PDB
• DBMS_MACUTL.G_SCOPE_COMMON (or 2) if the command rule is in the
application root
23-7
Chapter 23
DELETE_OWNER_FROM_POLICY Procedure
Example
The following example shows how to delete a common command rule from a
Database Vault policy. This command rule is in the application root of a multitenant
environment, so the user running this procedure must be in the CDB root.
BEGIN
DBMS_MACADM.DELETE_CMD_RULE_FROM_POLICY(
policy_name => 'HR_DV_Policy',
command => 'ALTER SESSION',
object_owner => '%',
object_name => '%',
clause_name => 'END SESSION',
parameter_name => 'KILL SESSION',
event_name => '',
action_name => '',
scope => DBMS_MACUTL.G_SCOPE_COMMON);
END;
/
Syntax
DBMS_MACADM.DELETE_OWNER_FROM_POLICY(
policy_name IN VARCHAR2,
owner_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current
database instance, query the DBA_DV_POLICY view, described in
DBA_DV_POLICY View.
owner_name User name. To find existing policy owners in the current instance, query
the DBA_DV_POLICY_OWNER view, described in
DBA_DV_POLICY_OWNER View.
Example
BEGIN
DBMS_MACADM.DELETE_OWNER_FROM_POLICY(
policy_name => 'HR_DV_Policy',
owner_name => 'PSMITH');
END;
/
23-8
Chapter 23
DELETE_REALM_FROM_POLICY Procedure
Syntax
DBMS_MACADM.DELETE_REALM_FROM_POLICY(
policy_name IN VARCHAR2,
realm_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current database
instance, query the DBA_DV_POLICY view.
realm_name Realm name. To find existing Database Vault realms in the current database
instance, query the DV_REALM view.
Example
BEGIN
DBMS_MACADM.DELETE_REALM_FROM_POLICY(
policy_name => 'HR_DV_Policy',
realm_name => 'HR Realm');
END;
/
You can remove a policy at any time, regardless of the state (enabled or disabled) of the
policy.
Syntax
DBMS_MACADM.DROP_POLICY(
policy_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current database
instance, query the DBA_DV_POLICY view, described in DBA_DV_POLICY
View.
23-9
Chapter 23
RENAME_POLICY Procedure
Example
BEGIN
DBMS_MACADM.DROP_POLICY(
policy_name => 'HR_DV_Policy');
END;
/
Syntax
DBMS_MACADM.RENAME_POLICY(
policy_name IN VARCHAR2,
new_policy_name IN VARCHAR2);
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current
database instance, query the DBA_DV_POLICY view, described in
DBA_DV_POLICY View.
new_policy_name New policy name, up to 128 characters in mixed case
Example
BEGIN
DBMS_MACADM.RENAME_POLICY(
policy_name => 'HR_DV_Policy',
new_policy_name => 'HR_WEST_COAST_DV_Policy');
END;
/
Syntax
DBMS_MACADM.UPDATE_POLICY_DESCRIPTION(
policy_name IN VARCHAR2,
description IN VARCHAR2 DEFAULT);
23-10
Chapter 23
UPDATE_POLICY_STATE Procedure
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current database
instance, query the DBA_DV_POLICY view, described in DBA_DV_POLICY
View.
description New description of the purpose of the policy, up to 4000 characters in mixed-
case
Example
BEGIN
DBMS_MACADM.UPDATE_POLICY_DESCRIPTION(
policy_name => 'HR_DV_Policy',
description => 'HR schema protection policy');
END;
/
Syntax
DBMS_MACADM.UPDATE_POLICY_STATE(
policy_name IN VARCHAR2,
policy_state IN NUMBER);
Parameters
Parameter Description
policy_name Policy name. To find existing Database Vault policies in the current database
instance, query the DBA_DV_POLICY view, described in DBA_DV_POLICY
View.
policy_state Specifies how the policy is enabled. Possible values are:
• DBMS_MACADM.G_ENABLED (1), which enables the policy after you create it
• DBMS_MACADM.G_DISABLED (0), which disables the policy after you create
it
• DBMS_MACADM. (2), which sets the policy to simulation mode. In simulation
mode, any violations to realms or command rules used in the policy are
logged in a designated log table with sufficient information to describe the
error, such as the user name or SQL statement used.
• DBMS_MACADM.G_PARTIAL (3), which sets the policy to partial mode. In
partial mode, the enforcement state of realms or command rules
associated with the policy can be changed individually.
See About Simulation Mode for more information about simulation mode
23-11
Chapter 23
UPDATE_POLICY_STATE Procedure
Example
BEGIN
DBMS_MACADM.UPDATE_POLICY_STATE(
policy_name => 'HR_DV_Policy',
policy_state => DBMS_MACADM.G_DISABLED);
END;
/
23-12
24
Oracle Database Vault API Reference
Oracle Database Vault provides a rich set of APIs, both in PL/SQL packages and in
standalone procedures.
• DBMS_MACADM PL/SQL Package Contents
The DBMS_MACADM package enables you to configure the realms, factors, rule sets,
command rules, secure application roles, and Oracle Label Security policies.
• DBMS_MACSEC_ROLES PL/SQL Package Contents
The DBMS_MACSEC_ROLES package enables you to check and set Oracle Database Vault
secure application roles.
• DBMS_MACUTL PL/SQL Package Contents
The DBMS_MACUTL PL/SQL package defines constants and utility methods that are
commonly used by other Oracle Database Vault packages, such as error handling.
• CONFIGURE_DV PL/SQL Procedure
The CONFIGURE_DV configures the initial two Oracle Database user accounts, which are
granted the DV_OWNER and DV_ACCTMGR roles, respectively.
• DVF PL/SQL Interface Contents
The DVF schema provides a set of factor-related PL/SQL functions.
Procedure Description
ADD_AUTH_TO_REALM procedure Authorizes a user or role to access a realm as an owner or
a participant
ADD_OBJECT_TO_REALM procedure Registers a set of objects for realm protection
CREATE_REALM procedure Creates a realm
DELETE_AUTH_FROM_REALM procedure Removes the authorization of a user or role to access a
realm
DELETE_OBJECT_FROM_REALM procedure Removes a set of objects from realm protection
24-1
Chapter 24
DBMS_MACADM PL/SQL Package Contents
Procedure Description
DELETE_REALM procedure Deletes a realm, including its related Database Vault
configuration information that specifies who is authorized
and what objects are protected
DELETE_REALM_CASCADE procedure Deletes a realm, including its related Database Vault
configuration information that specifies who is authorized
and what objects are protected
RENAME_REALM procedure Renames a realm. The name change takes effect
everywhere the realm is used.
UPDATE_REALM procedure Updates a realm
UPDATE_REALM_AUTH procedure Updates the authorization of a user or role to access a
realm
Procedure Description
CREATE_RULE_SET procedure Creates a rule set
RENAME_RULE_SET procedure Renames a rule set. The name change takes effect
everywhere the rule set is used.
DELETE_RULE_FROM_RULE_SET Deletes a rule from a rule set
procedure
DELETE_RULE_SET procedure Deletes a rule set
UPDATE_RULE_SET procedure Updates a rule set
CREATE_RULE procedure Creates a rule
ADD_RULE_TO_RULE_SET procedure Adds a rule to a rule set
DELETE_RULE procedure Deletes a rule
RENAME_RULE procedure Renames a rule. The name change takes effect
everywhere the rule is used.
UPDATE_RULE procedure Updates a rule
Procedure Description
CREATE_COMMAND_RULE procedure Creates a command rule, associates it with a rule set,
and lets you enable the command rule for rule
checking with a rule set
24-2
Chapter 24
DBMS_MACADM PL/SQL Package Contents
Procedure Description
CREATE_CONNECT_COMMAND_RULE Creates a CONNECT command rule
procedure
CREATE_SESSION_EVENT_CMD_RULE Creates a session event command rule, using the
procedure ALTER SESSION SQL statement
CREATE_SYSTEM_EVENT_CMD_RULE Creates a system event command rule, using the
procedure ALTER SYSTEM SQL statement
DELETE_COMMAND_RULE procedure Drops a command rule declaration
DELETE_CONNECT_COMMAND_RULE Drops a CONNECT command rule declaration
procedure
DELETE_SESSION_EVENT_CMD_RULE Drops a SESSION_EVENT_CMD command rule
procedure declaration
DELETE_SYSTEM_EVENT_CMD_RULE Drops a SYSTEM_EVENT_CMD command rule
procedure declaration
UPDATE_COMMAND_RULE procedure Updates a command rule declaration
UPDATE_CONNECT_COMMAND_RULE Updates a CONNECT command rule declaration
procedure
UPDATE_SESSION_EVENT_CMD_RULE Updates a SESSION_EVENT_CMD command rule
procedure declaration
UPDATE_SYSTEM_EVENT_CMD_RULE Updates a SYSTEM_EVENT_CMD command rule
procedure declaration
24-3
Chapter 24
DBMS_MACADM PL/SQL Package Contents
Procedure Description
CREATE_ROLE procedure Creates an Oracle Database Vault secure application
role
DELETE_ROLE procedure Deletes an Oracle Database Vault secure application
role
RENAME_ROLE procedure Renames an Oracle Database Vault secure
application role. The name change takes effect
everywhere the role is used.
UNASSIGN_ROLE procedure Unassigns an Oracle Database Vault secure
application role from a user
UPDATE_ROLE procedure Updates a Oracle Database Vault secure application
role
24-4
Chapter 24
DBMS_MACADM PL/SQL Package Contents
Procedure Description
CREATE_MAC_POLICY procedure Specifies the algorithm that is used to merge labels when
computing the label for a factor, or the Oracle Label
Security Session label
CREATE_POLICY_LABEL procedure Labels an identity within an Oracle Label Security policy
DELETE_MAC_POLICY_CASCADE Deletes all Oracle Database Vault objects related to an
procedure Oracle Label Security policy.
DELETE_POLICY_FACTOR procedure Removes the factor from contributing to the Oracle Label
Security label
DELETE_POLICY_LABEL procedure Removes the label from an identity within an Oracle Label
Security policy
UPDATE_MAC_POLICY procedure Specifies the algorithm that is used to merge labels when
computing the label for a factor, or the Oracle Label
Security Session label
Procedure Description
ADD_CMD_RULE_TO_POLICY procedure Adds a command rule to a Database Vault policy
ADD_OWNER_TO_POLICY procedure Adds an owner to a Database Vault policy
ADD_REALM_TO_POLICY procedure Adds a realm to a Database Vault policy
CREATE_POLICY procedure Creates a Database Vault policy
DELETE_CMD_RULE_FROM_POLICY Deletes a command rule from a Database Vault policy
procedure
DELETE_OWNER_FROM_POLICY procedure Deletes an owner from a Database Vault policy
DELETE_REALM_FROM_POLICY procedure Deletes a realm from a Database Vault policy
DROP_POLICY procedure Drops a Database Vault policy
RENAME_POLICY procedure Renames a Database Vault policy
UPDATE_POLICY_DESCRIPTION Updates a Database Vault policy description
procedure
UPDATE_POLICY_STATE procedure Updates the enablement status of the a Database Vault
policy
24-5
Chapter 24
DBMS_MACADM PL/SQL Package Contents
Procedure Description
ADD_NLS_DATA procedure Adds a new language to Oracle Database Vault
AUTHORIZE_DATAPUMP_USER Authorizes a user to perform Oracle Data Pump
procedure operations when Oracle Database Vault is enabled
AUTHORIZE_DDL procedure Grants a user authorization to execute data definition
language (DDL) statements
AUTHORIZE_MAINTENANCE_USER Grants a user authorization to perform Information
procedure Lifecycle Management (ILM) operations
AUTHORIZE_PROXY_USER procedure Grants a proxy user authorization to proxy other user
accounts
AUTHORIZE_SCHEDULER_USER Authorizes a user to schedule database jobs when
procedure Oracle Database Vault is enabled
AUTHORIZE_TTS_USER procedure Authorizes a user to perform Oracle Data Pump
transportable tablespace operations for a tablespace
when Oracle Database Vault is enabled
UNAUTHORIZE_DATAPUMP_USER Revokes the authorization that was granted by the
procedure DBMS_MACADM.AUTHORIZE_DATAPUMP_USER
procedure
UNAUTHORIZE_DDL procedure Revokes authorization from a user who was granted
authorization to execute DDL statements through the
DBMS_MACDM.AUTHORIZE_DDL procedure
UNAUTHORIZE_MAINTENANCE_USER Revokes authorization to perform ILM operations
procedure
UNAUTHORIZE_PROXY_USER procedure Revokes authorization from a user who was granted
proxy authorization from the
DBMS_MACADM.AUTHORIZE_PROXY_USER procedure
UNAUTHORIZE_SCHEDULER_USER Revokes authorization that was granted by the
procedure DBMS_MACADM.AUTHORIZE_SCHEDULER_USER
procedure
UNAUTHORIZE_TTS_USER procedure Revokes from authorization a user who had been
granted authorization to perform Oracle Data Pump
transportable tablespace operations for a tablespace
when Oracle Database Vault is enabled
DISABLE_DV procedure Disables Oracle Database Vault
DISABLE_DV_DICTIONARY_ACCTS Prevents users from logging into the DVSYS and DFV
procedure schema accounts
DISABLE_DV_PATCH_ADMIN Disables auditing of the DV_PATCH_ADMIN user
DISABLE_ORADEBUG procedure Disables the use of the ORADEBUG utility in an Oracle
Database Vault environment
ENABLE_DV procedure Enables Oracle Database Vault
ENABLE_DV_DICTIONARY_ACCTS Enables users to log into the DVSYS and DFV schema
procedure accounts
ENABLE_DV_PATCH_ADMIN Enables auditing of the DV_PATCH_ADMIN user
ENABLE_ORADEBUG procedure Enables the use of the ORADEBUG utility in an Oracle
Database Vault environment
24-6
Chapter 24
DBMS_MACSEC_ROLES PL/SQL Package Contents
24-7
Chapter 24
CONFIGURE_DV PL/SQL Procedure
This procedure is used as part of the registration process for Oracle Database Vault
with an Oracle database. You only need to use it once for the database instance.
The functions are then available to the general database account population through
PL/SQL functions and standard SQL.
Table 24-11 lists the DVF factor functions.
Function Description
F$CLIENT_IP Returns the IP address of the computer from which the client
is connected
F$DATABASE_DOMAIN Returns the domain of the database as specified in the
DB_DOMAIN initialization parameter
F$DATABASE_HOSTNAME Returns the host name of the computer on which the
database instance is running
F$DATABASE_INSTANCE Returns the database instance identification number of the
current database instance
F$DATABASE_IP Returns the IP address of the computer on which the
database instance is running
24-8
Chapter 24
DVF PL/SQL Interface Contents
Function Description
F$DATABASE_NAME Returns the name of the database as specified in the
DB_NAME initialization parameter
F$DOMAIN Returns a named collection of physical, configuration, or
implementation-specific factors in the run-time environment
(for example, a networked IT environment or subset of it) that
operates at a specific sensitivity level
F$ENTERPRISE_IDENTITY Returns the enterprise-wide identity for a user
F$IDENTIFICATION_TYPE Returns the way the schema of a user was created in the
database. Specifically, it reflects the IDENTIFIED clause in
the CREATE USER or ALTER USER syntax.
F$LANG Returns the ISO abbreviation for the language name, a
shorter form than the existing LANGUAGE parameter
F$LANGUAGE Returns the language and territory currently used by your
session, in VARCHAR2 data type, along with the database
character set
F$MACHINE Returns the computer (host) name for the database client
that established the database session.
F$NETWORK_PROTOCOL Returns the network protocol being used for communication,
as specified in the PROTOCOL=protocol portion of the
connect string
F$PROXY_ENTERPRISE_IDENTI Returns the Oracle Internet Directory distinguished name
TY (DN) when the proxy user is an enterprise user
F$SESSION_USER Returns the database user name by which the current user
is authenticated
24-9
25
Oracle Database Vault Data Dictionary Views
You can find information about the Oracle Database Vault configuration settings by querying
the Database Vault-specific data dictionary views.
• About the Oracle Database Vault Data Dictionary Views
Oracle Database Vault provides a set of DBA-style data dictionary views that can be
accessed through the DV_SECANALYST role or the DV_ADMIN role.
• CDB_DV_STATUS View
The CDB_DV_STATUS data dictionary view shows the status of Oracle Database Vault being
enabled and configured in a multitenant environment.
• DBA_DV_CODE View
The DBA_DV_CODE data dictionary view lists generic lookup codes for the user interface,
error messages, and constraint checking.
• DBA_DV_COMMAND_RULE View
The DBA_DV_COMMAND_RULE data dictionary view lists the SQL statements that are
protected by command rules.
• DBA_DV_DATAPUMP_AUTH View
The DBA_DV_DATAPUMP_AUTH data dictionary view lists the authorizations for using Oracle
Data Pump in an Oracle Database Vault environment.
• DBA_DV_DDL_AUTH View
The DBA_DV_DDL data dictionary view lists the users and schemas that were specified by
the DBMS_MACADM.AUTHORIZE_DDL procedure.
• DBA_DV_DICTIONARY_ACCTS View
The DBA_DV_DICTIONARY_ACCTS data dictionary view indicates whether users can directly
log into the DVSYS and DVF schema accounts.
• DBA_DV_FACTOR View
The DBA_DV_FACTOR data dictionary view lists the existing factors in the current database
instance.
• DBA_DV_FACTOR_TYPE View
The DBA_DV_FACTOR_TYPE data dictionary view lists the names and descriptions of factor
types used in the system.
• DBA_DV_FACTOR_LINK View
The DBA_DV_FACTOR_LINK data dictionary view shows the relationships of each factor
whose identity is determined by the association of child factors.
• DBA_DV_IDENTITY View
The DBA_DV_IDENTITY data dictionary view lists the identities for each factor.
• DBA_DV_IDENTITY_MAP View
The DBA_DV_IDENTITY_MAP data dictionary view lists the mappings for each factor identity.
• DBA_DV_JOB_AUTH View
The DBA_DV_JOB_AUTH data dictionary view lists the authorizations for using Oracle
Scheduler in an Oracle Database Vault environment.
25-1
Chapter 25
• DBA_DV_MAC_POLICY View
The DBA_DV_MAC_POLICY data dictionary view lists the Oracle Label Security
policies defined for use with Oracle Database Vault.
• DBA_DV_MAC_POLICY_FACTOR View
The DBA_DV_MAC_POLICY data dictionary view lists the factors that are associated
with Oracle Label Security policies.
• DBA_DV_MAINTENANCE_AUTH View
The DBA_DV_MAINTENANCE_AUTH data dictionary view provides information about
the configuration of Oracle Database Vault authorizations to use Information Life
Management (ILM) features.
• DBA_DV_ORADEBUG View
The DBA_DV_ORADEBUG data dictionary view indicates whether users can use the
ORADEBUG utility in an Oracle Database Vault environment.
• DBA_DV_PATCH_ADMIN_AUDIT View
The DBA_DV_PATCH_ADMIN_AUDIT data dictionary view indicates if auditing has
been enabled or disabled for the user who has been granted the DV_ADMIN_PATCH
role.
• DBA_DV_POLICY View
The DBA_DV_POLICY data dictionary view lists the Oracle Database Vault policies
that were created in the current database instance.
• DBA_DV_POLICY_LABEL View
The DBA_DV_POLICY_LABEL data dictionary view lists the Oracle Label Security
label for each factor identifier in the DBA_DV_IDENTITY view for each policy.
• DBA_DV_POLICY_OBJECT View
The DBA_DV_POLICY_OBJECT data dictionary view lists information about the objects
that are protected by Oracle Database Vault policies in the current database
instance.
• DBA_DV_POLICY_OWNER View
The DBA_DV_POLICY_OWNER data dictionary view lists the owners of Oracle
Database Vault policies that were created in the current database instance.
• DBA_DV_PROXY_AUTH View
The DBA_DV_PROXY_AUTH data dictionary view lists the proxy users and schemas
that were specified by the DBMS_MACADM.AUTHORIZE_PROXY_USER procedure.
• DBA_DV_PUB_PRIVS View
The DBA_DV_PUB_PRIVS data dictionary view lists data reflected in the Oracle
Database Vault privilege management reports used in Oracle Database Vault
Administrator.
• DBA_DV_REALM View
The DBA_DV_REALM data dictionary view lists the realms created in the current
database instance.
• DBA_DV_REALM_AUTH View
The DBA_DV_REALM_AUTH data dictionary view lists database user account or role
authorization (GRANTEE) who can access realm objects.
• DBA_DV_REALM_OBJECT View
The DBA_DV_REALM_OBJECT data dictionary view lists the database schemas, or
subsets of schemas, that are secured by the realms.
25-2
Chapter 25
• DBA_DV_ROLE View
The DBA_DV_ROLE data dictionary view lists the Oracle Database Vault secure application
roles used in privilege management.
• DBA_DV_RULE View
The DBA_DV_RULE data dictionary view lists the rules that have been defined.
• DBA_DV_RULE_SET View
The DBA_DV_RULE_SET data dictionary view lists the rules sets that have been created.
• DBA_DV_RULE_SET_RULE View
The DBA_DV_RULE_SET_RULE data dictionary view lists rules that are associated with
existing rule sets.
• DBA_DV_STATUS View
The DBA_DV_STATUS data dictionary view shows the status of Oracle Database Vault being
enabled and configured.
• DBA_DV_SIMULATION_LOG View
The DBA_DV_SIMULATION_LOG data dictionary view captures simulation log information for
realms and command rules that have had simulation mode enabled.
• DBA_DV_TTS_AUTH View
The DBA_DV_TTS_AUTH data dictionary view lists users who have been granted
authorization through the DBMS_MACADM.AUTHORIZE_TTS_USER procedure to perform
Oracle Data Pump transportable operations.
• DBA_DV_USER_PRIVS View
The DBA_DV_USER_PRIVS data dictionary view lists the privileges for a database user
account excluding privileges granted through the PUBLIC role.
• DBA_DV_USER_PRIVS_ALL View
The DBA_DV_USER_PRIVS_ALL data dictionary view lists the privileges for a database
account including privileges granted through PUBLIC.
• DVSYS.DV$CONFIGURATION_AUDIT View
The DVSYS.DV$CONFIGURATION_AUDIT data dictionary view captures DVSYS.AUDIT_TRAIL$
table audit trail records.
• DVSYS.DV$ENFORCEMENT_AUDIT View
The DVSYS.DV$ENFORCEMENT_AUDIT data dictionary view provides information about
enforcement-related audits from the DVSYS.AUDIT_TRAIL$ table.
• DVSYS.DV$REALM View
The DVSYS.DV$REALM data dictionary view describes settings that were used to create
Oracle Database Vault realms, such as which audit options have been assigned or
whether the realm is a mandatory realm.
• DVSYS.POLICY_OWNER_COMMAND_RULE View
The DVSYS.POLICY_OWNER_COMMAND_RULE data dictionary view enables users who have
been granted the DV_POLICY_OWNER role to find information about the command rules that
have been associated with Database Vault policies.
• DVSYS.POLICY_OWNER_POLICY View
The DVSYS.POLICY_OWNER_POLICY data dictionary view enables users who have been
granted the DV_POLICY_OWNER role to find information such as the names, descriptions,
and states of existing policies in the current database instance, including policies created
by other policy owners.
25-3
Chapter 25
About the Oracle Database Vault Data Dictionary Views
• DVSYS.POLICY_OWNER_REALM View
The POLICY_OWNER_REALM data dictionary view enables users who have been
granted the DV_POLICY_OWNER role to find information about the realms that have
been associated with Database Vault policies.
• DVSYS.POLICY_OWNER_REALM_AUTH View
The DVSYS.POLICY_OWNER_REALM_AUTH data dictionary view enables users who
have been granted the DV_POLICY_OWNER role to find information about the
authorization that was granted to realms that have been associated with Database
Vault policies.
• DVSYS.POLICY_OWNER_REALM_OBJECT View
The DVSYS.POLICY_OWNER_REALM_OBJECT data dictionary view enables users to find
information about the objects that have been added to realms that are associated
with Database Vault policies, such as. Only users who have been granted the
DV_POLICY_OWNER role can query this view.
• DVSYS.POLICY_OWNER_RULE View
The DVSYS.POLICY_OWNER_RULE data dictionary view enables users who have been
granted the DV_POLICY_OWNER role to find information about the rules that have
been associated with rule sets in Database Vault policies, such as the rule name
and its expression. Only users who have been granted the DV_POLICY_OWNER role
can query this view.
• DVSYS.POLICY_OWNER_RULE_SET View
The DVSYS.POLICY_OWNER_RULE_SET data dictionary view enables users who have
been granted the DV_POLICY_OWNER role to find information about the rule sets that
have been associated with Database Vault policies.
• DVSYS.POLICY_OWNER_RULE_SET_RULE View
The DVSYS.POLICY_OWNER_RULE_SET_RULE data dictionary view enables users who
have been granted the DV_POLICY_OWNER role to find information about the rule
sets that contain rules used in Database Vault policies.
• SYS.DV$CONFIGURATION_AUDIT View
The SYS.DV$CONFIGURATION_AUDIT view is almost the same as the
DVSYS.DV$CONFIGURATION_AUDIT view except that it captures unified audit trail
Database Vault audit records.
• SYS.DV$ENFORCEMENT_AUDIT View
The SYS.DV$ENFORCEMENT_AUDIT view is almost the same as the
DVSYS.DV$ENFORCEMENT_AUDIT view except that it captures unified audit trail
Database Vault audit records.
These views provide access to the various underlying Oracle Database Vault tables in
the DVSYS and LBACSYS schemas without exposing the primary and foreign key
columns that may be present. These views are intended for the database
administrative user to report on the state of the Oracle Database Vault configuration
without having to perform the joins required to get the labels for codes that are stored
in the core tables or from the related tables.
25-4
Chapter 25
CDB_DV_STATUS View
See Also:
Oracle Database Vault Reports if you are interested in running reports on Oracle
Database Vault
Related Views
• DBA_DV_STATUS View
25-5
Chapter 25
DBA_DV_CODE View
Table 25-1 describes the possible values from the CODE_GROUP column in the
DBA_DV_CODE data dictionary view.
25-6
Chapter 25
DBA_DV_COMMAND_RULE View
25-7
Chapter 25
DBA_DV_COMMAND_RULE View
25-8
Chapter 25
DBA_DV_DATAPUMP_AUTH View
This procedure grants a user authorization to execute Data Definition Language (DDL)
statements.
For example:
SELECT * FROM DBA_DV_DDL_AUTH WHERE GRANTEE = 'psmith';
25-9
Chapter 25
DBA_DV_DICTIONARY_ACCTS View
See Also:
• AUTHORIZE_DDL Procedure
• UNAUTHORIZE_DDL Procedure
For example:
SELECT * FROM DBA_DV_DICTIONARY_ACCTS;
25-10
Chapter 25
DBA_DV_FACTOR View
Related Views
• DBA_DV_FACTOR_LINK View
• DBA_DV_FACTOR_TYPE View
NAME VARCHAR2(128) NOT NULL Name of the factor. See Default Factors for a
list of default factors.
DESCRIPTION VARCHAR2(4000) NULL Description of the factor.
FACTOR_TYPE_NAME VARCHAR2(128) NOT NULL Category of the factor, which is used to classify
the purpose of the factor.
ASSIGN_RULE_SET_NAME VARCHAR2(128) NULL Rule set used to control the identify of the
factor.
GET_EXPR VARCHAR2(1024) NULL PL/SQL expression that retrieves the identity of
a factor.
VALIDATE_EXPR VARCHAR2(1024) NULL PL/SQL expression used to validate the identify
of the factor. It returns a Boolean value.
IDENTIFIED_BY NUMBER NOT NULL Determines the identity of a factor, based on
the expression listed in the GET_EXPR column.
Possible values are:
• 0: By constant
• 1: By method
• 2: By factors
IDENTIFIED_BY_MEANING VARCHAR2(4000) NULL Provides a text description for the
corresponding value in the IDENTIFIED_BY
column. Possible values are:
• By Constant: If IDENTIFIED_COLUMN is
0
• By Method: If IDENTIFIED_COLUMN is 1
• By Factors: If IDENTIFIED_COLUMN is 2
LABELED_BY NUMBER NOT NULL Determines the labeling the factor:
• 0: Labels the identities for the factor
directly from the labels associated with an
Oracle Label Security policy
• 1: Derives the factor identity label from the
labels of its child factor identities.
LABELED_BY_MEANING VARCHAR2(4000) NULL Provides a text description for the
corresponding value in the LABELED_BY
column. Possible values are:
• By Self: If LABELED_BY column is 0
• By Factors: If LABELED_BY column is 1
EVAL_OPTIONS NUMBER NOT NULL Determines how the factor is evaluated when
the user logs on:
• 0: When the database session is created
• 1: Each time the factor is accessed
• 2: On start-up
25-11
Chapter 25
DBA_DV_FACTOR_TYPE View
25-12
Chapter 25
DBA_DV_FACTOR_LINK View
NAME DESCRIPTION
--------- ----------------------------------------------------------------------
Time Time-based factor
Related Views
• DBA_DV_FACTOR View
• DBA_DV_FACTOR_LINK View
Related Views
• DBA_DV_FACTOR View
• DBA_DV_FACTOR_TYPE View
25-13
Chapter 25
DBA_DV_IDENTITY View
For example:
SELECT * FROM DBA_DV_IDENTITY WHERE VALUE = 'GLOBAL SHARED';
Output similar to the following appears, assuming you have created only one factor
identity:
FACTOR_NAME VALUE TRUST_LEVEL
---------------- -------------- ------------
Identification_Type GLOBAL SHARED 1
Related Views
• DBA_DV_FACTOR View
• DBA_DV_IDENTITY_MAP View
You can use this view to resolve the identity for factors that are identified by other
factors (for example, a domain) or for factors that have continuous domains (for
example, Age or Temperature).
For example:
SELECT FACTOR_NAME, IDENTITY_VALUE FROM DBA_DV_IDENTITY_MAP;
Related Views
• DBA_DV_FACTOR View
• DBA_DV_IDENTITY View
25-14
Chapter 25
DBA_DV_JOB_AUTH View
25-15
Chapter 25
DBA_DV_MAC_POLICY_FACTOR View
Related Views
• DBA_DV_MAC_POLICY_FACTOR View
• DBA_DV_POLICY_LABEL View
For example:
SELECT * FROM DBA_DV_MAC_POLICY_FACTOR;
Related Views
• DBA_DV_MAC_POLICY View
• DBA_DV_POLICY_LABEL View
25-16
Chapter 25
DBA_DV_MAINTENANCE_AUTH View
25-17
Chapter 25
DBA_DV_PATCH_ADMIN_AUDIT View
See Also:
• ENABLE_DV_PATCH_ADMIN_AUDIT Procedure
• DISABLE_DV_PATCH_ADMIN_AUDIT Procedure
Related Views
• DBA_DV_POLICY_OWNER View
• DBA_DV_POLICY_OBJECT View
25-18
Chapter 25
DBA_DV_POLICY_LABEL View
• DBA_DV_SIMULATION_LOG View
• DVSYS.POLICY_OWNER_POLICY View
For example:
SELECT * FROM DBA_DV_POLICY_LABEL;
Related Views
• DBA_DV_MAC_POLICY View
• DBA_DV_MAC_POLICY_FACTOR View
25-19
Chapter 25
DBA_DV_POLICY_OBJECT View
Related Views
• DBA_DV_POLICY View
• DBA_DV_POLICY_OWNER View
25-20
Chapter 25
DBA_DV_POLICY_OWNER View
Related Views
• DBA_DV_POLICY View
• DBA_DV_POLICY_OBJECT View
25-21
Chapter 25
DBA_DV_PROXY_AUTH View
This procedure grants a proxy user authorization to proxy other user accounts.
For example:
SELECT * FROM DBA_DV_DDL_AUTH WHERE GRANTEE = 'PRESTON';
See Also:
• AUTHORIZE_PROXY_USER Procedure
• UNAUTHORIZE_PROXY_USER Procedure
Related Views
• DBA_DV_USER_PRIVS View
• DBA_DV_USER_PRIVS_ALL View
• DBA_DV_ROLE View
25-22
Chapter 25
DBA_DV_REALM View
Related Views
• DBA_DV_REALM_AUTH View
• DBA_DV_REALM_OBJECT View
25-23
Chapter 25
DBA_DV_REALM_AUTH View
Related Views
• DBA_DV_REALM View
• DBA_DV_REALM_OBJECT View
25-24
Chapter 25
DBA_DV_REALM_AUTH View
25-25
Chapter 25
DBA_DV_REALM_OBJECT View
Related Views
• DBA_DV_REALM View
• DBA_DV_REALM_AUTH View
25-26
Chapter 25
DBA_DV_ROLE View
Related Views
• DBA_DV_PUB_PRIVS View
• DBA_DV_USER_PRIVS View
• DBA_DV_USER_PRIVS_ALL View
For example:
SELECT NAME, RULE_EXPR FROM DBA_DV_RULE WHERE NAME = 'Maintenance Window';
25-27
Chapter 25
DBA_DV_RULE_SET View
To find the rule sets that use specific rules, query the DBA_DV_RULE_SET_RULE view.
Related Views
• DBA_DV_RULE_SET View
• DBA_DV_RULE_SET_RULE View
For example:
SELECT RULE_SET_NAME, HANDLER_OPTIONS, HANDLER FROM DBA_DV_RULE_SET
WHERE RULE_SET_NAME = 'Maintenance Period';
Related Views
• DBA_DV_RULE View
25-28
Chapter 25
DBA_DV_RULE_SET View
• DBA_DV_RULE_SET_RULE View
25-29
Chapter 25
DBA_DV_RULE_SET_RULE View
Related Views
• DBA_DV_RULE View
25-30
Chapter 25
DBA_DV_STATUS View
• DBA_DV_RULE_SET View
Related Views
• CDB_DV_STATUS View
25-31
Chapter 25
DBA_DV_SIMULATION_LOG View
Related Views
• DBA_DV_REALM View for information about simulation mode settings for realms
• DBA_DV_COMMAND_RULE View for information about simulation mode settings
for command rules
• DBA_DV_POLICY View for information about simulation mode settings in Oracle
Database Vault policies
USERNAME VARCHAR2(128) NOT NULL Name of the user whose information is being
tracked
COMMAND VARCHAR2(128) NOT NULL Command rule being tracked
For a listing of existing command rules, query
the DBA_DV_COMMAND_RULE view, described in
DBA_DV_COMMAND_RULE View.
VIOLATION_TYPE VARCHAR2(4000) NULL Type of violation. See Table 25-2 for more
information.
REALM_NAME VARCHAR2(128) NULL Realm being tracked.
For a listing of existing realms, query the
DBA_DV_REALM view, described in
DBA_DV_REALM View.
OBJECT_OWNER VARCHAR2(128) NULL For command rules, the database schema to
which the command rule applied
25-32
Chapter 25
DBA_DV_TTS_AUTH View
OBJECT_NAME VARCHAR2(128) NULL For command rules, the database object that
the command rule protects
OBJECT_TYPE VARCHAR2(129) NULL For command rules, the type of object that is
being protected
RULE_SET_NAME VARCHAR2(128) NULL Rule set being tracked; it is associated with a
command rule
For a listing of existing rule sets, query the
DBA_DV_RULE_SET view, described in
DBA_DV_RULE_SET View
RETURN_CODE NUMBER NOT NULL The Oracle Database ORA error that results if
the Database Vault entity was in the enabled
state rather than in simulation state
SQLTEXT VARCHAR2(4000) NULL SQL text that the simulation mode captures
FACTOR_CONTEXT VARCHAR2(4000) NULL An XML document that contains all of the factor
identifiers for the current session at the point
when the audit event was triggered
TIMESTAMP TIMESTAMP(6) NULL Time stamp of user action, in UTC
WITH TIME ZONE (Coordinated Universal Time) time zone
Code Meaning
1000 Realm violation
1001 Command rule violation
1002 Oracle Data Pump authorization violation
1003 Simulation violation
1004 Oracle Scheduler authorization violation
1005 DDL authorization violation
1006 PARSE_AS_USER violation
Related Topics
• Using Simulation Mode for Logging Realm and Command Rule Activities
25-33
Chapter 25
DBA_DV_USER_PRIVS View
Related Views
• DBA_DV_DATAPUMP_AUTH View
For example:
SELECT USERNAME, ACCESS_TYPE, PRIVILEGE FROM DBA_DV_USER_PRIVS;
Related Views
• DBA_DV_PUB_PRIVS View
• DBA_DV_ROLE View
• DBA_DV_USER_PRIVS_ALL View
25-34
Chapter 25
DBA_DV_USER_PRIVS_ALL View
For example:
SELECT USERNAME, ACCESS_TYPE, PRIVILEGE FROM DBA_DV_USER_PRIVS;
Related Views
• DBA_DV_PUB_PRIVS View
• DBA_DV_ROLE View
• DBA_DV_USER_PRIVS View
25-35
Chapter 25
DVSYS.DV$CONFIGURATION_AUDIT View
Related View
• SYS.DV$CONFIGURATION_AUDIT View
25-36
Chapter 25
DVSYS.DV$CONFIGURATION_AUDIT View
Table 25-3 describes the possible values for the ACTION column of the
DVSYS.DV$CONFIGURATION_AUDIT view.
25-37
Chapter 25
DVSYS.DV$CONFIGURATION_AUDIT View
25-38
Chapter 25
DVSYS.DV$CONFIGURATION_AUDIT View
25-39
Chapter 25
DVSYS.DV$ENFORCEMENT_AUDIT View
Related View
• SYS.DV$ENFORCEMENT_AUDIT View
25-40
Chapter 25
DVSYS.DV$ENFORCEMENT_AUDIT View
25-41
Chapter 25
DVSYS.DV$ENFORCEMENT_AUDIT View
The following table describes the possible values for the ACTION column of the
DVSYS.DV$ENFORCEMENT_AUDIT view.
25-42
Chapter 25
DVSYS.DV$REALM View
Related Views
• DBA_DV_REALM View
25-43
Chapter 25
DVSYS.POLICY_OWNER_COMMAND_RULE View
For example:
SELECT COMMAND, OBJECT_OWNER, OBJECT_NAME FROM DVSYS.POLICY_OWNER_COMMAND_RULE;
Related Views
• DVSYS.POLICY_OWNER_POLICY View
25-44
Chapter 25
DVSYS.POLICY_OWNER_POLICY View
Related View
• DBA_DV_POLICY View
25-45
Chapter 25
DVSYS.POLICY_OWNER_REALM View
For example:
SELECT NAME, ENABLED FROM DVSYS.POLICY_OWNER_REALM;
Related Views
• DVSYS.POLICY_OWNER_REALM_AUTH View
• DVSYS.POLICY_OWNER_REALM_OBJECT View
25-46
Chapter 25
DVSYS.POLICY_OWNER_REALM_AUTH View
For example:
SELECT REALM_NAME, INHERITED_REALM FROM DVSYS.POLICY_OWNER_REALM_AUTH;
Related Views
• DVSYS.POLICY_OWNER_REALM View
• DVSYS.POLICY_OWNER_REALM_OBJECT View
25-47
Chapter 25
DVSYS.POLICY_OWNER_REALM_OBJECT View
Examples of information that users can find include the realm name, grantee, and
associated rule set.
For example:
SELECT REALM_NAME, OWNER, OBJECT_NAME, OBJECT_TYPE FROM
DVSYS.POLICY_OWNER_REALM_OBJECT;
Related Views
• DVSYS.POLICY_OWNER_REALM View
25-48
Chapter 25
DVSYS.POLICY_OWNER_RULE View
• DVSYS.POLICY_OWNER_REALM_AUTH View
For example:
SELECT NAME, RULE_EXPR FROM DVSYS.POLICY_OWNER_RULE WHERE NAME = 'True';
Related Views
• DVSYS.POLICY_OWNER_COMMAND_RULE View
• DVSYS.POLICY_OWNER_RULE_SET View
25-49
Chapter 25
DVSYS.POLICY_OWNER_RULE_SET View
For example:
SELECT RULE_SET_NAME, ENABLED FROM DVSYS.POLICY_OWNER_RULE_SET;
Related Views
• DVSYS.POLICY_OWNER_COMMAND_RULE View
• DVSYS.POLICY_OWNER_RULE View
• DVSYS.POLICY_OWNER_RULE_SET_RULE View
25-50
Chapter 25
DVSYS.POLICY_OWNER_RULE_SET View
25-51
Chapter 25
DVSYS.POLICY_OWNER_RULE_SET_RULE View
Related Views
• DVSYS.POLICY_OWNER_COMMAND_RULE View
• DVSYS.POLICY_OWNER_RULE_SET View
• DVSYS.POLICY_OWNER_RULE View
25-52
Chapter 25
SYS.DV$ENFORCEMENT_AUDIT View
25-53
26
Monitoring Oracle Database Vault
You can monitor Oracle Database Vault by checking for violations to the Database Vault
configurations and by tracking changes to policies.
• About Monitoring Oracle Database Vault
You can use the Database Vault home page in Oracle Enterprise Manager Cloud Control
to monitor a Database Vault-enabled database.
• Monitoring Security Violations and Configuration Changes
A user who has been granted the appropriate role can use Oracle Database Vault
Administrator to monitor security violations and configuration changes.
26-1
Chapter 26
Monitoring Security Violations and Configuration Changes
3. To find attempted violations for a specific time, such as the last 7 days, select from
the menu under the Time Series button in the upper right corner.
You also can change the pie chart to a graph by clicking the Time Series button.
4. To find the Configuration Issues Reports, Enforcement Audit Reports,
Configuration Changes Audit Reports, and Simulation Mode Reports, select
the appropriate link under Database Vault reports.
See Oracle Database Vault Reports for detailed information about the Database
Vault reports.
26-2
27
Oracle Database Vault Reports
Oracle Database Vault provides reports that track activities, such as the Database Vault
configuration settings.
• About the Oracle Database Vault Reports
Oracle Database Vault provides reports that display security-related information from the
database.
• Who Can Run the Oracle Database Vault Reports?
Users must have the DV_OWNER, DV_ADMIN, or DV_SECANALYST role before they can run the
Oracle Database Vault reports.
• Running the Oracle Database Vault Reports
A user who has been granted the appropriate roles can run the Oracle Database Vault
reports from Database Vault Administrator.
• Oracle Database Vault Configuration Issues Reports
The configuration issues reports track the settings for command rules, rule sets, realms,
and other Oracle Database Vault configurations.
• Oracle Database Vault Auditing Reports
If you have unified auditing enabled, then the Oracle Database Vault audit reports
capture the results of unified audit policies.
• Oracle Database Vault General Security Reports
The general security reports track information such as object privileges related to PUBLIC
or privileges granted to a database account or role.
27-1
Chapter 27
Who Can Run the Oracle Database Vault Reports?
27-2
Chapter 27
Oracle Database Vault Configuration Issues Reports
27-3
Chapter 27
Oracle Database Vault Configuration Issues Reports
• Owner does not exist for a realm-secured object. This can happen when the user
account has been dropped.
In most cases, however, these types of issues are caught when you configure the
realm and during validation.
27-4
Chapter 27
Oracle Database Vault Auditing Reports
27-5
Chapter 27
Oracle Database Vault General Security Reports
You can audit instances where a factor identity cannot be resolved and assigned (such
as No data found or Too many rows). A factor can have an associated rule set that
assigns an identity to the factor at run time. When you configure a factor, you can set it
to audit the rule set processing results.
27-6
Chapter 27
Oracle Database Vault General Security Reports
This report details all the object access the database accounts that you specify on the Report
Parameters page, through object grants to PUBLIC. On the Reports Parameters page, you
can filter the results based on the privilege, the object owner, or the object name.
27-7
Chapter 27
Oracle Database Vault General Security Reports
Note:
This report can be quite large if you choose the defaults.
On the Reports Parameters page, you can filter the results based on the privilege, the
object owner or the object name.
Note:
This report can be quite large if you choose the defaults.
27-8
Chapter 27
Oracle Database Vault General Security Reports
account you are inspecting for dependency and the object it may be dependent on, in the
Report Parameters page.
The Report Results page shows the dependent object and object type and the source object
name and type. This report shows where the potentially sensitive object is being used. By
looking at several accounts, you might be able to see patterns that can help you develop
restricted roles. These restricted roles can replace PUBLIC grants on widely used sensitive
objects.
27-9
Chapter 27
Oracle Database Vault General Security Reports
For example, these types of packages can be used to access operating system
resources.
The following system PL/SQL packages are included:
27-10
Chapter 27
Oracle Database Vault General Security Reports
This report can be used to determine which privileges can be revoked from PUBLIC, or from
other accounts and roles. This reduces vulnerabilities as part of an overall security policy
implementation using the principle of least privilege.
27-11
Chapter 27
Oracle Database Vault General Security Reports
This report also shows whether the accounts use an external password. However,
note that this report does not include operating system users who can become SYSDBA.
See Also:
DBA_DV_PUB_PRIVS View to find the values on which the counts listed in
these reports are based
27-12
Chapter 27
Oracle Database Vault General Security Reports
27-13
Chapter 27
Oracle Database Vault General Security Reports
This privilege can be misused to give another account more system privileges than
required.
See Also:
Oracle Database Vault Security Guidelines for guidelines on deciding who
should have privileged roles
Accounts that have this privilege can bypass all Virtual Private Database (VPD) policy
filters and any Oracle Label Security policies that use Oracle Virtual Private Database
indirectly. This is a powerful system privilege that should be granted only if absolutely
necessary, as it presents a target to gain access to sensitive information in tables that
are protected by Oracle Virtual Private Database or Oracle Label Security. You can
use the auditing policies described in Auditing Oracle Database Vault, to audit the use
of this privilege.
The BECOME USER privilege is a very powerful system privilege: it enables the
IMP_FULL_DATABASE and EXP_FULL_DATABASE roles for use with Oracle Data Pump.
Accounts that possess this privilege can be misused to get sensitive information or to
compromise an application.
27-14
Chapter 27
Oracle Database Vault General Security Reports
Oracle recommends that you restrict these privileges only to those accounts and roles that
truly need them (for example, the SYS account and the DV_ADMIN role). The ALTER SYSTEM
statement can be used to change the security-related database initialization parameters that
are set to recommended values as part of the Oracle Database Vault security strengthening
service. Both the ALTER SYSTEM and ALTER SESSION statements can be used to dump
database trace files, potentially containing sensitive configuration information, to the
operating system.
See Also:
ALTER SYSTEM and ALTER SESSION Privilege Security Considerations for
guidelines on using the ALTER SYSTEM and ALTER SESSION privileges
This table stores hashed passwords that were previously used by each account.
Access to this table can make guessing the existing password for an account easier for
someone hacking the database.
Remember that WITH GRANT is used for object-level privileges: An account that has been
granted privileges using the WITH GRANT option can be misused to grant object privileges to
another account.
27-15
Chapter 27
Oracle Database Vault General Security Reports
This privilege can be used to disable auditing, which could be used to eliminate the
audit trail record of a intruder who has compromised the system. The accounts that
have this privilege could be targets for intruders.
27-16
Chapter 27
Oracle Database Vault General Security Reports
This report helps determine whether any of these resources are approaching their limits
under the existing application load. Resources that show large increases over a short period
may point to a denial-of-service (DoS) attack. You might want to reduce the upper limit for the
resource to prevent the condition in the future.
27-17
Chapter 27
Oracle Database Vault General Security Reports
See Also:
Oracle Database Reference for more information about the AUDIT_TRAIL
parameter
Note:
Oracle JVM, the Java virtual machine option provided with Oracle Database
Vault, must be installed before you can run the Java Policy Grants Report.
27-18
Chapter 27
Oracle Database Vault General Security Reports
Directory objects should exist only for secured operating system (OS) directories, and access
to them within the database should be protected. You should never use the root operating
system directory on any storage device (for example, /), because it allows remote database
sessions to look at all files on the device.
27-19
Chapter 27
Oracle Database Vault General Security Reports
27-20
A
Auditing Oracle Database Vault
You can audit activities in Oracle Database Vault, such as changes to policy configurations.
• About Auditing in Oracle Database Vault
All activities in Oracle Database Vault can be audited, including Database Vault
administrator activities.
• Protection of the Unified Audit Trail in an Oracle Database Vault Environment
By default, AUDSYS schema, which contains the unified audit trail, is not protected by a
realm.
• Oracle Database Vault Specific Audit Events
Oracle Database Vault audit events track activities such as whether an action attempted
on a realm was successful.
• Archiving and Purging the Oracle Database Vault Audit Trail
If you have not migrated to unified auditing, you should periodically archive and purge the
Oracle Database Vault audit trail.
• Oracle Database Audit Settings Created for Oracle Database Vault
When you install Oracle Database Vault, it creates several AUDIT settings in the
database.
A-1
Appendix A
Protection of the Unified Audit Trail in an Oracle Database Vault Environment
• Using the unified audit policy SQL statements: These statements are the
CREATE AUDIT POLICY, ALTER AUDIT POLICY, DROP AUDIT POLICY, AUDIT, and NO
AUDIT statements. They are written to the unified audit trail, which is captured by
the UNIFIED_AUDIT_TRAIL, SYS.DV$CONFIGURATION_AUDIT, and
SYS.DV$ENFORCEMENT_AUDIT data dictionary views.
When you migrate to unified auditing, then the auditing features in the Database Vault
APIs are no longer effective. You should archive and purge these audit records, as
described in Archiving and Purging the Oracle Database Vault Audit Trail. From then
on, you can manage Database Vault audit policies through the unified audit policy
PL/SQL statements.
Except where noted, the remaining sections of this chapter describe how Database
Vault auditing works in a non-unified or mixed mode auditing environment.
See Also:
A-2
Appendix A
Oracle Database Vault Specific Audit Events
These audit records are not part of the Oracle Database audit trail, and how auditing is
enabled in the database has no effect how Oracle Database Vault collects its audit data in the
DVSYS.AUDIT_TRAIL$ table. In fact, even if auditing has been disabled in Oracle Database,
then the Oracle Database Vault audit functionality continues to write to the
DVSYS.AUDIT_TRAIL$ table.
Users who have been granted the DV_OWNER, DV_ADMIN, DV_SECANALYST or DV_MONITOR role
can directly query the DVYS.AUDIT_TRAIL$ table.
A-3
Appendix A
Oracle Database Vault Specific Audit Events
Table A-1 describes the format of the audit trail, which you must understand if you plan
to create custom reports that use the DVSYS.AUDIT_TRAIL$ table.
A-4
Appendix A
Archiving and Purging the Oracle Database Vault Audit Trail
A.4 Archiving and Purging the Oracle Database Vault Audit Trail
If you have not migrated to unified auditing, you should periodically archive and purge the
Oracle Database Vault audit trail.
• About Archiving and Purging the Oracle Database Vault Audit Trail
In a non-unified auditing environment, you can archive the Oracle Database Vault audit
trail by exporting the DVSYS.AUDIT_TRAIL$ table to a dump file.
A-5
Appendix A
Archiving and Purging the Oracle Database Vault Audit Trail
A.4.1 About Archiving and Purging the Oracle Database Vault Audit
Trail
In a non-unified auditing environment, you can archive the Oracle Database Vault audit
trail by exporting the DVSYS.AUDIT_TRAIL$ table to a dump file.
You should periodically archive and then purge the audit trail to prevent it from growing
too large.
If you choose to migrate to unified auditing, then use this procedure to archive and
purge the Database Vault audit trail records after you complete the migration. When
unified auditing begins to collect records, then the new records will be available for
viewing from the UNIFIED_AUDIT_TRAIL, SYS.DV$CONFIGURATION_AUDIT, and
SYS.DV$ENFORCEMENT_AUDIT data dictionary views.
2. Ensure that the user who will perform archiving has the appropriate privileges.
For example:
GRANT CREATE ANY DIRECTORY, EXP_FULL_DATABASE, UNLIMITED TABLESPACE TO
psmith;
3. Connect as a user who has been granted the DV_OWNER or DV_AUDIT_CLEANUP role.
For example:
connect ebrown
Enter password: password
4. Archive the Oracle Database Vault audit trail into a new table in an appropriate
schema.
For example:
CREATE TABLE psmith.dv_audit_trail nologging \
AS SELECT * FROM DVSYS.AUDIT_TRAIL$;
5. If the schema is already protected by a realm, then ensure that you or the user
performing the export operation has been granted the appropriate authorization to
use Oracle Data Pump in a Database Vault environment.
For example, to authorize user psmith to perform Data Pump operations on his
own schema:
A-6
Appendix A
Archiving and Purging the Oracle Database Vault Audit Trail
8. Exit SQL*Plus.
EXIT
9. Using Data Pump, export the Database Vault audit trail into the directory object that you
just created.
expdp psmith directory=dv_audit_dir tables=psmith.dv_audit_trail \
dumpfile=dv_audit.dmp log=dv_audit_exp.log
10. Connect to SQL*Plus as a user who has been granted the DV_OWNER role.
sqlplus ebrown
Enter password: password
11. If you have not done so, then create a realm around the schema that now contains the
Database Vault audit trail.
a. Create the realm. For example:
BEGIN
DBMS_MACADM.CREATE_REALM(
realm_name => 'DV Audit Trail Realm',
description => 'Realm to protect the DV audit trail',
enabled => DBMS_MACUTL.G_YES,
audit_options => DBMS_MACUTL.G_REALM_AUDIT_FAIL +
DBMS_MACUTL.G_REALM_AUDIT_SUCCESS,
realm_type => 1);
END;
/
b. Add the schema that contains to audit trail to this realm. For example:
BEGIN
DBMS_MACADM.ADD_OBJECT_TO_REALM(
realm_name => 'DV Audit Trail Realm',
object_owner => 'psmith',
object_name => '%',
object_type => '%');
END;
/
A-7
Appendix A
Oracle Database Audit Settings Created for Oracle Database Vault
See Also:
• Using Oracle Data Pump with Oracle Database Vault for more
information about granting users Oracle Data Pump privileges in a
Database Vault environment
• Oracle Database SQL Language Reference for information about the
CREATE DIRECTORY statement
• Oracle Database Utilities for information about the Oracle Data Pump
expdp utility
• Oracle Database Vault Realm APIs, for information about the realm-
related DBMS_MACADM procedures
Note that the DV_OWNER and DV_AUDIT_CLEANUP roles do not allow their grantees to
truncate the DVSYS.AUDIT_TRAIL$ system table.
You can query the DBA_ROLE_PRIVS data dictionary view to find the roles that have
been granted to a user.
2. Purge the Database Vault audit trail.
DELETE FROM DVSYS.AUDIT_TRAIL$;
Related Topics
• DV_AUDIT_CLEANUP Audit Trail Cleanup Role
The DV_AUDIT_CLEANUP role is used for purge operations.
A-8
Appendix A
Oracle Database Audit Settings Created for Oracle Database Vault
Table A-2 Audit Policy Settings Oracle Database Vault Adds to Oracle Database
Audit Setting Type Audited Statements (BY ACCESS and on Success or Failure
Unless Otherwise Noted)
User Audit Settings for DVSYS/DVF ADMINISTER DATABASE TRIGGER
User Audit Settings for LBACSYS ALTER object
See Table 14-1 for more information AUDIT SYSTEM
about these accounts. BECOME USER
See also these sections for detailed
CLUSTER
information on the DVSYS and DVF
schemas: COMMENT
• DVSYS Schema CONTEXT
• DVF Schema CREATE object
DATABASE LINK
DEBUG
DIRECTORY
DROP object
EXECUTE LIBRARY (WHENEVER NOT SUCCESSFUL)
EXECUTE PROCEDURE (WHENEVER NOT SUCCESSFUL)
EXEMPT ACCESS POLICY
EXPORT FULL DATABASE
GRANT object
IMPORT FULL DATABASE
INDEX
MANAGE SCHEDULER
MANAGE TABLESPACE
MATERIALIZED VIEW (audits both accessing and creating materialized
views)
SELECT SEQUENCE (WHENEVER NOT SUCCESSFUL)
SELECT TABLE (WHENEVER NOT SUCCESSFUL)
Object Audit Settings for DVF AUDIT PACKAGE/PROCEDURE/FUNCTION/SEQUENCE/TABLE
COMMENT TABLE/VIEW
DELETE TABLE/VIEW
EXECUTE PACKAGE/PROCEDURE/FUNCTION (WHENEVER NOT
SUCCESSFUL)
GRANT PACKAGE/PROCEDURE/FUNCTION/SEQUENCE/TABLE
RENAME PACKAGE/PROCEDURE/FUNCTION/SEQUENCE/VIEW/TABLE
SELECT SEQUENCE/TABLE/VIEW (WHENEVER NOT SUCCESSFUL)
A-9
Appendix A
Oracle Database Audit Settings Created for Oracle Database Vault
Table A-2 (Cont.) Audit Policy Settings Oracle Database Vault Adds to Oracle Database
Audit Setting Type Audited Statements (BY ACCESS and on Success or Failure
Unless Otherwise Noted)
Object Audit Settings for DVSYS AUDIT PACKAGE/PROCEDURE/FUNCTION/SEQUENCE/TABLE
Object Audit Settings for LBACSYS COMMENT TABLE/VIEW
DELETE TABLE/VIEW
EXECUTE PACKAGE/PROCEDURE/FUNCTION (WHENEVER NOT
SUCCESSFUL)
GRANT PACKAGE/PROCEDURE/FUNCTION/SEQUENCE/TABLE
INSERT TABLE/VIEW
RENAME PACKAGE/PROCEDURE/FUNCTION/SEQUENCE/VIEW/TABLE
SELECT SEQUENCE/TABLE/VIEW (WHENEVER NOT SUCCESSFUL)
UPDATE TABLE/VIEW
A-10
B
Disabling and Enabling Oracle Database Vault
Periodically you must disable and then re-enable Oracle Database Vault, for activities such as
installing Oracle Database optional products or features.
• When You Must Disable Oracle Database Vault
You may need to disable Oracle Database Vault to perform upgrade tasks or correct
erroneous configurations.
• Step 1: Disable Oracle Database Vault
Be aware that after you disable Oracle Database Vault, Oracle Label Security, which is
required to run Database Vault, is still enabled.
• Step 2: Perform the Required Tasks
At this stage, Oracle Database Vault is disabled and you can perform the required tasks.
• Step 3: Enable Oracle Database Vault
You can enable Oracle Database Vault and Oracle Label Security from SQL*Plus.
B-1
Appendix B
Step 1: Disable Oracle Database Vault
Note:
• Be aware that if you disable Oracle Database Vault, the privileges that
were revoked from existing users and roles during installation remain in
effect. See Privileges That Are Revoked from Existing Users and Roles
for a listing of the revoked privileges.
• When Oracle Database Vault is disabled, there are some Database Vault
features that you can still use.
• Oracle does not support the deinstallation of Oracle Database Vault.
EXEC DBMS_MACADM.DISABLE_DV;
To find the available PDBs, query the DBA_PDBS data dictionary view. To check the
current PDB, run the show con_name command.
3. Restart the database.
CONNECT SYS AS SYSOPER -- Or, CONNECT SYS@hrpdb AS SYSOPER
Enter password: password
SHUTDOWN IMMEDIATE
STARTUP
4. For Oracle RAC installations, repeat these steps for each node on which the
database is installed.
B-2
Appendix B
Step 3: Enable Oracle Database Vault
that a CONNECT command rule cannot prevent a user who has the DV_OWNER or
DV_ADMIN role from connecting to the database. This enables a Database Vault
administrator to correct a misconfigured protection without having to disable Database
Vault.
• Use the SYSTEM or SYS accounts to perform tasks such as creating or changing
passwords, or locking and unlocking accounts. In addition to modifying standard
database and administrative user accounts, you can modify passwords and the lock
status of any of the Oracle Database Vault-specific accounts, such as users who have
been granted the DV_ADMIN or DV_ACCTMGR roles. (See the tip under Oracle Database
Vault Accounts Created During Registration for a guideline for avoiding this problem in
the future.)
• Perform the installation or other tasks that require security protections to be
disabled.
EXEC DBMS_MACADM.ENABLE_DV;
If you are enabling Database Vault from the CDB root, for example:
CONNECT c##dbv_owner
Enter password: password
Oracle Label security must be enabled before you can use Database Vault. If it is not
enabled, then this query returns FALSE.
3. If Oracle Label Security is not enabled, then enable it.
CONNECT SYS AS SYSDBA -- Or, CONNECT SYS@hrpdb AS SYSDBA
Enter password: password
EXEC LBACSYS.CONFIGURE_OLS;
EXEC LBACSYS.OLS_ENFORCEMENT.ENABLE_OLS;
B-3
Appendix B
Step 3: Enable Oracle Database Vault
SHUTDOWN IMMEDIATE
STARTUP
5. For Oracle RAC installations, repeat these steps for each node on which the
database is installed.
B-4
C
Postinstallation Oracle Database Vault
Procedures
After you register Oracle Database Vault, you can perform specialized tasks, such as
configuring it on Oracle Real Application Clusters (Oracle RAC) nodes.
• Configuring Oracle Database Vault on Oracle RAC Nodes
After you configure Oracle Database Vault for an Oracle Real Application Clusters
(Oracle RAC) instance, you must configure each Oracle RAC node.
• Adding Languages to Oracle Database Vault
By default, Oracle Database Vault loads only the English language tables.
• Deinstalling Oracle Database Vault
You can remove Oracle Database Vault from an Oracle Database installation, for both to
both single-instance and Oracle RAC installations.
• Reinstalling Oracle Database Vault
You can reinstall Oracle Database Vault by using Database Configuration Assistant and
afterward, register Database Vault.
Related Topics
• Converting a Standalone Oracle Database to a PDB and Plugging It into a CDB
You can convert a standalone Oracle Database Release 12c or later database to a PDB,
and then plug this PDB into a CDB.
2. Run the following ALTER SYSTEM statements on each Oracle RAC node:
ALTER SYSTEM SET AUDIT_SYS_OPERATIONS=TRUE SCOPE=SPFILE; -- For non-unified
auditing environments
ALTER SYSTEM SET OS_ROLES=FALSE SCOPE=SPFILE;
ALTER SYSTEM SET RECYCLEBIN='OFF' SCOPE=SPFILE;
ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE' SCOPE=SPFILE;
ALTER SYSTEM SET SQL92_SECURITY=TRUE SCOPE=SPFILE;
SHUTDOWN IMMEDIATE
STARTUP
C-1
Appendix C
Adding Languages to Oracle Database Vault
You can specify the language setting using any case. For example:
EXEC DBMS_MACADM.ADD_NLS_DATA('french');
EXEC DBMS_MACADM.ADD_NLS_DATA('JAPANESE');
C-2
Appendix C
Deinstalling Oracle Database Vault
3. If the recycle bin is on, then disable it using one of the following statements:
ALTER SYSTEM SET RECYCLEBIN = OFF;
4. Connect as a user who has been granted the DV_OWNER or DV_ADMIN role.
For example:
CONNECT leo_dvowner -- Or, CONNECT leo_dvowner@hrpdb
Enter password: password
6. Connect as SYS with the SYSOPER privilege and then restart the database.
For example:
CONNECT SYS AS SYSOPER -- Or, CONNECT SYS@hrpdb AS SYSOPER
Enter password: password
SHUTDOWN IMMEDIATE
STARTUP
For Oracle RAC installations, shut down and then restart each database instance as
follows:
srvctl stop database -db db_name
srvctl start database -db db_name
8. If necessary, in SQL*Plus, as user SYS with the SYSDBA administrative privilege, manually
revoke the EXECUTE privilege on the DBMS_RLS PL/SQL package from any users who have
been granted the DV_OWNER role.
When you configure Oracle Database Vault, one of the privileges that DV_OWNERusers are
granted is this privilege. However, when you remove Oracle Database Vault, DV_OWNER
users still have this privilege. Optionally, you can revoke it.
Afterward, you can double-check that Oracle Database Vault is truly deinstalled by logging in
to SQL*Plus and entering the following statement:
SELECT * FROM V$OPTION WHERE PARAMETER = 'Oracle Database Vault';
C-3
Appendix C
Reinstalling Oracle Database Vault
3. Use DBCA to configure Database Vault for either a new or an existing database.
See Oracle Database 2 Day DBA for detailed information about creating a
database with DBCA.
4. Follow the instructions in Registering Oracle Database Vault with an Oracle
Database to register Database Vault.
C-4
D
Oracle Database Vault Security Guidelines
As with all Oracle Database products, you should follow security guidelines to better secure
your Oracle Database Vault installation.
• Separation of Duty Guidelines
Oracle Database Vault is designed to easily implement separation of duty guidelines.
• Managing Oracle Database Administrative Accounts
Oracle provides guidelines for managing security for administrative accounts such as
SYSTEM or users who have the SYSDBA administrative privilege.
• Accounts and Roles Trusted by Oracle Database Vault
Oracle Database Vault restricts access to application data from many privileged users
and roles in the database.
• Accounts and Roles That Should be Limited to Trusted Individuals
You should limit powerful accounts and roles only to trusted individuals.
• Guidelines for Using Oracle Database Vault in a Production Environment
You should follow special guidelines when you run Oracle Database Vault in a production
environment.
• Secure Configuration Guidelines
You should be aware of security considerations for special PL/SQL packages, privileges,
and the recycle bin.
D-1
Appendix D
Separation of Duty Guidelines
Separation of duty has taken on increased importance over the past 10 years. For
many organizations, separation of duty is a new concept that continues to evolve.
Database consolidation, regulatory compliance, and outsourcing are just a few of the
drivers for increased separation of duty. Oracle Database Vault separation of duty
strengthens security by separating security-related administration from day-to-day
DBA operations. You can tailor your Database Vault separation of duty implementation
to easily adapt to current and future business requirements. Small organizations, in
particular, need flexibility as they attempt to increase their security profile with limited
resources.
Important:
As a safety measure, you should keep and maintain the backup user
account in case the primary DV_OWNER account owner forgets his or her
password or leaves the company. It is also important that you do not lose
access to all of the user accounts that have been granted the DV_OWNER
role. There is no way to recover the DV_OWNER role if you lose access
(such as with a lost password or a staff departure) to any account that
has the DV_OWNER role. If you lose access to the DV_OWNER role, then you
cannot modify any Database Vault controls or disable Database Vault. To
remedy this problem, you can recover the database to the last known
point where the database had possession of the Database Vault owner
account.
D-2
Appendix D
Separation of Duty Guidelines
See Also:
• Oracle Database Vault Roles for an in-depth look at how the Oracle Database
Vault roles provide for separation of duty
• Oracle Database Vault Accounts Created During Registration for a full list of the
default Oracle Database Vault accounts
• Backup Oracle Database Vault Accounts for more information about the
importance of backup accounts
D-3
Appendix D
Separation of Duty Guidelines
JSMITH Yes No No No No No No
SHARDY No No No No No No Yes
PKESTNER No No Yes No No No No
RTYLER No No No No Yes No No
SANDERSON No No No Yes No Yes No
SYSTEM No No No No Yes, for EBS No No
patching
RMAN No Yes Yes No No No No
In some cases, system management tasks may require temporary access to data
through specific tools and programs. When this happens, build provisions for this
temporary or emergency access into the Oracle Database Vault rules and rule sets.
D-4
Appendix D
Managing Oracle Database Administrative Accounts
D-5
Appendix D
Managing Oracle Database Administrative Accounts
For all other cases, create named database accounts to perform daily database
administration. Members of the OSDBA user group are also given the SYSDBA
administrative privilege. The database SYS account and accounts with SYSDBA privilege
along with the operating system root and oracle accounts should be managed in a
Privileged Account Management (PAM) system and checked out only when required.
Related Topics
• Management of SYSDBA Access
You should avoid using the SYS account and the SYSDBA privilege for normal
database maintenance tasks.
D-6
Appendix D
Accounts and Roles Trusted by Oracle Database Vault
See Also:
Oracle Database Advanced Security Guide for more information about Transparent
Data Encryption
Related Topics
• Backup Oracle Database Vault Accounts
As a best practice, you should maintain backup accounts for the DV_OWNER and
DV_ACCTMGR roles.
D-7
Appendix D
Accounts and Roles That Should be Limited to Trusted Individuals
D-8
Appendix D
Accounts and Roles That Should be Limited to Trusted Individuals
Related Topics
• ENABLE_DV_PATCH_ADMIN_AUDIT Procedure
The ENABLE_DV_PATCH_ADMIN_AUDIT procedure enables realm, command rule, and rule
set auditing of the actions by users who have the DV_PATCH_ADMIN role.
This prevents SYSOPER from modifying the Oracle data dictionary directly. The SYSOPER
privilege has limited privileges within the database, but individuals with this role can start and
shut down the Oracle database. Only grant the SYSOPER privilege to trusted individuals.
D-9
Appendix D
Guidelines for Using Oracle Database Vault in a Production Environment
D-10
Appendix D
Secure Configuration Guidelines
• Installing patches and new applications might re-grant some of the privileges that Oracle
recommends that you revoke in this section. Check these privileges after you install
patches and new applications to verify that they are still revoked.
• When you revoke EXECUTE privileges on packages, ensure that you grant EXECUTE on the
packages to the owner, check the package dependencies, and recompile any invalid
packages after the revoke.
To find users who have access to the package, log into the database instance as a
named database administrator and issue the following query.
SELECT * FROM DBA_TAB_PRIVS WHERE TABLE_NAME = package_name;
Note that these two queries do not identify references to packages made through
dynamic SQL.
However, a user must have access to the directory object to manipulate the files in that
operating system directory.
The DBMS_FILE_TRANSFER package is owned by SYS and granted to the
EXECUTE_CATALOG_ROLE. Users with EXECUTE access on this package can move files from one
D-11
Appendix D
Secure Configuration Guidelines
location to another on the same file system. They also can move files between
database instances, including databases on remote systems.
See Also:
Oracle Database PL/SQL Packages and Types Reference for information
about configuring the UTL_FILE package securely
See Also:
The following sections for examples of command rules that you can create to
protect use of the CREATE DATABASE LINK statement:
Example D-1 shows how to create a command rule to deny access to the CREATE
DATABASE LINK privilege.
D-12
Appendix D
Secure Configuration Guidelines
Example D-1 Creating a Command Rule to Deny Access to CREATE DATABASE LINK
BEGIN
DBMS_MACADM.CREATE_COMMAND_RULE (
command => 'CREATE DATABASE LINK',
rule_set_name => 'Disabled',
object_owner => '%',
object_name => '%',
enabled => DBMS_MACUTL.G_YES);
END;
/
COMMIT;
When a valid user must use the CREATE DATABASE LINK statement, the Oracle Database
Vault owner can reenable it from Oracle Database Vault Administrator or issue the following
commands in SQL*Plus.
Example D-2 Creating a Command Rule to Enable Access to CREATE DATABASE
LINK
BEGIN
DBMS_MACADM.UPDATE_COMMAND_RULE (
command => 'CREATE DATABASE LINK',
rule_set_name => 'Enabled',
object_owner => '%',
object_name => '%',
enabled => DBMS_MACUTL.G_YES);
END;
/
COMMIT;
Example D-3 Command Rules to Disable and Enable Access to CREATE DIRECTORY
-- Disable access to CREATE DIRECTORY
BEGIN
DBMS_MACADM.CREATE_COMMAND_RULE (
command => 'CREATE DIRECTORY',
rule_set_name => 'Disabled',
object_owner => '%',
object_name => '%',
enabled => dbms_macutl.g_yes);
END;
/
COMMIT;
D-13
Appendix D
Secure Configuration Guidelines
D-14
Appendix D
Secure Configuration Guidelines
Oracle also recommends that you add rules to the existing command rule for ALTER SYSTEM
statement. You can use Oracle Database Vault Administrator to create a rule and add it to a
rule set. You should grant the ALTER SESSION privilege only to trusted users. (For example,
the ALTER SESSION statement can enable tracing.)
D.6.6.2 Example: Adding Rules to the Existing ALTER SYSTEM Command Rule
You can create a rule that prevents users with the ALTER SYSTEM privilege from issuing ALTER
SYSTEM statements.
Example D-4 shows how to create a rule that prevents users with ALTER SYSTEM privilege
from issuing the ALTER SYSTEM DUMP statement. Log into the database instance as the Oracle
Database Vault Owner when you create this command rule.
Alternatively, you can use Oracle Database Vault Administrator to create and add this rule to
the rule set. See Creating a Rule to Add to a Rule Set for more information.
Example D-4 Adding Rules to the Existing ALTER SYSTEM Command Rule
CONNECT bea_dvacctmgr
Enter password: password
BEGIN
DBMS_MACADM.CREATE_RULE('NO_SYSTEM_DUMP',
'(INSTR(UPPER(DV_SQL_TEXT),''DUMP'') = 0)');
END;
/
EXEC DBMS_MACADM.ADD_RULE_TO_RULE_SET
('Allow Fine Grained Control of System Parameters','NO_SYSTEM_DUMP');
D-15
Appendix D
Secure Configuration Guidelines
COMMIT;
D-16
E
Troubleshooting Oracle Database Vault
You can troubleshoot Oracle Database Vault by using tools such as trace files or checking
certain Oracle Database Vault reports.
• Using Trace Files to Diagnose Oracle Database Vault Events
Trace files, which the database generates, capture important information to help you
debug errors.
• General Diagnostic Tips
Oracle provides general tips for diagnosing problems in realms, factors, and rule sets.
• Configuration Problems with Oracle Database Vault Components
Oracle Database Vault provides reports to check configuration problems with realms,
command rules, factors, rule sets, or secure application roles.
• Resetting Oracle Database Vault Account Passwords
Backup accounts can help you reset lost passwords for users who have been granted the
DV_OWNER and DV_ACCTMGR roles.
E-1
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
See Also:
Oracle Database Administrator’s Guide for more information about how to
manage trace files
E.1.2 Types of Oracle Database Vault Trace Events That You Can and
Cannot Track
You can use trace files to track a variety of Oracle Database Vault activities.
Table E-1 describes these activities.
E-2
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
E-3
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
2. Enter the ALTER SESSION SET EVENTS SQL statement to set the tracing to low,
high, or highest, as described in Levels of Oracle Database Vault Trace Events.
• To turn on tracing for failed operations that have a low impact, enter one of the
following statements:
ALTER SESSION SET EVENTS 'TRACE[DV] DISK=LOW';
ALTER SESSION SET EVENTS '47998 TRACE NAME CONTEXT FOREVER, LEVEL 1';
• To turn on tracing for both failed and successful operations that have a high
impact, enter one of the following statements:
ALTER SESSION SET EVENTS 'TRACE[DV] DISK=HIGH';
ALTER SESSION SET EVENTS '47998 TRACE NAME CONTEXT FOREVER, LEVEL 3';
• To turn on tracing for both failed and successful operations with a function and
PL/SQL call stack that has the highest impact, enter one of the following
statements:
ALTER SESSION SET EVENTS 'TRACE[DV] DISK=HIGHEST';
ALTER SESSION SET EVENTS '47998 TRACE NAME CONTEXT FOREVER, LEVEL 4';
2. Enter the ALTER SYSTEM SET EVENTS SQL statement, using the syntax that is
shown in Step 2 in Enabling Trace Events for the Current Database Session.
For example:
ALTER SYSTEM SET EVENTS 'TRACE[DV] DISK=LOW';
Another way that you can enable trace events for all database sessions is to add the
following line to the init.ora file, and then restart the database:
E-4
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
Related Topics
• Disabling Trace Events for All Database Sessions
You can use the ALTER SYSTEM SET EVENTS SQL statement to disable Database Vault
tracing for all database sessions.
• Levels of Oracle Database Vault Trace Events
You can use the several levels for Oracle Database Vault trace events.
E-5
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
E.1.6.2 Using the Linux grep Command to Search Trace Files for Strings
To query or process the trace files, you can use the Linux grep command to search for
strings.
• For example, to find the trace files that show realm authorization failures, enter the
following command:
grep 'Result=Realm Authorization Failed' *.trc
diag/rdbms/orcl/orcl/trace/orcl_m002_14551.trc
diag/rdbms/orcl/orcl/trace/orcl_tmon_13450.trc
diag/rdbms/orcl/orcl/trace/orcl_vktm_963.trc
diag/rdbms/orcl/orcl/trace/alert_orcl.log
...
The following ADRCI command returns a list of all trace files whose name contains the
word ora:
adrci> show tracefile %ora%
/u01/app/oracle/product/12.1.0/log/diag/rdbms/orcl/orcl/trace/orcl_ora_18841.trc
E-6
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
/u01/app/oracle/product/12.1.0/log/diag/rdbms/orcl/orcl/trace/orcl_ora_12017.trc
/u01/app/oracle/product/12.1.0/log/diag/rdbms/orcl/orcl/trace/orcl_ora_19372.trc
/u01/app/oracle/product/12.1.0/log/diag/rdbms/orcl/orcl/trace/orcl_ora_12221.trc
/u01/app/oracle/product/12.1.0/log/diag/rdbms/orcl/orcl/trace/orcl_ora_1600.trc
...
The following ADRCI command searches for trace files that contain the phrase Realm
Authorization Failed:
adrci> show trace %trc -xp "[payload like '%Realm Authorization Failed%']"
See Also:
• Oracle Database Utilities for detailed information about the ADRCI utility
• Oracle Database Administrator’s Guide for information about viewing reports
with the ADRCI utility
E-7
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
Realm_Name=realm 3 Required_Auth_Level=0
Current_User=116
Object_Owner=U1 Object_Name=T1 Object_Type=TABLE
SQL_Text=INSERT INTO U1.T1 VALUES(30)
E.1.8 Example: High Level Trace Enabled for Oracle Database Vault
Authorization
You can track Oracle Database Vault authorizations in a trace file with high level trace
enabled.
Example E-2 shows an example of this type of trace file.
Example E-2 High Level Trace Enabled for Oracle Database Vault Authorization
Result= Realm Authorization Passed
Reason=Current user is the object owner
Current_User=70 Command=SELECT
Object_Owner=LBACSYS Object_Name=LBAC$AUDIT Object_Type=TABLE
……
E-8
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
E-9
Appendix E
Using Trace Files to Diagnose Oracle Database Vault Events
jsaRunJob<-spefcmpa<-spefmccallstd<-pextproc<-__PGOSF495_peftrusted<-
__PGOSF522_psdexsp<-rpiswu2<-psdextp<-pefccal<-pefcal<-pevm_FCAL<-pfrinstr_FCAL<-
pfrrun_no_tool<-pfrrun<-plsql_run
<-peicnt<-kkxexe<-opiexe<-kpoal8<-opiodr<-ttcpip<-opitsk<-opiino<-opiodr<-
opidrv<-sou2o<-opimai_real<-ssthrdmain<-main<-__libc_start_main<-_start
E-10
Appendix E
General Diagnostic Tips
2. Enter the ALTER SYSTEM SET EVENTS SQL statement, using the syntax that is shown in
Step 2 in Disabling Trace Events for the Current Database Session.
For example:
ALTER SYSTEM SET EVENTS 'TRACE[DV] OFF';
Another way that you can disable trace events for all database sessions is to add the
following line to the init.ora file, and then restart the database:
event="47998 trace name context off"
Ensure that the init.ora file does not have any conflicting 47998 lines, such as
event="47998 trace name context forever, level [1]".
E-11
Appendix E
Configuration Problems with Oracle Database Vault Components
• For PL/SQL expressions used in factors and rule sets, grant the EXECUTE privilege
on the PL/SQL package functions used in these expressions directly to the
account and determine if the results appear to be correct.
• Use the auditing reports to diagnose problems in general. See Oracle Database
Vault Auditing Reports for more information.
To reset the DV_OWNER user password, you must temporarily revoke the DV_OWNER role
from this user, reset the password, and then re-grant the role back to the user.
1. Log in to the database instance as the backup user for the DV_OWNER user account.
For example:
sqlplus dbv_owner_backup
Enter password: password
2. Revoke the DV_OWNER role from the DV_OWNER user who has lost the password.
For example:
E-12
Appendix E
Resetting Oracle Database Vault Account Passwords
Follow the guidelines in Oracle Database Security Guide to replace password with a
password that is secure.
5. Connect as the backup DV_OWNER user.
CONNECT dbv_owner_backup
Enter password: password
Note:
Ensure that the backup DV_OWNER account is safely stored in case it is needed
again.
To reset the DV_ACCTMGR user password, you can use the backup DV_ACCTMGR account to reset
this user’s password.
1. Log in to the database instance as the backup user for the DV_ACCTMGR user account.
For example:
sqlplus dbv_acctmgr_backup
Enter password: password
Follow the guidelines in Oracle Database Security Guide to replace password with a
password that is secure.
Note:
Ensure that the backup DV_ACCTMGR account is safely stored in case it is needed
again.
E-13
Index
A ALTER SYSTEM statement
guidelines on managing privileges, D-15
access control policy ALTER USER statement
reports monitoring, 26-1
Core Database Vault Audit Report, 27-6 ANY System Privileges for Database Accounts
Access to Sensitive Objects Report, 27-11 Report, 27-10
accounts application security
See database accounts finding privilege use by users, 4-4
Accounts With DBA Roles Report, 27-14 audit policy change
Accounts with SYSDBA/SYSOPER Privilege monitoring, 26-1
Report, 27-12 AUDIT privilege, 27-16
ad hoc tools AUDIT Privileges Report, 27-16
preventing use of, 8-23 AUDIT_SYS_OPERATIONS initialization
administrators parameter, 2-1
DBA operations in Oracle Database Vault, AUDIT_TRAIL$ system table
13-1 affected by AUDIT_TRAIL initialization
restricting different types, 8-28 parameter, A-3
ADRCI utility archiving, A-6
Database Vault, E-6 format, A-3
alerts purging, A-8
email alert in rule set, 6-16 auditing
Enterprise Manager Cloud Control, 13-5 about, A-1
ALTER ROLE statement archiving Database Vault audit trail, A-6
monitoring, 26-1 about, A-6
ALTER SESSION command rules, 7-4, 17-16 Core Database Audit Report, 27-17
about, 7-4 DBMS_MACUTL fields, 21-1
ALTER SESSION event command rules factors
creating, 17-10 options, 8-13
updating, 17-21 intruders
ALTER SESSION privilege using factors, 8-12
enabling trace files, E-3 Oracle Database audit settings, A-8
reports, ALTER SYSTEM or ALTER purging Database Vault audit trail, A-8
SESSION Report, 27-14 about, A-6
ALTER SESSION statement realms
guidelines on managing privileges, D-15 DBMS_MACUTL fields, 21-1
ALTER SYSTEM command rules options, 5-8
deleting system event command rules, 17-17 reports, 27-5
ALTER SYSTEM event command rules rule sets
creating, 17-12 DBMS_MACUTL fields, 21-1
updating, 17-23 options, 6-5
ALTER SYSTEM or ALTER SESSION Report, secure application roles
27-14 audit records, 9-10
ALTER SYSTEM privilege auditing policies
reports, ALTER SYSTEM or ALTER about, A-1
SESSION Report, 27-14
Index-1
Index
Index-2
Index
Index-3
Index
Index-4
Index
Index-5
Index
DBMS_MACADM.CREATE_SYSTEM_EVENT_ DBMS_MACADM.DROP_DOMAIN_IDENTITY
CMD_RULE procedure, 17-12 procedure, 18-15
DBMS_MACADM.DELETE_AUTH_FROM_REA DBMS_MACADM.DROP_POLICY procedure,
LM procedure, 15-7 23-9
DBMS_MACADM.DELETE_COMMAND_RULE DBMS_MACADM.ENABLE_DV procedure
procedure, 17-13 about, 22-17
DBMS_MACADM.DELETE_CONNECT_COMM registering Database Vault with, 3-3, 3-5, 3-7
AND_RULE procedure, 17-15 DBMS_MACADM.ENABLE_DV_DICTIONARY_
DBMS_MACADM.DELETE_FACTOR procedure, ACCTS procedure, 22-18
18-11 DBMS_MACADM.ENABLE_ORADEBUG
DBMS_MACADM.DELETE_FACTOR_LINK procedure, 22-19
procedure, 18-12 DBMS_MACADM.ENSABLE_DV_PATCH_ADMI
DBMS_MACADM.DELETE_FACTOR_TYPE N_AUDIT procedure, 22-18
procedure, 18-12 DBMS_MACADM.GET_INSTANCE_INFO
DBMS_MACADM.DELETE_IDENTITY function, 18-16
procedure, 18-13 DBMS_MACADM.GET_SESSION_INFO
DBMS_MACADM.DELETE_IDENTITY_MAP function, 18-15
procedure, 18-14 DBMS_MACADM.RENAME_FACTOR
DBMS_MACADM.DELETE_MAC_POLICY_CAS procedure, 18-17
CADE procedure, 20-4 DBMS_MACADM.RENAME_FACTOR_TYPE
DBMS_MACADM.DELETE_OBJECT_FROM_R procedure, 18-17
EALM procedure, 15-8 DBMS_MACADM.RENAME_POLICY procedure,
DBMS_MACADM.DELETE_OWNER_FROM_P 23-10
OLICY procedure, 23-8 DBMS_MACADM.RENAME_REALM procedure,
DBMS_MACADM.DELETE_POLICY_FACTOR 15-10
procedure, 20-5 DBMS_MACADM.RENAME_ROLE procedure,
DBMS_MACADM.DELETE_POLICY_LABEL 19-3
procedure, 20-5 DBMS_MACADM.RENAME_RULE procedure,
DBMS_MACADM.DELETE_REALM procedure, 16-9
15-9 DBMS_MACADM.RENAME_RULE_SET
DBMS_MACADM.DELETE_REALM_CASCADE procedure, 16-10
procedure, 15-10 DBMS_MACADM.UNAUTHORIZE_DDL
DBMS_MACADM.DELETE_REALM_FROM_PO procedure, 22-10
LICY procedure, 23-9 DBMS_MACADM.UNAUTHORIZE_DIAGNOSTI
DBMS_MACADM.DELETE_ROLE procedure, C_ADMIN procedure, 22-11
19-2 DBMS_MACADM.UNAUTHORIZE_PROXY_US
DBMS_MACADM.DELETE_RULE procedure, ER procedure, 22-13
16-8 DBMS_MACADM.UNAUTHORIZE_SCHEDULE
DBMS_MACADM.DELETE_RULE_FROM_RUL R_USER procedure, 22-13
E_SET procedure, 16-8 DBMS_MACADM.UNAUTHORIZE_TTS_USER
DBMS_MACADM.DELETE_RULE_SET procedure, 22-14
procedure, 16-9 DBMS_MACADM.UPDATE_COMMAND_RULE
DBMS_MACADM.DELETE_SESSION_EVENT_ procedure, 17-17
CMD_RULE procedure, 17-16 DBMS_MACADM.UPDATE_CONNECT_COMM
DBMS_MACADM.DELETE_SYSTEM_EVENT_C AND_RULE procedure, 17-20
MD_RULE procedure, 17-17 DBMS_MACADM.UPDATE_FACTOR procedure,
DBMS_MACADM.DISABLE_DV procedure, 18-18
22-15 DBMS_MACADM.UPDATE_FACTOR_TYPE
DBMS_MACADM.DISABLE_DV_DICTIONARY_ procedure, 18-21
ACCTS procedure, 22-15 DBMS_MACADM.UPDATE_IDENTITY
DBMS_MACADM.DISABLE_DV_PATCH_ADMIN procedure, 18-21
_AUDIT procedure, 22-16 DBMS_MACADM.UPDATE_MAC_POLICY
DBMS_MACADM.DISABLE_ORADEBUG procedure, 20-6
procedure, 22-16 DBMS_MACADM.UPDATE_POLICY_DESCRIP
TION procedure, 23-10
Index-6
Index
DBMS_MACADM.UPDATE_POLICY_STATE DBMS_MACUTL.USER_HAS_ROLE_VARCHAR
procedure, 23-11 function, 21-18
DBMS_MACADM.UPDATE_REALM procedure, DBMS_MACUTL.USER_HAS_SYSTEM_PRIVIL
15-11 EGE function, 21-19
DBMS_MACADM.UPDATE_REALM_AUTH DBMS_PRIVILEGE_CAPTURE PL/SQL
procedure, 15-13 package, 4-5
DBMS_MACADM.UPDATE_ROLE procedure, DBSNMP schema realm protection, 5-7
19-3 DBSNMP user account
DBMS_MACADM.UPDATE_RULE procedure, changing password, 13-6
16-11 granted DV_MONITOR role, 14-15
DBMS_MACADM.UPDATE_RULE_SET DDL operations
procedure, 16-11 DV_PATCH_ADMIN impact, 13-3
DBMS_MACADM.UPDATE_SESSION_EVENT_ performing in Oracle Database Vault, 13-2
CMD_RULE procedure, 17-21 restrictions, 13-2
DBMS_MACADM.UPDATE_SYSTEM_EVENT_ deinstallation, B-1
CMD_RULE procedure, 17-23 deinstalling Oracle Database Vault, C-2
DBMS_MACSEC_ROLES package DELETE_CATALOG_ROLE role, 27-15
about, 19-4 deleting event command rules, 17-16
functions, listed, 19-4 Denial of Service (DoS) attacks
DBMS_MACSEC_ROLES.CAN_SET_ROLE reports
function, 19-4 System Resource Limits Report, 27-16
DBMS_MACSEC_ROLES.SET_ROLE Tablespace Quotas Report, 27-19
procedure, 19-5 diagnostic view and table queries
DBMS_MACUTL package MACADM procedure for authorization, 22-5
about, 21-1 MACADM procedure for revoking
constants (fields) authorization, 22-11
examples, 21-5 Direct and Indirect System Privileges By
listed, 21-1 Database Account Report, 27-9
procedures and functions, listed, 21-6 Direct Object Privileges Report, 27-8
DBMS_MACUTL PL/SQL package contents, direct system privileges, 27-9
24-7 Direct System Privileges By Database Account
DBMS_MACUTL.CHECK_DVSYS_DML_ALLO Report, 27-9
WED procedure, 21-7 disabling system features with Disabled default
DBMS_MACUTL.GET_CODE_VALUE function, rule set, 6-3
21-8 domains
DBMS_MACUTL.GET_DAY function, 21-11 defined with factors, 8-1
DBMS_MACUTL.GET_HOUR function, 21-10 finding database domain with
DBMS_MACUTL.GET_MINUTE function, 21-10 DVF.F$DATABASE_DOMAIN, 18-31
DBMS_MACUTL.GET_MONTH function, 21-12 finding with DVF.F$DOMAIN, 18-33
DBMS_MACUTL.GET_SECOND function, 21-9 DROP ROLE statement
DBMS_MACUTL.GET_YEAR function, 21-12 monitoring, 26-1
DBMS_MACUTL.IS_ALPHA function, 21-13 DROP USER statement
DBMS_MACUTL.IS_DIGIT function, 21-14 monitoring, 26-1
DBMS_MACUTL.IS_DVSYS_OWNER function, dual key connection, dual key security
21-14 See two-person integrity (TPI)
DBMS_MACUTL.IS_OLS_INSTALLED function, DV_ACCTMGR role, E-13
21-15 about, 14-23
DBMS_MACUTL.IS_OLS_INSTALLED_VARCHA backup account, 14-29
R function, 21-16 creating profile to protect user granted this
DBMS_MACUTL.ROLE_GRANTED_ENABLED_ role, 3-10
VARCHAR function, 21-20 Database Vault disabled, 14-23
DBMS_MACUTL.USER_HAS_OBJECT_PRIVIL GRANT and REVOKE operations affected
EGE function, 21-16 by, 14-23
DBMS_MACUTL.USER_HAS_ROLE function, privileges associated with, 14-23
21-17 realm protection, 5-6
Index-7
Index
Index-8
Index
Index-9
Index
Index-10
Index
Index-11
Index
Index-12
Index
Index-13
Index
Oracle Label Security (OLS) (continued) Oracle Virtual Private Database (VPD) (continued)
integration with Oracle Database Vault (continued) using Database Vault factors with Oracle
procedure, 12-8 Label Security, 12-10
requirements, 12-7 ORADEBUG utility
labels about, 13-28
about, 8-15 DBA_DV_ORADEBUG view, 25-17
determining with GET_FACTOR_LABEL, PL/SQL procedure for disabling in Database
18-24 Vault, 22-16
invalid label identities, 27-4 PL/SQL procedure for enabling in Database
policies Vault, 22-19
accounts that bypass, 27-14 using with Database Vault, 13-28
monitoring policy changes, 26-1 OS Directory Objects Report, 27-19
nonexistent, 27-4 OS Security Vulnerability Privileges Report,
procedures 27-16
DBMS_MACADM (configuration), 20-1 OS_ROLES initialization parameter, 2-1
reports, 12-14 OUTlN schema realm protection, 5-8
views
DBA_DV_MAC_POLICY, 25-15
DBA_DV_MAC_POLICY_FACTOR,
P
25-16 parameters
DBA_DV_POLICY_LABEL, 25-19 modified after installation, 2-1
See also LBACSYS account reports
Oracle OLAP realm protection, 5-7 Security Related Database Parameters
Oracle Real Application Clusters Report, 27-16
configuring Database Vault on RAC nodes, parent factors
C-1 See factors
deinstalling Oracle Database Vault from, C-2 Password History Access Report, 27-15
multiple factor identities, 8-8 passwords
Oracle Recovery Manager (RMAN) forgotten, solution for, B-1
in an Oracle Database Vault environment, reports, 27-17
13-20 Database Account Default Password
Oracle Scheduler, 13-15 Report, 27-17
DBA_DV_JOB_AUTH view, 25-15 Password History Access Report, 27-15
granting Oracle Database Vault Username/Password Tables Report,
authorization, 13-16 27-19
realm protection, 5-7 resetting for DV_ACCTMGR user, E-13
revoking Oracle Database Vault resetting for DV_OWNER user, E-12
authorization, 13-17 patch operations in Database Vault environment,
SCHEDULER_ADMIN role, impact of Oracle 13-29
Database Vault installation, 2-3 patches
using with Oracle Database Vault, 13-15 auditing DV_PATCH_ADMIN user, 14-22
Oracle software owner, guidelines on managing, DBMS_MACADM.DISABLE_DV_PATCH_ADMIN_AUDIT
D-8 procedure, 22-16
Oracle Spatial realm protection, 5-7 DBMS_MACADM.ENSABLE_DV_PATCH_ADMIN_AUDIT
Oracle Streams procedure, 22-18
Database Vault role used for, 14-18 DV_PATCH_ADMIN requirement for, 14-22
Oracle System Privilege and Role Management security consideration, D-10
Realm, 5-7 two-person integrity used for, 6-23
Oracle Text realm protection, 5-7 PDBs, 1-11
Oracle Virtual Private Database (VPD), 6-3 command rules in, 7-3
accounts that bypass, 27-14 disabling tracing
factors, attaching to, 12-5 all database sessions, E-11
GRANT EXECUTE privileges with Grant current database session, E-11
VPD Administration default rule set, DVF schema, 14-2
6-3 DVSYS schema, 14-1, 14-4
Index-14
Index
Index-15
Index
Index-16
Index
Index-17
Index
Index-18
Index
Index-19
Index
Index-20
Index
Index-21
Index
Index-22
Index
W
WITH ADMIN Privileges Grants Report, 27-14
Index-23