1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 14:02:08 +02:00
tldr/pages/common/sops.md
Vitor Henrique c8f956319f
pages*: simplify page description (#12149)
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-02-14 21:25:13 +01:00

28 lines
719 B
Markdown

# sops
> SOPS (Secrets OPerationS): manage secrets.
> More information: <https://github.com/mozilla/sops>.
- Encrypt a file:
`sops -e {{path/to/myfile.json}} > {{path/to/myfile.enc.json}}`
- Decrypt a file to `stdout`:
`sops -d {{path/to/myfile.enc.json}}`
- Rotate data keys for a sops file:
`sops -r {{path/to/myfile.enc.yaml}}`
- Change the extension of the file once encrypted:
`sops -d --input-type json {{path/to/myfile.enc.json}}`
- Extract keys by naming them, and array elements by numbering them:
`sops -d --extract '["an_array"][1]' {{path/to/myfile.enc.json}}`
- Show the difference between two sops files:
`diff <(sops -d {{path/to/secret1.enc.yaml}}) <(sops -d {{path/to/secret2.enc.yaml}})`