10 Tools to Manage Kubernetes Secrets Safely

10 tools to manage Kubernetes Secrets safely: encryption at rest, Vault, OpenBao, External Secrets Operator, Secrets Store CSI, Sealed Secrets, SOPS.

Dec 31, 2025 - 15:28
Nov 6, 2026 - 03:47
 0  207
10 Tools to Manage Kubernetes Secrets Safely

The safest way to manage Kubernetes Secrets is to keep the source of truth in a dedicated secrets manager (HashiCorp Vault, OpenBao or a cloud service) and sync or mount values into Pods with External Secrets Operator or the Secrets Store CSI Driver. If secrets must live in Git, encrypt them with Sealed Secrets or SOPS. Always enable encryption at rest and tight RBAC.

This guide compares 10 tools for handling secrets inside and around a Kubernetes cluster. It builds on the security parts of our Kubernetes architecture components guide. If your question is how to keep credentials out of repositories in general, read best practices for storing secrets in Git repositories first. Facts below were checked against kubernetes.io and each vendor's documentation in November 2026.

Key takeaways

  • A Kubernetes Secret is base64-encoded, not encrypted. Anyone who can read the object or the etcd data can read the value.
  • Turn on encryption at rest for Secrets, ideally with a KMS v2 provider, and restrict get, list and watch on Secrets through RBAC.
  • External Secrets Operator syncs values from an external manager into native Secrets. The Secrets Store CSI Driver mounts them as files and can skip native Secrets entirely.
  • Sealed Secrets and SOPS let you commit encrypted secrets to Git for GitOps workflows.
  • HashiCorp Vault moved to the Business Source License in 2023. OpenBao is the open source fork under the Linux Foundation.
  • Rotation only works if applications reload credentials. Plan for restarts or file watching.

What is wrong with plain Kubernetes Secrets?

Kubernetes stores Secret objects in etcd. By default they are only base64-encoded, so kubectl get secret db -o yaml followed by a base64 decode reveals the value to anyone with read access. The Kubernetes documentation lists the minimum steps: enable encryption at rest, configure least-privilege RBAC, restrict which containers mount a Secret, and consider an external secret store. Two more risks are less obvious. Anyone allowed to create a Pod in a namespace can mount any Secret in that namespace, and list or watch permission on Secrets returns their full contents, not just names.

The 10 tools compared

#ToolTypeWhere the secret livesHow Pods get it
1Native Secrets + encryption at rest (KMS v2)Built-inetcd, encryptedEnv vars or volume
2HashiCorp VaultSecrets managerVaultAgent Injector, Vault Secrets Operator or CSI provider
3OpenBaoSecrets manager (open source fork)OpenBaoAgent, CSI or ESO
4External Secrets OperatorSync operatorExternal managerSynced native Secret
5Secrets Store CSI DriverCSI driverExternal managerMounted files (optional sync)
6Sealed SecretsGit encryptionEncrypted in Git, decrypted in clusterNative Secret
7SOPSGit encryptionEncrypted file in GitDecrypted by Flux, Argo CD plugin or helm-secrets
8AWS Secrets ManagerCloud managerAWSESO or CSI provider
9Azure Key VaultCloud managerAzureCSI provider (AKS add-on) or ESO
10Google Cloud Secret ManagerCloud managerGoogle CloudCSI provider (GKE add-on) or ESO

Built-in protection

1. Native Secrets with encryption at rest

Before adding any tool, harden what Kubernetes already gives you. On self-managed clusters, an EncryptionConfiguration file passed to the API server with --encryption-provider-config encrypts Secrets before they reach etcd. The kms provider (KMS v2, stable since Kubernetes 1.29) uses envelope encryption with a key held in an external KMS, so a stolen etcd backup is useless without that key.

apiVersion: apiserver.config.k8s.io/v1
kind: EncryptionConfiguration
resources:
  - resources:
      - secrets
    providers:
      - kms:
          apiVersion: v2
          name: my-kms
          endpoint: unix:///var/run/kmsplugin/socket.sock
      - identity: {}

Managed services handle this for you or offer it as an option: EKS, AKS and GKE all support envelope encryption of Secrets with their cloud KMS. After enabling encryption, rewrite existing Secrets so they are stored encrypted (kubectl get secrets -A -o json | kubectl replace -f -). Combine it with immutable: true for Secrets that should never change, and mount Secrets as files rather than environment variables, since env vars leak more easily into crash dumps and child processes.

Secrets managers

2. HashiCorp Vault

