Skip to main content

More Info:

OCI Vaults should use private endpoints (VIRTUAL_PRIVATE vault type). Private endpoints ensure key management operations never traverse the public internet, reducing exposure to interception.

Risk Level

Medium

Address

Compliance, Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Well Architected Framework
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • GDPR
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • PCI
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate “OCI Encryption Vaults Should Use Private Endpoints” using the OCI Console, you need to ensure that each vault is created/available via a virtual private endpoint in a VCN subnet (not via a public endpoint).Below are step‑by‑step instructions.

1. Identify Vaults Using Public Endpoints

  1. Sign in to the OCI Console.
  2. In the top‑left hamburger menu, go to:
    Identity & Security → Vault.
  3. Select the Compartment where your vaults reside.
  4. For each vault:
    • Click the vault name.
    • On the vault details page, check the Endpoint Type:
      • If it shows Public endpoint, this is non‑compliant.
      • If it shows a Private endpoint (with associated VCN/subnet), it’s already compliant.
You cannot convert an existing public vault to private; you must create a new one with a private endpoint and migrate usage.

2. Prepare Network for Private Endpoints

You need a VCN and private subnet where the vault private endpoint will live.
  1. In the Console: Networking → Virtual Cloud Networks.
  2. Ensure you have:
    • A VCN in the same region as the vault.
    • A private subnet (no public IPs) with:
      • Appropriate route table (traffic to Vault goes through OCI Service Gateway or within OCI backbone).
      • Appropriate security lists / NSG rules to allow traffic from your workloads to the private endpoint.
  3. If you don’t have a suitable subnet:
    • Create one under the VCN:
      • Create Subnet → choose Private and configure CIDR/security accordingly.

3. Create a New Vault with a Private Endpoint

  1. Go to Identity & Security → Vault.
  2. Click Create Vault.
  3. Fill in:
    • Name: e.g., app-prod-vault-private.
    • Compartment: select appropriate.
  4. Under Type:
    • Choose Default vault type (or Virtual private vault if your policy requires it).
  5. Under Endpoint Type (or similar section, name may vary slightly by console version):
    • Select Private endpoint.
  6. Configure the private endpoint:
    • VCN: choose the VCN prepared in step 2.
    • Subnet: choose the private subnet.
    • (Optional) Select Network Security Groups for tighter control, if required.
  7. Click Create Vault.
The vault will be provisioned with a private endpoint IP in that subnet.

4. Recreate Keys and Secrets in the New Vault

For encryption monitoring to remain accurate and to keep systems working, you must recreate current crypto material in the new private‑endpoint vault.
  1. Open the new vault.
  2. Under Resources, create new keys:
    • Click Master Encryption Keys → Create Key.
    • Configure Key Shape, Algorithm, Key Size, and Protection Mode to match the old key as closely as possible.
  3. If you use Secrets:
    • Go to Secrets → Create Secret.
    • Copy values from old secrets or re‑generate them securely.
  4. If you used Key Version pinning in clients, plan to reference the new keys/versions accordingly.

5. Update All Dependent Services and Applications

You must repoint every service that uses the old (public endpoint) vault to use the new (private endpoint) vault and keys.Typical locations to update:
  • Block Volumes / Boot Volumes / File Storage / Object Storage:
    • For volumes or buckets using a customer‑managed key:
      • Go to each resource in the Console.
      • Edit encryption settings (if supported) to use the new key in the private‑endpoint vault.
      • If OCI doesn’t let you change the CMK in‑place, you may need to create new resources encrypted with the new key and migrate data.
  • Databases (ADB, DB Systems):
    • Check the Encryption Key / Customer-Managed Key section.
    • Point to the new key in the private vault (if the service supports key switch).
  • OCI Logging, Streaming, Functions, OKE, etc.:
    • For any service configured with a customer‑managed KMS key, update it to reference the new key OCID (from the new vault).
  • Custom Applications:
    • Update configuration (environment variables, config files, or Vault SDK usage) to:
      • Use the new key OCID and/or secret OCID.
      • Ensure the application accesses the vault from within the VCN or over a private connection (FastConnect / VPN), not via public internet.
Verify your monitoring/“Encryption Monitoring” layer now tracks the new vault and keys (e.g., check dashboards, metrics, and alerts for the new vault OCID).

6. Validate Private Connectivity

From a compute instance or workload in the same VCN:
  1. Ensure it’s in a subnet that can route to the vault’s private endpoint (subnet / NSG rules allow traffic).
  2. Run an application test that performs:
    • Encrypt, Decrypt, Sign, Verify, or Get Secret calls through the OCI SDK or CLI using the new vault/key/secret OCIDs.
  3. Confirm:
    • No public internet is required (no public IP necessity, traffic stays within VCN/Service Gateway).
    • Your network flow logs / VPC Flow Logs (if enabled) show traffic only through private paths.

7. Decommission Old Public-Endpoint Vaults

After everything uses the new private‑endpoint vault and you’ve validated:
  1. In Identity & Security → Vault, open the old (public) vault.
  2. Ensure:
    • No keys or secrets are referenced by any live resources (double‑check services and application configs).
  3. Optionally schedule key deletion (or rotate and disable usage) as per your retention policy.
  4. Once sure nothing uses it:
    • Delete keys and secrets (if your policy allows).
    • Delete the vault:
      • On the vault details page, choose Delete.
      • Confirm.

8. Ensure Continuous Monitoring Shows Compliance

  1. Re‑run your OCI Security / Compliance / Encryption Monitoring checks:
    • If using OCI Cloud Guard / Security Zones / custom monitoring, verify the “Vaults should use private endpoints” rule is now passing for the relevant compartments.
  2. Confirm that all new vaults are created going forward with:
    • Endpoint type: Private.
    • Optionally enforce via:
      • Security Zones with policies that disallow public KMS endpoints.
      • IAM / Governance standards and provisioning templates (e.g., Terraform with private endpoints only).

