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

Fix NullPointerException in RotableSecret #100779

Merged
merged 3 commits into from Oct 13, 2023
Merged

Conversation

gwbrown
Copy link
Contributor

@gwbrown gwbrown commented Oct 12, 2023

This commit fixes two things:

  1. RotatableSecret#matches could throw a NullPointerException when the current secret is null but the prior secret is not.
  2. RotatableSecret#checkExpired would not expire a prior secret when checking the same millisecond the prior secret was due to expire.

Both of these would cause intermittent test failures, the first based on randomization and the second based on timing.

Fixes #99759

This commit fixes two things:
1) RotatableSecret#matches could throw a NullPointerException when the current secret is null but the prior secret is not.
2) RotatableSecret#checkExpired would not expire a prior secret when checking the same millisecond the prior secret was due to expire.

Both of these would cause intermittent test failures, the first based on randomization
@gwbrown gwbrown added >bug :Security/Security Security issues without another label v8.11.1 v8.12.0 labels Oct 12, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Oct 12, 2023
@elasticsearchmachine
Copy link
Collaborator

Hi @gwbrown, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@@ -0,0 +1,6 @@
pr: 100779
summary: Fix bugs causing `RotatableSecretTests#testBasicRotation` to fail
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: update summary to 'Fix NullPointerException in RotableSecret'

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this !

@gwbrown gwbrown changed the title Fix bugs causing RotatableSecretTests#testBasicRotation to fail Fix NullPointerException in RotableSecret Oct 12, 2023
@gwbrown gwbrown added the auto-backport-and-merge Automatically create backport pull requests and merge when ready label Oct 12, 2023
@gwbrown
Copy link
Contributor Author

gwbrown commented Oct 12, 2023

@elasticmachine run elasticsearch-ci/part-1

@gwbrown gwbrown merged commit be136c8 into elastic:main Oct 13, 2023
16 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.11

gwbrown added a commit to gwbrown/elasticsearch that referenced this pull request Oct 13, 2023
This commit fixes two things:
1) RotatableSecret#matches could throw a NullPointerException when the current secret is null but the prior secret is not.
2) RotatableSecret#checkExpired would not expire a prior secret when checking the same millisecond the prior secret was due to expire.

Both of these would cause intermittent test failures, the first based on randomization, the second based on timing.
elasticsearchmachine pushed a commit that referenced this pull request Oct 13, 2023
This commit fixes two things:
1) RotatableSecret#matches could throw a NullPointerException when the current secret is null but the prior secret is not.
2) RotatableSecret#checkExpired would not expire a prior secret when checking the same millisecond the prior secret was due to expire.

Both of these would cause intermittent test failures, the first based on randomization, the second based on timing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-and-merge Automatically create backport pull requests and merge when ready >bug :Security/Security Security issues without another label Team:Security Meta label for security team v8.11.1 v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] RotatableSecretTests testBasicRotation failing
3 participants