Re-encrypt to new recipients

Rotate data key to recipients in .sops.yaml without re-encrypting plaintext manually

sops updatekeys secrets.yaml

tool
sops4 commands
tags
sopssecretssecuritygitops

More sops commands

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

    Inject decrypted secrets as env vars for one command; note: nothing hits disk

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

    Set a single nested key without opening an editor; great for scripted rotation

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

    Encrypt only values in place; note: keys stay readable so diffs stay reviewable

all 4 sops commands