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

@@ -334,7 +334,10 @@ public class Configuration extends BaseConfiguration {
public static final String PATH_API = "api/";
@Parameter(value = "http_bind_address", required = true)
private HostAndPort httpBindAddress = HostAndPort.fromParts("127.0.0.1", GRAYLOG_DEFAULT_PORT);
private HostAndPort httpBindAddress = HostAndPort.fromParts("0.0.0.0", GRAYLOG_DEFAULT_PORT);
@Parameter(value = "hostname", required = true)
private String hostname = Tools.getLocalCanonicalHostname();
@Parameter(value = "http_publish_uri", validator = URIAbsoluteValidator.class)
private URI httpPublishUri;
@@ -550,4 +553,8 @@ public class Configuration extends BaseConfiguration {
private boolean isRegularFileAndReadable(Path path) {
return path != null && Files.isRegularFile(path) && Files.isReadable(path);
}
public String getHostname() {
return hostname;
}
}