Cloud Secrets Management: Rotation Workflows and Access-Control Templates for Vault, AWS Secrets Manager, and Google Secret Manager
secrets managementVaultAWS Secrets ManagerGoogle Secret Managersecret rotationIAMKubernetes secretsTerraform

Cloud Secrets Management: Rotation Workflows and Access-Control Templates for Vault, AWS Secrets Manager, and Google Secret Manager

OOracles Cloud Editorial Team
2026-11-11
8 min read

A practical checklist for rotating and granting access to secrets across Vault, AWS Secrets Manager, and Google Secret Manager.

Secret rotation is only safe when identity, application behavior, deployment automation, and rollback plans are designed together. This guide provides a reusable checklist for Vault, AWS Secrets Manager, and Google Secret Manager, including a comparison table, rotation workflow, CI/CD patterns, infrastructure templates, and post-rotation audit checks.

Overview

A secret is more than a password stored outside the codebase. It has an owner, a source of truth, an access policy, a delivery mechanism, a rotation schedule, and a recovery procedure. A rotation plan that changes the value but does not update applications, workers, caches, or external integrations can create an outage while still appearing successful in the secrets platform.

The safest general pattern is to separate secret administration from secret consumption. Administrators and automation create or rotate values. Applications receive only the values they need, through a workload identity or narrowly scoped machine identity. CI/CD should normally retrieve a secret at runtime or pass it through a protected mechanism rather than writing it into source control, container images, build artifacts, or ordinary logs.

The right implementation depends on the provider and the credential type. A database password that supports two active values can use an overlapping rotation window. A third-party API key that allows only one active value needs a coordinated cutover and a tested rollback. Short-lived credentials may reduce the need for manual rotation, but they still require monitoring and failure handling.

CapabilityVaultAWS Secrets ManagerGoogle Secret Manager
Primary access modelVault policies attached to an authenticated identityIAM permissions on secret resources, usually through a workload roleIAM permissions on secret resources, usually through a service account or workload identity
Rotation approachCan use dynamic secrets, database credential engines, or external automationCan use managed rotation integrations or a custom rotation function, where supportedTypically uses version creation plus external automation and application coordination
VersioningDepends on the secrets engine; key-value storage supports versioned valuesSecret versions and staging labels support controlled promotionSecret versions can be enabled, disabled, or destroyed according to the workflow
Encryption controlVault storage and seal or key-management configurationProvider-managed encryption or a customer-managed KMS keyProvider-managed encryption or a customer-managed key configuration
Best fit to evaluateCentralized policy, dynamic credentials, and multi-environment controlWorkloads already integrated with AWS IAM and deployment servicesWorkloads already integrated with Google Cloud IAM and service identities

This is a design comparison, not a promise that every feature is available in every deployment mode. Confirm the provider's current API, identity integration, Terraform provider behavior, and regional constraints before applying a production change.

Checklist by scenario

Scenario 1: Rotating a database credential

  1. Identify every consumer, including background workers, scheduled jobs, migration tools, replicas, and disaster-recovery environments.
  2. Confirm whether the database accepts two valid credentials during a transition. If it does, create the replacement before revoking the old value.
  3. Create a new secret version or dynamic lease and record its version identifier without recording the secret value.
  4. Update the consumer through its normal deployment path. Prefer a workload identity or mounted secret mechanism over copying the value into a pipeline variable.
  5. Run an authenticated application check that exercises the database path, not merely a health endpoint that does not use the database.
  6. Watch error rates, connection failures, authentication errors, and job queues during the overlap window.
  7. Revoke or disable the previous credential only after all confirmed consumers use the replacement.

Scenario 2: Rotating an API key or signing secret

  1. Check whether the external provider supports multiple active keys or a grace period.
  2. Publish the new value to the secret manager and label it as pending, current, or equivalent in your own change record.
  3. Deploy consumers that can use the new key. For signing secrets, plan how verifiers will accept old and new signatures during the transition.
  4. Test an actual request against a safe endpoint or controlled integration environment.
  5. Revoke the old key only after confirming traffic no longer depends on it. Preserve the audit record, but do not preserve the secret value in tickets or logs.

Scenario 3: Rotating a Kubernetes secret

  1. Determine how the pod receives the value: environment variable, mounted file, CSI integration, sidecar, or an application-level fetch.
  2. Check whether that delivery method refreshes values automatically. Environment variables normally require a new process, so plan a controlled rollout.
  3. Update the secret reference or version, then restart only the workloads that need the new value.
  4. Confirm readiness, authentication, and dependency connectivity after the rollout. Use the Kubernetes Deployment Readiness Checklist for a broader release review.
  5. Verify that the old value is absent from pod specifications, rendered manifests, debug output, and build artifacts.

Scenario 4: Integrating rotation with CI/CD

Give the pipeline identity permission to read only the named secret versions required by that job. Fetch values as late as possible, mask them where the CI system supports masking, and avoid shell tracing. A generic pattern is:

# Pseudocode: use the CI platform's protected identity
secret_ref='payments/database-password'
secret_value=$(secret-cli read --name "$secret_ref" --version 'current')

# Pass through the process environment only when the application requires it
set +x
./migration-command
unset secret_value

For production deployments, consider having the workload retrieve its own secret using its runtime identity. This reduces the number of systems that can read the value and keeps deployment credentials separate from application credentials. Review the broader pipeline design with the CI/CD Pipeline Design Guide.

Starter infrastructure template

The following Terraform-style outline is intentionally provider-specific only where the resource names are familiar. Treat it as a design starter: pin provider versions, inspect generated plans, and adapt IAM or policy syntax to your organization.

# Variables should contain identifiers, not secret values
variable 'secret_name' { type = string }
variable 'workload_identity' { type = string }

# Create the secret container with your selected provider resource
# Store the value through a controlled bootstrap or rotation workflow.

# Grant the workload the narrowest read permission:
# - one secret, not an entire project or account
# - one operation, such as read or access-version
# - one identity, not a shared human credential

# Add an audit rule or alert for unexpected reads, policy changes,
# version destruction, and rotation failures.

For Kubernetes, keep secret references in Helm values or manifests rather than literal values. A chart can expose a secret name, version, or external-secret reference while the actual value remains in the provider. Review the Helm Chart Maintenance Guide before packaging the rotation change.

What to double-check

  • Identity scope: Confirm the runtime identity can read the intended secret but cannot enumerate unrelated secrets, modify policies, or destroy versions.
  • Secret path and version: Check project, account, region, namespace, mount, version label, and environment. A successful read from the wrong location can be harder to detect than a failed read.
  • Application reload behavior: Establish whether the application reads once at startup, reloads a mounted file, or fetches on demand. Test the real behavior rather than relying on platform assumptions.
  • Overlap and rollback: Define how long both credentials remain usable and who can disable the new value if validation fails.
  • Encryption and key policies: If customer-managed encryption is used, verify that the workload and secret-management service can use the required key operations. Secret access and key access are separate permissions in many designs.
  • Audit evidence: Capture timestamps, actor identity, secret identifier, version transition, deployment reference, validation result, and revocation result. Never capture the plaintext value.
  • Observability: Alert on rotation failures and unexpected access, and correlate authentication errors with deployments. The Prometheus and Grafana Monitoring Stack guide can help structure operational dashboards.

Common mistakes

  • Rotating without inventory: Unknown consumers often include one-off scripts, old workers, or recovery jobs. Maintain an owner and consumer list for important secrets.
  • Putting secrets in Terraform state: Some resource arguments and outputs can remain in state even when the value is not visible in the plan. Protect state, restrict access, and use a workflow that minimizes plaintext exposure.
  • Assuming a new version changes running pods: A provider version update does not automatically reload an application. Test the delivery and restart behavior.
  • Revoking first: Immediate revocation may remove the rollback path. Use an overlap when the dependency supports it, then remove the old credential after validation.
  • Using shared human credentials: Shared keys make ownership, least privilege, and audit review difficult. Prefer distinct workload identities.
  • Logging command output: Shell tracing, failed debug statements, and exception payloads can expose values. Add secret-redaction tests to pipeline reviews.
  • Skipping external-provider coordination: Your secret manager can hold a new value, but an external API, database, or signing consumer may still reject it. Treat the dependency's activation and revocation steps as part of the rotation.

When to revisit

Revisit this checklist before seasonal planning cycles, scheduled credential rotations, major platform migrations, and any change to CI/CD or Kubernetes secret delivery. Review it immediately after a security advisory, suspected credential exposure, failed rotation, identity-policy change, or incident involving authentication.

At least quarterly, confirm that provider APIs, Terraform providers, SDKs, CLI commands, IAM roles, KMS or key policies, and Helm integrations still match your implementation. Test one rotation in a non-production environment, then perform a production exercise with an explicit owner, maintenance window, validation query, rollback decision, and evidence location.

Before closing each rotation, mark these items complete: the new value was generated safely; all intended consumers used it; access logs show the expected identity; monitoring showed no unexplained authentication errors; the old value was disabled or revoked; and the runbook records how to recover. Keep this checklist with the service's operational documentation and link it to the deployment or change record so the next rotation begins with verified context rather than guesswork.

Related Topics

#secrets management#Vault#AWS Secrets Manager#Google Secret Manager#secret rotation#IAM#Kubernetes secrets#Terraform
O

Oracles Cloud Editorial Team

DevOps and Cloud Infrastructure Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.