SOPS — Secrets OPerationS — is an editor of encrypted files. It was launched at Mozilla in 2015 and donated to the CNCF as a Sandbox project in 2023, where it is now stewarded by its own group of maintainers. SOPS encrypts the values inside structured configuration files — YAML, JSON, dotenv/ENV, INI and raw binary — while leaving the keys, comments and overall file structure in cleartext. The result is a secrets file that is still readable, diffable and reviewable in a pull request: you can see which secrets changed without seeing what they are.
Encryption uses a per-file AES-256-GCM data key, and that data key is wrapped in turn — envelope encryption — by one or more master keys from the backends a team already runs: AWS KMS, GCP KMS, Azure Key Vault, HuaweiCloud KMS, HashiCorp Vault / OpenBao, age and PGP/GnuPG. The wrapped master keys plus a MAC for integrity checking live in a sops metadata block at the foot of the file, so a colleague only needs the file and their own key to decrypt it — no separate key server lookup or shared passphrase.
ENC[AES256_GCM,data:…,iv:…,tag:…,type:str]. --encrypted-regex and --unencrypted-regex decide which parts of a tree are encrypted, so a Kubernetes manifest can encrypt only data/stringData.tree['data']. The format is inferred from the file extension (override with --input-type / --output-type).--kms), GCP KMS (--gcp-kms), Azure Key Vault (--azure-kv), HuaweiCloud KMS (--hckms), HashiCorp Vault / OpenBao and age (--age) or PGP (--pgp). Credentials come from the usual provider environment/CLI configuration, or from SOPS_KMS_ARN, SOPS_PGP_FP, SOPS_GCP_KMS_IDS, SOPS_AGE_KEY_FILE and friends..sops.yaml creation rules — a repo-level config maps a path regex to the keys to use, so secrets/prod/*.yaml is automatically encrypted for the production team keys and new files need no flags at all.sops updatekeys adds or removes recipients without re-encrypting the values, while sops rotate generates a fresh data key and re-encrypts everything, optionally adding and removing master keys in the same pass (--add-age, --rm-pgp, …).lastmodified stamp and the key list are kept in the metadata.--filename-override picks the format and the matching creation rule for piped data, --output and -i (--in-place) control the destination, and sops exec-env / sops exec-file run a command with the decrypted secrets injected as environment variables or as a temporary file that is removed on exit.sops edit transparently decrypts, opens $EDITOR and re-encrypts on save; sops set / sops unset change a single value without an editor; sops filestatus reports whether a file is encrypted; sops publish pushes a file to S3, GCS or Vault with a re-encryption rule.The usual alternative to a secrets manager is to keep credentials out of the repository altogether, which pushes them into an unversioned place that nobody reviews. SOPS takes the opposite approach: the secret stays with the code, in a file that can be committed, diffed and code-reviewed, but the sensitive part of it is unreadable without a key the team already controls. That makes secret changes visible — a pull request shows that db_password was rotated — without exposing the value in the review UI, the git history or a CI log.
Because the master keys live in the cloud KMS or key store that the organisation already pays for and audits, there is no new server to run and no new credential to distribute. Revoking a person’s access is a matter of removing them from the KMS policy or from the creation_rules and running sops updatekeys — no shared passphrase to rotate and no re-deployment of the application.
Secret manifests encrypted in the same repository as the workloads and decrypt them in the pipeline (the basis of tools such as helm-secrets and sealed-secret workflows).config.yaml or .env, so non-secret settings stay greppable.sops exec-env 'deploy.sh' so they never touch the disk.sops rotate re-encrypts all values with a new data key in one command, which is the cheap way to respond to a leaked file.kms:Encrypt and kms:Decrypt on the relevant AWS KMS keys).sops edit, taken from $SOPS_EDITOR or $EDITOR (vim, nano or vi as a fallback).SOPS is free and open source software, released under the Mozilla Public License 2.0. It was created at Mozilla by Adrian Utrilla and Julien Vehent, and is now a Cloud Native Computing Foundation Sandbox project.
Browse more self-hosted security and privacy tooling in the full directory, or submit a tool of your own.