-
Notifications
You must be signed in to change notification settings - Fork 25k
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
fix and unmute FIPS tests #119618
fix and unmute FIPS tests #119618
Conversation
setting 'xpack.monitoring.exporters._http.auth.username', 'monitoring_agent' | ||
setting 'xpack.monitoring.exporters._http.ssl.verification_mode', 'full' | ||
setting 'xpack.monitoring.exporters._http.ssl.certificate_authorities', 'testnode.crt' | ||
keystore 'xpack.monitoring.exporters._http.auth.secure_password', 'x-pack-test-password' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test has been muted for 5+ years... I believe that this is needed due to the changes in secure settings and stricter validation. Should be functionally equivalent.
|
||
@BeforeClass | ||
public static void getKeyStore() { | ||
try { | ||
keyStore = PathUtils.get(SmokeTestMonitoringWithSecurityIT.class.getResource("/testnode.jks").toURI()); | ||
trustStore = PathUtils.get(SmokeTestMonitoringWithSecurityIT.class.getResource("/testnode.crt").toURI()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to enable this to work in FIPS, I need to prefer to use PEM formatting not the java keystore. also fixed the name to call this a trust store, not a key store (so no pass needed).
public void testSettingsFilter() throws IOException { | ||
final Request request = new Request("GET", "/_cluster/settings"); | ||
final Response response = client().performRequest(request); | ||
final ObjectPath path = ObjectPath.createFromResponse(response); | ||
final Map<String, Object> settings = path.evaluate("transient.xpack.monitoring.exporters._http"); | ||
final Map<String, Object> settings = path.evaluate("persistent.xpack.monitoring.exporters._http"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was just an oversite when removing the HLRC
assertThat(handshakeException, throwableWithMessage(containsStringIgnoringCase("subject alternative names"))); | ||
assertThat(handshakeException, throwableWithMessage(containsString(webServer.getHostName()))); | ||
|
||
final Exception handshakeException = expectThrows(Exception.class, () -> clientSocket.getInputStream().read()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bouncy castle throws a different exception with a different stack trace.
@@ -133,7 +132,7 @@ public void testDiagnosticTrustManagerForHostnameVerificationFailure() throws Ex | |||
DiagnosticTrustManager.class.getName(), | |||
Level.WARN, | |||
"failed to establish trust with server at \\[" | |||
+ Pattern.quote(webServer.getHostName()) | |||
+ (inFipsJvm() ? "<unknown host>" : Pattern.quote(webServer.getHostName())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BC JSSE says "unknown host" but JVM's default JSSE says "127.0.0.1"
@elasticsearchmachine run elasticsearch-ci/part-1-fips |
Pinging @elastic/es-security (Team:Security) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thanks for fixing this!
💚 Backport successful
|
Fixes and un-mutes tests associated with FIPS. Most of the fixes are due to differing expected exceptions or log messages when using BouncyCastle as the JCE/JSSE provider. Only test code is changed with this commit. fixes: elastic#49094
Fixes and un-mutes tests associated with FIPS.
Most of the fixes are due to differing expected exceptions or log messages when using BouncyCastle as the JCE/JSSE provider.
Only test code is changed with this commit.
fixes: #49094