Integrating TDE with CipherTrust Manager on Oracle 19c
This section outlines the following steps to integrate TDE with the CipherTrust Manager on Oracle 19c:
Configuring Keystore Location
After configuring CAKM for Oracle TDE library with Oracle TDE, you need to configure the keystore location.
In the pfile or spfile, set the software wallet location in the WALLET_ROOT
parameter and wallet type in the TDE_CONFIGURATION
parameter.
Configuring HSM Wallet
This section covers the following topics:
Configuring HSM Wallet on Fresh Setup
Create wallet directory using the following commands:
For Linux
For Windows
Create the
<software_wallet_location>
directory manually.After creating the wallet location, provide Read, Write, and execute permissions on the
<software_wallet_location>
to Oracle user.Set
WALLET_ROOT
parameter in the spfile.Restart the database.
Set
TDE_CONFIGURATION
parameter.Check the existing wallets in the Oracle database. Initially, there will be no wallet. To verify this, execute the following command:
Output:
WRL_TYPE WRL_PARAMETER WALLET_TYPE STATUS HSM UNKNOWN CLOSED Note
In following sample command,
<cm_user:cm_user_password>
represents the NAE user name and its password. NAE user name and password are case-sensitive. They must appear in double-quotes (" ") separated by a colon (:).
NAE user specified in here is the owner of the encryption key created and stored on the CipherTrust Manager.
The CipherTrust Manager GUI displays the generated master encryption key.Connect to the database as
<oracle_db_user>
and open the hardware security module (HSM) keystore.Set the HSM keystore TDE master encryption key.
Check the wallet status by executing the following query:
Output:
WRL_TYPE WRL_PARAMETER WALLET_TYPE STATUS HSM HSM OPEN While using Oracle RAC, repeat the steps from 1 to 6 on the other node(s).
For Column and Tablespace encryption, refer Tasks.
Configuring Manual HSM Wallet to Auto-Login HSM Wallet
After configuring Manual HSM wallet, you can enable Auto-Login. Auto-Login prevents the need to open the wallet each time you restart the database. To enable Auto-Login, follow the steps below:
Create the directory for every database and permit the oracle user to access this directory.
For Linux
For Windows
Create the
<software_wallet_location>
directory manually.After creating the wallet location, provide Read, Write, and execute permissions on the
<software_wallet_location>
to Oracle user.Start new sql session and set
WALLET_ROOT
parameter in spfile.Restart the database.
Set
TDE_CONFIGURATION
parameter.Create the software keystore at the location provided in the spfile file.
Open the software keystore.
Reverse migrate the HSM Wallet to File Wallet.
Add the secret to the software keystore. This secret is the HSM's password and the client is
HSM_PASSWORD
. HSM_PASSWORD is an oracle defined client name that represents the HSM password as a secret in the software keystore.Create Auto-Login.
Restart database to enable Auto-Login.
Set
TDE_CONFIGURATION
parameter.Migrate Auto-Login File Wallet to Auto-Login HSM Wallet.
Confirm HSM Auto-Login is now activated.
Access the data from column encrypted table or tablespace encrypted tables.
When using Oracle RAC, perform all the above steps only on one target instance and have all the other RAC instance(s) shutdown. After following the above steps copy the cwallet.sso file from the configured node to all the other node(s) at the same
<software_wallet_location>
location. After copying cwallet.sso on the other node(s), restart all the other RAC instance(s).
Configuring Manual HSM Wallet with PDB in United Mode
Note
Whenever you restart any of the databases, you must run alter pluggable command as shown below:ALTER PLUGGABLE DATABASE <pdb_name>/<ALL> OPEN READ WRITE;
• Do not configure HSM Auto-Login for CBD until you generate the master key for pluggable database (PDB) (All PDBs in case multiple PDBs are using TDE). After generating the master key for all PDBs, you can configure the CDB for Auto-Login and it will work for all PDBs as well.
• To plug a PDB from one CDB to another, simply unplug the PDB from one Container and plug into another Container Database and open the wallet in PDB. It would start working.
To configure an HSM wallet with a PDB in United mode:
Configure Keystore Location using the following command:
Open the PDB in read-write mode.
Grant the administrator privilege to
pdbuser
.Set
TDE_CONFIGURATION
parameter.Open the HSM wallet in CDB and PDB.
Set the HSM master encryption key in CDB and PDB.
Log into the targeted PDB and create encrypted tablespace and table.
For Column and Tablespace encryption, refer Tasks.
Configuring Auto-login HSM Wallet with PDB
To enable Auto-Login with PDB, you need to enable Auto-Login in the container database only. Once you enable Auto-Login in CDB, it would automatically work for PDB. To configure Auto-Login in CDB, follow the below steps:
Create the directory for every database and permit the oracle user to access this directory.
Set
WALLET_ROOT
to software location parameter in the spfile and restart the database.Set
TDE_CONFIGURATION
parameter in pfile and spfile.Create the software keystore at the location provided in the spfile.
Open the software keystore.
Reverse migrate HSM Wallet to File Wallet.
Add the secret to the software keystore. This secret is the HSM's password and the client is
HSM_PASSWORD
. HSM_PASSWORD is an oracle defined client name that represents the HSM password as a secret in the software keystore.Create Auto-Login.
Restart the database.
Set
TDE_CONFIGURATION
parameter.Migrate Auto-Login File Wallet to Auto-Login HSM Wallet.
Check the wallet status.
Connect to the PDB.
Check the wallet status and access the data from the encrypted tablespace and tables.
When using Oracle RAC, perform all the above steps only on one target instance and have all the other RAC instance shutdown.
After all the above steps are completed copy the
cwallet.sso
file from the configured target node to all the other node(s) at the/tde location. After copying cwallet.sso
, start all other RAC instance(s) and open the PDB.
Migrating from Software Wallet to HSM Wallet
This section covers the following topics:
Migrating Manual Software Wallet to HSM Wallet
You can migrate the already configured software-based wallet to HSM wallet. If you have a software wallet configured already, wallet information will look like below:
Output:
WRL_TYPE | WRL_PARAMETER | WALLET_TYPE | STATUS |
---|---|---|---|
FILE | <software_wallet_location> | PASSWORD | OPEN |
To migrate a software wallet to an HSM wallet:
Set
TDE_CONFIGURATION
parameter.Run the command to migrate the key from the software wallet to the HSM wallet.
When using Oracle RAC, it is recommended to perform all the above steps only on one target instance and have all the other RAC instance shutdown down.
After all the above steps are completed copy the ewallet.p12 file from the configured target node to all the other node(s) at the
/tde location. Restart all other RAC instance(s).
Migrating Manual Software Wallet to Auto-Login HSM Wallet
You can migrate the already configured manual software-based wallet to Auto-Login HSM wallet. If you have a software wallet configured already, wallet information will look like below:
Check the wallet status:
Output:
WRL_TYPE WRL_PARAMETER WALLET_TYPE STATUS FILE <software_wallet_location>
PASSWORD OPEN Add the secret to the software keystore. This secret is the HSM's password and the client is
HSM_PASSWORD
.HSM_PASSWORD
is an oracle defined client name that represents the HSM password as a secret in the software keystore.You must include the
<cm_user:cm_user_password>
andHSM_PASSWORD
in single quotes. It will not work if you do not do this.Create a new Auto-Login keystore using the password of the Oracle software wallet.
Restart the database and check the wallet status.
Set
TDE_CONFIGURATION
parameter and verify.Migrate the manual software wallet to Auto-Login HSM wallet.
Create new MEK on CM
Access the data from the encrypted tablespace and tables.
When using Oracle RAC, after follwoing the above steps copy the
cwallet.sso
file from the configured node to all the other node(s) at the same location. After copyingcwallet.sso
on the other node(s), restart the database.
Migrating Auto-Login Software Wallet to Auto-Login HSM Wallet
You can directly migrate a software-based Auto-Login enabled wallet to an Auto-Loginenabled HSM wallet. If you have a software wallet configured already, the content of the spfile
file and wallet information will have the following structure:
Output:
WRL_TYPE | WRL_PARAMETER | WALLET_TYPE | STATUS |
---|---|---|---|
FILE | <software_wallet_location> | AUTOLOGIN | OPEN |
Rename or move the
cwallet.sso
file from the location specified above to any other location.Restart the database and open the software keystore.
Add the secret to the software keystore. This secret is the HSM's password and the client is
HSM_PASSWORD
.HSM_PASSWORD
is an oracle defined client name that represents the HSM password as a secret in the software keystore.You must include the
<cm_user:cm_user_password>
andHSM_PASSWORD
in single quotes. It will not work if you do not do this.Create a new Auto-Login keystore using the password of the Oracle software wallet.
Restart the database and check the wallet status.
Set
TDE_CONFIGURATION
parameter.Migrate the Auto-Login software wallet to Auto-Login HSM wallet.
Create new MEK on CM.
Access the data from the encrypted tablespace and tables.
When using Oracle RAC, after following the above steps copy the
cwallet.sso
file from the configured node to all the other node(s) at the same location. After copyingcwallet.sso
on the other node(s), restart the database.
Migrating Software Wallet to HSM Wallet in PDB
If you are using PDB with software wallet, you can migrate to an HSM wallet. Your spfile
file and wallet status for both CDB and PDB will have the following structure:
CDB:
Output:
WRL_TYPE | WRL_PARAMETER | WALLET_TYPE | STATUS |
---|---|---|---|
FILE | <software_wallet_location> | PASSWORD | OPEN |
PDB:
Output:
WRL_TYPE | WRL_PARAMETER | WALLET_TYPE | STATUS |
---|---|---|---|
FILE | PASSWORD | OPEN |
Set
TDE_CONFIGURATION
parameter and verify.Migrate both CDB and PDB to HSM wallet and set the encryption key.
Check the wallet status.
Restart the database, login with CDB and open the wallet.
Note
After restarting any of the databases, you must run alter pluggable command as shown below:
ALTER PLUGGABLE DATABASE <pdb_name>/<ALL> OPEN READ WRITE;
Log on to the PDB and open the wallet. HSM wallet will open and retrieve the data from the encrypted tables.
When using Oracle RAC, perform all the above steps only on one target instance and have all the other RAC instance shutdown down.
After all the above steps are completed copy the ewallet.p12 file from the configured target node to all the other node(s) at the
/tde location. Restart all other RAC instance(s) and open the PDB.
Migrating Auto-Login File Wallet with PDB to Auto-Login HSM Wallet with PDB
You can directly migrate a software-based Auto-Login enabled wallet to an Auto-Login enabled HSM wallet. If you have a software wallet configured already, the content of the spfile
file and wallet information will have the following structure:
Output:
WRL_TYPE | WRL_PARAMETER | WALLET_TYPE | STATUS |
---|---|---|---|
FILE | <software_wallet_location> | AUTOLOGIN | OPEN |
Rename or move the
cwallet.sso
file from the location specified above to any other location.Restart the database and open the software keystore.
Set the
TDE_CONFIGURATION
parameter.Migrate the Software wallet to HSM wallet.
Check the wallet status.
Set the master encryption key for the HSM keystore.
Closed the HSM keystore.
Set the
TDE_CONFIGURATION
parameter.Open keystore for all PDBs.
Add the secret to the software keystore. This secret is the HSM's password and the client is
HSM_PASSWORD
.HSM_PASSWORD
is an oracle defined client name that represents the HSM password as a secret in the software keystore.You must include the
<cm_user:cm_user_password>
andHSM_PASSWORD
in single quotes. It will not work if you do not do this.Create a new Auto-Login keystore using the password of the Oracle software wallet.
Set the
TDE_CONFIGURATION
parameter.Restart the database.
Open the PDB in read-write mode.
Check Wallet status.
Connect to the PDB.
Check Wallet status.
(This step is applicable to Oracle RAC.) After running the above steps on the source node, perform the following steps on all the destination nodes.
Rename the existing cwallet.sso file.
Copy the cwallet.sso file from the source node to the destination node in the cluster at the same location.
Restart the database on the destination node.
Open the PDB in Read-Write mode.
Migrating Back from HSM Wallet to Software Wallet
If you want to switch from an HSM keystore to a software keystore then you can use reverse migration of the keystore.
Note
It is recommended to keep the HSM. Earlier backup files may rely on TDE master encryption keys present in the HSM.
Set
TDE_CONFIGURATION
parameter.Log on to the database instance as a user who has been granted the
ADMINISTER KEY MANAGEMENT
orSYSKM
privilege.Run Reverse Migration command.
After you complete the reverse migration, you do not need to restart the database or manually reopen the software keystore.
When using Oracle RAC, perform all the above steps only on one target instance and have all the other RAC instance shutdown.
After all the above steps are completed copy the ewallet.p12 file from the configured target node to all the other node(s) at the
/tde location. Restart all other RAC instance(s) and open wallet.