Skip to main content
CriticalSecretsOWASP A07:2021CWE-798

How to fix: Oracle Cloud Infrastructure (OCI) credentials in source

Oracle config files (.oci/config), user OCIDs, tenancy OCIDs, and API signing keys (PEM) grant full tenancy access.

Why it matters

Exposed OCI credentials grant full programmatic access to your Oracle Cloud tenancy at the IAM policy level of the compromised user, including compute instances, databases, object storage, and network infrastructure.

Oracle config files (.oci/config), user OCIDs, tenancy OCIDs, and API signing keys (PEM) grant full tenancy access.

How to fix it

  1. 1Delete the compromised API key in OCI Console → Identity → Users → API Keys
  2. 2Create a new key pair and upload only the public key to OCI
  3. 3Move to Instance Principals or Resource Principals to eliminate static credentials

Code examples

Store OCI config securely (never in source)

bash
# Store the private key in a secrets manager, not in source
# Example with HashiCorp Vault:
vault kv put secret/oci private_key=@~/.oci/oci_api_key.pem

# In CI: set as a masked variable, not a config file
export OCI_CLI_KEY_CONTENT="$(vault kv get -field=private_key secret/oci)"

Use Instance Principal (no static credentials needed)

Python
import oci

# Use Instance Principal on OCI compute: no key file needed
signer = oci.auth.signers.InstancePrincipalsSecurityTokenSigner()
object_storage = oci.object_storage.ObjectStorageClient(config={}, signer=signer)

References

Detected automatically by VulnRadar. The check id is secret-oracle-cloud-credentials, stable across every scan so you can filter or diff on it.

See every secrets check

Questions

How severe is Oracle Cloud Infrastructure (OCI) credentials in source?
VulnRadar rates this critical severity in the secrets category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id secret-oracle-cloud-credentials, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Oracle Cloud Infrastructure (OCI) credentials in source map to?
It maps to CWE-798. In the OWASP Top 10 it falls under A07:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for oracle cloud infrastructure (oci) credentials in source

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Oracle Cloud Infrastructure (OCI) credentials in source | VulnRadar