Home/Glossary/Secrets Management

Secrets Management

The practice and tooling for securely storing, accessing, rotating, and auditing sensitive credentials like API keys, passwords, certificates, and encryption keys.

Security OperationsAlso called: "secrets vault", "credential management", "secret storage"

Secrets management centralizes control over sensitive credentials, eliminating hardcoded secrets in code and configuration files while providing audit trails and access controls.

Why it matters

  • Hardcoded secrets in repositories are a leading cause of breaches and compliance failures.
  • Manual secret rotation is error-prone and often neglected, leaving stale credentials exposed.
  • Audit requirements demand knowing who accessed what secrets and when.
  • Dynamic environments require programmatic secret delivery without human intervention.

Key concepts

  • Secret: Any sensitive data that grants access: passwords, API keys, tokens, certificates, encryption keys.
  • Vault/Store: Centralized, encrypted repository for secrets with access control.
  • Dynamic Secrets: Short-lived credentials generated on-demand that auto-expire.
  • Secret Rotation: Automatic or scheduled replacement of credentials to limit exposure windows.
  • Seal/Unseal: Process of encrypting vault contents and controlling when decryption is possible.

Best practices

  • Never commit secrets: Use pre-commit hooks and secret scanning to prevent repository exposure.
  • Principle of least privilege: Grant applications access only to secrets they need.
  • Short-lived credentials: Prefer dynamic secrets that expire quickly over long-lived static credentials.
  • Audit everything: Log all secret access for compliance and incident investigation.
  • Automate rotation: Schedule regular rotation and ensure applications handle credential refresh.
  • Encrypt at rest and in transit: Secrets should never be stored or transmitted in plaintext.

Common tools and platforms

  • HashiCorp Vault: Industry-standard secrets management with dynamic secrets and PKI.
  • AWS Secrets Manager: Managed service with automatic rotation for AWS resources.
  • Azure Key Vault: Microsoft's cloud-native secrets and key management service.
  • Google Secret Manager: GCP's managed secrets storage with IAM integration.
  • CyberArk, Delinea: Enterprise privileged access management platforms.

Integration patterns

  • Environment variables: Inject secrets at runtime without modifying application code.
  • Sidecar injection: Kubernetes sidecars fetch and refresh secrets automatically.
  • Init containers: Retrieve secrets before application starts.
  • Direct API calls: Applications fetch secrets programmatically with authentication.