Autonomous AI Database (Serverless) - OCI Vault

Autonomous AI Database integrates with OCI Vault to provide data encryption using a customer-managed key (CMK). This integration centralizes key storage and management, which simplifies the overall key lifecycle.

To enable OCI Vault for Autonomous AI Database, complete the following steps.

Note

Note: The customer-managed encryption key option is not available during Autonomous AI Database instance creation. This option is available after the database instance is created.

  • Oracle Autonomous AI Database (Serverless) integration with OCI Vault is available through the OCI Console and OCI CLI.

  • Complete the following steps:

    1. Create an OCI Vault

      For more information, see Create an Oracle Cloud Infrastructure Vault.

    2. Create a Master Encryption Key in the Vault

      For more information, see Create a Master Encryption Key in the Vault.

    3. Create an OCI Dynamic Group

      1. From the OCI console, select Oracle AI Database, and then select Autonomous AI Database.

      2. Select the name of your Autonomous AI Database.

      3. Scroll down to the General information section. Take a note of your Autonomous AI Database Compartment information. This screenshot shows how to obtain your compartment information.

      4. From the navigation menu , select Identity & Security, and then select Compartments.

      5. From the Compartments list, navigate to the compartment validated in the previous step and take a note of the OCID information. This screenshot shows how to obtain your OCID information.

      6. From the navigation menu , select Identity & Security, and then select Domains.

      7. From the Applied filters section, select the Root Compartment and then select the name of your domain. This screenshot shows how to navigate to your domain.

      8. Select the Dynamic groups tab, and then select the Create dynamic group button.

        1. Name: Enter a descriptive name for the group.

        2. Description: Provide a brief description of the dynamic group’s purpose.

        3. Matching Rules: Enter the following statement, replacing ` ` with the compartment **OCID** you noted in the previous step:

          ALL {resource.compartment.id = '<your_Compartment_OCID>'}
        4. Review your information, and then select the Create button.

        This screenshot shows how to create a dynamic group.

    4. Create an OCI Policy

      1. From the navigation menu , select Identity & Security, and then select Policies.

      2. In the Applied Filter section, select the Root Compartment, and then select the Create Policy button.

        1. Name: Enter a descriptive name for the group.

        2. Description: Provide a brief description of the dynamic group’s purpose.

        3. Enable the Show manual editor button, and then enter the following statements. Replace <dynamic-group-name> with the name of the dynamic group created in the previous step, and<your_Compartment_OCID> with your specific compartment OCID:

          Allow dynamic-group <dynamic-group-name> to use vaults in compartment id <your_Compartment_OCID>
          Allow dynamic-group <dynamic-group-name> to use keys in compartment id <your_Compartment_OCID>
          Note

          Note:

          To use customer-managed keys with Autonomous Data Guard with a remote standby, the following policies are required:

        4. Review your information and then select the Create button.

      This screenshot shows how to create a policy.

    5. Modify the Customer Management Key to OCI Vault

      1. From the OCI console, select Oracle AI Database, and then select Autonomous AI Database.

      2. Select the name of your Autonomous AI Database.

      3. Select the More action button, and then select Manage encryption key option. This screenshot shows how to change key management.

      4. From the Manage encryption key page, enter the following information.

        1. Select the Encrypt using a customer-managed key option.

        2. Select Oracle as the Key type.

        3. Select the This tenancy option.

        4. Select the compartment where you created your OCI Vault, then select the Vault that you want to use.

        5. Select the compartment where you created your Master encryption key, then select the key that you want to use.

        6. Select the Save button.

        This screenshot shows how to change key management.

    6. Verify Autonomous AI Database Encryption Method

      1. From the OCI console, select Oracle AI Database, and then select Autonomous AI Database.

      2. Select the name of your Autonomous AI Database.

      3. Select the Autonomous AI Database information tab, scroll down to the Encryption section to view the Encryption key details. You can verify the key used to encrypt your Encryption Key and view the Encryption key OCID of the key. This screenshot shows how to verify the database encryption method.

        Note

        Note: The customer-managed encryption key is stored in OCI Vault, external to the database host. If the customer-managed encryption key is disabled or deleted, the database will be inaccessible.

    Rotate Customer-Managed Encryption Key(s) on Autonomous AI Database with OCI Vault

    To rotate your customer-managed encryption key(s), complete the following steps.

    1. Create a new master encryption key within your OCI Vault. For more information, see Create a Master Encryption Key in the Vault.

    2. From the OCI console, select Oracle AI Database, and then select Autonomous AI Database.

    3. Select the name of your Autonomous AI Database.

    4. Select the More action button, and then select Manage encryption key option.

    5. Select the OCI Vault that contains the key you want to use.

    6. Select a Master Encryption Key that is different from the one currently in use for your Autonomous AI Database instance.

    7. Select the Save button.

      Note

      Note:

  • Oracle Autonomous AI Database (Serverless) integration with OCI Vault is available through the OCI Console and OCI CLI.

  • Oracle Autonomous AI Database Serverless integrates with OCI Vault to provide data encryption by using a customer-managed key (CMK). This integration centralizes key storage and management, which simplifies key lifecycle management.

    Enable OCI Vault Encryption for Oracle Autonomous AI Database Serverless

    To use a customer-managed encryption key, configure Autonomous AI Database Serverless to use an OCI Vault key instead of the default Oracle-managed key.

    After you enable OCI Vault encryption, the OCI API output shows:

    • encryption-key.provider: OCI

    • kms-key-id: the OCI Vault key OCID

    • vault-id: the OCI Vault OCID

    Prerequisites

    1. Use one of the following options:

      • OCI Cloud Shell

      • OCI CLI on macOS

      • OCI CLI on Windows

    2. Confirm that you have permission to:

      1. Read and update the Autonomous AI Database Serverless.

      2. Use or create an OCI Vault.

      3. Use or create an OCI Vault key.

      4. Create or manage Vault replicas if the Autonomous AI Database Serverless has a standby, peer, or clone in another region.

      5. Add or request the required IAM policy for the database service to use the key.

    3. The OCI Vault key must be in the same OCI region as the Autonomous AI Database Serverless.

    4. If the Autonomous AI Database Serverless has a standby, peer, or clone in another region, the Vault must also have a replica in that region.

    5. Set your environment:

      1. Export the variables and replace the values with your environment-specific values:

        export OCI_PROFILE="oci_profile"
        export OCI_REGION="oci_region"
        
        export ADB_OCID="ocid1.autonomousdatabase.oc1...."
        export ADB_COMPARTMENT_OCID="ocid1.compartment.oc1...."
        
        export VAULT_OCID="ocid1.vault.oc1...."
        export KEY_OCID="ocid1.key.oc1...."
      2. If you need to create a new Vault and key, set values for the Vault and key names:

        export VAULT_DISPLAY_NAME="adb-vault"
        export KEY_DISPLAY_NAME="adb-tde-key"

    Complete the following steps:

    1. Use an Existing OCI Vault Key

      1. If you already have an OCI Vault and key, confirm that the variables are set:
      printf 'VAULT_OCID=%s\nKEY_OCID=%s\n' "$VAULT_OCID" "$KEY_OCID"
    2. Create a New OCI Vault and Key

      1. Create the vault:
      export VAULT_OCID=$(oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        kms management vault create \
      
        --compartment-id "$ADB_COMPARTMENT_OCID" \
      
        --display-name "$VAULT_DISPLAY_NAME" \
      
        --vault-type DEFAULT \
      
        --wait-for-state ACTIVE \
      
        --query "data.id" \
      
        --raw-output)
      1. Get the vault management endpoint:
      export VAULT_MANAGEMENT_ENDPOINT=$(oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        kms management vault get \
      
        --vault-id "$VAULT_OCID" \
      
        --query 'data."management-endpoint"' \
      
        --raw-output)
      1. Create an AES key:
      export KEY_OCID=$(oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        kms management key create \
      
        --endpoint "$VAULT_MANAGEMENT_ENDPOINT" \
      
        --compartment-id "$ADB_COMPARTMENT_OCID" \
      
        --display-name "$KEY_DISPLAY_NAME" \
      
        --key-shape '{"algorithm":"AES","length":32}' \
      
        --protection-mode HSM \
      
        --wait-for-state ENABLED \
      
        --query "data.id" \
      
        --raw-output)
      1. Confirm the vault and key values:
      printf 'VAULT_OCID=%s\nKEY_OCID=%s\n' "$VAULT_OCID" "$KEY_OCID"
    3. Confirm or Create a Vault Replica for a Standby or Peer Region

      If the Autonomous AI Database Serverless has a standby database, peer database, or clone in another region, create a Vault replica in that region before you enable OCI Vault encryption.

      1. Confirm whether the Autonomous AI Database Serverless has peer database IDs:
      oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        db autonomous-database get \
      
        --autonomous-database-id "$ADB_OCID" \
      
        --query 'data.{"display-name":"display-name","peer-db-ids":"peer-db-ids"}' \
      
        --output json
      1. If a peer database exists, set the standby or peer region and create the vault replica:
      export VAULT_REPLICA_REGION="oci_standby_or_peer_region"
      
      oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        kms management vault create-vault-replica \
      
        --vault-id "$VAULT_OCID" \
      
        --replica-region "$VAULT_REPLICA_REGION" \
      
        --output json
      1. Validate the vault replica:
      oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        kms management vault list-vault-replicas \
      
        --vault-id "$VAULT_OCID" \
      
        --all \
      
        --output json
      1. If the Vault replica is missing, the Autonomous AI Database Serverless update can fail with the following error:
      The vault does not have a replica. Replicate the vault into the standby or the clone region and retry.
    4. Confirm the IAM Policy

      1. Confirm that OCI IAM allows the database service to use the key. Example policy:
      Allow service database to use keys in compartment <key_compartment_name>
      1. If the vault and key are in a different compartment than the Autonomous AI Database Serverless, scope the policy to the key compartment.
    5. Enable OCI Vault Encryption

      1. Run the following command to enable OCI Vault encryption:
      oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        db autonomous-database update \
      
        --autonomous-database-id "$ADB_OCID" \
      
        --encryption-key "{"provider":"OCI","kmsKeyId":"$KEY_OCID","vaultId":"$VAULT_OCID"}" \
      
        --wait-for-state AVAILABLE \
      
        --force
    6. Validate the Encryption Key

      1. Run the following command to validate the encryption key:
      oci --profile "$OCI_PROFILE" \
      
        --region "$OCI_REGION" \
        db autonomous-database get \
      
        --autonomous-database-id "$ADB_OCID" \
      
        --query 'data.{"display-name":"display-name","lifecycle-state":"lifecycle-state","kms-key-id":"kms-key-id","vault-id":"vault-id","encryption-key":"encryption-key"}' \
      
        --output json
       Expected result:
      
      {
        "display-name": "autonomous_database_name",
        "encryption-key": {
          "provider": "OCI"
        },
        "kms-key-id": "ocid1.key.oc1....",
        "lifecycle-state": "AVAILABLE",
        "vault-id": "ocid1.vault.oc1...."
      }
       `encryption-key.provider` set to `OCI`, a key OCID in `kms-key-id`, and a non-null `vault-id` indicate that the Autonomous AI Database Serverless uses an OCI Vault customer-managed key.
      
  • There is currently no content for this page. Oracle AI Database@Azure team intends to add content here, and this placeholder text is provided until that text is added. The Oracle AI Database@Azure team is excited about future new features, enhancements, and fixes to this product and this accompanying documentation. We strongly recommend you watch this page for those updates.