OpenSearch/x-pack
Ioannis Kakavas 12ba9e3e16
Gracefully handle exceptions from Security Providers (#65464) (#65554)
In certain situations, such as when configured in FIPS 140 mode,
the Java security provider in use might throw a subclass of
java.lang.Error. We currently do not catch these and as a result
the JVM exits, shutting down elasticsearch.

This commit attempts to address this by catching subclasses of Error
that might be thrown for instance when a PBKDF2 implementation
is used from a Security Provider in FIPS 140 mode, with the password
input being less than 14 bytes (112 bits).

- In our PBKDF2 family of hashers, we catch the Error and
throw an ElasticsearchException while creating or verifying the
hash. We throw on verification instead of simply returning false
on purpose so that the message bubbles up and the cause becomes
obvious (otherwise it would be indistinguishable from a wrong
password).
- In KeyStoreWrapper, we catch the Error in order to wrap and re-throw 
a GeneralSecurityException with a helpful message. This can happen when 
using any of the keystore CLI commands, when the node starts or when we 
attempt to reload secure settings.
- In the `elasticsearch-users` tool, we catch the ElasticsearchException that
the Hasher class re-throws and throw an appropriate UserException.

Tests are missing because it's not trivial to set CI in fips approved mode
right now, and thus any tests would need to be muted. There is a parallel
effort in #64024 to enable that and tests will be added in a followup.
2020-11-26 17:04:34 +02:00
..
dev-tools
docs [DOCS] Fix obsolete Slack setup info (#57834) (#65447) 2020-11-24 12:44:46 -05:00
license-tools Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00
plugin Gracefully handle exceptions from Security Providers (#65464) (#65554) 2020-11-26 17:04:34 +02:00
qa Add support for data stream APIs in transport client. (#65484) 2020-11-25 10:23:02 +01:00
snapshot-tool Fix Broken Exception Handling in Snapshot Cleanup Tool (#63243) 2020-10-05 16:50:47 +02:00
test Disable composePull task on idp-fixture project due to error (#62510) 2020-09-17 08:55:47 -07:00
transport-client Replace compile configuration usage with api (7.x backport) (#58721) 2020-06-30 15:57:41 +02:00
NOTICE.txt
README.md
build.gradle Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00

README.md

Elastic License Functionality

This directory tree contains files subject to the Elastic License. The files subject to the Elastic License are grouped in this directory to clearly separate them from files licensed under the Apache License 2.0.