diagram.mmd — flowchart
Cloud Secret Management flowchart diagram

Cloud secret management is the practice of centrally storing, controlling access to, rotating, and auditing sensitive credentials — API keys, database passwords, TLS certificates, and OAuth tokens — in a dedicated secrets store rather than embedding them in code or configuration files.

Hardcoded credentials in source code are one of the most common and critical security vulnerabilities. Secret management services (AWS Secrets Manager, HashiCorp Vault, Google Secret Manager, Azure Key Vault) solve this by treating secrets as first-class managed resources with:

Encrypted storage: Secrets are encrypted at rest using cloud KMS (Key Management Service). The encryption key itself may be customer-managed (CMEK), giving full control over key rotation and access.

Fine-grained access control: IAM policies grant specific roles or service accounts read access to only the secrets they need. A Lambda function's execution role might have secretsmanager:GetSecretValue permission only for the secrets it uses — nothing more.

Automatic rotation: Secrets Manager can rotate database passwords on a schedule (e.g., every 30 days). A rotation Lambda updates the credentials in both the secrets store and the target database atomically. Applications reading the secret on each request automatically receive the new value.

Audit logging: Every GetSecretValue API call is logged to CloudTrail (or equivalent), creating an immutable record of when secrets were accessed, by whom, and from which IP or service.

Workload injection: In Kubernetes, the Secrets Store CSI Driver or a sidecar agent fetches secrets from Vault/Secrets Manager and mounts them as files or environment variables into pod containers at startup — no secrets stored in etcd.

See Cloud IAM Permission Model for how access to secrets is authorized, and Container Deployment Pipeline for how secrets reach containers during deployment.

Free online editor
Edit this diagram in Graphlet
Fork, modify, and export to SVG or PNG. No sign-up required.
Open in Graphlet →

Frequently asked questions

Cloud secret management is the practice of centrally storing, controlling access to, rotating, and auditing sensitive credentials — API keys, database passwords, TLS certificates, and OAuth tokens — in a dedicated secrets store rather than embedding them in code or configuration files.
A rotation function (often a Lambda) is scheduled by the secrets manager to run on a defined cadence. It generates a new credential, updates it in both the secrets store and the target system (e.g., the database) atomically, and verifies the new credential works before removing the old one. Applications that fetch the secret on each request automatically receive the rotated value without redeployment.
Use AWS Secrets Manager when your workloads run predominantly on AWS and you want native integration with RDS rotation, IAM access control, and CloudTrail auditing with minimal operational overhead. Use HashiCorp Vault when you need a cloud-agnostic solution, advanced secret engines (PKI, SSH, database dynamic secrets), fine-grained leasing and revocation, or self-hosted control for compliance requirements.
Hardcoding secrets in source code or Dockerfiles is the most critical mistake — secrets committed to git are effectively compromised. Other failures include storing secrets in environment variables passed through CI/CD pipelines (visible in logs), not enabling audit logging on secret access, and over-sharing secrets across services rather than issuing per-service scoped credentials.
mermaid
flowchart LR SecretOwner([Security Team\nSecret Owner]) --> Store[Secrets Store\nAWS Secrets Manager / Vault] Store --> Encrypt[Encrypt at Rest\nKMS customer-managed key] Store --> AccessPolicy[IAM Access Policies\nrole-based read grants] AccessPolicy --> WorkloadRole[Workload IAM Role\ne.g. Lambda execution role] WorkloadRole --> GetSecret[GetSecretValue API Call] GetSecret --> IAMCheck{IAM Policy\nAllows Access?} IAMCheck -->|Denied| AccessDenied([403 Access Denied]) IAMCheck -->|Allowed| ReturnSecret[Return Decrypted Secret\nover TLS] ReturnSecret --> App([Application Uses Secret\nDB password / API key]) GetSecret --> AuditLog[Audit Log\nCloudTrail / Vault Audit] Store --> Rotation[Automatic Rotation\nscheduled Lambda] Rotation --> UpdateSecret[Update Secret Value\nin store] UpdateSecret --> UpdateDB[Update Credential\nin target database] UpdateDB --> Notify[Notify Dependent Apps\ncache invalidation] Store --> K8sCSI[K8s Secrets Store CSI\nor Vault Agent sidecar] K8sCSI --> MountEnv[Mount as env var\nor file in pod]
Copied to clipboard