Skip to content

Commit

Permalink
Warn users if security is implicitly disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
BigPandaToo committed Mar 16, 2021
1 parent 6b56c8d commit 16d858c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ testClusters.matching { it.name == "integTest"}.configureEach {
keystorePassword 'keystore-password'
}

setting 'xpack.security.enabled', 'false'
// enable regexes in painless so our tests don't complain about example snippets that use them
setting 'script.painless.regex.enabled', 'true'
setting 'path.repo', "${buildDir}/cluster/shared/repo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@
*
*/
public class DoSection implements ExecutableSection {
private final String SecurityDisabledWarningHeaderPattern = "Elasticsearch built-in security features are not enabled, your cluster may " +
"be accessible without authentication. Read https:\\/\\/www\\.elastic\\.co\\/guide\\/en\\/elasticsearch\\/reference" +
"\\/(\\d+\\.)(\\d+)(\\.\\d+)?\\/get-started-enable-security\\.html for more information";

public static DoSection parse(XContentParser parser) throws IOException {
String currentFieldName = null;
XContentParser.Token token;
Expand Down Expand Up @@ -383,7 +379,6 @@ void checkWarningHeaders(final List<String> warningHeaders, final Version master
.map(HeaderWarning::escapeAndEncode)
.collect(toCollection(LinkedHashSet::new));
final Set<Pattern> allowedRegex = new LinkedHashSet<>(allowedWarningHeadersRegex);
allowedRegex.add(Pattern.compile(SecurityDisabledWarningHeaderPattern));
final Set<String> expected = expectedWarningHeaders.stream()
.map(HeaderWarning::escapeAndEncode)
.collect(toCollection(LinkedHashSet::new));
Expand Down

0 comments on commit 16d858c

Please sign in to comment.