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
MediumAddress
Compliance, SecurityCompliance 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
Remediation
Using Console
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.
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.
1. Identify Vaults Using Public Endpoints
- Sign in to the OCI Console.
- In the top‑left hamburger menu, go to:
Identity & Security → Vault. - Select the Compartment where your vaults reside.
- 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.
2. Prepare Network for Private Endpoints
You need a VCN and private subnet where the vault private endpoint will live.- In the Console: Networking → Virtual Cloud Networks.
- 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.
- If you don’t have a suitable subnet:
- Create one under the VCN:
- Create Subnet → choose Private and configure CIDR/security accordingly.
- Create one under the VCN:
3. Create a New Vault with a Private Endpoint
- Go to Identity & Security → Vault.
- Click Create Vault.
- Fill in:
- Name: e.g.,
app-prod-vault-private. - Compartment: select appropriate.
- Name: e.g.,
- Under Type:
- Choose Default vault type (or Virtual private vault if your policy requires it).
- Under Endpoint Type (or similar section, name may vary slightly by console version):
- Select Private endpoint.
- 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.
- Click Create Vault.
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.- Open the new vault.
- 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.
- If you use Secrets:
- Go to Secrets → Create Secret.
- Copy values from old secrets or re‑generate them securely.
- 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.
- For volumes or buckets using a customer‑managed key:
- 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.
- Update configuration (environment variables, config files, or Vault SDK usage) to:
6. Validate Private Connectivity
From a compute instance or workload in the same VCN:- Ensure it’s in a subnet that can route to the vault’s private endpoint (subnet / NSG rules allow traffic).
- Run an application test that performs:
Encrypt,Decrypt,Sign,Verify, orGet Secretcalls through the OCI SDK or CLI using the new vault/key/secret OCIDs.
- 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:- In Identity & Security → Vault, open the old (public) vault.
- Ensure:
- No keys or secrets are referenced by any live resources (double‑check services and application configs).
- Optionally schedule key deletion (or rotate and disable usage) as per your retention policy.
- 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
- 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.
- 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.
Using CLI
Using CLI
In OCI, a vault’s endpoint type (PUBLIC vs PRIVATE) cannot be changed after creation. To remediate, you must:
Any rows returned are non-compliant vaults.
Note:
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:
Repeat for all keys in the old vault once you are certain they are no longer used.
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
- Identify public vaults
- Create replacement vaults with PRIVATE endpoints in the correct VCN/subnet
- Recreate/migrate keys
- Point apps/services to the new vault/key OCIDs
- Schedule deletion of the old public vaults
1. Identify vaults using PUBLIC endpoints
2. Create a vault with a PRIVATE endpoint
You need:- VCN OCID
- Subnet OCID (in that VCN, with correct routing to your workloads)
--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:- Get an import job in the new vault (
oci kms management import-job create). - Wrap key material and import using
oci kms management key import-key.
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
5. Disable and then delete the old public vault
Disable and schedule deletion of old keys
Schedule deletion of the old vault
6. (Optional) Confirm compliance via CLI
Re-run the public-vault check:time-of-deletion values for your environment.Using Python
Using Python
In OCI, a Vault’s endpoint type (PUBLIC vs PRIVATE) cannot be changed after creation.
So “remediation” means:
Or use instance/principals config if running on OCI compute/functions.
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:
Because export/import is very specific to your setup (key algorithms, wrapping keys, compliance constraints), in practice you will:
Examples (sketches):Block Volume example:Object Storage Bucket example:Do this for every resource that used keys in the old PUBLIC vault.
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.
So “remediation” means:
- Find all PUBLIC vaults.
- Create equivalent PRIVATE vaults in a subnet with private access.
- Re‑point any dependent resources (keys, services using those keys) to the new vaults.
- (Optionally) schedule deletion of old PUBLIC vaults.
1. Prerequisites
~/.oci/config: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):
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.
-
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:
7. Decommission Old PUBLIC Vaults
After you confirm:- All data is re‑encrypted with keys in private vaults.
- All services use new key OCIDs.
8. Making This an Automated “Monitoring Remediation” Script
Wrap the logic:- List vaults in target compartments.
- Find vaults with
endpoint_type == "PUBLIC". - For each:
- Check if a matching
*-privatevault exists. - If not, create it.
- Log vault and key mappings so you can:
- Manually or automatically run service‑specific updates to re‑point keys.
- Check if a matching
- Optionally send alerts if manual steps are required (e.g., non‑exportable keys).
- 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.
Using Terraform
Using Terraform
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.
