7 Authorizing DDL on a Different Schema
In an Oracle Database Vault environment, when a schema is protected by a realm or has access to realm protected objects, through realm authorization or object privileges, then the schema automatically has DDL controls applied to it to prevent a malicious actor from performing DDL modifications.
The only unexpected failure from the previous test is GKRAMER should be
authorized to perform index creation in the HR schema.
For example, if a malicious user had privileges to modify a procedure in the
HR schema, then they could insert malicious code into the
procedure, and it would be trusted by the Database Vault realm. To avoid this situation,
Oracle Database Vault enforces controls on DDL statements.
To allow GKRAMER to perform CREATE INDEX
for HR objects, you must authorize GKRAMER to perform
DDL:
- Connect as
C##JSMITHto the pluggable database:connect c##jsmith@pdb_name -
SELECT * FROM DBA_DV_DDL_AUTH ORDER BY 1; EXEC DBMS_MACADM.AUTHORIZE_DDL('GKRAMER','HR'); SELECT * FROM DBA_DV_DDL_AUTH ORDER BY 1; - Since you only changed the DDL authorization for
GKRAMER, you will only retest the commands forGRKAMER:- Connect as
GRKAMER:connect GRKAMER - Attempt the following
commands:
SELECT COUNT(*) FROM HR.EMPLOYEES; CREATE TABLE HR.EMP2 AS SELECT * FROM HR.EMPLOYEES; CREATE INDEX HR.TEST_IDX ON HR.EMP2(HIRE_DATE,LAST_NAME); DROP INDEX HR.TEST_IDX; DROP TABLE HR.EMP2; - As
C##CMACK, query the Unified Audit view to identify Database Vault related records and compare the results to the table below:SELECT EVENT_TIMESTAMP, DBUSERNAME, OBJECT_SCHEMA, OBJECT_NAME, SQL_TEXT, RETURN_CODE FROM UNIFIED_AUDIT_TRAIL WHERE AUDIT_TYPE = 'Database Vault' AND OBJECT-SCHEMA = 'HR';You will also see
GKRAMERcannot drop the index they created. This is because of the Database Vault command rule you created preventingDROP INDEXcommands on theHRschema.Command GKRAMERWithout DDL AuthorizationGKRAMERWith DDL AuthorizationSELECT COUNT(*) FROM HR.EMPLOYEES;ORA-01031: insufficient privilegesORA-01031: insufficient privilegesCREATE TABLE HR.EMP2 AS SELECT * FROM HR.EMPLOYEES;ORA-01031: insufficient privilegesORA-01031: insufficient privilegesCREATE INDEX HR.TEST_IDX ON HR.EMP2(HIRE_DATE,LAST_NAME);ORA-47415: Insufficient Oracle Database Vault authorization for DDLSuccessDROP INDEX HR.TEST_IDX;ORA-01418: specified index does not existSuccessDROP TABLE HR.EMP2;ORA-47401: realm violation for CREATE INDEX on HR.TEST_IDXORA-47401: realm violation for CREATE INDEX on HR.TEST_IDXNote:
If you have upgraded from an earlier Oracle AI Database release, you may see (%,%) in theDBA_DV_DDL_AUTHview. As this authorization was added in a later release, Oracle chose to allow the existing DDL-allowed behavior to continue. If you are performing a new installation of Oracle Database 19c or later, you will not have the (%,%) authorization.
- Connect as