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

Secret rotation docs #14106

Merged
merged 9 commits into from
Feb 19, 2025
Merged

Secret rotation docs #14106

merged 9 commits into from
Feb 19, 2025

Conversation

komalali
Copy link
Member

@komalali komalali commented Feb 19, 2025

Proposed changes

Fixes https://github.com/pulumi/pulumi-service/issues/25530

Unreleased product version (optional)

Related issues (optional)

@pulumi-bot
Copy link
Collaborator


It is a best practice to define a separate environment for your rotated functions, and import them into the environments that require the rotated credentials. This allows you to manage the rotation logic in a single place, and allows for the rotated environment to be versioned separately from the rest of your configuration. Specifically, since a new revision is created on every rotation, you may want to always import the latest version of the rotated environment to ensure that the latest rotated credentials are always used.

Another reason to keep your rotated functions in a separate environment is that an environment containing a rotation function *cannot be rolled back*, since the rotated secrets have been deactivated. By keeping your rotation functions separate, you can ensure that the rest of your configuration can be rolled back to a previous revision if needed.
Copy link
Member

Choose a reason for hiding this comment

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

Rollback is still enabled?

If you are saying rollback is meaningless, then I'd word it differently

Copy link
Member Author

Choose a reason for hiding this comment

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

We should disable rollback completely. But currently it is possible to click rollback - but the provider will not be updated back to the secrets that were valid at the time. We should really just disable this.

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator


If multiple rotation functions are defined in a single environment, it is possible that some fail while others succeed. In these cases, a partial failure will be reported.

To handle partial failures, failed keys can be individually retried using the `esc rotate` command with the `--path` flag. This will allow you to retry the rotation of a specific key without affecting the rotation of other keys in the environment.
Copy link
Member

Choose a reason for hiding this comment

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

did we not ship the retry button?

Copy link
Contributor

Choose a reason for hiding this comment

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

not yet, we have an issue to fast follow on: https://github.com/pulumi/pulumi-service/issues/25970

@@ -11,12 +11,16 @@ menu:
weight: 2
---

Environments can also be composed from other environments.
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that we have exact same blob about importing environments in "Working with Environments" page. I think we should remove it out of there, since we have this separate page, or at least also update it there

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this wasn't addressed in this PR, I added a new issue: #14130

TODO: Add example of retrying a failed key

{{% notes type="warning" %}}
**WARNING** Beware of double rotation in the case of partial failures. If a key is rotated twice, the first rotation will be invalidated and the second rotation will be active. This can lead to unexpected behavior if not handled correctly, for example if the rotated secret has not been updated at the consumer.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
**WARNING** Beware of double rotation in the case of partial failures. If a key is rotated twice, the first rotation will be invalidated and the second rotation will be active. This can lead to unexpected behavior if not handled correctly, for example if the rotated secret has not been updated at the consumer.
**WARNING** Beware of double rotation in case of partial failures. If a key is rotated twice, the first rotation will be invalidated and the second rotation will be active. This can lead to downtime, if the rotated secret has not yet been pulled in by its consumers.

I thought I was the only one who hates articles!

* Add AWS IAM Rotator docs

* fixup
@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@komalali komalali force-pushed the komal/secret-rotation-docs branch from f9c6a0e to ec41218 Compare February 19, 2025 20:15
@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@komalali komalali marked this pull request as ready for review February 19, 2025 22:19
@komalali komalali requested a review from a team as a code owner February 19, 2025 22:19
@pulumi-bot
Copy link
Collaborator

@komalali komalali force-pushed the komal/secret-rotation-docs branch from 384dbf5 to 1732f98 Compare February 19, 2025 22:54
@komalali komalali enabled auto-merge (squash) February 19, 2025 22:56
@komalali komalali disabled auto-merge February 19, 2025 22:57
@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@komalali komalali merged commit 85219dd into master Feb 19, 2025
8 checks passed
@komalali komalali deleted the komal/secret-rotation-docs branch February 19, 2025 23:02
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.

8 participants