Vault stores static secrets, generates dynamic credentials (for example a database user that expires after an hour), and offers encryption as a service. Its Kubernetes auth method lets Pods log in with their service account token. There are three main ways to deliver secrets to Pods:

  • The Vault Agent Injector, a mutating webhook that adds an agent sidecar which writes secrets to a shared volume, driven by Pod annotations.
  • The Vault Secrets Operator (VSO), which syncs Vault secrets into native Kubernetes Secrets through custom resources.
  • The Vault CSI provider, used with the Secrets Store CSI Driver.

Vault changed from the MPL to the Business Source License in August 2023, and IBM completed its acquisition of HashiCorp in February 2025. Check the license terms if you build a product on it. Vault is powerful but needs operating skill: unsealing, high availability, backups and upgrades. For interview preparation, see our HashiCorp Vault interview questions.

3. OpenBao

OpenBao is a community fork of Vault created after the license change and hosted by the Linux Foundation, under the MPL 2.0. It keeps Vault's API and concepts, including the Kubernetes auth method, so most Vault tooling and knowledge transfers. Choose it if you want Vault's model with an open source license and are comfortable with a younger project. Feature sets have started to diverge from Vault, so check the OpenBao documentation for any feature you rely on.

Delivering external secrets into Pods

4. External Secrets Operator

External Secrets Operator (ESO) is a CNCF project that reads secrets from an external API and writes them into native Kubernetes Secrets. It supports many providers, including AWS Secrets Manager, AWS Parameter Store, Azure Key Vault, Google Secret Manager, Vault, OpenBao, 1Password, Doppler and Infisical. A SecretStore or ClusterSecretStore describes how to authenticate, and an ExternalSecret says which keys to fetch and how often to refresh.

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: db-credentials
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: aws-secrets
    kind: ClusterSecretStore
  target:
    name: db-credentials
  data:
  - secretKey: password
    remoteRef:
      key: prod/shop/db
      property: password

Because the output is a normal Secret, applications need no changes. The trade-off is that the value exists in etcd, so encryption at rest and RBAC still matter. Check the API version your installed ESO release serves, since older releases use v1beta1. ESO fits GitOps well: the ExternalSecret manifest contains no secret value and can be committed. Our post on secret management in GitOps workflows covers that pattern.

5. Secrets Store CSI Driver

The Secrets Store CSI Driver, a Kubernetes SIG Auth subproject, mounts secrets from an external store into a Pod as files using a CSI volume. Provider plugins exist for AWS, Azure, Google Cloud and Vault. A SecretProviderClass defines what to fetch. Secrets are fetched when the Pod starts, and optional rotation can refresh the mounted files. If you do nothing else, the value never becomes a Kubernetes Secret object, which reduces exposure through the API. You can optionally sync to a native Secret when an app needs environment variables.

QuestionExternal Secrets OperatorSecrets Store CSI Driver
OutputNative Kubernetes SecretFiles in a volume (sync optional)
App changesNoneApp reads files, or use sync
Value stored in etcdYesNo, unless sync is enabled
Works when the external store is downYes, last synced valueNew Pods fail to start
Best forGitOps, many teams, env varsMinimizing copies of secrets

Encrypting secrets for Git

6. Sealed Secrets

Sealed Secrets, from Bitnami Labs, runs a controller in the cluster that holds a private key. Developers use the kubeseal CLI with the controller's public key to turn a Secret into a SealedSecret, which is safe to commit. Only the controller can decrypt it into a normal Secret. By default a sealed secret is bound to its name and namespace, so it cannot be copied elsewhere and decrypted.

kubectl create secret generic db --from-literal=password=CHANGE_ME \
  --dry-run=client -o yaml | kubeseal --format yaml > db-sealed.yaml

Back up the controller's sealing keys. If you lose them when rebuilding a cluster, every sealed secret in Git becomes unreadable. Sealed Secrets keeps the source of truth in Git, so rotation still means re-sealing and committing.

7. SOPS

SOPS, a CNCF project, encrypts the values in YAML, JSON, ENV and INI files while leaving keys readable, which keeps Git diffs meaningful. It can use age, PGP, AWS KMS, GCP KMS, Azure Key Vault or Vault Transit for keys. Flux decrypts SOPS files natively during reconciliation. Argo CD needs a plugin, and Helm users often use the helm-secrets plugin. A .sops.yaml file sets which keys encrypt which paths:

creation_rules:
  - path_regex: k8s/prod/.*\.yaml
    encrypted_regex: ^(data|stringData)$
    kms: arn:aws:kms:ap-south-1:111122223333:key/EXAMPLE-KEY-ID

