4 Managing the Keystore and the Master Encryption Key
You can modify settings for the keystore and TDE master encryption key, and store Oracle Database and store Oracle GoldenGate secrets in a keystore.
- Managing the Keystore
You can perform maintenance activities on keystores such as changing passwords, and backing up, merging, and moving keystores. - Managing the TDE Master Encryption Key
You can manage the TDE master encryption key in several ways. - Storing Oracle Database Secrets
Secrets are data that support internal Oracle Database features that integrate external clients such as Oracle GoldenGate into the database. - Storing Oracle GoldenGate Secrets in a Keystore
You can store Oracle GoldenGate secrets in Transparent Data Encryption keystores.
Parent topic: Using Transparent Data Encryption
Managing the Keystore
You can perform maintenance activities on keystores such as changing passwords, and backing up, merging, and moving keystores.
- Performing Operations That Require a Keystore Password
ManyADMINISTER KEY MANAGEMENToperations require access to a keystore password, for both software and hardware keystores. - Changing the Password of a Software Keystore
Oracle Database enables you to easily change password-protected software keystore passwords. - Changing the Password of a Hardware Keystore
To change the password of a hardware keystore, you must use theADMINISTER KEY MANAGEMENTstatement. - Configuring an External Store for a Keystore Password
An external store for a keystore password stores the keystore password in a centrally accessed and managed location. - Backing Up Password-Protected Software Keystores
When you back up a password-protected software keystore, you can create a backup identifier string to describe the backup type. - How the V$ENCRYPTION_WALLET View Interprets Backup Operations
TheBACKUPcolumn of theV$ENCRYPTION_WALLETview indicates a how a copy of the keystore was created. - Backups of the Hardware Keystore
You cannot use Oracle Database to back up hardware keystores. - Merging Software Keystores
You can merge software keystores in a variety of ways. - Moving a TDE Master Encryption Key into a New Keystore
You can move an existing TDE master encryption key into a new keystore from an existing software password keystore. - Moving a Software Keystore to a New Location
You move a software keystore to a new location after you have updated theWALLET_ROOTparameter. - Moving a Software Keystore Out of Automatic Storage Management
You can use theADMINISTER KEY MANAGEMENTstatement to move a software keystore out Automatic Storage Management. - Migrating Between a Software Password Keystore and a Hardware Keystore
You can migrate between password-protected software keystores and hardware keystores. - Migration of Keystores to and from Oracle Key Vault
You can use Oracle Key Vault to migrate both software and hardware keystores to and from Oracle Key Vault. - Configuring Keystores for Automatic Storage Management
You can store a software keystore on an Automatic Storage Management (ASM) disk group. - Closing a Keystore
You can manually close software and hardware keystores. - Backup and Recovery of Encrypted Data
For software keystores, you cannot access encrypted data without the TDE master encryption key. - Dangers of Deleting Keystores
Oracle strongly recommends that you do not delete keystores until you have moved the keystore encryption key to a new keystore.
Parent topic: Managing the Keystore and the Master Encryption Key
Performing Operations That Require a Keystore Password
Many ADMINISTER KEY MANAGEMENT operations require access to a keystore password, for both software and hardware keystores.
In some cases, a software keystore depends on an auto-login keystore before the operation can succeed. The auto-login keystore must be closed and the password-protected keystore must be opened before the password can be accessed. Auto-login keystores open automatically when they are configured and a key is requested. They are generally used for operations where the keystore could be closed but a database operation needs a key (for example, after the database is restarted). Because the auto-login keystore opens automatically, it can be retrieved to perform a database operation without manual intervention. However, some keystore operations that require the keystore password cannot be performed when the auto-login keystore is open. The auto-login keystore must be closed and the password-protected keystore must be opened for the keystore operations that require a password.
In a multitenant environment, the re-opening of keystores affects other PDBs. For example, an auto-login keystore in the root must be accessible by the PDBs in the CDB for this root.
You can temporarily open the keystore by including the FORCE KEYSTORE clause in the ADMINISTER KEY MANAGEMENT statement when you perform the following operations: rotating a keystore password; creating, using, rekeying, tagging, importing, exporting, migrating, or reverse migrating encryption keys; opening or backing up keystores; adding, updating, or deleting secret keystores. In a multitenant environment, if no keystore is open in the root, then FORCE KEYSTORE opens the password-protected keystore in the root.
Parent topic: Managing the Keystore
Changing the Password of a Software Keystore
Oracle Database enables you to easily change password-protected software keystore passwords.
- About Changing the Password of a Password-Protected Software Keystore
You can only change the password for protected-protected software keystores. - Changing the Password-Protected Software Keystore Password
To change the password of a password-protected software keystore, you must use theADMINISTER KEY MANAGEMENTstatement.
Parent topic: Managing the Keystore
About Changing the Password of a Password-Protected Software Keystore
You can only change the password for protected-protected software keystores.
You can change this password at any time, as per the security policies, compliance guidelines, and other security requirements of your site. As part of the command to change the password, you will be forced to specify the WITH BACKUP clause, and thus forced to make a backup of the current keystore. During the password change operation, Transparent Data Encryption operations such as encryption and decryption will continue to work normally.
You can change this password at any time. You may want to change this password if you think it was compromised.
Parent topic: Changing the Password of a Software Keystore
Changing the Password-Protected Software Keystore Password
To change the password of a password-protected software keystore, you must use the ADMINISTER KEY MANAGEMENT statement.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Change the password of the password-protected software keystore by using the following syntax:
ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD [FORCE KEYSTORE] IDENTIFIED BY old_password SET new_password [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
old_passwordis the current keystore password that you want to change. -
new_passwordis the new password that you will set for the keystore. -
WITH BACKUPcreates a backup of the current keystore before the password is changed. You must include this clause. -
backup_identifierspecifies an optional identifier string for the backup that is created. Thebackup_identifieris added to the name of the backup file. Enclosebackup_identifierin single quotation marks (' '). This identifier is appended to the named keystore file (for example,ewallet_time_stamp_emp_key_pwd_change.p12).
The following example backs up the current keystore and then changes the password for the keystore:
ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD FORCE KEYSTORE IDENTIFIED BY old_password SET new_password WITH BACKUP USING 'pwd_change'; keystore altered.
-
Parent topic: Changing the Password of a Software Keystore
Changing the Password of a Hardware Keystore
To change the password of a hardware keystore, you must use the ADMINISTER KEY MANAGEMENT statement.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Close the hardware keystore.
For example, for an HSM:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY "psmith:password";For a keystore whose password is stored externally:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY EXTERNAL STORE;
-
From the hardware security module management interface, create a new hardware security module password.
-
In SQL*Plus, open the hardware keystore.
For example:
ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "psmith:new_password"; ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY EXTERNAL STORE;
Related Topics
Parent topic: Managing the Keystore
Configuring an External Store for a Keystore Password
An external store for a keystore password stores the keystore password in a centrally accessed and managed location.
IDENTIFIED BY EXTERNAL STORE clause in the ADMINISTER KEY MANAGEMENT statement.
Afterward, you must use the EXTERNAL STORE clause in the ADMINISTER KEY MANAGEMENT statement for the following operations: opening, closing, backing up the keystore; adding, updating, or deleting a secret keystore; creating, using, rekeying, tagging, importing, exporting encryption keys.
For example:
ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY EXTERNAL STORE;
You can change or delete external keystore passwords by using the ADMINISTER KEY MANAGEMENT UPDATE CLIENT SECRET statement or the ADMINISTER KEY MANAGEMENT DELETE CLIENT SECRET statement.
Related Topics
Parent topic: Managing the Keystore
Backing Up Password-Protected Software Keystores
When you back up a password-protected software keystore, you can create a backup identifier string to describe the backup type.
- About Backing Up Password-Protected Software Keystores
You must back up password-protected software keystores, as per the security policy and requirements of your site. - Creating a Backup Identifier String for the Backup Keystore
The backup file name of a software password keystore is derived from the name of the password-protected software keystore. - Backing Up a Password-Protected Software Keystore
TheBACKUP KEYSTOREclause of theADMINISTER KEY MANAGEMENTstatement backs up a password-protected software keystore.
Parent topic: Managing the Keystore
About Backing Up Password-Protected Software Keystores
You must back up password-protected software keystores, as per the security policy and requirements of your site.
A backup of the keystore contains all of the keys contained in the original keystore. Oracle Database prefixes the backup keystore with the creation time stamp (UTC). If you provide an identifier string, then this string is inserted between the time stamp and keystore name.
After you complete the backup operation, the keys in the original keystore are marked as "backed up". You can check the status of keys querying the V$ENCRYPTION_WALLET data dictionary view.
You cannot back up auto-login or local auto-login software keystores. No new keys can be added to them directly through the ADMINISTER KEY MANAGEMENT statement operations. The information in these keystores is only read and hence there is no need for a backup.
If you have not yet backed up the keystore, then you can include the BACKUP clause in the ADMINISTER KEY MANAGEMENT statement when you create the TDE master encryption key. This both backs up the keystore and creates the TDE master encryption key.
Parent topic: Backing Up Password-Protected Software Keystores
Creating a Backup Identifier String for the Backup Keystore
The backup file name of a software password keystore is derived from the name of the password-protected software keystore.
Parent topic: Backing Up Password-Protected Software Keystores
Backing Up a Password-Protected Software Keystore
The BACKUP KEYSTORE clause of the ADMINISTER KEY MANAGEMENT statement backs up a password-protected software keystore.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Back up the keystore by using the following syntax
ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE [USING 'backup_identifier'] FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | software_keystore_password] [TO 'keystore_location'];
In this specification:
-
USINGbackup_identifieris an optional string that you can provide to identify the backup. Enclose this identifier in single quotation marks (' '). This identifier is appended to the named keystore file (for example,ewallet_time-stamp_emp_key_backup.p12). -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
software_keystore_passwordis the password for the keystore.
-
-
keystore_locationis the path at which the backup keystore is stored. If you do not specify thekeystore_location, then the backup is created in the same directory as the original keystore. Enclose this location in single quotation marks (' ').
The following example backs up a software keystore in the same location as the source keystore.
ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE USING 'hr.emp_keystore' FORCE KEYSTORE IDENTIFIED BY software_keystore_password TO '/etc/ORACLE/KEYSTORE/DB1/'; keystore altered.In the following version, the password for the keystore is external, so the
EXTERNAL STOREclause is used. The keystore is backed up into the same directory as the current keystore.ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE USING 'hr.emp_keystore' FORCE KEYSTORE IDENTIFIED BY EXTERNAL STORE;
After you run this statement, an
ewallet_identifier.p12file (for example,ewallet_time-stamp_hr.emp_keystore.p12) appears in the keystore location. -
Parent topic: Backing Up Password-Protected Software Keystores
How the V$ENCRYPTION_WALLET View Interprets Backup Operations
The BACKUP column of the V$ENCRYPTION_WALLET view indicates a how a copy of the keystore was created.
The column indicates if a copy of the keystore had been created with the WITH BACKUP clause of the ADMINISTER KEY MANAGEMENT statement or the ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE statement.
When you modify a key or a secret, the modifications that you make do not exist in the previously backed-up copy, because you make a copy and then modify the key itself. Because there is no copy of the modification in the previous keystores, the BACKUP column is set to NO, even if the BACKUP had been set to YES previously. Hence, if the BACKUP column is YES, then after you perform an operation that requires a backup, such as adding a custom attribute tag, the BACKUP column value changes to NO.
Parent topic: Managing the Keystore
Backups of the Hardware Keystore
You cannot use Oracle Database to back up hardware keystores.
See your HSM vendor instructions for information about backing up keys for hardware keystores.
Parent topic: Managing the Keystore
Merging Software Keystores
You can merge software keystores in a variety of ways.
- About Merging Software Keystores
You can merge any combination of software keystores, but the merged keystore must be password-protected. It can have a password that is different from the constituent keystores. - Merging One Software Keystore into an Existing Software Keystore
You can use theADMINISTER KEY MANAGEMENTstatement with theMERGE KEYSTOREclause to merge one software keystore into another existing software keystore. - Merging Two Software Keystores into a Third New Keystore
You can merge two software keystores into a third new keystore, so that the two existing keystores are not changed. - Merging an Auto-Login Software Keystore into an Existing Password-Protected Software Keystore
You can merge an auto-login software keystore into an existing password-protected software keystore. - Reversing a Software Keystore Merge Operation
You cannot directly reverse a keystore merge operation.
Parent topic: Managing the Keystore
About Merging Software Keystores
You can merge any combination of software keystores, but the merged keystore must be password-protected. It can have a password that is different from the constituent keystores.
To use the merged keystore, you must explicitly open the merged keystore after you create it, even if one of the constituent keystores was already open before the merge.
Whether a common key from two source keystores is added or overwritten to a merged keystore depends on how you write the ADMINISTER KEY MANAGEMENT merge statement. For example, if you merge Keystore 1 and Keystore 2 to create Keystore 3, then the key in Keystore 1 is added to Keystore 3. If you merge Keystore 1 into Keystore 2, then the common key in Keystore 2 is not overwritten.
The ADMINISTER KEY MANAGEMENT merge statement has no bearing on the configured keystore that is in use. However, the merged keystore can be used as the new configured database keystore if you want. Remember that you must reopen the keystore if you are using the newly created keystore as the keystore for the database at the location configured by the WALLET_ROOT parameter.
Merging One Software Keystore into an Existing Software Keystore
You can use the ADMINISTER KEY MANAGEMENT statement with the MERGE KEYSTORE clause to merge one software keystore into another existing software keystore.
-
To perform this type of merge, follow the steps in Merging Two Software Keystores into a Third New Keystore but use the following SQL statement:
ADMINISTER KEY MANAGEMENT MERGE KEYSTORE 'keystore1_location' [IDENTIFIED BY software_keystore1_password] INTO EXISTING KEYSTORE 'keystore2_location' IDENTIFIED BY software_keystore2_password [WITH BACKUP [USING 'backup_identifier]];
In this specification:
-
keystore1_locationis the directory location of the first keystore, which will be left unchanged after the merge. Enclose this path in single quotation marks (' '). -
The
IDENTIFIED BYclause is required for the first keystore if it is a password-protected keystore.software_keystore1_passwordis the password for the first keystore. -
keystore2_locationis the directory location of the second keystore into which the first keystore is to be merged. Enclose this path in single quotation marks (' '). -
software_keystore2_passwordis the password for the second keystore. -
WITH BACKUPcreates a backup of the software keystore. Optionally, you can use theUSINGclause to add a brief description of the backup. Enclose this description in single quotation marks (' '). This identifier is appended to the named keystore file (for example,ewallet_time-stamp_emp_key_backup.p12, withemp_key_backupbeing the backup identifier). Follow the file naming conventions that your operating system uses.
-
The resultant keystore after the merge operation is always a password-protected keystore.
Parent topic: Merging Software Keystores
Merging Two Software Keystores into a Third New Keystore
You can merge two software keystores into a third new keystore, so that the two existing keystores are not changed.
Parent topic: Merging Software Keystores
Merging an Auto-Login Software Keystore into an Existing Password-Protected Software Keystore
You can merge an auto-login software keystore into an existing password-protected software keystore.
-
Use the
ADMINISTER KEY MANAGEMENT MERGE KEYSTORESQL statement to merge an auto-login software keystore into an existing password-protected software keystore.
Example 4-1 shows how to merge an auto-login software keystore into a password-protected software keystore. It also creates a backup of the second keystore before creating the merged keystore.
Example 4-1 Merging a Software Auto-Login Keystore into a Password Keystore
ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '/etc/ORACLE/KEYSTORE/DB1'
INTO EXISTING KEYSTORE '/etc/ORACLE/KEYSTORE/DB2'
IDENTIFIED BY keystore_password WITH BACKUP;
In this specification:
-
MERGE KEYSTOREmust specify the auto-login keystore. -
EXISTING KEYSTORErefers to the password keystore.
Parent topic: Merging Software Keystores
Reversing a Software Keystore Merge Operation
You cannot directly reverse a keystore merge operation.
When you merge a keystore into an existing keystore (rather than creating a new one), you must include the WITH BACKUP clause in the ADMINISTER KEY MANAGEMENT statement to create a backup of this existing keystore. Later on, if you decide that you must reverse the merge, you can replace the merged software keystore with the one that you backed up.
In other words, suppose you want merge Keystore A into Keystore B. By using the WITH BACKUP clause, you create a backup for Keystore B before the merge operation begins. (The original Keystore A is still intact.) To reverse the merge operation, revert to the backup that you made of Keystore B.
-
Use the
ADMINISTER KEY MANAGEMENT MERGE KEYSTORESQL statement to perform merge operations.-
For example, to perform a merge operation into an existing keystore:
ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '/etc/ORACLE/KEYSTORE/DB1' INTO EXISTING KEYSTORE '/etc/ORACLE/KEYSTORE/DB2' IDENTIFIED BY password WITH BACKUP USING "merge1";Replace the new keystore with the backup keystore, which in this case would be named
ewallet_time-stamp_merge1.p12. -
To merge an auto-login keystore into a password-based keystore, use the
ADMINISTER KEY MANAGEMENT MERGE KEYSTORESQL statement.
-
Parent topic: Merging Software Keystores
Moving a TDE Master Encryption Key into a New Keystore
You can move an existing TDE master encryption key into a new keystore from an existing software password keystore.
Related Topics
Parent topic: Managing the Keystore
Moving a Software Keystore to a New Location
You move a software keystore to a new location after you have updated the WALLET_ROOT parameter.
If you are using Oracle Key Vault, then you can configure a TDE direct connection where Key Vault directly manages the master encryption keys. In this case, you will never need to manually move the keystore to a new location.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege. -
Back up the software keystore.
For example:
ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE USING 'hr.emp_keystore' FORCE KEYSTORE IDENTIFIED BY software_keystore_password TO '/etc/ORACLE/KEYSTORE/DB1/'; -
Close the software keystore.
Examples of ways that you can close the keystore are as follows.
For an auto-login software keystore:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE;
For a password-protected software keystore:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY software_keystore_password;For a keystore in which the password is stored externally:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY EXTERNAL STORE;
-
Exit the database session.
For example, if you are logged in to SQL*Plus:
EXIT
-
In the
init.orafile for the database instance, update theWALLET_ROOTparameter to point to the new location where you want to move the keystore. -
Use the operating system move command (such as
mv) to move the keystore with all of its keys to the new directory location.
Related Topics
Parent topic: Managing the Keystore
Moving a Software Keystore Out of Automatic Storage Management
You can use the ADMINISTER KEY MANAGEMENT statement to move a software keystore out Automatic Storage Management.
Parent topic: Managing the Keystore
Migrating Between a Software Password Keystore and a Hardware Keystore
You can migrate between password-protected software keystores and hardware keystores.
- Migrating from a Password-Protected Software Keystore to a Hardware Keystore
You can migrate from a password-protected software keystore to a hardware keystore. - Migrating from a Hardware Keystore to a Password-Based Software Keystore
You can migrate a hardware keystore to a software keystore. - Keystore Order After a Migration
After you perform a migration, keystores can be either primary or secondary in their order.
Parent topic: Managing the Keystore
Migrating from a Password-Protected Software Keystore to a Hardware Keystore
You can migrate from a password-protected software keystore to a hardware keystore.
- Step 1: Convert the Software Keystore to Open with the Hardware Keystore
Some Oracle tools require access to the old software keystore to encrypt or decrypt data that was exported or backed up using the software keystore. - Step 2: Configure the Hardware Security Module Keystore Type
You can use theALTER SYSTEMstatement to configure the HSM keystore type. - Step 3: Perform the Hardware Keystore Migration
You can use theADMINISTER KEY MANAGEMENTSQL statement to perform a hardware keystore migration.
Step 1: Convert the Software Keystore to Open with the Hardware Keystore
Some Oracle tools require access to the old software keystore to encrypt or decrypt data that was exported or backed up using the software keystore.
Examples of these tools are Oracle Data Pump and Oracle Recovery Manager.
-
Use the
ADMINISTER KEY MANAGEMENTSQL statement to convert a software keystore to a open with a hardware keystore.-
To set the software keystore password as that of the hardware keystore, use the following syntax:
ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD FORCE KEYSTORE IDENTIFIED BY software_keystore_password SET "hardware_keystore_credentials" WITH BACKUP [USING 'backup_identifier'];
In this specification:
-
software_keystore_passwordis the same password that you used when creating the software keystore. -
hardware_keystore_credentialsis the new software keystore password which is the same as the password of the hardware keystore. -
WITH BACKUPcreates a backup of the software keystore. Optionally, you can use theUSINGclause to add a brief description of the backup. Enclose this description in single quotation marks (' '). This identifier is appended to the named keystore file (for example,ewallet_time-stamp_emp_key_backup.p12, withemp_key_backupbeing the backup identifier). Follow the file naming conventions that your operating system uses.
-
-
To create an auto-login keystore for a software keystore, use the following syntax:
ADMINISTER KEY MANAGEMENT CREATE [LOCAL] AUTO_LOGIN KEYSTORE FROM KEYSTORE 'keystore_location' IDENTIFIED BY software_keystore_password;
In this specification:
-
LOCALenables you to create a local auto-login software keystore. Otherwise, omit this clause if you want the keystore to be accessible by other computers. -
keystore_locationis the path to the keystore directory location of the keystore that is configured in thesqlnet.orafile. -
software_keystore_passwordis the existing password of the configured software keystore.
-
-
Step 2: Configure the Hardware Security Module Keystore Type
You can use the ALTER SYSTEM statement to configure the HSM keystore type.
Step 3: Perform the Hardware Keystore Migration
You can use the ADMINISTER KEY MANAGEMENT SQL statement to perform a hardware keystore migration.
To migrate from the software keystore to hardware keystore, you must use the MIGRATE USING keystore_password clause in the ADMINISTER KEY MANAGEMENT SET KEY SQL statement to decrypt the existing TDE table keys and the tablespace encryption keys with the TDE master encryption key in the software keystore and then reencrypt them with the newly created TDE master encryption key in the hardware keystore.
After you complete the migration, you do not need to restart the database, nor do you need to manually re-open the hardware keystore. The migration process automatically reloads the keystore keys in memory.
-
Migrate the hardware keystores by using the following syntax:
ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY "user_name:password" MIGRATE USING software_keystore_password [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
user_name:passwordis the user ID and password that was created in Step 2 under Step 2: Configure the Hardware Security Module (in Configuring Transparent Data Encryption). Enclose this setting in double quotation marks (" ") and separateuser_nameandpasswordwith a colon (:). -
software_keystore_passwordis the same password that you used when creating the software keystore or that you have changed to in Step 1: Convert the Software Keystore to Open with the Hardware Keystore. -
USINGenables you to add a brief description of the backup. Enclose this description in single quotation marks (' '). This identifier is appended to the named keystore file (for example,ewallet_time-stamp_emp_key_backup.p12, withemp_key_backupbeing the backup identifier). Follow the file naming conventions that your operating system uses.
-
Note:
If the database contains columns encrypted with a public key, then the columns are decrypted and reencrypted with an AES symmetric key generated by HSM-based Transparent Data Encryption.
Migrating from a Hardware Keystore to a Password-Based Software Keystore
You can migrate a hardware keystore to a software keystore.
- About Migrating Back from a Hardware Keystore
To switch from using a hardware keystore solution to a software keystore, you can use reverse migration of the keystore. - Step 1: Configure Hardware Security Module Keystore Type
You can use theALTER SYSTEMstatement to configure the hardware security module keystore type. - Step 2: Configure the Keystore for the Reverse Migration
TheADMINISTER KEY MANAGEMENTstatement with theSET ENCRYPTION KEYandREVERSE MIGRATEclauses can be used to reverse the migration of a keystore. - Step 3: Configure the Hardware Keystore to Open with the Software Keystore
After you complete the migration, the migration process automatically reloads the keystore keys in memory.
About Migrating Back from a Hardware Keystore
To switch from using a hardware keystore solution to a software keystore, you can use reverse migration of the keystore.
After you complete the switch, keep the hardware security module, in case earlier backup files rely on the TDE master encryption keys in the hardware security module.
If you had originally migrated from the software keystore to the hardware security module and reconfigured the software keystore as described in Migration of a Previously Configured TDE Master Encryption Key, then you already have an existing keystore with the same password as the HSM password. Reverse migration configures this keystore to act as the new software keystore with a new password. If your existing keystore is an auto-login software keystore and you have the password-based software keystore for this auto-login keystore, then use the password-based keystore. If the password-based keystore is not available, then merge the auto-login keystore into a newly created empty password-based keystore, and use the newly created password-based keystore.
If you do not have an existing keystore, then you must specify a keystore location using the WALLET_ROOT parameter in the init.ora file. When you perform the reverse migration, migrate to the previous keystore so that you do not lose the keys.
Related Topics
Step 1: Configure Hardware Security Module Keystore Type
You can use the ALTER SYSTEM statement to configure the hardware security module keystore type.
Step 2: Configure the Keystore for the Reverse Migration
The ADMINISTER KEY MANAGEMENT statement with the SET ENCRYPTION KEY and REVERSE MIGRATE clauses can be used to reverse the migration of a keystore.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Reverse migrate the keystore by using the following syntax:
ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY software_keystore_password REVERSE MIGRATE USING "user_name:password" [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
software_keystore_passwordis the password for the existing keystore or the new keystore. -
user_name:passwordis the user ID and password that was created in Step 2 in Step 2: Configure the Hardware Security Module (in Configuring Transparent Data Encryption). If the pre-hardware security module software keystore is the new keystore, then you must ensure that it has the same password as theuser_name:passwordbefore issuing the reverse migration command. Enclose this setting in double quotation marks (" "). -
WITH BACKUPcreates a backup of the software keystore. Optionally, you can include theUSINGclause to add a brief description of the backup. Enclose this description in single quotation marks (' '). This identifier is appended to the named keystore file (for example,ewallet_time-stamp_emp_key_backup.p12, withemp_key_backupbeing the backup identifier). Follow the file naming conventions that your operating system uses.
For example:
ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY password REVERSE MIGRATE USING "psmith:password" WITH BACKUP; keystore altered.
-
-
Optionally, change the keystore password.
For example:
ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD IDENTIFIED BY old_password SET new_password WITH BACKUP USING 'pwd_change';
Related Topics
Step 3: Configure the Hardware Keystore to Open with the Software Keystore
After you complete the migration, the migration process automatically reloads the keystore keys in memory.
You do not need to restart the database, nor do you need to manually re-open the software keystore.
The hardware keystore may still be required after reverse migration because the old keys are likely to have been used for encrypted backups or by tools such as Oracle Data Pump and Oracle Recovery Manager. You should cache the hardware keystore credentials in the keystore so that the HSM can be opened with the software keystore.
Related Topics
Keystore Order After a Migration
After you perform a migration, keystores can be either primary or secondary in their order.
The WALLET_ORDER column of the V$ENCRYPTION_WALLET dynamic view describes whether a keystore is primary (that is, it holds the current TDE master encryption key) or if it is secondary (it holds the previous TDE master encryption key). The WRL_TYPE column describes the type of locator for the keystore (for example, FILE for the sqlnet.ora file). The WALLET_ORDER column shows SINGLE if two keystores are not configured together and no migration was ever performed previously.
Table 4-1 describes how the keystore order works after you perform a migration.
Table 4-1 Keystore Order After a Migration
| Type of Migration Done | WRL_TYPE | WALLET_ORDER | Description |
|---|---|---|---|
|
Migration of software keystore to HSM |
|
|
Both the HSM and software keystore are configured. The TDE master encryption key can be either in the HSM or the software keystore. The TDE master encryption key is first searched in the HSM. If the TDE master encryption key is not in the primary keystore (HSM), then it will be searched for in the software keystore. All of the new TDE master encryption keys will be created in the primary keystore (in this case, the HSM). |
|
Reverse migration of HSM to software keystore |
|
|
Both the HSM and software keystore are configured. The TDE master encryption key can be either in the HSM or the software keystore. The TDE master encryption key is first searched for in the software keystore. If the TDE master encryption key is not present in the primary (that is, software) keystore, then it will be searched for in the HSM. All of the new TDE master encryption keys will be created in the primary keystore (in this case, the software keystore). |
Migration of Keystores to and from Oracle Key Vault
You can use Oracle Key Vault to migrate both software and hardware keystores to and from Oracle Key Vault.
This enables you to manage the keystores centrally, and then share the keystores as necessary with other TDE-enabled databases in your enterprise.
Oracle Key Vault enables you to upload a keystore to a container called a virtual wallet, and then create a new virtual wallet from the contents of previously uploaded Oracle keystores. For example, suppose you previously uploaded a keystore that contains 5 keys. You can create a new virtual wallet that consists of only 3 of these keys. You then can download this keystore to another TDE-enabled database. This process does not modify the original keystore.
In addition to Oracle keystores, Oracle Key Vault enables you to securely share other security objects, such as credential files and Java keystores, across the enterprise. It prevents the loss of keys and keystores due to forgotten passwords or accidentally deleted keystores. You can use Oracle Key Vault with products other than TDE: Oracle Real Application Security, Oracle Active Data Guard, and Oracle GoldenGate. Oracle Key Vault facilitates the movement of encrypted data using Oracle Data Pump and Oracle Transportable Tablespaces.
Related Topics
Parent topic: Managing the Keystore
Configuring Keystores for Automatic Storage Management
You can store a software keystore on an Automatic Storage Management (ASM) disk group.
- About Configuring Keystores for Automatic Storage Management
You can configure a keystore for Automatic Storage Management (ASM) for a standalone database or a multitenant environment. TheWALLET_ROOTlocation can be compliant or non-compliant with Oracle Managed File (OMF) systems. - Configuring a Keystore on a Standalone Database to Point to an ASM Location
On a standalone database system, you can set theWALLET_ROOTparameter to point to an ASM location. - Configuring a Keystore in a Multitenant Environment to Point to an ASM Location
You can setWALLET_ROOTto point to an ASM directory within which the TDE keystore of the CDB root (which all united mode PDBs share) and the TDE keystores of all isolated mode PDBs are located. - Configuring a Keystore to Point to an ASM Location When the WALLET_ROOT Location Does Not Follow OMF Guidelines
If the chosenWALLET_ROOTlocation does not comply with the Oracle Managed File (OMF) guidelines, then the Oracle database cannot perform automation of the directory creation.
Parent topic: Managing the Keystore
About Configuring Keystores for Automatic Storage Management
You can configure a keystore for Automatic Storage Management (ASM) for a standalone database or a multitenant environment. The WALLET_ROOT location can be compliant or non-compliant with Oracle Managed File (OMF) systems.
You should use the WALLET_ROOT and TDE_CONFIGURATION initialization parameters to configure the keystore location in an ASM system. The TDE_CONFIGURATION parameter must be set with the attribute KEYSTORE_CONFIGURATION=FILE in order for the WALLET_ROOT parameter to work. Note that starting with Oracle Database release 19c, the ENCRYPTION_WALLET_LOCATION, set in the sqlnet.ora file, is deprecated in favor of WALLET_ROOT and TDE_CONFIGURATION.
To perform the configuration, you must specify a + sign, followed by the ASM disk group and path where the keystore will be located. For example:
WALLET_ROOT=+disk_group/path
Note the following:
- When you designate the path for the
WALLET_ROOTfor databases in standalone or multitenant environments, or environments where theWALLET_ROOTlocation either complies or does not comply with the Oracle Managed File (OMF) directory naming convention, be aware that this path must follow certain conventions so that the database can automate the creation of the directory components of the TDE keystore locations for you. Otherwise, you must manually create the directories under theWALLET_ROOTlocation. - If you must move or merge software keystores between a regular file system and an ASM file system, then you can use the same keystore merge statements that are used to merge software keystores.
- To execute commands to manage keystores in an ASM environment, you can use the
ASMCMDutility.
Configuring a Keystore on a Standalone Database to Point to an ASM Location
On a standalone database system, you can set the WALLET_ROOT parameter to point to an ASM location.
Parent topic: Configuring Keystores for Automatic Storage Management
Configuring a Keystore in a Multitenant Environment to Point to an ASM Location
You can set WALLET_ROOT to point to an ASM directory within which the TDE keystore of the CDB root (which all united mode PDBs share) and the TDE keystores of all isolated mode PDBs are located.
Parent topic: Configuring Keystores for Automatic Storage Management
Configuring a Keystore to Point to an ASM Location When the WALLET_ROOT Location Does Not Follow OMF Guidelines
If the chosen WALLET_ROOT location does not comply with the Oracle Managed File (OMF) guidelines, then the Oracle database cannot perform automation of the directory creation.
ALTER DISKGROUP command to manually create the necessary directories under the WALLET_ROOT location. You must use the ALTER DISKGROUP ... ADD DIRECTORY statement to manually create the necessary directories, because no automation of the directory creation is possible when the WALLET_ROOT parameter is not using an OMF-compliant value.
Parent topic: Configuring Keystores for Automatic Storage Management
Closing a Keystore
You can manually close software and hardware keystores.
- About Closing Keystores
After you open a keystore, it remains open until you shut down the database instance. - Closing a Software Keystore
You can manually close password-based software keystores, auto-login software keystores, and local auto-login software keystores. - Closing a Hardware Keystore
To close a hardware keystore, you must use theADMINISTER KEY MANAGEMENTstatement with theSET KEYSTORE CLOSEclause.
Parent topic: Managing the Keystore
About Closing Keystores
After you open a keystore, it remains open until you shut down the database instance.
When you restart the database instance, then auto-login and local auto-login software keystores automatically open when required (that is, when the TDE master encryption key must be accessed). However, software password-based and hardware keystores do not automatically open. You must manually open them again before you can use them.
When you close a software or hardware keystore, you disable all of the encryption and decryption operations on the database. Hence, a database user or application cannot perform any operation involving encrypted data until the keystore is reopened.
When you re-open a keystore after closing it, the keystore contents are reloaded back into the database. Thus, if the contents had been modified (such as during a migration), the database will have the latest keystore contents.
You can check if a keystore is closed by querying the STATUS column of the V$ENCRYPTION_WALLET view.
The following data operations will fail if the keystore is not accessible:
-
SELECTdata from an encrypted column -
INSERTdata into on an encrypted column -
CREATEa table with encrypted columns -
CREATEan encrypted tablespace
Parent topic: Closing a Keystore
Closing a Software Keystore
You can manually close password-based software keystores, auto-login software keystores, and local auto-login software keystores.
In the case of an auto-login keystore, which opens automatically when it is accessed, manually close it if you moved it to a new location. You do this if you are changing your configuration from an auto-login keystore to a password-based keystore: you move out the auto-login keystore, and then close the auto-login keystore.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Run the
ADMINISTER KEY MANAGEMENTSQL statement.-
For a password-based software keystore, use the following syntax:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE [IDENTIFIED BY [EXTERNAL STORE | software_keystore_password]];In this specification:
-
IDENTIFIED BYcan be one of the following:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
software_keystore_passwordis the password of the user who created the keystore.
-
-
-
For an auto-login or local auto-login software keystore, use the following SQL statement:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE;You do not need to specify a password for this statement.
-
Closing a keystore disables all of the encryption and decryption operations. Any attempt to encrypt or decrypt data or access encrypted data results in an error.
Parent topic: Closing a Keystore
Closing a Hardware Keystore
To close a hardware keystore, you must use the ADMINISTER KEY MANAGEMENT statement with the SET KEYSTORE CLOSE clause.
-
Log
into the database instance as a user who has been granted theADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Close the hardware keystore by using this syntax:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY [EXTERNAL STORE | "hardware_keystore_credentials"];In this specification:
-
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
hardware_keystore_credentialsrefers to the credentials for either an HSM or an Oracle Key Vault hardware keystore. For an HSM, specify the credentials using this format, enclosed in quotation marks and separating the components with a colon:“user_name:password”, withuser_namebeing the user who created the HSM and password being this user’s password. For Oracle Key Vault, enter only the password of the user who created the keystore. Enclose this password with quotation marks.
-
For example:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY "psmith:password"; -
Parent topic: Closing a Keystore
Backup and Recovery of Encrypted Data
For software keystores, you cannot access encrypted data without the TDE master encryption key.
Because the TDE master encryption key is stored in the keystore, you should periodically back up the software keystore in a secure location. You must back up a copy of the keystore whenever you set a new TDE master encryption key or perform any operation that writes to the keystore.
Do not back up the software keystore in the same location as the encrypted data. Back up the software keystore separately. This is especially true when you use the auto-login keystore, which does not require a password to open. In case the backup tape is lost, a malicious user should not be able to get both the encrypted data and the keystore.
Oracle Recovery Manager (Oracle RMAN) does not back up the software keystore as part of the database backup. When using a media manager such as Oracle Secure Backup with Oracle RMAN, Oracle Secure Backup automatically excludes auto-open keystores (the cwallet.sso files). However, it does not automatically exclude encryption keystores (the ewallet.p12 files). It is a good practice to add the following exclude data set statement to your Oracle Secure Backup configuration:
exclude name *.p12
This setting instructs Oracle Secure Backup to exclude the encryption keystore from the backup set.
If you lose the software keystore that stores the TDE master encryption key, then you can restore access to encrypted data by copying the backed-up version of the keystore to the appropriate location. If you archived the restored keystore after the last time that you reset the TDE master encryption key, then you do not need to take any additional action.
If the restored software keystore does not contain the most recent TDE master encryption key, then you can recover old data up to the point when the TDE master encryption key was reset by rolling back the state of the database to that point in time. All of the modifications to encrypted columns after the TDE master encryption key was reset are lost.
Related Topics
Parent topic: Managing the Keystore
Dangers of Deleting Keystores
Oracle strongly recommends that you do not delete keystores until you have moved the keystore encryption key to a new keystore.
Deleting a keystore that still contains keys is particularly dangerous if after you have configured Transparent Data Encryption and the keystore is in use. You can find if a keystore is in use by querying the STATUS column of the V$ENCRYPTION_WALLET view after you open the keystore.
The reason you should not delete a keystore that has active keys in it is because the keystore contains a list of all of the keys that were used for the database. Deleting the keystore deletes these keys, and could result in the loss of encrypted data. The deletion of a keystore can even hamper the normal functioning of the Oracle database. Even if you decrypted all of the data in your database, you still should not delete the keystore, because the TDE master encryption key in the keystore is also used for other Oracle Database features, such as off-lined tablespaces, Oracle Recovery Manager, and Oracle Secure Backup.
Even after you have migrated your software keystores to a hardware keystore, you should not delete the original keystore. The keys in the original keystore will be needed at a later time, for example when recovering an offline encrypted tablespace. Even if there is no data online that are not encrypted, the key may still be in use.
The exception is in the case of software auto-login (or auto-login local) keystores. If you do not want to use this type of keystore, then ideally you should move it to a secure directory. Only delete an auto-login keystore if you are sure that it comes from a specific password-based software keystore and that this keystore is available. The keystore should be available and known.
If you must delete a keystore, do so with great caution. You must first move the keys within the keystore to a new keystore by using the ADMINISTER KEY MANAGEMENT MOVE KEYS TO NEW KEYSTORE statement. After the key is in a new keystore, then you can safely delete the old keystore.
Managing the TDE Master Encryption Key
You can manage the TDE master encryption key in several ways.
- Creating User-Defined TDE Master Encryption Keys
You can create a user-defined TDE master encryption key outside the database by generating a TDE master encryption key ID. - Creating TDE Master Encryption Keys for Later Use
You can create a TDE master encryption key that can be activated at a later date. - Activating TDE Master Encryption Keys
After you activate a TDE master encryption key, it can be used. - TDE Master Encryption Key Attribute Management
TDE master encryption key attributes store information about the TDE master encryption key. - Creating Custom TDE Master Encryption Key Attributes for Reports
Custom TDE master encryption key attributes enable you to defined attributes that are specific to your needs. - Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software keystores and hardware keystores. - Exporting and Importing the TDE Master Encryption Key
You can export and import the TDE master encryption key in different ways. - Management of TDE Master Encryption Keys Using Oracle Key Vault
You can use Oracle Key Vault to manage and share TDE master encryption keys across an enterprise.
Parent topic: Managing the Keystore and the Master Encryption Key
Creating User-Defined TDE Master Encryption Keys
You can create a user-defined TDE master encryption key outside the database by generating a TDE master encryption key ID.
- About User-Defined TDE Master Encryption Keys
A TDE master encryption key that is outside the database has its own user-generated ID, which tracks the use of the TDE master encryption key. - Creating a User-Defined TDE Master Encryption Key
To create a user-defined TDE master encryption key, use theADMINISTER KEY MANAGEMENTstatement with theSET | CREATE [ENCRYPTION] KEYclause.
Parent topic: Managing the TDE Master Encryption Key
About User-Defined TDE Master Encryption Keys
A TDE master encryption key that is outside the database has its own user-generated ID, which tracks the use of the TDE master encryption key.
You can use the ADMINISTER KEY MANAGEMENT to create and set user-defined TDE master encryption key IDs. After you generate the TDE master encryption key, you can bring this key into the database. Optionally, you can specify the TDE master encryption key ID in various ADMINISTER KEY MANAGEMENT statements.
This type of configuration benefits Oracle Fusion SaaS Cloud environments in that it enables you to generate a TDE master encryption key this complies with your site’s requirements. This key that you generate supports the current encryption algorithms and can be used for software keystores.
After you generate the TDE master encryption key ID, you can encrypt your data as you normally would.
The TDE master encryption key and its corresponding ID will not be captured by any auditing logs.
Parent topic: Creating User-Defined TDE Master Encryption Keys
Creating a User-Defined TDE Master Encryption Key
To create a user-defined TDE master encryption key, use the ADMINISTER KEY MANAGEMENT statement with the SET | CREATE [ENCRYPTION] KEY clause.
Related Topics
Parent topic: Creating User-Defined TDE Master Encryption Keys
Creating TDE Master Encryption Keys for Later Use
You can create a TDE master encryption key that can be activated at a later date.
- About Creating a TDE Master Encryption Key for Later Use
TheCREATE KEYclause of theADMINISTER KEY MANAGEMENTstatement can create a TDE master encryption key to be activated at a later date. - Creating a TDE Master Encryption Key for Later Use
A keystore must be opened before you can create a TDE master encryption key for use later on. - Example: Creating a TDE Master Encryption Key in a Single Database
You can use theADMINISTER KEY MANAGEMENT CREATE KEY USING TAGstatement to create a TDE master encryption key in a single database.
Parent topic: Managing the TDE Master Encryption Key
About Creating a TDE Master Encryption Key for Later Use
The CREATE KEY clause of the ADMINISTER KEY MANAGEMENT statement can create a TDE master encryption key to be activated at a later date.
You then can activate this key on the same database or export it to another database and activate it there.
This method of TDE master encryption key creation is useful in a multitenant environment when you must re-create the TDE master encryption keys. The CREATE KEY clause enables you to use a single SQL statement to generate a new TDE master encryption key for all of the PDBs within a multitenant environment. The creation time of the new TDE master encryption key is later than the activation of the TDE master encryption key that is currently in use. Hence, the creation time can serve as a reminder to all of the PDBs to activate the most recently created TDE master encryption key as soon as possible.
Parent topic: Creating TDE Master Encryption Keys for Later Use
Creating a TDE Master Encryption Key for Later Use
A keystore must be opened before you can create a TDE master encryption key for use later on.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Create the TDE master encryption key by using this syntax:
ADMINISTER KEY MANAGEMENT CREATE KEY [USING TAG 'tag'] [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
tagis the associated attribute and information that you define. Enclose this setting in single quotation marks (' '). -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
keystore_passwordis the mandatory keystore password that you used when you created the original keystore. It is case sensitive.
-
-
WITH BACKUPbacks up the TDE master encryption key in the same location as the key, as identified by theWRL_PARAMETERcolumn of theV$ENCRYPTION_WALLETview. To find the key locations for all of the database instances, query theGV$ENCRYPTION_WALLETview.You must back up password-based software keystores. You do not need to back up auto-login or local auto-login software keystores. Optionally, include the
USINGbackup_identifierclause to add a description of the backup. Enclosebackup_identifierin single quotation marks (' ').
-
-
If necessary, activate the TDE master encryption key.
-
Fin the key ID.
SELECT KEY_ID FROM V$ENCRYPTION_KEYS; KEY_ID ---------------------------------------------------- AWsHwVYC2U+Nv3RVphn/yAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-
Use this key ID to activate the key.
ADMINISTER KEY MANAGEMENT USE KEY 'AWsHwVYC2U+Nv3RVphn/yAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' USING TAG 'quarter:second;description:Activate Key on standby' IDENTIFIED BY password WITH BACKUP;
-
Example: Creating a TDE Master Encryption Key in a Single Database
You can use the ADMINISTER KEY MANAGEMENT CREATE KEY USING TAG statement to create a TDE master encryption key in a single database.
Example 4-2 shows how to create a TDE master encryption key in a single database. After you run this statement, a TDE master encryption key with the tag definition is created in the keystore for that database. You can query the TAG column of the V$ENCRYPTION_KEYS view for the identifier of the newly created key. You can query the CREATION_TIME column to find the most recently created key, which would be the key that you created from this statement. You can export this key to another database if you want or activate it locally later on, as described in Activating TDE Master Encryption Keys.
Example 4-2 Creating a TDE Master Encryption Key in a Single Database
ADMINISTER KEY MANAGEMENT CREATE KEY USING TAG
'source:admin@source;target:db1@target'
IDENTIFIED BY password WITH BACKUP;
keystore altered.
Parent topic: Creating TDE Master Encryption Keys for Later Use
Activating TDE Master Encryption Keys
After you activate a TDE master encryption key, it can be used.
- About Activating TDE Master Encryption Keys
You can activate a previously created or imported TDE master encryption key by using theUSE KEYclause ofADMINSTER KEY MANAGEMENT. - Activating a TDE Master Encryption Key
To activate a TDE master encryption key, you must open the keystore and useADMINISTER KEY MANAGEMENTwith theUSE KEYclause. - Example: Activating a TDE Master Encryption Key
You can use the ADMINISTER KEY MANAGEMENT SQL statement to activate a TDE master encryption key.
Parent topic: Managing the TDE Master Encryption Key
About Activating TDE Master Encryption Keys
You can activate a previously created or imported TDE master encryption key by using the USE KEY clause of ADMINSTER KEY MANAGEMENT.
After you activate the key, it is available for use. The key will be used to protect all of the column keys and all of the tablespace encryption keys. If you have deployed a logical standby database, then you must export the TDE master encryption keys after recreating them, and then import them into the standby database. You can have the TDE master encryption key in use on both the primary and the standby databases. To do so, you must activate the TDE master encryption key after you import it to the logical standby database.
Parent topic: Activating TDE Master Encryption Keys
Activating a TDE Master Encryption Key
To activate a TDE master encryption key, you must open the keystore and use ADMINISTER KEY MANAGEMENT with the USE KEY clause.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Query the
KEY_IDcolumn of theV$ENCRYPTION_KEYSview to find the key identifier.For example:
SELECT KEY_ID FROM V$ENCRYPTION_KEYS; KEY_ID ---------------------------------------------------- ARaHD762tUkkvyLgPzAi6hMAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-
Use this key identifier to activate the TDE master encryption key by using the following syntax:
ADMINISTER KEY MANAGEMENT USE KEY 'key_identifier_from_V$ENCRYPTION_KEYS' [USING TAG 'tag'] [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
key_identifier_from_V$ENCRYPTION_KEYSis the key identifie. Enclose this setting in single quotation marks (' '). -
tagis the associated attributes and information that you define. Enclose this setting in single quotation marks (' '). -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
keystore_passwordis the mandatory keystore password that you used when you created the original keystore.
-
-
WITH BACKUPbacks up the TDE master encryption key in the same location as the key, as identified by theWRL_PARAMETERcolumn of theV$ENCRYPTION_WALLETview. To find the key locations for all of the database instances, query theGV$ENCRYPTION_WALLETview.You must back up password-based software keystores. You do not need to back up auto-login or local auto-login software keystores. Optionally, include the
USINGbackup_identifierclause to add a description of the backup. Enclosebackup_identifierin single quotation marks (' ').
-
Related Topics
Parent topic: Activating TDE Master Encryption Keys
Example: Activating a TDE Master Encryption Key
You can use the ADMINISTER KEY MANAGEMENT SQL statement to activate a TDE master encryption key.
Example 4-3 shows how to activate a previously imported TDE master encryption key and then update its tag. This key is activated with the current database time stamp and time zone.
Example 4-3 Activating a TDE Master Encryption Key
ADMINISTER KEY MANAGEMENT USE KEY
'ARaHD762tUkkvyLgPzAi6hMAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
USING TAG 'quarter:second;description:Activate Key on standby'
IDENTIFIED BY password WITH BACKUP;
keystore altered.In this version of the same operation, the FORCE KEYSTORE clause is added in the event that the auto-login keystore is in use, or if the keystore is closed. The password of the keystore is stored externally, so the EXTERNAL STORE setting is used for the IDENTIFIED BY clause.
ADMINISTER KEY MANAGEMENT USE KEY 'ARaHD762tUkkvyLgPzAi6hMAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' USING TAG 'quarter:second;description:Activate Key on standby' FORCE KEYSTORE IDENTIFIED BY EXTERNAL STORE WITH BACKUP; keystore altered.
Parent topic: Activating TDE Master Encryption Keys
TDE Master Encryption Key Attribute Management
TDE master encryption key attributes store information about the TDE master encryption key.
- TDE Master Encryption Key Attributes
TDE master encryption key attributes include detailed information about the TDE master encryption key. - Finding the TDE Master Encryption Key That Is in Use
A TDE master encryption key that is in use is the encryption key that was activated most recently for the database.
Parent topic: Managing the TDE Master Encryption Key
TDE Master Encryption Key Attributes
TDE master encryption key attributes include detailed information about the TDE master encryption key.
The information contains the following types:
-
Key time stamp information: Internal security policies and compliance policies usually determine the key rekeying frequency. You should expire keys when they reach the end of their lifetimes and then generate new keys. Time stamp attributes such as key creation time and activation time help you to determine the key age accurately, and automate key generation.
The
V$ENCRYPTION_KEYSview includes columns such asCREATION_TIMEandACTIVATION_TIME.See Oracle Database Reference for a complete description of theV$ENCRYPTION_KEYSview. -
Key owner information: Key owner attributes help you to determine the user who created or activated the key. These attributes can be important for security, auditing, and tracking purposes. Key owner attributes also include key use information, such as whether the key is used for standalone TDE operations or used in a multitenant environment.
The
V$ENCRYPTION_KEYSview includes columns such asCREATOR, CREATOR_ID, USER, USER_ID,andKEY_USE. -
Key source information: Keys often must be moved between databases for operations such as import-export operations and Data Guard-related operations. Key source attributes enable you to track the origin of each key. You can track whether a key was created locally or imported, and the database name and instance number of the database that created the key. In a multitenant environment, you can track the PDB where the key was created.
The
V$ENCRYPTION_KEYSview includes columns such asCREATOR_DBNAME, CREATOR_DBID, CREATOR_INSTANCE_NAME, CREATOR_INSTANCE_NUMBER, CREATOR_PDBNAME,and so on. -
Key usage information: Key usage information determines the database or PDB where the key is being used. It also helps determine whether a key is in active use or not.
The
V$ENCRYPTION_KEYSview includes columns such asACTIVATING_DBNAME, ACTIVATING_DBID, ACTIVATING_INSTANCE_NAME, ACTIVATING_PDBNAME,and so on. -
User-defined information and other information: When creating a key, you can tag it with information using the
TAGoption. Each key contains important information such as whether or not it has been backed up.The
V$ENCRYPTION_KEYSview includes columns such asKEY_ID, TAG,and other miscellaneous columns, for exampleBACKED_UP.
Note:
TDE Master Key Attributes and Tag are only supported with a hardware security module that has PKCS#11 data object support.Parent topic: TDE Master Encryption Key Attribute Management
Finding the TDE Master Encryption Key That Is in Use
A TDE master encryption key that is in use is the encryption key that was activated most recently for the database.
Parent topic: TDE Master Encryption Key Attribute Management
Creating Custom TDE Master Encryption Key Attributes for Reports
Custom TDE master encryption key attributes enable you to defined attributes that are specific to your needs.
- About Creating Custom Attribute Tags
Attribute tags enable you to monitor specific activities users perform, such as accessing a particular terminal ID. - Creating a Custom Attribute Tag
To create a custom attribute tag, you must use theSET TAGclause of theADMINISTER KEY MANAGEMENTstatement.
Parent topic: Managing the TDE Master Encryption Key
About Creating Custom Attribute Tags
Attribute tags enable you to monitor specific activities users perform, such as accessing a particular terminal ID.
By default, Oracle Database defines a set of attributes that describe various characteristics of the TDE master encryption keys that you create, such as the creation time, database in which the TDE master encryption key is used, and so on. These attributes are captured by the V$ENCRYPTION_KEY dynamic view.
You can create custom attributes that can be captured by the TAG column of the V$ENCRYPTION_KEYS dynamic view. This enables you to define behaviors that you may want to monitor, such as users who perform activities on encryption keys. The tag can encompass multiple attributes, such as session IDs from a specific terminal.
After you create the tag for a TDE master encryption key, its name should appear in the TAG column of the V$ENCRYPTION_KEYS view for that TDE master encryption key. If you create a tag for the secret, then the tag appears in the SECRET_TAG column of the V$CLIENT_SECRETS view. If you create a secret with a tag, then the tag appears in the SECRET_TAG column of the V$CLIENT_SECRETS view.
Creating a Custom Attribute Tag
To create a custom attribute tag, you must use the SET TAG clause of the ADMINISTER KEY MANAGEMENT statement.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
If necessary, query the
TAGcolumn of theV$ENCRYPTION_KEYdynamic view to find a listing of existing tags for the TDE master encryption keys.When you create a new tag for a TDE master encryption key, it overwrites the existing tag for that TDE master encryption key.
-
Create the custom attribute tag by using the following syntax:
ADMINISTER KEY MANAGEMENT SET TAG 'tag' FOR 'master_key_identifier' [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING 'backup_identifier']];
In this specification
-
tagis the associated attributes or information that you define. Enclose this information in single quotation marks (' '). -
master_key_identifieridentifies the TDE master encryption key for which thetagis set. To find a list of TDE master encryption key identifiers, query theKEY_IDcolumn of theV$ENCRYPTION_KEYSdynamic view. -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
keystore_passwordis the password that was used to create the keystore.
-
-
backup_identifierdefines the tag values. Enclose this setting in single quotation marks (' ') and separate each value with a colon.
For example, to create a tag that uses two values, one to capture a specific session ID and the second to capture a specific terminal ID:
ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY USING TAG 'sessionid=3205062574:terminal=xcvt' IDENTIFIED BY keystore_password WITH BACKUP; keystore altered.Both the session ID (
3205062574) and terminal ID (xcvt) can derive their values by using either theSYS_CONTEXTfunction with theUSERENVnamespace, or by using theUSERENVfunction. -
Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software keystores and hardware keystores.
- About Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software password-based and hardware keystores. - Creating, Tagging, and Backing Up a TDE Master Encryption Key
TheADMINISTER KEY MANAGEMENTstatement enables you to create, tag, and back up a TDE master encryption key. - About Rekeying the TDE Master Encryption Key
Oracle Database uses a unified TDE Master Encryption Key for both TDE column encryption and TDE tablespace encryption. - Rekeying the TDE Master Encryption Key
You can use theADMINISTER KEY MANAGEMENTstatement to rekey a TDE master encryption key. - Changing the TDE Master Encryption Key for a Tablespace
You can use theENCRYPTandREKEYclauses of theALTER TABLESPACEstatement to encrypt a tablespace.
Parent topic: Managing the TDE Master Encryption Key
About Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software password-based and hardware keystores.
The TDE master encryption key is stored in an external security module (keystore), and it is used to protect the TDE table keys and tablespace encryption keys. By default, the TDE master encryption key is a system-generated random value created by Transparent Data Encryption (TDE).
Use the ADMINISTER KEY MANAGEMENT statement to set or reset (REKEY) the TDE master encryption key. When the master encryption key is set, then TDE is considered enabled and cannot be disabled.
Before you can encrypt or decrypt database columns or tablespaces, you must generate a TDE master encryption key. Oracle Database uses the same TDE master encryption key for both TDE column encryption and TDE tablespace encryption. The instructions for setting a software or hardware TDE master encryption key explain how to generate a tDE master encryption key.
Creating, Tagging, and Backing Up a TDE Master Encryption Key
The ADMINISTER KEY MANAGEMENT statement enables you to create, tag, and back up a TDE master encryption key.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Create and back up the TDE master encryption key, and apply a tag, by using the following syntax:
ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY [USING TAG 'tag'] [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] WITH BACKUP [USING 'backup_identifier'];
In this specification:
-
tagis the tag that you want to create. Enclose this tag in single quotation marks (' '). -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
keystore_passwordis eithersoftware_keystore_passwordorhardware_keystore_credentials. As with software passwords, it is case sensitive. You must enclose the password string in double quotation marks (" "). Separateuser_nameandpasswordwith a colon (:).
-
-
WITH BACKUPbacks the TDE master encryption key up in the same location as the key, as identified by theWRL_PARAMETERcolumn of theV$ENCRYPTION_WALLETview. To find theWRL_PARAMETERvalues for all of the database instances, query theGV$ENCRYPTION_WALLETview.You must back up password-based software keystores. You do not need to use it for auto-login or local auto-login software keystores. Optionally, include the
USINGbackup_identifierclause to add a description of the backup. Enclose this identifier in single quotation marks (' ').
For example:
ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY USING TAG 'backups" IDENTIFIED BY password WITH BACKUP USING 'hr.emp_key_backup'; keystore altered. -
Oracle Database uses the keystore in the keystore location specified by the WALLET_ROOT parameter in the initialization parameter file to store the TDE master encryption key.
About Rekeying the TDE Master Encryption Key
Oracle Database uses a unified TDE Master Encryption Key for both TDE column encryption and TDE tablespace encryption.
When you rekey the TDE master encryption key for TDE column encryption, the TDE Master Encryption Key for TDE tablespace encryption also is rekeyed. Rekey the TDE Master Encryption Key only if it was compromised or as per the security policies of the organization. This process deactivates the previous TDE master encryption key.
For better security and to meet compliance regulations, periodically rekey the TDE master encryption key. This process deactivates the previous TDE master encryption key, creates a new TDE master encryption key, and then activates it. You can check the keys that were created recently by querying the CREATION_TIME column in the V$ENCRYPTION_KEYS view. To find the keys that were activated recently, query the ACTIVATION_TIME column in the V$ENCRYPTION_KEYS view.
You cannot change the TDE master encryption key or rekey a TDE master encryption key for an auto-login keystore. Because auto-login keystores do not have a password, an administrator or a privileged user can change the keys without the knowledge of the security officer. However, if both the auto-login and the password-based keystores are present in the configured location (as set in the sqlnet.ora file), then when you rekey the TDE master encryption key, a TDE master encryption key is added to both the auto-login and password-based keystores. If the auto-login keystore is in use in a location that is different from that of the password-based keystore, then you must re-create the auto-login keystore.
Do not perform a rekey operation of the master key concurrently with an online tablespace rekey operation. You can find if an online tablespace is in the process of being TDE Master Encryption Keyed by issuing the following query:
SELECT TS#,ENCRYPTIONALG,STATUS FROM V$ENCRYPTED_TABLESPACES;
A status of REKEYING means that the corresponding tablespace is still being rekeyed.
Note:
You cannot add new information to auto-login keystores separately.
Rekeying the TDE Master Encryption Key
You can use the ADMINISTER KEY MANAGEMENT statement to rekey a TDE master encryption key.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
If you are rekeying the TDE master encryption key for a keystore that has auto login enabled, then ensure that both the auto login keystore, identified by the
.ssofile, and the encryption keystore, identified by the.p12file, are present.You can find the location of these files by querying the
WRL_PARAMETERcolumn of theV$ENCRYPTION_WALLETview. To find theWRL_PARAMETERvalues for all of the database instances, query theGV$ENCRYPTION_WALLETview. -
Rekey the TDE master encryption key by using the following syntax:
ADMINISTER KEY MANAGEMENT SET [ENCRYPTION] KEY [FORCE KEYSTORE] [USING TAG 'tag_name'] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
tagis the associated attributes and information that you define. Enclose this setting in single quotation marks (' '). -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
keystore_passwordis the mandatory keystore password that you created when you created the keystore in Step 2: Create the Software Keystore.
-
-
WITH BACKUPcreates a backup of the keystore. You must use this option for password-based and hardware keystores. Optionally, you can use theUSINGclause to add a brief description of the backup. Enclose this description in single quotation marks (' '). This identifier is appended to the named keystore file (for example,ewallet_time-stamp_emp_key_backup.p12). Follow the file naming conventions that your operating system uses.
For example:
ADMINISTER KEY MANAGEMENT SET KEY FORCE KEYSTORE IDENTIFIED BY keystore_password WITH BACKUP USING 'emp_key_backup'; keystore altered. -
Exporting and Importing the TDE Master Encryption Key
You can export and import the TDE master encryption key in different ways.
- About Exporting and Importing the TDE Master Encryption Key
Oracle Database features such as transportable tablespaces and Oracle Data Pump move data that is possibly encrypted between databases. - About Exporting TDE Master Encryption Keys
You can useADMINISTER KEY MANAGEMENT EXPORTto export TDE master encryption keys from a keystore, and then import them into another keystore. - Exporting a TDE Master Encryption Key
TheADMINISTER KEY MANAGEMENTstatement with theEXPORT [ENCRYPTION] KEYS WITH SECRETclause exports a TDE master encryption key. - Example: Exporting a TDE Master Encryption Key by Using a Subquery
TheADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYSstatement can export a TDE master encryption key by using a subquery. - Example: Exporting a List of TDE Master Encryption Key Identifiers to a File
TheADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS WITH SECRETstatement can export a list of TDE master encryption key identifiers to a file. - Example: Exporting All TDE Master Encryption Keys of the Database
TheADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYSSQL statement can export all TDE master encryption keys of a database. - About Importing TDE Master Encryption Keys
TheADMINISTER KEY MANAGEMENT IMPORTstatement can import exported TDE master encryption keys from a key export file into a target keystore. - Importing a TDE Master Encryption Key
TheADMINISTER KEY MANAGEMENTstatement with theIMPORT [ENCRYPTION] KEYS WITH SECRETclause can import a TDE master encryption key. - Example: Importing a TDE Master Encryption Key
You can use the ADMINISTER KEY MANAGEMENT IMPORT KEYS SQL statement to import a TDE master encryption key. - How Keystore Merge Differs from TDE Master Encryption Key Export or Import
The keystore merge operation differs from the TDE master encryption key export and import operations.
Parent topic: Managing the TDE Master Encryption Key
About Exporting and Importing the TDE Master Encryption Key
Oracle Database features such as transportable tablespaces and Oracle Data Pump move data that is possibly encrypted between databases.
These are some common scenarios in which you can choose to export and import TDE master encryption keys to move them between source and target keystores. For Data Guard (Logical Standby), you must copy the keystore that is in the primary database to the standby database. Instead of merging the primary database keystore with the standby database, you can export the TDE master encryption key that is in use and then import it to the standby database. Moving transportable tablespaces that are encrypted between databases requires that you export the TDE master encryption key at the source database and then import it into the target database.
Parent topic: Exporting and Importing the TDE Master Encryption Key
About Exporting TDE Master Encryption Keys
You can use ADMINISTER KEY MANAGEMENT EXPORT to export TDE master encryption keys from a keystore, and then import them into another keystore.
A TDE master encryption key is exported together with its key identifier and key attributes. The exported keys are protected with a password (secret) in the export file.
You can specify the TDE master encryption keys to be exported by using the WITH IDENTIFIER clause of the ADMINSITER KEY MANAGENT EXPORT statement. To export the TDE master encryption keys, you can either specify their key identifiers as a comma-separated list, or you can specify a query that enumerates their key identifiers. Be aware that Oracle Database executes the query determining the key identifiers within the current user's rights and not with definer's rights.
If you omit the WITH IDENTIFER clause, then all of the TDE master encryption keys of the database are exported.
Exporting a TDE Master Encryption Key
The ADMINISTER KEY MANAGEMENT statement with the EXPORT [ENCRYPTION] KEYS WITH SECRET clause exports a TDE master encryption key.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.For example:
sqlplus sec_admin as syskm Enter password: password Connected. -
Export the TDE master encryption keys by using the following syntax:
ADMINISTER KEY MANAGEMENT EXPORT [ENCRYPTION] KEYS WITH SECRET "export_secret" TO 'file_path' [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH IDENTIFIER IN 'key_id1', 'key_id2', 'key_idn' | (SQL_query)];
In this specification:
-
export_secretis a password that you can specify to encrypt the export the file that contains the exported keys. Enclose this secret in double quotation marks (" "), or you can omit the quotation marks if the secret has no spaces. -
file_pathis the complete path and name of the file to which the keys must be exported. Enclose this path in single quotation marks (' '). You can export to regular file systems only. -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
software_keystore_passwordis the password of the keystore containing the keys.
-
-
key_id1,key_id2,key_idnis a string of one or more TDE master encryption key identifiers for the TDE master encryption key being exported. Separate each key identifier with a comma and enclose each of these key identifiers in single quotation marks (' '). To find a list of TDE master encryption key identifiers, query theKEY_IDcolumn of theV$ENCRYPTION_KEYSdynamic view. -
SQL_queryis a query that fetches a list of the TDE master encryption key identifiers. It should return only one column which contains the TDE master encryption key identifiers. This query is executed with current user rights.
-
Related Topics
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Exporting a TDE Master Encryption Key by Using a Subquery
The ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS statement can export a TDE master encryption key by using a subquery.
Example 4-5 shows how to export TDE master encryption keys whose identifiers are fetched by a query to a file called export.exp. The TDE master encryption keys in the file are encrypted using the secret my_secret. The SELECT statement finds the identifiers for the TDE master encryption keys to be exported.
Example 4-4 Exporting a List of TDE Master Encryption Key Identifiers to a File
ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
WITH SECRET "my_secret"
TO '/TDE/export.exp'
FORCE KEYSTORE
IDENTIFIED BY password
WITH IDENTIFIER IN 'AdoxnJ0uH08cv7xkz83ovwsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'AW5z3CoyKE/yv3cNT5CWCXUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
keystore altered.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Exporting a List of TDE Master Encryption Key Identifiers to a File
The ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS WITH SECRET statement can export a list of TDE master encryption key identifiers to a file.
Example 4-4 shows how to export TDE master encryption keys by specifying their identifiers as a list, to a file called export.exp. TDE master encryption keys in the file are encrypted using the secret my_secret. The identifiers of the TDE master encryption key to be exported are provided as a comma-separated list.
Example 4-5 Exporting TDE Master Encryption Key Identifiers by Using a Subquery
ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
WITH SECRET "my_secret" TO '/etc/TDE/export.exp'
FORCE KEYSTORE
IDENTIFIED BY password
WITH IDENTIFIER IN (SELECT KEY_ID FROM V$ENCRYPTION_KEYS WHERE ROWNUM <3);
keystore altered.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Exporting All TDE Master Encryption Keys of the Database
The ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS SQL statement can export all TDE master encryption keys of a database.
Example 4-6 shows how to export all of the TDE master encryption keys of the database to a file called export.exp. The TDE master encryption keys in the file are encrypted using the secret my_secret.
Example 4-6 Exporting All of the TDE Master Encryption Keys of the Database
ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' FORCE KEYSTORE IDENTIFIED BY password; keystore altered.
Parent topic: Exporting and Importing the TDE Master Encryption Key
About Importing TDE Master Encryption Keys
The ADMINISTER KEY MANAGEMENT IMPORT statement can import exported TDE master encryption keys from a key export file into a target keystore.
You cannot re-import TDE master encryption keys that have already been imported.
Importing a TDE Master Encryption Key
The ADMINISTER KEY MANAGEMENT statement with the IMPORT [ENCRYPTION] KEYS WITH SECRET clause can import a TDE master encryption key.
-
Log in to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENTorSYSKMprivilege.sqlplus sec_admin as syskm Enter password: password Connected. -
Run the following SQL statement:
ADMINISTER KEY MANAGEMENT IMPORT [ENCRYPTION] KEYS WITH SECRET "import_secret" FROM 'file_name' [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
import_secretis the same password that was used to encrypt the keys during the export operation. Enclose this secret in double quotation marks (" "), or you can omit the quotation marks if the secret has no spaces. -
file_nameis the complete path and name of the file from which the keys need to be imported. Enclose this setting in single quotation marks (' '). -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation. You must open the keystore for this operation. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
software_keystore_passwordis the password of the software keystore where the keys are being imported.
-
-
WITH BACKUPmust be used in case the target keystore was not backed up before the import operation.backup_identifieris an optional string that you can provide to identify the keystore backup. Enclose this setting in single quotation marks (' ').
-
Related Topics
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Importing a TDE Master Encryption Key
You can use the ADMINISTER KEY MANAGEMENT IMPORT KEYS SQL statement to import a TDE master encryption key.
Example 4-7 shows how to import the TDE master encryption key identifiers that are stored in the file export.exp and encrypted with the secret my_secret.
Example 4-7 Importing TDE Master Encryption Key Identifiers from an Export File
ADMINISTER KEY MANAGEMENT IMPORT KEYS
WITH SECRET "my_secret"
FROM '/etc/TDE/export.exp'
FORCE KEYSTORE
IDENTIFIED BY password WITH BACKUP;
keystore altered.Parent topic: Exporting and Importing the TDE Master Encryption Key
How Keystore Merge Differs from TDE Master Encryption Key Export or Import
The keystore merge operation differs from the TDE master encryption key export and import operations.
Even though both the ADMINISTER KEY MANAGEMENT MERGE statement and the ADMINISTER KEY MANAGEMENT EXPORT and IMPORT statements eventually move the TDE master encryption keys from one keystore to the next, there are differences in how these two statements function.
-
The
MERGEstatement merges two keystores whereas theEXPORTandIMPORTstatements export the keys to a file or import the keys from a file. The keystore is different from the export file, and the two cannot be used interchangeably. The export file is not a keystore and cannot be configured to be used with a database as a keystore. Similarly, theIMPORTstatement cannot extract the TDE master encryption keys from the keystore. -
The
MERGEstatement merges all of the TDE master encryption keys of the specified keystores where as theEXPORTandIMPORTstatements can be selective. -
The
EXPORTandIMPORTstatements require the user to provide both a location (filepath) and the file name of the export file, whereas theMERGEstatement only takes in the location of the keystores. -
The file name of the keystores is fixed and is determined by the
MERGEoperation and can be eitherewallet.p12orcwallet.sso. The file names for the export files used in theEXPORTtheIMPORTstatements are specified by the user. -
The keystores on Automatic Storage Management (ASM) disk groups or regular file systems can be merged with
MERGEstatements. The export files used in theEXPORTand theIMPORTstatements can only be a regular operating system file and cannot be located on an ASM disk group. -
The keystores merged using the
MERGEstatement do not need to be configured or in use with the database. TheEXPORTstatement can only export the keys from a keystore that is configured and in use with the database and is also open when the export is done. TheIMPORTstatement can only import the keys into a keystore that is open, configured, and in use with the database. -
The
MERGEstatement never modifies the metadata associated with the TDE master encryption keys. TheEXPORTandIMPORToperations can modify the metadata of the TDE master encryption keys when required, such as during a PDB plug operation.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Management of TDE Master Encryption Keys Using Oracle Key Vault
You can use Oracle Key Vault to manage and share TDE master encryption keys across an enterprise.
Oracle Key Vault securely stores the keys in a central repository, along with other security objects such as credential files and Java keystores, and enables you to share these objects with other TDE-enabled databases.
Storing Oracle Database Secrets
Secrets are data that support internal Oracle Database features that integrate external clients such as Oracle GoldenGate into the database.
- About Storing Oracle Database Secrets in a Keystore
Keystores can store secrets that support internal Oracle Database features and integrate external clients such as Oracle GoldenGate. - Storage of Oracle Database Secrets in a Software Keystore
TheADMINISTER KEY MANAGEMENT ADD SECRET|UPDATE SECRET|DELETE SECRETstatements can add secrets, update secrets, and delete secrets from a keystore. - Example: Adding an HSM Password to a Software Keystore
TheADMINISTER KEY MANAGEMENT ADD SECRETstatement can add an HSM password to a software keystore. - Example: Changing an HSM Password Stored as a Secret in a Software Keystore
TheADMINISTER KEY MANAGEMENT UPDATE SECRETstatement can change an HSM password that is stored as a secret in a software keystore. - Example: Deleting an HSM Password Stored as a Secret in a Software Keystore
TheADMINISTER KEY MANAGEMENT DELETE SECRETstatement can delete HSM passwords that are stored as secrets in a software keystore. - Storage of Oracle Database Secrets in a Hardware Keystore
TheADMINISTER KEY MANAGEMENT ADD SECRET|UPDATE SECRET|DELETE SECRETstatements can add, update, and delete secrets. - Example: Adding an Oracle Database Secret to a Hardware Keystore
TheADMINISTER KEY MANAGEMENT ADD SECRETstatement can add an Oracle Database secret to a hardware keystore. - Example: Changing an Oracle Database Secret in a Hardware Keystore
TheADMINISTER KEY MANAGEMENT MANAGEMENT UPDATE SECRETstatement can change an Oracle Database secret in a hardware keystore. - Example: Deleting an Oracle Database Secret in a Hardware Keystore
TheADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENTstatement can delete an Oracle Database secret that is in a hardware keystore. - Configuring Auto-Login Hardware Security Modules
A hardware security module can be configured to use the auto-login capability.
Parent topic: Managing the Keystore and the Master Encryption Key
About Storing Oracle Database Secrets in a Keystore
Keystores can store secrets that support internal Oracle Database features and integrate external clients such as Oracle GoldenGate.
The secret key must be a string adhering to Oracle identifier rules. You can add, update, or delete a client secret in an existing keystore. The Oracle GoldenGate Extract process must have data encryption keys to decrypt the data that is in data files and in REDO or UNDO logs. Keys are encrypted with shared secrets when you share the keys between an Oracle database and an Oracle GoldenGate client. The software keystore stores the shared secrets.
Depending on your site's requirements, you may require automated open keystore operations even when a hardware security module is configured. For this reason, the hardware security module password can be stored in a software auto-login keystore, which enables the auto-login capability for the hardware security module. The Oracle Database side can also store the credentials for the database to log in to an external storage server in the software keystore.
You can store Oracle Database secrets in both software keystores and hardware keystores:
-
Software keystores: You can store secrets in software password-based, auto-login, and local auto-login software keystores. If you want to store secrets in an auto-login (or auto-login local) keystore, then note the following:
-
If the software auto-login keystore is in the same location as its corresponding password-based software keystore, then the secrets are added automatically.
-
If the software auto-login keystore is in a different location from its corresponding password-based software keystore, then you must create the auto-login keystore again from the password-based keystore, and keep the two keystores in synchronization.
-
-
Hardware keystores: You can store secrets in standard hardware security modules.
Storage of Oracle Database Secrets in a Software Keystore
The ADMINISTER KEY MANAGEMENT ADD SECRET|UPDATE SECRET|DELETE SECRET statements can add secrets, update secrets, and delete secrets from a keystore.
As with all of the ADMINISTER KEY MANAGEMENT statements, you must have the ADMINISTER KEY MANAGEMENT or the SYSKM administrative privilege. To find information about existing secrets, you can query the V$CLIENT_SECRETS dynamic view.
-
Adding a secret: Use the following syntax:
ADMINISTER KEY MANAGEMENT ADD SECRET 'secret' FOR CLIENT 'client_identifier' [USING TAG 'tag'] [TO [[LOCAL] AUTOLOGIN] KEYSTORE keystore_location [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING backup_id];
-
Updating a secret: Use the following syntax:
ADMINISTER KEY MANAGEMENT UPDATE SECRET 'secret' FOR CLIENT 'client_identifier' [USING TAG 'tag'] [TO [[LOCAL] AUTOLOGIN] KEYSTORE keystore_location [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING backup_id];
-
Deleting a secret: Use the following syntax:
ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT 'client_identifier' [FROM [[LOCAL] AUTOLOGIN] KEYSTORE keystore_location [FORCE KEYSTORE] IDENTIFIED BY [EXTERNAL STORE | keystore_password] [WITH BACKUP [USING backup_id];
In all of these statements, the specification is as follows:
-
secretis the client secret key to be stored, updated, or deleted. Enclose this setting in single quotation marks (' ') or omit the quotation marks if the secret has no spaces. To find information about existing secrets and their client identifiers, query theV$CLIENT_SECRETSdynamic view. -
client_identifieris an alphanumeric string used to identify the secret key.client_identifierdoes not have a default value. Enclose this setting in single quotation marks (' '). -
TO [[LOCAL] AUTOLOGIN] KEYSTORErefers to the location of an auto-login keystore, which is specified in thesqlnet.orafile. -
tagis an optional, user-defined description for the secret key to be stored. You can usetagwith theADDandUPDATEoperations. Enclose this setting in single quotation marks (' '). This tag appears in theSECRET_TAGcolumn of theV$CLIENT_SECRETSview.WITH BACKUPis required in case the keystore was not backed up before theADD,UPDATE, orDELETEoperation.backup_identifieris an optional user-defined description for the backup. Enclosebackup_identifierin single quotation marks (' '). -
[TO | FROM [[LOCAL] AUTOLOGIN] KEYSTOREspecifies the location of the auto-login or password keystore, which is set in the sqlnet.orafile. -
FORCE KEYSTOREtemporarily opens the password-protected keystore for this operation if an auto-login keystore is open (and in use) or if the keystore is closed. -
IDENTIFIED BYcan be one of the following settings:-
EXTERNAL STOREuses the keystore password stored in the external store to perform the keystore operation. -
keystore_passwordis the password for the keystore.
-
Parent topic: Storing Oracle Database Secrets
Example: Adding an HSM Password to a Software Keystore
The ADMINISTER KEY MANAGEMENT ADD SECRET statement can add an HSM password to a software keystore.
Example 4-8 shows how to add a hardware security module (HSM) password as a secret to a software keystore.
Example 4-8 Adding an Oracle Database Secret to a Software Keystore
ADMINISTER KEY MANAGEMENT ADD SECRET 'psmith:password' FOR CLIENT 'HSM_PASSWORD' USING TAG 'HSM credentials' FORCE KEYSTORE IDENTIFIED BY password WITH BACKUP;
In this version, the keystore password is in an external store, so the EXTERNAL STORE setting is used for IDENTIFIED BY:
ADMINISTER KEY MANAGEMENT
ADD SECRET 'psmith:password' FOR CLIENT 'HSM_PASSWORD'
USING TAG 'HSM credentials' FORCE KEYSTORE
IDENTIFIED BY EXTERNAL STORE WITH BACKUP;
Parent topic: Storing Oracle Database Secrets
Example: Changing an HSM Password Stored as a Secret in a Software Keystore
The ADMINISTER KEY MANAGEMENT UPDATE SECRET statement can change an HSM password that is stored as a secret in a software keystore.
Example 4-9 shows how to change an HSM password that is stored as a secret in a software keystore.
Example 4-9 Changing an Oracle Database Secret to a Software Keystore
ADMINISTER KEY MANAGEMENT UPDATE SECRET admin_password FOR CLIENT 'admin@myhost' USING TAG 'new_host_credentials' FORCE KEYSTORE IDENTIFIED BY software_keytore_password;
In this version, the password for the keystore is in an external store:
DMINISTER KEY MANAGEMENT UPDATE SECRET admin_password FOR CLIENT 'admin@myhost' USING TAG 'new_host_credentials' FORCE KEYSTORE IDENTIFIED BY EXTERNAL STORE;
Parent topic: Storing Oracle Database Secrets
Example: Deleting an HSM Password Stored as a Secret in a Software Keystore
The ADMINISTER KEY MANAGEMENT DELETE SECRET statement can delete HSM passwords that are stored as secrets in a software keystore.
Example 4-10 shows how to delete an HSM password that is stored as a secret in the software keystore.
Example 4-10 Deleting an Oracle Database Secret in a Software Keystore
ADMINISTER KEY MANAGEMENT
DELETE SECRET FOR CLIENT 'HSM_PASSWORD'
FORCE KEYSTORE
IDENTIFIED BY password WITH BACKUP;In this version, the password for the keystore is in an external store:
ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT 'HSM_PASSWORD' FORCE KEYSTORE IDENTIFIED BY EXTERNAL STORE WITH BACKUP;
Parent topic: Storing Oracle Database Secrets
Storage of Oracle Database Secrets in a Hardware Keystore
The ADMINISTER KEY MANAGEMENT ADD SECRET|UPDATE SECRET|DELETE SECRET statements can add, update, and delete secrets.
As with all ADMINISTER KEY MANAGEMENT statements, you must have the ADMINISTER KEY MANAGEMENT or the SYSKM administrative privilege. When you add, update, or delete secrets from a keystore that is in use or presently open, then you must run ADMINISTER KEY MANAGEMENT in the root.
You can store Oracle Database secrets in both HSM and Oracle Key Vault hardware keystores, but be aware that automatic logins do not work if you store the HSM_PASSWORD in a Key Vault keystore.
Note:
Before you attempt to add a secret to a hardware security module, ensure that it has PKCS#11 data object support.
-
Adding a secret: Use the following syntax:
ADMINISTER KEY MANAGEMENT ADD SECRET 'secret' FOR CLIENT 'client_identifier' [USING TAG 'tag'] [TO [[LOCAL] AUTOLOGIN] KEYSTORE keystore_location [FORCE KEYSTORE] IDENTIFIED BY "hardware_keystore_credentials" [WITH BACKUP [USING backup_id]];
-
Updating a secret: Use the following syntax:
ADMINISTER KEY MANAGEMENT UPDATE SECRET 'secret' FOR CLIENT 'client_identifier' [USING TAG 'tag'] [TO [[LOCAL] AUTOLOGIN] KEYSTORE keystore_location [FORCE KEYSTORE] IDENTIFIED BY "hardware_keystore_credentials" [WITH BACKUP [USING backup_id]];
-
Deleting a secret: Use the following syntax:
ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT 'client_identifier' [FROM [[LOCAL] AUTOLOGIN] KEYSTORE keystore_location [FORCE KEYSTORE] IDENTIFIED BY "hardware_keystore_credentials" [WITH BACKUP [USING backup_id]];
In all of these statements, the specification as follows:
-
secretis the client secret key to be stored, updated, or deleted. Enclose this setting in double quotation marks (' ') or omit the quotation marks if the secret has no spaces. To find information about existing secrets and their client identifiers, query theV$CLIENT_SECRETSdynamic view. -
client_identifieris an alphanumeric string used to identify the secret key.client_identifierdoes not have a default value. Enclose this setting in single quotation marks (' '). -
tagis an optional, user-defined description for the secret key to be stored. You can usetagwith theADDandUPDATEoperations. Enclose this setting in single quotation marks (' '). This tag appears in theSECRET_TAGcolumn of theV$CLIENT_SECRETSview. -
[TO | FROM [[LOCAL] AUTOLOGIN] KEYSTOREspecifies the location of the keystore used for the hardware keystore. -
hardware_keystore_credentialsrefers to the credentials for either an HSM or an Oracle Key Vault hardware keystore. For an HSM, specify the credentials using this format, enclosed in quotation marks and separating the components with a colon:“user_name:password”, withuser_namebeing the user who created the HSM and password being this user’s password. For Oracle Key Vault, enter only the password of the user who created the keystore. Enclose this password with quotation marks.
Parent topic: Storing Oracle Database Secrets
Example: Adding an Oracle Database Secret to a Hardware Keystore
The ADMINISTER KEY MANAGEMENT ADD SECRET statement can add an Oracle Database secret to a hardware keystore.
Example 4-11 shows how to add a password for a user to a hardware keystore.
Example 4-11 Adding an Oracle Database Secret to a Hardware Keystore
ADMINISTER KEY MANAGEMENT ADD SECRET 'password' FOR CLIENT 'admin@myhost' USING TAG 'myhost admin credentials' IDENTIFIED BY "psmith:password";
In this version, the keystore password is in an external store, so the EXTERNAL STORE setting is used for IDENTIFIED BY:
ADMINISTER KEY MANAGEMENT ADD SECRET 'password'
FOR CLIENT 'admin@myhost' USING TAG 'myhost admin credentials'
IDENTIFIED BY EXTERNAL STORE;
Parent topic: Storing Oracle Database Secrets
Example: Changing an Oracle Database Secret in a Hardware Keystore
The ADMINISTER KEY MANAGEMENT MANAGEMENT UPDATE SECRET statement can change an Oracle Database secret in a hardware keystore.
Example 4-12 shows how to change a password that is stored as a secret in a hardware keystore.
Example 4-12 Changing an Oracle Database Secret in a Hardware Keystore
ADMINISTER KEY MANAGEMENT MANAGEMENT UPDATE SECRET 'password2'
FOR CLIENT 'admin@myhost' USING TAG 'New host credentials'
IDENTIFIED BY "psmith:password";
In this version, the password for the keystore is in an external store:
ADMINISTER KEY MANAGEMENT MANAGEMENT UPDATE SECRET 'password2'
FOR CLIENT 'admin@myhost' USING TAG 'New host credentials'
IDENTIFIED BY EXTERNAL STORE;
Parent topic: Storing Oracle Database Secrets
Example: Deleting an Oracle Database Secret in a Hardware Keystore
The ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT statement can delete an Oracle Database secret that is in a hardware keystore.
Example 4-13 shows how to delete a hardware security module password that is stored as a secret in the hardware keystore.
Example 4-13 Deleting an Oracle Database Secret in a Hardware Keystore
ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT 'admin@myhost'
IDENTIFIED BY "psmith:password";In this version, the password for the keystore is in an external store:
ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT 'admin@myhost' IDENTIFIED BY EXTERNAL STORE;
Parent topic: Storing Oracle Database Secrets
Configuring Auto-Login Hardware Security Modules
A hardware security module can be configured to use the auto-login capability.
- About Configuring Auto-Login Hardware Security Modules
An auto-login hardware security module stores the hardware security module credentials in an auto-login keystore. - Configuring an Auto-Login Hardware Security Module
TheADMINISTER KEY MANAGEMENTstatement configures an auto-login hardware security module.
Parent topic: Storing Oracle Database Secrets
About Configuring Auto-Login Hardware Security Modules
An auto-login hardware security module stores the hardware security module credentials in an auto-login keystore.
This configuration reduces the security of the system as a whole. However, this configuration does support unmanned or automated operations and is useful in deployments where automatic re-login of the hardware security module is necessary.
Be aware that executing the query SELECT * FROM V$ENCRYPTION_WALLET will automatically open an auto-login hardware security module. For example, suppose you have an auto-login hardware security module configured. If you close the keystore and query the V$ENCRYPTION_WALLET view, then the output will indicate that a keystore is open. This is because V$ENCRYPTION_WALLET opened up the auto-login hardware and then displayed the status of the auto-login keystore.
To enable the auto-login capability for a hardware security module, you must store the hardware security module credentials in the hardware keystore.
Parent topic: Configuring Auto-Login Hardware Security Modules
Configuring an Auto-Login Hardware Security Module
The ADMINISTER KEY MANAGEMENT statement configures an auto-login hardware security module.
-
Reconfigure the
WALLET_ROOTparameter in theinit.orafile to include the keystore location of the software keystore, if it is not already present.The software keystore location may already be present if the you have previously migrated to using HSM.
For example:
WALLET_ROOT=/etc/ORACLE/WALLETS/orcl
-
Add or update the secret in the software keystore.
The secret is the hardware security module password and the client is the
HSM_PASSWORD.HSM_PASSWORDis an Oracle-defined client name that is used to represent the HSM password as a secret in the software keystore.For example:
ADMINISTER KEY MANAGEMENT ADD SECRET 'user_name:password' FOR CLIENT 'HSM_PASSWORD' TO LOCAL AUTOLOGIN KEYSTORE software_keystore_location WITH BACKUP;
In this example,
software_keystore_locationis the location of the software keystore that you just defined.
At this stage, the next time that a TDE operation executes, the hardware security module auto-login keystore opens automatically.
Related Topics
Parent topic: Configuring Auto-Login Hardware Security Modules
Storing Oracle GoldenGate Secrets in a Keystore
You can store Oracle GoldenGate secrets in Transparent Data Encryption keystores.
- About Storing Oracle GoldenGate Secrets in Keystores
You can use a keystore to store secret keys for tools and external clients such as Oracle GoldenGate. - Oracle GoldenGate Extract Classic Capture Mode TDE Requirements
Ensure that you meet the requirements for Oracle GoldenGate Extract to support Transparent Data Encryption capture. - Configuring Keystore Support for Oracle GoldenGate
You can configure Transparent Data Encryption keystore support for Oracle GoldenGate by using a shared secret for the keystore.
Parent topic: Managing the Keystore and the Master Encryption Key
About Storing Oracle GoldenGate Secrets in Keystores
You can use a keystore to store secret keys for tools and external clients such as Oracle GoldenGate.
The secret key must be a string adhering to Oracle identifier rules. You can add, update, or delete a client secret in an existing keystore. This section describes how to capture Transparent Data Encryption encrypted data in the Oracle GoldenGate Extract (Extract) process using classic capture mode.
TDE support when Extract is in classic capture mode requires the exchange of the following keys:
-
TDE support for Oracle GoldenGate in the classic capture mode of the Extract process requires that an Oracle database and the Extract process share the secret to encrypt sensitive information being exchanged. The shared secret is stored securely in the Oracle database and Oracle GoldenGate domains. The shared secret is stored in the software keystore or the HSM as the database secret.
-
The decryption key is a password known as the shared secret that is stored securely in the Oracle database and Oracle GoldenGate domains. Only a party that has possession of the shared secret can decrypt the table and redo log keys.
After you configure the shared secret, Oracle GoldenGate Extract uses the shared secret to decrypt the data. Oracle GoldenGate Extract does not handle the TDE master encryption key itself, nor is it aware of the keystore password. The TDE master encryption key and password remain within the Oracle database configuration.
Oracle GoldenGate Extract only writes the decrypted data to the Oracle GoldenGate trail file, which Oracle GoldenGate persists during transit. You can protect this file using your site's operating system standard security protocols, as well as the Oracle GoldenGate AES encryption options. Oracle GoldenGate does not write the encrypted data to a discard file (specified with the DISCARDFILE parameter). The word ENCRYPTED will be written to any discard file that is in use.
Oracle GoldenGate does require that the keystore be open when processing encrypted data. There is no performance effect of Oracle GoldenGate feature on the TDE operations.
Parent topic: Storing Oracle GoldenGate Secrets in a Keystore
Oracle GoldenGate Extract Classic Capture Mode TDE Requirements
Ensure that you meet the requirements for Oracle GoldenGate Extract to support Transparent Data Encryption capture.
The requirements are as follows:
-
To maintain high security standards, ensure that the Oracle GoldenGate Extract process runs as part of the Oracle user (the user that runs the Oracle database). That way, the keys are protected in memory by the same privileges as the Oracle user.
-
Run the Oracle GoldenGate Extract process on the same computer as the Oracle database installation.
Parent topic: Storing Oracle GoldenGate Secrets in a Keystore
Configuring Keystore Support for Oracle GoldenGate
You can configure Transparent Data Encryption keystore support for Oracle GoldenGate by using a shared secret for the keystore.
- Step 1: Decide on a Shared Secret for the Keystore
A shared secret for a keystore is a password. - Step 2: Configure Oracle Database for TDE Support for Oracle GoldenGate
TheDBMS_INTERNAL_CLKMPL/SQL package enables you to configure TDE support for Oracle GoldenGate. - Step 3: Store the TDE GoldenGate Shared Secret in the Keystore
TheADMINISTER KEY MANAGEMENTstatement can store a TDE GoldenGate shared secret in a keystore. - Step 4: Set the TDE Oracle GoldenGate Shared Secret in the Extract Process
The GoldenGate Software Command Interface (GGSCI) utility set the TDE Oracle GoldenGate shared secret in the extract process.
Parent topic: Storing Oracle GoldenGate Secrets in a Keystore
Step 1: Decide on a Shared Secret for the Keystore
A shared secret for a keystore is a password.
-
Decide on a shared secret that meets or exceeds Oracle Database password standards.
Do not share this password with any user other than trusted administrators who are responsible for configuring Transparent Data Encryption to work with Oracle GoldenGate Extract.
Related Topics
Parent topic: Configuring Keystore Support for Oracle GoldenGate
Step 2: Configure Oracle Database for TDE Support for Oracle GoldenGate
The DBMS_INTERNAL_CLKM PL/SQL package enables you to configure TDE support for Oracle GoldenGate.
-
Log in to the database instance as user
SYSwith theSYSDBAadministrative privilege.For example
sqlplus sys as sysdba Enter password: password Connected. -
Load the Oracle Database-supplied
DBMS_INTERNAL_CLKMPL/SQL package.For example:
@?/app/oracle/product/12.2/rdbms/admin/prvtclkm.plb
The
prvtclkm.plbfile also enables Oracle GoldenGate to extract encrypted data from an Oracle database. -
Grant the
EXECUTEprivilege on theDBMS_INTERNAL_CLKMPL/SQL package to the Oracle GoldenGate Extract database user.For example:
GRANT EXECUTE ON DBMS_INTERNAL_CLKM TO psmith;
This procedure enables the Oracle database and Oracle GoldenGate Extract to exchange information.
-
Exit SQL*Plus.
Parent topic: Configuring Keystore Support for Oracle GoldenGate
Step 3: Store the TDE GoldenGate Shared Secret in the Keystore
The ADMINISTER KEY MANAGEMENT statement can store a TDE GoldenGate shared secret in a keystore.
-
Set the Oracle GoldenGate-TDE key in the keystore by using the following syntax.
ADMINISTER KEY MANAGEMENT ADD|UPDATE|DELETE SECRET 'secret' FOR CLIENT 'secret_identifier' [USING TAG 'tag'] IDENTIFIED BY keystore_password [WITH BACKUP [USING 'backup_identifier']];
In this specification:
-
secretis the client secret key to be stored, updated, or deleted. Enclose this setting in single quotation marks (' '). -
secret_identifieris an alphanumeric string used to identify the secret key.secret_identifierdoes not have a default value. Enclose this setting in single quotation marks (' '). -
tagis an optional, user-defined description for the secret key to be stored.tagcan be used with theADDandUPDATEoperations. Enclose this setting in single quotation marks (' '). This tag appears in theSECRET_TAGcolumn of theV$CLIENT_SECRETSview. Creating Custom TDE Master Encryption Key Attributes for Reports -
keystore_passwordis the password for the keystore that is configured. -
WITH BACKUPis required in case the keystore was not backed up before theADD,UPDATEorDELETEoperation.backup_identifieris an optional user-defined description for the backup. Enclosebackup_identifierin single quotation marks (' ').
The following example adds a secret key to the keystore and creates a backup in the same directory as the keystore:
ADMINISTER KEY MANAGEMENT ADD SECRET 'some_secret' FOR CLIENT 'ORACLE_GG' USING TAG 'GoldenGate Secret' IDENTIFIED BY password WITH BACKUP USING 'GG backup'; -
-
Verify the entry that you just created.
For example:
SELECT CLIENT, SECRET_TAG FROM V$CLIENT_SECRETS WHERE CLIENT = 'ORACLEGG'; CLIENT SECRET_TAG -------- ------------------------------------------ ORACLEGG some_secret
-
Switch the log files.
CONNECT / AS SYSDBA ALTER SYSTEM SWITCH LOGFILE;
See Also:
-
Creating Custom TDE Master Encryption Key Attributes for Reports for more information about tags
-
Oracle Database Administrator’s Guide for more information about switching log files
-
How Transparent Data Encryption Works with Oracle Real Application Clusters if you are having problems using this procedure in an Oracle Real Application Clusters environment
Parent topic: Configuring Keystore Support for Oracle GoldenGate
Step 4: Set the TDE Oracle GoldenGate Shared Secret in the Extract Process
The GoldenGate Software Command Interface (GGSCI) utility set the TDE Oracle GoldenGate shared secret in the extract process.
-
Start the GGSCI utility.
For example:
ggsci
-
In the GGSCI utility, run the
ENCRYPT PASSWORDcommand to encrypt the shared secret so that it is obfuscated within the Oracle GoldenGate Extract parameter file.ENCRYPT PASSWORD shared_secret algorithm ENCRYPTKEY keyname
In this specification:
-
shared_secretis the clear-text shared secret that you created when you decided on a shared secret for the keystore. This setting is case sensitive. -
algorithmis one of the following values to specify AES encryption:-
AES128 -
AES192 -
AES256
-
-
keynameis the logical name of the encryption key in theENCKEYSlookup file. Oracle GoldenGate uses this name to look up the actual key in theENCKEYSfile.
For example:
ENCRYPT PASSWORD password AES256 ENCRYPTKEY mykey1 -
-
In the Oracle GoldenGate Extract parameter file, set the
DBOPTIONSparameter with theDECRYPTPASSWORDoption.As input, supply the encrypted shared secret and the Oracle GoldenGate-generated or user-defined decryption key.
DBOPTIONS DECRYPTPASSWORD shared_secret algorithm ENCRYPTKEY keyname
In this specification:
-
shared_secretis the clear-text shared secret that you created when you decided on a shared secret for the keystore. This setting is case sensitive. -
algorithmis one of the following values to specify AES encryption:-
AES128 -
AES192 -
AES256
-
-
keynameis the logical name of the encryption key in theENCKEYSlookup file.For example:
DBOPTIONS DECRYPTPASSWORD AACAAAAAAAAAAAIALCKDZIRHOJBHOJUH AES256 ENCRYPTKEY mykey1
-
Related Topics
Parent topic: Configuring Keystore Support for Oracle GoldenGate