Grant Roles to the Oracle Data Safe Service Account on Your Target Database
The Oracle Data Safe features that you can use with your target database depend on the roles you grant to the Oracle Data Safe service account on that target database. You can grant and revoke roles as needed.
The roles are different for Autonomous Databases versus non-Autonomous Databases. For non-Autonomous databases, you can grant roles to the Oracle Data Safe service account prior to or after registering your database. For Autonomous Databases, you first need to register your database, which unlocks the Oracle Data Safe preseeded service account, and then grant and revoke roles as needed. By default, the Oracle Data Safe service account on an Autonomous Database is already granted some of the roles.
Roles for the Oracle Data Safe Service Account
Oracle Recommendation:
Grant only the roles needed to the Oracle Data Safe service on your target databases. How you grant roles depends on the type of target databases that you have.The following table describes the roles for non-Autonomous Databases and Autonomous Databases. If you are registering a non-Autonomous Database (for example, a DB system, on-premises Oracle Database, or an Oracle Database on a compute instance), you can grant the roles in the first column. If you are registering an Autonomous Database, you can grant the roles in the second column. By default, some or most of the roles are granted by default so it is best to refer to each type of target registration.
Roles for Non-Autonomous Databases | Roles for Autonomous Databases | Description |
---|---|---|
|
|
Privileges required for the User Assessment and Security Assessment features |
|
|
Privileges required for accessing audit trails for the target database |
|
|
Privileges required for the Data Discovery feature (discovering sensitive data in the target database) |
|
|
Privileges required for the Data Masking feature (masking sensitive data in the target database) |
|
|
Privileges required for updating target database audit policies |
|
|
Privileges required for the SQL Firewall feature (collect, monitor, and allow and block SQL traffic) Only for Oracle Database 23ai or later |
Grant Roles to the Oracle Data Safe Service on an Autonomous Database
By default, an Autonomous Database comes with a database account
specifically created for Oracle Data Safe named DS$ADMIN
. The roles that you grant to this account
determine the Oracle Data Safe features that you can use with your Autonomous Database.
For an Autonomous Database, all roles are already granted by default, except for DS$DATA_MASKING_ROLE
and DS$SQL_FIREWALL_ROLE
.
Note:
If Database Vault is enabled on your Autonomous Database, be aware that there are specific steps to take in the procedure below to get Oracle Data Safe to work with Database Vault.To grant or revoke roles from the Oracle Data Safe service account on an Autonomous Database database, you can run the
DS_TARGET_UTIL
PL/SQL package on the Autonomous Database. You
need to run this package as the PDB Admin user (ADMIN
) or as a user
that has execute permission on the DS_TARGET_UTIL
PL/SQL
package.
You can grant or revoke roles as often as needed.
- To grant or revoke a role from the Oracle Data Safe service account, do the following:
- Using a tool like SQL*Plus or SQL Developer, log in to your
Autonomous Database as the PDB Admin user (
ADMIN
) or as a user that has execute permission on theDS_TARGET_UTIL
PL/SQL package. - Run one of the following commands:
EXECUTE DS_TARGET_UTIL.GRANT_ROLE('role_name');
Note:
If Database Vault is enabled on your database and you grant theDS$DATA_MASKING_ROLE
role, expect anORA-20001
error and proceed to step 3.-
EXECUTE DS_TARGET_UTIL.REVOKE_ROLE('role_name');
where role_name is the name of an Oracle Data Safe role.
role_name
must be in quotation marks.
- Using a tool like SQL*Plus or SQL Developer, log in to your
Autonomous Database as the PDB Admin user (
- If Database Vault is enabled on your database and you want to use the
following features in Oracle Data Safe, do the following:
- User Assessment or Security Assessment features: connect to your
database as a user with the
DV_OWNER
role and grant theDV_SECANALYST
role to theDS$ADMIN
user. - Data Masking feature:
- Connect to the database as a user with the
DV_OWNER
role and authorize theADMIN
user to the Oracle System Privilege and Role Management Realm. - Connect to the database as the
ADMIN
user and grantUNLIMITED TABLESPACE
to theDS$ADMIN
user.
- Connect to the database as a user with the
- SQL Firewall: If you granted the role as the PDB Admin user
(
ADMIN
) or as a user that has theDV_ADMIN
orDV_OWNER
role, then this step is not necessary. However, if you did not, then connect to your database as a user with theDV_ADMIN
orDV_OWNER
role and run the following command as a user that has either theDV_ADMIN
orDV_OWNER
role:
.BEGIN DBMS_MACADM.AUTHORIZE_SQL_FIREWALL ( uname => '<DATASAFE_ADMIN>', manage_dv_admins => 'N'); END; /
- User Assessment or Security Assessment features: connect to your
database as a user with the
- If Database Vault is enabled on your database and you want to revoke
the following features in Oracle Data Safe, do the following:
- User Assessment or Security Assessment feature: Connect to the
database as the a user with the
DV_OWNER
role and revoke theDV_SECANALYST
role from theDS$ADMIN
user. - Data Masking feature:
- Connect to the database as the
ADMIN
user and revokeUNLIMITED TABLESPACE
from theDS$ADMIN
user. - Connect to the database as a user with the
DV_OWNER
role and unauthorize theADMIN
user from the Oracle System Privilege and Role Management Realm.
- Connect to the database as the
- SQL Firewall feature:
- Connect to your database as a user with the
DV_ADMIN
orDV_OWNER
roles and run the following:BEGIN DBMS_MACADM.UNAUTHORIZE_SQL_FIREWALL ( uname => '<DATASAFE_ADMIN>', manage_dv_admins => 'Y'); END; /
- Connect to your database as a user with the
- Revoke the
SQL_FIREWALL
role by following step one.
- User Assessment or Security Assessment feature: Connect to the
database as the a user with the
Grant Roles to the Oracle Data Safe Service on a Non-Autonomous Database
To grant or revoke roles from the Oracle Data Safe service account on a non-Autonomous Database, you need to run a SQL privileges
script called datasafe_privileges.sql
. You can download this script
from Oracle Data Safe in Oracle Cloud Infrastructure. To run the script, you need to be connected to
your database as the SYS
user.
You can run the script as many times as needed. For example, suppose that in the beginning you only need to use the Activity Auditing feature in Oracle Data Safe. You can run the SQL privileges script to grant the database access to only Activity Auditing. Later, you decide you want to use the Data Discovery feature too. You can run the SQL privileges script again on the database to grant the database access to Data Discovery.
Example 3-1 Grant all privileges and make all Oracle Data Safe features available
@datasafe_privileges.sql <DATASAFE_ADMIN> GRANT ALL -VERBOSE
Example 3-2 Grant the privileges required to use the making feature
@datasafe_privileges.sql <DATASAFE_ADMIN> GRANT MASKING