← All articles

Secrets Management Strategy: EKS, ECS, GCP, Vault

Three tabbed folders beside an open blank notebook with an amber bookmark.
Compare credential responsibilities across environments before choosing a shared process.

Key takeaways

  • A secrets management strategy needs four layers: custody, delivery, rotation, and lifecycle governance, and most teams only have the first two.
  • EKS and ECS move and store secret values but leave ownership, expiry dates, and rotation deadlines untracked across providers like Stripe and GitHub.
  • GitLab CI variables can be masked and protected but carry no expiry date or required owner, so long-lived keys persist until someone remembers them.
  • A dedicated vault earns its operational cost when you need dynamic credentials or one delivery path across multiple clouds and SaaS providers.
  • A metadata-only lifecycle inventory tracks owners, expiry dates, and rotation deadlines across platforms without holding secret values, adding no custody risk.

A secrets management strategy needs two layers: where each secret lives (your vault, EKS, ECS, GCP, GitLab CI, or a GitOps repo) and who owns its lifecycle, because no native tool coordinates ownership, expiry, and rotation deadlines across platforms. This guide compares all six side by side, then gives you one decision framework for choosing across them.

What does a secrets management strategy actually need to cover?

A complete secrets management strategy covers four layers: custody (where the secret value lives), delivery (how workloads receive it), rotation (how values change), and lifecycle governance (who owns each credential, when it expires, and what happens next). Most teams running EKS or ECS have the first two and none of the last two.

Custody vs delivery vs rotation vs lifecycle governance

Custody is the vault itself: AWS Secrets Manager, HashiCorp Vault, or Infisical holding the value. Delivery is how a pod or container gets it at runtime, for example mounting secrets through the Secrets Store CSI Driver on EKS instead of baking them into the image. Rotation is the 30/60/90 day policy you set for longer-lived creds and the short-lived creds you issue everywhere else.

Lifecycle governance is the layer nobody owns: which team is responsible for the Stripe key, when that GitHub token expires, and who gets told before it breaks prod. Your vault stores values; it does not track that "Payments platform" owns one key, "Platform engineering" owns another, and both lapse in the same week.

Why a vault alone is not a strategy

A vault answers "where is the secret value?" It cannot answer "who owns this key and what happens when it expires?" That gap is why devs end up with secrets in Postman collections and why expiry still arrives as an incident. Coordination of ownership, expiry, and rotation deadlines across AWS, Stripe, and GitHub is a separate problem; our notes on API key lifecycle management cover it in depth.

How does EKS secrets management work natively?

Kubernetes Secrets and etcd encryption

Kubernetes Secrets store values as objects in etcd. By default, etcd encryption is not enabled, so base64 encoding is the only protection until you turn on an encryption provider (KMS, aescbc, or secretbox) at the cluster level. EKS supports KMS encryption with an AWS KMS key you create and manage. Rotation of the KMS key is a manual task; Kubernetes does nothing on its own.

Secrets Store CSI driver and External Secrets Operator

Two common integrations pull from AWS Secrets Manager instead of storing values in etcd. The Secrets Store CSI driver mounts secrets as volumes at pod start. The External Secrets Operator (ESO) syncs Secrets Manager values into Kubernetes Secrets and keeps them refreshed. Both move the value, not the lifecycle: neither tracks who owns the external secret, when the underlying API key expires, or whether a 30/60/90 day rotation policy is being met.

What EKS still leaves to you

EKS gives you storage and sync mechanics. Ownership, expiry dates, and rotation deadlines across Secrets Manager, Stripe, and GitHub stay in spreadsheets or tribal knowledge, which is exactly the sprawl problem covered in API key management best practices. Metadata-only tracking fills that gap without custody of the secret value.

How does ECS secrets management differ from EKS?

ECS handles secrets at the task definition level instead of the cluster level. You reference AWS Secrets Manager or SSM Parameter Store entries directly in the container definition, and the ECS agent injects them as environment variables at launch. The AWS documentation on specifying sensitive data in ECS task definitions covers the exact syntax and required IAM permissions.

Secrets in task definitions

Each container declares its own secrets block, so a task pulls only what it needs. Values never land in the task definition itself, only ARNs do. The tradeoff: injection happens once at task start, so a rotation mid-task does nothing until the next deploy.

IAM task roles and short-lived creds

