Encrypt a file in place with age

Encrypt only the values in place; keys stay readable, so diffs are still easy to review.

SOPS_AGE_RECIPIENTS=age1<id> sops -e -i secrets.yaml

tool
sops4 commands
tags
sopssecretssecuritygitops

More sops commands

  • sops updatekeys secrets.yaml

    Update the file's recipients to match .sops.yaml and re-encrypt the data key for them, without decrypting the file by hand.

  • sops exec-env secrets.enc.yaml 'terraform apply'

    Pass decrypted secrets as env variables to one command; nothing is written to disk.

  • sops --set '["db"]["password"] "s3cr3t"' secrets.enc.yaml

    Set one nested key without opening an editor; handy for scripted secret rotation.

all 4 sops commands