2019-12-24 17:04:03 +00:00
|
|
|
# sops
|
|
|
|
|
|
|
|
> SOPS: Secrets OPerationS.
|
2020-02-17 23:08:30 +00:00
|
|
|
> Tool for managing secrets.
|
2019-12-24 17:04:03 +00:00
|
|
|
> More information: <https://github.com/mozilla/sops>.
|
|
|
|
|
|
|
|
- Encrypt a file:
|
|
|
|
|
|
|
|
`sops -e {{path/to/myfile.json}} > {{path/to/myfile.enc.json}}`
|
|
|
|
|
2023-08-09 06:29:02 +01:00
|
|
|
- Decrypt a file to `stdout`:
|
2019-12-24 17:04:03 +00:00
|
|
|
|
|
|
|
`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}})`
|