If you provide details of one specific vault (whether it is “default” or “virtual private vault,” region, and what resources use its keys), I can give a targeted sequence of exactly what to click and in what order for that scenario.
In OCI, a vault’s endpoint type (PUBLIC vs PRIVATE) cannot be changed after creation. To remediate, you must:
  1. Identify public vaults
  2. Create replacement vaults with PRIVATE endpoints in the correct VCN/subnet
  3. Recreate/migrate keys
  4. Point apps/services to the new vault/key OCIDs
  5. Schedule deletion of the old public vaults
Below are concise, CLI-focused steps.

1. Identify vaults using PUBLIC endpoints

Any rows returned are non-compliant vaults.

2. Create a vault with a PRIVATE endpoint

You need:
  • VCN OCID
  • Subnet OCID (in that VCN, with correct routing to your workloads)
Note: --network-id should be the subnet OCID for a PRIVATE endpoint.

3. Recreate/migrate keys into the new private vault

List keys in the old (public) vault:
For each key, create a new key in the private vault (no direct “move”; you must recreate):
If you must preserve an existing key’s material, use imported keys:
  1. Get an import job in the new vault (oci kms management import-job create).
  2. Wrap key material and import using oci kms management key import-key.
(Only do this if compliance allows key export/import.)

4. Update applications and OCI services to use the new key/vault

  • For each workload (DB, Object Storage, Block Volumes, Functions, custom apps, etc.), change:
    • Vault OCID (if used directly)
    • Key OCID to the new key in the PRIVATE vault
  • This change is typically in:
    • Service-specific KMS configuration (e.g., DB system TDE config)
    • Application configuration / environment variables
    • Terraform/Ansible/IaC definitions
Verify encryption and normal operation after changes.

5. Disable and then delete the old public vault

Disable and schedule deletion of old keys

Repeat for all keys in the old vault once you are certain they are no longer used.

Schedule deletion of the old vault


6. (Optional) Confirm compliance via CLI

Re-run the public-vault check:
The table should now be empty for compartments in scope of your “Encryption Monitoring” rule.If you share your current vault and key structure (OCIDs, counts, which services use them), I can tailor exact CLI sequences and sample time-of-deletion values for your environment.
In OCI, a Vault’s endpoint type (PUBLIC vs PRIVATE) cannot be changed after creation.
So “remediation” means:
  1. Find all PUBLIC vaults.
  2. Create equivalent PRIVATE vaults in a subnet with private access.
  3. Re‑point any dependent resources (keys, services using those keys) to the new vaults.
  4. (Optionally) schedule deletion of old PUBLIC vaults.
Below is how to do this with the OCI Python SDK for “encryption monitoring” remediation.

1. Prerequisites

~/.oci/config:
Or use instance/principals config if running on OCI compute/functions.

2. Identify Vaults Using PUBLIC Endpoints


3. Ensure You Have a VCN/Subnet for Private Endpoints

The private vault must be reachable in a private subnet.
If you already have a VCN + private subnet, just note the subnet OCID.
Otherwise (one‑time setup, not per vault):
If you already have a private subnet, just set:

4. Create a PRIVATE Vault (Replacement for Each PUBLIC Vault)

Endpoint type is set at creation time:

5. Migrate Keys from Old PUBLIC Vault to New PRIVATE Vault

You cannot move keys directly between vaults; you must:
  • Export key material from the old vault (if exportable).
  • Import into a new key in the private vault.
  • Update dependent services to use the new key OCID.
Example (simplified, exportable keys only):
Because export/import is very specific to your setup (key algorithms, wrapping keys, compliance constraints), in practice you will:
  • For non‑exportable keys:
    Create new keys in the private vault and re‑encrypt application data, DB tablespaces, object storage, etc., with the new keys.
  • For OCI native services (block volumes, database, object storage, etc.):
    Use service‑specific API calls to change the KMS key ID to the new key in the private vault.

6. Update Dependent Services to Use the New PRIVATE Vault Keys

For each service that uses an old key OCID, call its update API with the new key OCID.
Examples (sketches):
Block Volume example:
Object Storage Bucket example:
Do this for every resource that used keys in the old PUBLIC vault.

7. Decommission Old PUBLIC Vaults

After you confirm:
  • All data is re‑encrypted with keys in private vaults.
  • All services use new key OCIDs.
Then:

8. Making This an Automated “Monitoring Remediation” Script

Wrap the logic:
  1. List vaults in target compartments.
  2. Find vaults with endpoint_type == "PUBLIC".
  3. For each:
    • Check if a matching *-private vault exists.
    • If not, create it.
    • Log vault and key mappings so you can:
      • Manually or automatically run service‑specific updates to re‑point keys.
  4. Optionally send alerts if manual steps are required (e.g., non‑exportable keys).
You can run this via:
  • OCI Functions (triggered by Monitoring/Events when a new PUBLIC vault is detected).
  • A scheduled job (OCI DevOps, external CI, cron, etc.).

If you share a specific service (e.g., “Object Storage only” or “Autonomous DB only”), I can give you a concrete Python snippet for updating its KMS key to a vault with a private endpoint.
Changing an existing oci_kms_vault from a public (DEFAULT) vault to VIRTUAL_PRIVATE is a replacement operation: Terraform will show the old vault as destroyed and a new one created; you must recreate keys and re-point any using services to the new vault.For verification, terraform plan should show vault_type set to "VIRTUAL_PRIVATE" and a populated network_endpoint_details block with network_endpoint_type = "VIRTUAL_PRIVATE" on the oci_kms_vault resource.