Open jkakavas opened 2 years ago
8.3
No response
bundled
N/A
FIPS 140-2 settings validation fails when the keystore type is not explicitly set to bcfks ( or anything else for that matter ).
bcfks
In https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java#L1410 , and only if the x.keystore.type is not explicitly set, we try to infer the type of the keystore ourselves using KeyStoreUtil.inferKeyStoreType. This however only differentiates between PKCS12 and JKS keystores by suffix name and cannot analyze a keystore type detecting this is BCFIPS ( or other ) format.
x.keystore.type
KeyStoreUtil.inferKeyStoreType
PKCS12
JKS
This causes the validation to fail with a
JKS Keystores cannot be used in a FIPS 140 compliant JVM. Please revisit [setting.name:setting_value] settings;
message.
As mentioned a workaround is to explicitly set the type to something( other than JKS) , i.e.
x.y.z.keystore.type: BCFKS
Pinging @elastic/es-security (Team:Security)
Elasticsearch Version
8.3
Installed Plugins
No response
Java Version
bundled
OS Version
N/A
Problem Description
FIPS 140-2 settings validation fails when the keystore type is not explicitly set to
bcfks
( or anything else for that matter ).Steps to Reproduce
In https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java#L1410 , and only if the
x.keystore.type
is not explicitly set, we try to infer the type of the keystore ourselves usingKeyStoreUtil.inferKeyStoreType
. This however only differentiates betweenPKCS12
andJKS
keystores by suffix name and cannot analyze a keystore type detecting this is BCFIPS ( or other ) format.This causes the validation to fail with a
message.
As mentioned a workaround is to explicitly set the type to something( other than JKS) , i.e.
Logs (if relevant)
No response