Skip to main content

Common Misconfiguration

Organizations using multiple cloud providers often expose credentials for all platforms in a single configuration file or codebase.

Vulnerable Example

Secure Example

Detection Patterns

  • AWS Access Key ID: `(AKIA|ASIA)[0-9A-Z]{16}`
  • AWS Secret Access Key: `[A-Za-z0-9/+=]{40}`
  • Azure Client Secret: `[A-Za-z0-9~._-]{30,}`
  • GCP API Key: `AIza[0-9A-Za-z\\-_]{35}`
  • GCP Service Account: `"private_key":\s*"-----BEGIN (RSA|EC) PRIVATE KEY-----"`
  • DigitalOcean Token: `dop_v1_[a-f0-9]{64}`
  • Alibaba Access Key ID: `LTAI[a-zA-Z0-9]{15,}`
  • OCI API Key Fingerprint: `([0-9a-f]{2}:){15}[0-9a-f]{2}`

Prevention Best Practices

  1. Use Native Identity: Use cloud-native identity services (AWS IAM, Azure Managed Identity, GCP ADC/Workload Identity) whenever possible.
  2. Centralize Secrets: Implement a centralized secret management system (like HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, or GCP Secret Manager).
  3. Federate Identity: Use identity federation (like OIDC) to grant external systems access without static keys.
  4. Least Privilege: Enforce least-privilege principles across all cloud environments.
  5. Per-Environment Credentials: Use completely separate credentials and roles for development, staging, and production.
  6. Enable MFA: Enforce Multi-Factor Authentication (MFA) for all human cloud accounts.
  7. Use CSPM: Implement a Cloud Security Posture Management (CSPM) tool to continuously monitor for misconfigurations.
  8. Regular Audits: Conduct regular multi-cloud security audits to find and remediate exposed credentials.