Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions content/en/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,21 @@ You can also specify these options in the `.sops.yaml` config file.
> and `--unencrypted-comment-regex` are mutually exclusive and
> cannot all be used in the same file.

### Rotating secrets after a key in a key group has been compromised

First, remove the key from the key group in `.sops.yaml`, then run the following for each sops-encrypted file (only `secret.sops.yaml` in this example):

``` sh
sops updatekeys secret.sops.yaml
sops rotate --in-place secret.sops.yaml
```

This ensures that *first* the compromised key is removed from the list of keys that has access to the per-file data key, and only *then* rotates the data key. If done in the wrong order, the data key is encrypted with a key that the compromised key still has access to.

Running `sops rotate` periodically is recommended anyways.

Only after this is done, should you start rotating the actual passwords, API keys and other secrets that are encrypted inside `secret.sops.yaml`. Otherwise, if you put in new credentials before completing this step, the compromised key would still have access to those.

## Config file format

This section describes the format of the SOPS config file.
Expand Down