Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sops: update page #12719

Merged
merged 6 commits into from
May 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 12 additions & 8 deletions pages/common/sops.md
kbdharun marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# sops

> SOPS (Secrets OPerationS): manage secrets.
> SOPS (Secrets OPerationS): a simple and flexible tool for managing secrets.
> More information: <https://github.com/mozilla/sops>.

- Encrypt a file:

`sops -e {{path/to/myfile.json}} > {{path/to/myfile.enc.json}}`
`sops -e {{path/to/file.json}} > {{path/to/file.enc.json}}`

- Decrypt a file to `stdout`:

`sops -d {{path/to/myfile.enc.json}}`
`sops -d {{path/to/file.enc.json}}`

- Rotate data keys for a sops file:
- Update the declared keys in a `sops` file:

`sops -r {{path/to/myfile.enc.yaml}}`
`sops updatekeys {{path/to/file.enc.yaml}}`

- Rotate data keys for a `sops` file:

`sops -r {{path/to/file.enc.yaml}}`

- Change the extension of the file once encrypted:

`sops -d --input-type json {{path/to/myfile.enc.json}}`
`sops -d --input-type json {{path/to/file.enc.json}}`

- Extract keys by naming them, and array elements by numbering them:

`sops -d --extract '["an_array"][1]' {{path/to/myfile.enc.json}}`
`sops -d --extract '["an_array"][1]' {{path/to/file.enc.json}}`

- Show the difference between two sops files:
- Show the difference between two `sops` files:

`diff <(sops -d {{path/to/secret1.enc.yaml}}) <(sops -d {{path/to/secret2.enc.yaml}})`