Include Graylog CA into places where we connect to the DataNode (#15925)

* first version adding gl CA

* adding custom trutstore

* fixed SSLContext

* fixed SSLContext for connectivity check

* fix comments

* fixed imports

* reverting altnames tmp change

* reverting altnames tmp change

* fixed preflightconfig, fixed hostname-verifier

* added credentials to target string, set hostname

* added credentials from target string

* only add TrustManager if https is requested

* fixing tests

* add another alt name

* change creation of restBaseUrl

* DatanodeSecuritySetupIT adaptation for stable hostname of the datanode

* trying to fix naming/binding for docker

* adding another alt name

* added s to http

* changing exception

* more debug output

* change test

* change test

* adding debug

* switch back to http

* more debugging

* more debugging

* added exception to retryer

* fixed boolean eval

* going to the next step on FAILED, too

* fixing if clause

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* removed wrong credentials provider

* added name verifying

* fix alt name handling

* removed unneccessary hostname verifier

* reverted DefaultX509TrustManager

* removed link to DefaultX509TrustManager because it's used in different contexts, singleton for SSL related stuff so we don't instantiate it all the time

* full rollback DefaultX509TrustManager

* reverted change on logging

* revert VersionProbe, unnecessary changes

* DatanodeSecuritySetupIT fixed, separated bind address and hostname

* changed to lambda

* changed to lambda

* small refactorings in csrsigner

* added test for CustomCAX509TrustManager

* added binding for CaService into Preflight

* fixing bindings

* fixing bindings

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
This commit is contained in:
Jan Heise
2023-07-21 12:59:55 +02:00
committed by GitHub
parent b423943849
commit 34d5b47d2a
31 changed files with 686 additions and 219 deletions

View File

@@ -28,6 +28,8 @@ import java.util.Map;
public record OpensearchConfiguration(
Path opensearchDir,
Path opensearchConfigDir,
String bindAddress,
String hostname,
int httpPort,
int transportPort,
String authUsername,
@@ -45,6 +47,9 @@ public record OpensearchConfiguration(
config.put("bootstrap.system_call_filter", "false");
}
if (bindAddress != null && !bindAddress.isBlank()) {
config.put("network.host", bindAddress);
}
config.put("http.port", String.valueOf(httpPort));
config.put("transport.port", String.valueOf(transportPort));
if (clusterName != null && !clusterName.isBlank()) {
@@ -75,6 +80,6 @@ public record OpensearchConfiguration(
public HttpHost getRestBaseUrl() {
final boolean sslEnabled = Boolean.parseBoolean(asMap().getOrDefault("plugins.security.ssl.http.enabled", "false"));
return new HttpHost("localhost", httpPort(), sslEnabled ? "https" : "http");
return new HttpHost(hostname(), httpPort(), sslEnabled ? "https" : "http");
}
}