Assigning a Key to an Object Storage Bucket

Assign a Vault master encryption key to an Object Storage bucket.

You can encrypt the data encryption keys that encrypt the objects in a bucket by using your own Vault master encryption key. By default, buckets are encrypted with keys managed by Oracle. For more information, see Object Storage Data Encryption and Overview of Vault
Important

Buckets in a security zone can't use the default encryption key managed by Oracle. You must use your own Vault master encryption key.
    1. On the Buckets list page, select the Object Storage bucket that you want to work with. If you need help finding the list page or the bucket, see Listing Buckets.
    2. On the details page, find Encryption key. and select Assign.
      The Assign master encryption key panel opens.
    3. Enter the following information:
      • Enable bucket key: Enable this option to use the Bucket Key with SSE-KMS. We recommend this setting when using SSE-KMS key to reduce calls from Object Storage to KMS, which lowers PUT and GET latency, and decreases the likelihood of KMS throttling.
      • The Vault compartment and vault that contain the master encryption key you want to use. The current compartment is displayed by default.
      • The master encryption key compartment and master encryption key. The current compartment is displayed by default.
    4. Select Assign or Edit.
  • Use the oci os bucket update command and required parameters to assign a Vault key to a bucket. We recommended that you enable Bucket Key with SSE-KMS because this setting reduces calls from Object Storage to KMS, which lowers PUT and GET latency, and decreases the likelihood of KMS throttling.

    oci os bucket update --name bucket_name --namespace-name namespace_name --kms-key-id kms_key_id --is-bucket-key-enabled true [OPTIONS]

    For example:

    oci os bucket update  --bucket-name MyBucket --namespace-name namespace --kms-key-id ocid1.key.oc1..exampleuniqueID --is-bucket-key-enabled true              
    {
      "data": {
        "acl-group-id": null,
        "approximate-count": null,
        "approximate-size": null,
        "auto-tiering": "Disabled",
        "bucket-scope": "NAMESPACE",
        "compartment-id": "ocid1.tenancy.oc1..exampleuniqueID",
        "created-by": "ocid1.user.oc1..exampleuniqueID",
        "defined-tags": {},
        "etag": "8bac979a-754f-4af5-9625-c1a1079d57c1",
        "freeform-tags": {},
        "id": "ocid1.bucket.oc1.exampleuniqueID",
        "is-bucket-key-enabled": true,
        "is-read-only": false,
        "kms-key-id": "ocid1.key.oc1.exampleuniqueID",
        "metadata": {},
        "name": "MyBucket",
        "namespace": "namespace",
        "object-events-enabled": false,
        "object-level-audit-mode": "Disabled",
        "object-lifecycle-policy-etag": null,
        "public-access-type": "NoPublicAccess",
        "replication-enabled": false,
        "soft-delete-policy": {
          "current-policy": {
            "cool-off-duration": null,
            "restore-duration": null,
            "soft-delete-mode": "Disabled",
            "time-activation": null
          },
          "next-policy": null,
          "time-modified": null
        },
        "storage-tier": "Standard",
        "time-created": "2026-06-17T22:35:38.081000+00:00",
        "versioning": "Disabled"
      },
      "etag": "8bac979a-754f-4af5-9625-c1a1079d57c1"
    }
    

    If you're updating the key, run the same oci os bucket update command with the updated kms_key_id value.

    See Overview of Vault for more details.

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • This task can't be performed using the API.