Skip to content

docs: Add example for dealing with compromised key#34

Open
fhoekstra wants to merge 5 commits into
getsops:mainfrom
fhoekstra:patch-1
Open

docs: Add example for dealing with compromised key#34
fhoekstra wants to merge 5 commits into
getsops:mainfrom
fhoekstra:patch-1

Conversation

@fhoekstra
Copy link
Copy Markdown

The order of operations in this scenario is very specific and error-prone. It would make sense to document this right here in this project.

I would appreciate any feedback and/or corrections!

The order of operations in this scenario is very specific and error-prone. It would make sense to document this right here in this project.

Signed-off-by: fhoekstra <32362869+fhoekstra@users.noreply.github.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 23, 2026

Deploy Preview for getsops ready!

Name Link
🔨 Latest commit 33533f5
🔍 Latest deploy log https://app.netlify.com/projects/getsops/deploys/6a1688e695bb48000886686e
😎 Deploy Preview https://deploy-preview-34--getsops.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: fhoekstra <32362869+fhoekstra@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I think it is a great idea to have a section on this in the docs. I've added two comments below, which are my personal ones; maybe someone else from @getsops/maintainers might want to comment on them?

Also note that currently there's a large reorganization happening (#31) which conflicts with tihs PR (and in fact with any other PR changing the documentation). I don't know how long it will take @getsops/maintainers to review that PR, so whether it makes sense to merge this one first and rebase the other, or the other way around.

Comment thread content/en/docs/_index.md Outdated
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is generally better to schedule the operations this way, doing it the other way is only a problem in two specific situations:

  1. secret.sops.yaml file is checked in between the two sops calls above;
  2. alternatively, the compromised key is with a cloud provider (AWS, Azure, GCP, HWC, Vault) which is compromised itself, so that the call to encrypt the document key actually stores that document key.

I'm not sure whether this should be mentioned, but it probably makes sense to mention that the resulting file should be checked in after performing the two above steps.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I've added a line about committing and pushing the file after this.
I was thinking of the file getting checked in between those actions (and assuming a public repo etc), I have changed the wording to be more nuanced and added your comment as a footnote

Comment thread content/en/docs/_index.md Outdated
fhoekstra and others added 2 commits May 26, 2026 18:44
Co-authored-by: Felix Fontein <felix@fontein.de>
Signed-off-by: fhoekstra <32362869+fhoekstra@users.noreply.github.com>
…rs and clarify checking in of the updated file.

Signed-off-by: fhoekstra <32362869+fhoekstra@users.noreply.github.com>
@fhoekstra
Copy link
Copy Markdown
Author

Also note that currently there's a large reorganization happening (#31) which conflicts with tihs PR (and in fact with any other PR changing the documentation). I don't know how long it will take @getsops/maintainers to review that PR, so whether it makes sense to merge this one first and rebase the other, or the other way around.

I am interested in this subject right now because of the move to post-quantum encryption. Currently waiting for FluxCD 2.9 to be released, and then a lot of Kubernetes users of SOPS will be looking at moving to post-quantum. I'm looking to do a simple how-to blog post on it either way, it would be nice if I could point at the official documentation for this process.

But I understand there's "always something" and I wouldn't want to slow down the docs improvement project.

Signed-off-by: fhoekstra <32362869+fhoekstra@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants