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

[Test] Adjust assertions ReloadSecureSettings test for FIPS jvm #66965

Merged
merged 2 commits into from
Jan 5, 2021

Conversation

ywangd
Copy link
Member

@ywangd ywangd commented Jan 5, 2021

When the JVM is configured to be in FIPS mode, the reload security settings API returns a different error message that is specific to FIPS when given an empty password. This PR adjust the assertions so that they are matched correspondingly.

Resolves: #66880

@ywangd ywangd added >test Issues or PRs that are addressing/adding tests v8.0.0 v7.12.0 v7.11.1 :Security/FIPS Running ES in FIPS 140-2 mode labels Jan 5, 2021
@elasticmachine elasticmachine added the Team:Security Meta label for security team label Jan 5, 2021
@elasticmachine
Copy link
Collaborator

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

equalTo("Provided keystore password was incorrect"),
equalTo("Keystore has been corrupted or tampered with")));
assertThat(ObjectPath.eval("reload_exception.type", node), equalTo("security_exception"));
if (inFipsJvm()) {
Copy link
Member

@jkakavas jkakavas Jan 5, 2021

Choose a reason for hiding this comment

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

The "keystore is tampered with" is also thrown in fips, see #57050

Copy link
Member Author

Choose a reason for hiding this comment

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

For this specific case, i.e. empty password, the error message should always be
Error generating an encryption key from the provided password because it is generated without even reading the keystore file as opposed to other error messages. With this being said, I like @tvernum's suggestion as well. So we are settled here.

…csearch/password_protected_keystore/ReloadSecureSettingsWithPasswordProtectedKeystoreRestIT.java

Co-authored-by: Tim Vernum <[email protected]>
@ywangd ywangd requested a review from tvernum January 5, 2021 00:56
Copy link
Contributor

@tvernum tvernum left a comment

Choose a reason for hiding this comment

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

LGTM

@ywangd
Copy link
Member Author

ywangd commented Jan 5, 2021

@albertzaharovits @BigPandaToo I added more people as reviewers since I wasn't sure who would be around to help it out. But I really just need one approval for this simple change. Given @tvernum has approved it, I am going to merge it without further delay. Thanks!

@ywangd ywangd merged commit c5be873 into elastic:master Jan 5, 2021
ywangd added a commit to ywangd/elasticsearch that referenced this pull request Jan 5, 2021
…tic#66965)

When the JVM is configured to be in FIPS mode, the reload security settings API
returns a different error message that is specific to FIPS when given an empty
password. This PR adjust the assertions so that they are matched
correspondingly.

Co-authored-by: Tim Vernum <[email protected]>
ywangd added a commit to ywangd/elasticsearch that referenced this pull request Jan 5, 2021
…tic#66965)

When the JVM is configured to be in FIPS mode, the reload security settings API
returns a different error message that is specific to FIPS when given an empty
password. This PR adjust the assertions so that they are matched
correspondingly.

Co-authored-by: Tim Vernum <[email protected]>
ywangd added a commit that referenced this pull request Jan 5, 2021
…) (#66966)

When the JVM is configured to be in FIPS mode, the reload security settings API
returns a different error message that is specific to FIPS when given an empty
password. This PR adjust the assertions so that they are matched
correspondingly.

Co-authored-by: Tim Vernum <[email protected]>
ywangd added a commit that referenced this pull request Jan 5, 2021
…) (#66967)

When the JVM is configured to be in FIPS mode, the reload security settings API
returns a different error message that is specific to FIPS when given an empty
password. This PR adjust the assertions so that they are matched
correspondingly.

Co-authored-by: Tim Vernum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Security/FIPS Running ES in FIPS 140-2 mode Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests v7.11.1 v7.12.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReloadSecureSettingsWithPasswordProtectedKeystoreRestIT failures in fips mode
5 participants