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

VAULT-18307 Vault incorrectly requeues credentials when the rotation period is updated #23528

Merged
merged 14 commits into from
Oct 11, 2023

Conversation

kpcraig
Copy link
Contributor

@kpcraig kpcraig commented Oct 5, 2023

This PR implements a hopefully simple fix where Vault wouldn't reprioritize credentials when the rotation period was changed. Tests are incoming, but I wanted to get some thoughts on a question below:

The question that invites some bikeshedding is how to update the 'next rotation time' period -

Right now, I am doing the simplest case - take the current time, add the rotation period. This is easy to understand, but if, say someone updates a 30 day rotation to a 45 day rotation, could result in a rotation period (just this once) that is much longer than expected.

Another way would be to update the next rotation time to be "as though" it was with the new rotation period, e.g., if you update a 30d period to 45d, we would add only 15 days. If you lowered the rotation period to 20d, we would subtract 10 days. This could result in a priority in the past, which might be unexpected, but would be programmatically fine - the credential would simply rotate the next time the queue is checked.

There are also hybrid approaches possible, of course, trading off complexity with trying to do "what people would want".

@kpcraig kpcraig requested a review from a team as a code owner October 5, 2023 17:03
@vercel
Copy link

vercel bot commented Oct 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
vault ⬜️ Ignored (Inspect) Oct 5, 2023 5:03pm

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Oct 5, 2023
@kpcraig kpcraig changed the title VAULT-18307 Vault correctly requeues credentials when the rotation period is updated VAULT-18307 Vault incorrectly requeues credentials when the rotation period is updated Oct 5, 2023
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Build Results:
All builds succeeded! ✅

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

CI Results:
All Go tests succeeded! ✅

website/content/api-docs/secret/aws.mdx Outdated Show resolved Hide resolved
@schavis schavis added the content-lgtm Content changes approved. Merge depends on code review label Oct 9, 2023
@schavis schavis requested review from schavis and removed request for schavis October 9, 2023 20:58
@schavis
Copy link
Contributor

schavis commented Oct 9, 2023

Content LGTM. Feel free to merge once ENG signs off on the other changes

@schavis schavis requested review from schavis and removed request for schavis October 9, 2023 20:59
is this worth it? who can say
@vinay-gopalan vinay-gopalan self-requested a review October 9, 2023 22:46
@kpcraig kpcraig enabled auto-merge (squash) October 11, 2023 16:57
@kpcraig kpcraig merged commit 30f19b3 into main Oct 11, 2023
104 checks passed
@kpcraig kpcraig deleted the VAULT-18307/aws-static-roles-rotation-fixes branch October 11, 2023 17:07
marcboudreau pushed a commit that referenced this pull request Oct 11, 2023
…guration (#23547)

* CI: Pre-emptively delete logs dir after cache restore in test-collect-reports (#23600)

* Fix OktaNumberChallenge (#23565)

* remove arg

* changelog

* exclude changelog in verifying doc/ui PRs (#23601)

* Audit: eventlogger sink node reopen on SIGHUP (#23598)

* ensure nodes are asked to reload audit files on SIGHUP

* added changelog

* Capture errors emitted from all nodes during proccessing of audit pipelines (#23582)

* Update security-scan.yml

* Listeners: Redaction only for TCP (#23592)

* redaction should only work for TCP listeners, also fix bug that allowed custom response headers for unix listeners

* fix failing test

* updates from PR feedback

* fix panic when unlocking unlocked user (#23611)

* VAULT-18307: update rotation period for aws static roles on update (#23528)

* add disable_replication_status_endpoints tcp listener config parameter

* add wrapping handler for disabled replication status endpoints setting

* adapt disable_replication_status_endpoints configuration parsing code to refactored parsing code

* refactor configuration parsing code to facilitate testing

* fix a panic when parsing configuration

* update refactored configuration parsing code

* fix merge corruption

* add changelog file

* document new TCP listener configuration parameter

* make sure disable_replication_status_endpoints only has effect on TCP listeners

* use active voice for explanation of disable_replication_status_endpoints

* fix minor merge issue

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com>
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
Co-authored-by: Mark Collao <106274486+mcollao-hc@users.noreply.github.com>
Co-authored-by: davidadeleon <56207066+davidadeleon@users.noreply.github.com>
Co-authored-by: kpcraig <3031348+kpcraig@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content-lgtm Content changes approved. Merge depends on code review hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants