forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce Transport TLS check on all licenses. (elastic#79602)
Historically, we haven't enabled the transport TLS bootstrap check for trial licenses because: - We wanted to make the experience of trial license users as easy as possible and configuring transport TLS was considered cumbersome. - Trial licenses have a limited lifetime so that minimizes the impact of this potentially insecure configuration. With security on by default project we are: - Enabling security by default for basic and trial licenses - We offer an easy, automated way for users to configure transport TLS - Enabling by default this bootstrap check for basic licenses. It doesn't make much sense for us to enforce the bootstrap check on basic licenses but not on trial and given that the concerns that were driving the original decision are not there or have been partly alleviated, this commit changes our behavior so that we enable the TLS bootstrap check regardless of the license level.
- Loading branch information
Showing
10 changed files
with
118 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
.../plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/TLSLicenseBootstrapCheck.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...lugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/TransportTLSBootstrapCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
package org.elasticsearch.xpack.core.ssl; | ||
|
||
import org.elasticsearch.bootstrap.BootstrapCheck; | ||
import org.elasticsearch.bootstrap.BootstrapContext; | ||
import org.elasticsearch.xpack.core.XPackSettings; | ||
|
||
/** | ||
* Bootstrap check to ensure that if we are starting up with security enabled, transport TLS is enabled | ||
*/ | ||
public final class TransportTLSBootstrapCheck implements BootstrapCheck { | ||
@Override | ||
public BootstrapCheckResult check(BootstrapContext context) { | ||
assert XPackSettings.SECURITY_ENABLED.get(context.settings()) | ||
: "Bootstrap check should not be installed unless security is enabled"; | ||
if (XPackSettings.TRANSPORT_SSL_ENABLED.get(context.settings()) == false) { | ||
return BootstrapCheckResult.failure( | ||
"Transport SSL must be enabled if security is enabled. " | ||
+ "Please set [xpack.security.transport.ssl.enabled] to [true] or disable security by setting " | ||
+ "[xpack.security.enabled] to [false]" | ||
); | ||
} | ||
return BootstrapCheckResult.success(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.