Skip to content

Add tests for errors thrown by Security Providers#67259

Merged
jkakavas merged 7 commits intoelastic:masterfrom
jkakavas:hasher-tests
Jan 14, 2021
Merged

Add tests for errors thrown by Security Providers#67259
jkakavas merged 7 commits intoelastic:masterfrom
jkakavas:hasher-tests

Conversation

@jkakavas
Copy link
Copy Markdown
Contributor

We handled the exceptions thrown by Security Providers in the case
of short encryption keys in #65464 and this commit adds a couple
of tests to validate that the appropriate exceptions are thrown
when encryption keys derived from short passwords are in use, in
FIPS 140-2 mode.

We handled the exceptions thrown by Security Providers in the case
of short encryption keys in elastic#65464 and this commit adds a couple
of tests to validate that the appropriate exceptions are thrown
when encryption keys derived from short passwords are in use, in
FIPS 140-2 mode.
@jkakavas jkakavas added >test Issues or PRs that are addressing/adding tests v8.0.0 v7.11.1 :Security/FIPS Running ES in FIPS 140-2 mode labels Jan 11, 2021
@jkakavas jkakavas requested a review from BigPandaToo January 11, 2021 15:38
@elasticmachine elasticmachine added the Team:Security Meta label for security team label Jan 11, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

public void testDecryptKeyStoreWithShortPasswordInFips() throws Exception {
assumeTrue("This should run only in FIPS mode", inFipsJvm());
KeyStoreWrapper keystore = KeyStoreWrapper.create();
keystore.save(env.configFile(), "alongenoughpassword".toCharArray());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SHould we add the save when trying to save keystore with a short pwd?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These both use the same code ( KeystoreWrapper#createCipher ) so I considered coverage sufficient. No objections to add one more test if you think it's useful though

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leaving it up to you.
LGTM otherwise

@jkakavas
Copy link
Copy Markdown
Contributor Author

@elasticmachine update branch

@jkakavas
Copy link
Copy Markdown
Contributor Author

@elasticmachine update branch

@jkakavas jkakavas merged commit a37122d into elastic:master Jan 14, 2021
jkakavas added a commit to jkakavas/elasticsearch that referenced this pull request Jan 15, 2021
We handled the exceptions thrown by Security Providers in the case
of short encryption keys in elastic#65464 and this commit adds a couple
of tests to validate that the appropriate exceptions are thrown
when encryption keys derived from short passwords are in use, in
FIPS 140-2 mode.
jkakavas added a commit to jkakavas/elasticsearch that referenced this pull request Jan 15, 2021
We handled the exceptions thrown by Security Providers in the case
of short encryption keys in elastic#65464 and this commit adds a couple
of tests to validate that the appropriate exceptions are thrown
when encryption keys derived from short passwords are in use, in
FIPS 140-2 mode.
jkakavas added a commit that referenced this pull request Jan 15, 2021
We handled the exceptions thrown by Security Providers in the case
of short encryption keys in #65464 and this commit adds a couple
of tests to validate that the appropriate exceptions are thrown
when encryption keys derived from short passwords are in use, in
FIPS 140-2 mode.
jkakavas added a commit that referenced this pull request Jan 15, 2021
We handled the exceptions thrown by Security Providers in the case
of short encryption keys in #65464 and this commit adds a couple
of tests to validate that the appropriate exceptions are thrown
when encryption keys derived from short passwords are in use, in
FIPS 140-2 mode.
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 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants