From 16d858c768a624deed7a4811f44be850fe0cb251 Mon Sep 17 00:00:00 2001 From: BigPandaToo Date: Tue, 16 Mar 2021 12:55:53 +0100 Subject: [PATCH] Warn users if security is implicitly disabled --- docs/build.gradle | 1 + .../org/elasticsearch/test/rest/yaml/section/DoSection.java | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index 99cf9a23d9992..8e041b07d7d34 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -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" diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java index ea3f5bdc78ac0..29a009332a093 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java @@ -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; @@ -383,7 +379,6 @@ void checkWarningHeaders(final List warningHeaders, final Version master .map(HeaderWarning::escapeAndEncode) .collect(toCollection(LinkedHashSet::new)); final Set allowedRegex = new LinkedHashSet<>(allowedWarningHeadersRegex); - allowedRegex.add(Pattern.compile(SecurityDisabledWarningHeaderPattern)); final Set expected = expectedWarningHeaders.stream() .map(HeaderWarning::escapeAndEncode) .collect(toCollection(LinkedHashSet::new));