-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Security: FIPS 140-2 Compliance roadmap #29851
Comments
Original comment by @tvernum: I added a task for CI as well. |
Original comment by @jaymode: I am not sure that we should promote a specific provider for FIPS compliance. We currently depend on bouncycastle for:
I'd like to see if we can remove our dependency on bouncycastle in the running of our plugin and limit our usage to CLI tools. There are a few reasons for this, but my main driver is to keep bouncy castle out of our codebase so the the bcfips provider can be installed by a user. Currently our use of bouncycastle results in jar hell with the bcfips jars. In order to generate certificates, we will need to use bouncycastle as there is no Java API for doing so yet (LINK REDACTED). However for reading PEM files, we could look at other options. |
Original comment by @jkakavas:
Another thing we can't do AFAICT is read pem encoded password protected private key files, as we do almost transparently in |
Original comment by @rjernst: Ioannis, can you expand on what the restriction is in FIPS which disallows On Fri, Feb 2, 2018 at 9:48 AM Ioannis Kakavas EMAIL REDACTED
|
Original comment by @jkakavas:
None, probably I was not clear above. What I meant to say is that we can't read password protected ( that is to say encrypted) private keys stored in PEM format without using BouncyCastle, as we do now, or without reimplementing a large part of LINK REDACTED so that we can deal with PKCS#5 encrypted, PKCS#8 encoded ones. It was meant as an addition to Jay's list as to what we currently depend on BC for. |
Original comment by @jaymode: We currently do not support PKCS#8 encoded PEM files, see this LINK REDACTED. The encrypted private keys that we support is fairly limited in scope: if (parsed instanceof PEMEncryptedKeyPair) {
char[] keyPassword = passwordSupplier.get();
if (keyPassword == null) {
throw new IllegalArgumentException("cannot read encrypted key without a password");
}
// we have an encrypted key pair so we need to decrypt it
PEMEncryptedKeyPair encryptedKeyPair = (PEMEncryptedKeyPair) parsed;
privateKeyInfo = encryptedKeyPair
.decryptKeyPair(new JcePEMDecryptorProviderBuilder().setProvider(BC_PROV).build(keyPassword))
.getPrivateKeyInfo();
} else if (parsed instanceof PEMKeyPair) {
privateKeyInfo = ((PEMKeyPair) parsed).getPrivateKeyInfo();
} else if (parsed instanceof PrivateKeyInfo) {
privateKeyInfo = (PrivateKeyInfo) parsed;
} else if (parsed instanceof ASN1ObjectIdentifier) {
// skip this object and recurse into this method again to read the next object
return innerReadPrivateKey(parser, passwordSupplier);
} else {
String msg = "parsed an unsupported object [" + parsed.getClass().getSimpleName() + "]";
if (parsed instanceof X509CertificateHolder || parsed instanceof X509TrustedCertificateBlock) {
msg = msg + ". Encountered a PEM Certificate while expecting a PEM Key.";
}
throw new IllegalArgumentException(msg);
} @jkakavas what do you think now that the scope of what we'd need to do is fairly contained? |
Original comment by @jkakavas: We do support PKCS#8 private keys, but we do not support PKCS#5 encrypted PKCS#8 private keys in PEM format. We also support PKCS#1 private keys, both PKCS#5 encrypted and not, again in PEM format. So in summary our CertUtils needs to be able to read ( from PEM formatted files):
It narrows the scope, I think the only one that would need extra implementation is the latter, parsing the algorithm and IV from the header. I'll get to it |
Original comment by @jkakavas: FYI BCFIPS 1.0.1. was recently certified : LINK REDACTED |
Closing this as all subtasks have been concluded. |
Original comment by @jkakavas:
The purpose of this Meta issue is to help us keep track of the tasks necessary in order to assert FIPS 140-2 Compliance for Elasticsearch and X-Pack
A short introduction into the needs of FIPS 140-2 Compliance and the initial research into the possibility of becoming compliant is described in LINK REDACTED ( LINK REDACTED and LINK REDACTED )
readFully()
to read exactly the number of bytes we expect from the Stream #28515) Modify Secure Settings keystore in order to only use FIPS 140 approved algorithms.ReloadableX509KeyManager
andReloadableX509TrustManager
withX509KeyManager
,X509TrustManager
respectively and implement reloadability(sic) in a higher layer.org.elasticsearch.license.CryptUtils
,org.elasticsearch.xpack.security.authc.support.Hasher
)FIPS 140-2 Compliant
andFIPS 140-2 Validated
and determine if there is a need to go down the (hard/expensive/long) road of the latter.fips_mode
setting and associated bootstrap checksThe text was updated successfully, but these errors were encountered: