-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Update DB Static role rotation logic to generate new password if retried password fails #28989
base: main
Are you sure you want to change the base?
Conversation
Build Results: |
@@ -456,6 +458,7 @@ func (b *databaseBackend) setStaticAccount(ctx context.Context, s logical.Storag | |||
Statements: statements, | |||
} | |||
input.Role.StaticAccount.PrivateKey = wal.NewPrivateKey | |||
usedExistingCredential = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also generate a new Private Key credential if one fails? Or should the fix be focussed to password specific?
CI Results: |
@@ -1087,6 +1087,91 @@ func TestBackend_StaticRole_Role_name_check(t *testing.T) { | |||
} | |||
} | |||
|
|||
// TestStaticRole_NewCredentialGeneration verifies that new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love when new tests appear =)
Description
Previously, when a static role rotation failed, we would store the password in the WAL entry. Upon retries, this same stored password would be reused. This leads customers to infinite loop cases where a failing password is infinitely retried.
This PR adds a fix which will generate a new credential and delete the existing WAL entry if it has failed on a retry. This will unblock customers until we can provide them with more control over their password policies so that password rotation failures don't happen as often.
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.