Every task runs under a task role, and ECS brokers temporary credentials for AWS API calls automatically. That removes humans from the transport layer for AWS-native access, which is exactly where ECS beats EKS on simplicity. The catch is provider lock-in: Stripe keys and GitHub tokens still need manual handling, and nothing tracks who owns a credential or when its 30/60/90 day rotation deadline lands. KeyGuardRail monitors that metadata layer across providers without holding secret values; see how we handle custody at our trust center.

How does GCP secrets management compare?

Secret Manager basics

GCP Secret Manager stores secret values as versioned resources. Access is governed by IAM bindings, so you grant a service account read on a specific secret rather than a whole vault. Each version is immutable: you add a new version to rotate, and old versions stay until you disable or destroy them.

Rotation notifications and versioning

Secret Manager can publish a rotation notification to a Pub/Sub topic on a schedule you set. The notification does not rotate anything; it tells a subscriber that a deadline is due so your pipeline or script can write the next version. Someone still owns that subscriber, and if it breaks, the expiry passes silently.

Multi-cloud reality: AWS plus GCP

If your fleet is split, AWS Secrets Manager and GCP Secret Manager each track expiry inside their own console, with no shared view of who owns a key or when it is due. That split is where secrets sprawl starts: a Stripe key referenced by both clouds has two half-records and no single rotation deadline. A lifecycle layer that watches metadata only, without taking custody of secret values, gives you one owner and one audit trail per credential across both platforms. We cover that pattern in more depth at how to manage API keys across multiple cloud providers.

What are the options for GitLab CI secrets management?

GitLab CI gives you two native options: CI/CD variables stored in GitLab itself, or a secrets resolver that pulls from an external vault at job runtime. Most teams start with the first and drift into sprawl.

CI/CD variables: masked and protected

Variables can be masked (hidden in job logs) and protected (only exposed on protected branches or tags). Masking hides the value from logs, not from anyone who can edit the pipeline or read a job's environment. Because every variable lives per-project or per-group, with no expiry date and no required owner, a Stripe key pasted in 2023 keeps working until someone remembers to rotate it. This is the classic sprawl vector: dozens of projects, dozens of variables, no lifecycle record anywhere.

Pulling from an external vault in pipelines

The better pattern is storing secrets in Vault, Infisical, or Doppler and having jobs fetch them at runtime via GitLab's secrets resolver or an API call. The vault holds the value; the pipeline holds a reference. But that only solves storage and access. Ownership, rotation deadlines, and expiry tracking still live outside the vault, which is why teams end up rebuilding manual credential rotation tracking in spreadsheets; see our alternatives to manual credential rotation tracking.

How does GitOps secrets management work?

GitOps pushes your desired state into Git, and Git rejects secrets. Plaintext credentials in a repo violate every rotation policy you have, so teams use one of two patterns to reconcile the two.

The encrypted-in-Git pattern: SOPS and sealed-secrets

SOPS encrypts individual values in a YAML file using a cloud KMS key, so the ciphertext is safe to commit while the key lives outside Git. Sealed-secrets takes the same idea for Kubernetes: you encrypt a secret against the cluster's key pair, and only the in-cluster controller can decrypt it. Encrypted values are still static, so expiry dates and ownership live nowhere unless you track them separately.

The pull pattern: External Secrets Operator

External Secrets Operator syncs from a backend like AWS Secrets Manager or GCP Secret Manager into Kubernetes Secrets, so the repo holds references, not values. Backends with rotation hooks help here: GCP Secret Manager can publish rotation notifications via Pub/Sub (docs), which you can wire into a re-sync.

Audit trail implications

Encrypted-in-Git gives you a full change history in git log, but no record of who read a value. The pull pattern inverts that: the backend logs every access, while Git shows only reference changes. Neither tells you which credential is 80 days old or who owns it.

When does HashiCorp Vault (or a dedicated vault) beat native tools?

Criteria: dynamic secrets, multi-cloud, delivery

Judge a dedicated vault on three things: does it issue short-lived creds dynamically, does it cover AWS plus GCP plus SaaS providers from one place, and can it deliver secrets to EKS, ECS, GitLab CI, and GitOps workflows without a different mechanism for each.

Where dedicated vaults win

HashiCorp Vault earns its operational cost when you need dynamic credentials, like database creds generated per-pod instead of long-lived static keys. Infisical and Doppler make sense when one team spans AWS and SaaS providers like Stripe and GitHub and you want one delivery path instead of four. If your rotation policy is "30/60/90 days for anything static," a vault with humans out of the transport layer beats manual rotation in Secrets Manager.

Where they do not

