18. Vault and attaching keys to Block Volume - CloudDarsh/OracleCloud GitHub Wiki

Vault

OCI Vault is an encryption management service that stores and manages encryption keys and secrets to securely access resources.

Creating a Vault

Click on Create Vault

image

Select the Compartment in which we have to create the vault, and click on Create Vault.

YouTube Thumbnail - 2025-04-07T112709 256

image

Creating a Key

Now once the vault is created then we have to create a key, so click on the created vault and go inside.

image

Now, while creating a key , we get 2 options for protection mode(HSM,Software)

Where a key is stored and processed depends on its protection mode.

In key shape also we have three options but usually we go with AES.

dnerw (1620 x 1020 px)

Key created

image

Attaching the key to Block Volume

Now we have to attach the new key created by us to the block volume.

Go to our existing block volume and click on assign

image

Now select the vault which we created and the key and assign it.

Untitled design (4)

We might get a error like this while assigning the key , this error means we this compartment where we have our block volume , does not have the permission to manage keys, so we have to create a policy to give this permission.

Untitled design (5)

Creating a Policy for Permission to attach the key to Block Volume

Now we have to go to Identity and Security --> Policy --> Create Policy.

image

Now we have to write the policy and create it.

image

Once the policy is created, now we have to try to assign the key to the block volume.

Now we can see that the key is assigned to the Block Volume.

image

By time to time as per requirement , we have to rotate the keys for security purpose.

So the steps to rotate the key are -->

We have to go the vault created --> Go the key --> Rotate Key

image

image

image

image