SOPS suits teams that want encrypted config in Git without running a controller. The same practices from our Git secrets guide apply: never commit the decrypted file, and scan commits for leaks.

Cloud secrets managers

8. AWS Secrets Manager

AWS Secrets Manager stores secrets encrypted with AWS KMS, controls access with IAM, and can rotate supported database credentials automatically with Lambda functions. On EKS, Pods get access through IAM roles for service accounts (IRSA) or EKS Pod Identity, then read secrets through ESO or the AWS provider for the Secrets Store CSI Driver. AWS Systems Manager Parameter Store is a lower-cost option for simpler configuration values.

9. Azure Key Vault

Azure Key Vault stores secrets, keys and certificates. AKS offers the Azure Key Vault provider for the Secrets Store CSI Driver as a managed add-on, and Microsoft Entra Workload ID lets Pods authenticate without stored credentials. Key Vault access can be controlled with Azure RBAC, which is easier to audit alongside other Azure permissions.

10. Google Cloud Secret Manager

Google Cloud Secret Manager stores versioned secrets with IAM access control and audit logging. GKE offers a Secret Manager add-on based on the Secrets Store CSI Driver, and Workload Identity Federation for GKE lets Pods use a Google identity without key files. ESO also supports it if you prefer native Secrets.

Which approach should you choose?

SituationRecommended setup
Single cloud, managed KubernetesThat cloud's secrets manager + its CSI add-on or ESO + workload identity
Multi-cloud or on-premisesVault or OpenBao + ESO or the Vault Secrets Operator
GitOps with FluxSOPS with age or a cloud KMS key, or ESO manifests in Git
GitOps with Argo CD, small teamSealed Secrets or ESO
Need short-lived database credentialsVault or OpenBao dynamic secrets
Every clusterEncryption at rest + least-privilege RBAC + audit logging

Practices that apply whatever tool you use

  • Give each workload its own service account and grant it only the secrets it needs. Avoid cluster-wide read access to Secrets.
  • Enable API server audit logging for Secret reads, and alert on unusual access.
  • Rotate on a schedule and immediately after any suspected leak. Our post on when to rotate secrets automatically covers timing.
  • Make applications pick up new values: watch mounted files, or trigger a rolling restart when a Secret changes (for example with a checksum annotation in Helm).
  • Keep secrets out of container images, Helm values committed in plain text and CI logs.
  • Use Pod Security Admission and admission policies to block unexpected Pods that could mount Secrets.

Learn Kubernetes security hands-on

Secrets handling, encryption at rest and RBAC are part of the Certified Kubernetes Security Specialist curriculum. Our CKS training covers them with labs, and the DevSecOps training adds Vault and pipeline secrets. Both run in the classroom in Kharadi, Pune and live online.

Frequently asked questions

Are Kubernetes Secrets encrypted by default?

No. Secrets are base64-encoded and stored in etcd unencrypted unless encryption at rest is configured. Managed services such as EKS, AKS and GKE offer envelope encryption with their KMS, and on self-managed clusters you configure an EncryptionConfiguration.

What is the difference between External Secrets Operator and the Secrets Store CSI Driver?

ESO copies values from an external manager into native Kubernetes Secrets. The CSI driver mounts values as files in the Pod and only creates a Secret if you enable sync. ESO needs no app changes; the CSI driver keeps fewer copies.

Is it safe to commit Sealed Secrets to Git?

Yes. A SealedSecret is encrypted with the controller's public key and can only be decrypted by the controller in the cluster. Back up the controller's private keys, or you will not be able to decrypt them after rebuilding the cluster.

Should I use Sealed Secrets or SOPS?

Sealed Secrets needs a controller and is tied to one cluster's keys. SOPS encrypts files with age, PGP or a cloud KMS and works well with Flux. Pick SOPS for multi-cluster or KMS-based setups, Sealed Secrets for simple single-cluster GitOps.

Is HashiCorp Vault still open source?

No. Vault moved to the Business Source License in August 2023. OpenBao, a Linux Foundation fork under MPL 2.0, is the open source alternative with a compatible API.

Should secrets be environment variables or files?

Files are safer. Environment variables can leak through crash dumps, debug output and child processes, and they do not update without a restart. Mounted files can be refreshed in place.

How do I rotate a secret without downtime?

Update the value in the source store, let ESO or the CSI driver refresh it, and have the app reload the file or trigger a rolling restart. Support old and new credentials briefly during the switch.

Who can read Secrets in a namespace?

Anyone with get, list or watch on Secrets, and anyone who can create Pods there, since a Pod can mount any Secret in its namespace. Restrict both through RBAC.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.