If you are single-cloud, use short-lived IAM roles, and your secrets already live in AWS Secrets Manager, a second vault adds moving parts without removing risk. KeyGuardRail is not a vault and fails the dynamic-creds criterion by design: it monitors credential lifecycle metadata (ownership, expiry, rotation deadlines) across platforms without holding secret values, so it sits alongside whichever vault you keep.

Which approach should you pick? A side-by-side decision framework

The comparison table

PlatformCustodyRotation supportDelivery modelLifecycle gap
EKSAWS Secrets Manager or CSI driverManual or via rotation LambdasEnv vars, mounted filesNo owner or deadline tracking
ECSSecrets Manager, SSM Parameter StoreSame as EKSTask definitionsSame gap
GCP Secret ManagerGCP-nativeVersion-level, manual triggersEnv vars, mounted volumesNo cross-cloud view
GitLab CICI/CD variables with external secrets integrationDepends on external providerJob-level env varsNo expiry visibility in GitLab itself
GitOpsSecrets in cluster or sealedWhatever the underlying vault offersSynced manifestsDrift between repo and reality
HashiCorp VaultCentralizedDynamic secrets, leasesSidecar, agent, APIOwnership lives outside the vault

Decision path by team shape

One cloud, one team: stay native and add a rotation policy doc with named owners. Two clouds plus SaaS keys (Stripe, GitHub): pick one vault as the source of truth and treat native stores as delivery mechanisms. Multiple teams with shared credentials: you need the lifecycle layer — who owns each key, when it expires, when it rotates — because no platform in the table tracks that across the others. That coordination layer is where KeyGuardRail sits: metadata and deadlines only, no secret custody.

How do you coordinate lifecycle across platforms that each manage secrets differently?

Metadata only: tracking expiry without holding values

Your vault stores values. Nothing you run tracks metadata: who owns the Stripe key, when the GitHub token expires, which AWS IAM key is 95 days past its 30/60/90 day rotation policy. That gap is why secrets sprawl survives even after everyone uses Secrets Manager. A metadata-only inventory records expiry dates, owners, and rotation deadlines without ever holding the secret value, so there is no new custody risk.

Assigning owners and rotation deadlines

Every credential gets a named owner ("Payments platform", "Platform engineering") and a rotation deadline. When a deadline approaches, the owner is notified, not a shared channel nobody reads. If a key has no owner, that gap becomes visible instead of silent. This is the audit trail that answers "who owns this key" during an incident or a SOC 2 review.

Where KeyGuardRail fits

KeyGuardRail is credential lifecycle monitoring without secret custody: it tracks expiry and ownership across AWS, Stripe, GitHub, and your vault, while your existing vault keeps storing values. The honest fix, as practitioners put it, is to stop trusting humans as the transport layer. Lifecycle monitoring closes the coordination gap; the vault keeps doing its job.

FAQ

Should I use AWS Secrets Manager or HashiCorp Vault for EKS?

If you are single-cloud on AWS and rely on short-lived IAM roles, Secrets Manager plus the CSI driver or External Secrets Operator is usually enough. Vault earns its operational cost when you need dynamic credentials, such as per-pod database creds, or one delivery path across AWS, GCP, and SaaS providers like Stripe and GitHub.

Is it safe to store secrets in GitLab CI variables?

Partially. Masking hides values from job logs, not from anyone who can edit the pipeline or read a job's environment. Variables carry no expiry date and no required owner, so a Stripe key pasted in 2023 keeps working until someone remembers it. For anything long-lived, fetch from an external vault at job runtime instead.

How often should I rotate API keys and long-lived credentials?

A common policy is 30/60/90 days for anything static, paired with issuing short-lived credentials wherever possible so rotation becomes rare. The harder problem is enforcement: no native platform tracks whether a deadline was met or notifies the owning team, so pick a cadence you can actually monitor and assign named owners.

What is the difference between External Secrets Operator and sealed-secrets?

External Secrets Operator uses a pull pattern: it syncs values from a backend like AWS Secrets Manager into Kubernetes Secrets, and your repo holds references only. Sealed-secrets uses encrypted-in-Git: values are encrypted against the cluster's key pair and committed as ciphertext. The backend logs every access with ESO; Git gives you change history but no read audit trail.

How do I track which credentials are expiring when they live in different platforms?

Use a metadata-only lifecycle inventory: record each credential's owner, expiry date, and rotation deadline without holding the secret value itself. That gives one owner and one audit trail per credential across AWS, Stripe, GitHub, and your vault, with no new custody risk, and surfaces ownerless keys instead of letting them lapse silently.