Insecure startup of OS in datanode only if explicitly configured (#16108)

* Insecure startup of OS in datanode only if explicitly configured

* Data node can be started without starting OS, just to be discovered by pre-flight mode
This commit is contained in:
luk-kaminski
2023-08-07 17:21:08 +02:00
committed by GitHub
parent b0882211c0
commit e7025a9da8
8 changed files with 39 additions and 28 deletions

View File

@@ -41,9 +41,7 @@ import org.slf4j.LoggerFactory;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.nio.file.Path;
import java.security.KeyStore;
import java.security.KeyStoreException;
@@ -67,7 +65,7 @@ public class DatanodeSecuritySetupIT {
private Path httpCert;
@BeforeEach
void setUp() throws UnknownHostException {
void setUp() {
String containerHostname = "graylog-datanode-host-" + RandomStringUtils.random(8, "0123456789abcdef");
// first generate a self-signed CA
@@ -86,6 +84,7 @@ public class DatanodeSecuritySetupIT {
// configure transport security
datanodeContainer.withEnv("GRAYLOG_DATANODE_TRANSPORT_CERTIFICATE", "datanode-transport-certificates.p12");
datanodeContainer.withEnv("GRAYLOG_DATANODE_TRANSPORT_CERTIFICATE_PASSWORD", "password");
datanodeContainer.withEnv("GRAYLOG_DATANODE_INSECURE_STARTUP", "false");
// configure http security
datanodeContainer.withEnv("GRAYLOG_DATANODE_HTTP_CERTIFICATE", "datanode-https-certificates.p12");

View File

@@ -73,6 +73,7 @@ public class DatanodeContainerizedBackend {
.withNetwork(network)
.withEnv("GRAYLOG_DATANODE_OPENSEARCH_LOCATION", IMAGE_WORKING_DIR)
.withEnv("GRAYLOG_DATANODE_INSECURE_STARTUP", "true")
.withEnv("GRAYLOG_DATANODE_OPENSEARCH_DATA_LOCATION", IMAGE_WORKING_DIR + "/data")
.withEnv("GRAYLOG_DATANODE_OPENSEARCH_LOGS_LOCATION", IMAGE_WORKING_DIR + "/logs")
.withEnv("GRAYLOG_DATANODE_OPENSEARCH_CONFIG_LOCATION", IMAGE_WORKING_DIR + "/config")