diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java index 4ba5e5a2b58e2..a0596e740085e 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java @@ -43,6 +43,7 @@ private DeprecationChecks() { NodeDeprecationChecks::indexThreadPoolCheck, NodeDeprecationChecks::bulkThreadPoolCheck, NodeDeprecationChecks::tribeNodeCheck, + NodeDeprecationChecks::authRealmsTypeCheck, NodeDeprecationChecks::httpPipeliningCheck, NodeDeprecationChecks::discoveryConfigurationCheck, NodeDeprecationChecks::azureRepositoryChanges, diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java index ab0b4329d50d3..1895424e6ce21 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java @@ -98,6 +98,22 @@ static DeprecationIssue tribeNodeCheck(List nodeInfos, List return null; } + static DeprecationIssue authRealmsTypeCheck(List nodeInfos, List nodeStats) { + List nodesFound = nodeInfos.stream() + .filter(nodeInfo -> nodeInfo.getSettings().getGroups("xpack.security.authc.realms").size() > 0) + .map(nodeInfo -> nodeInfo.getNode().getName()) + .collect(Collectors.toList()); + + if (nodesFound.size() > 0) { + return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + "Security realm settings structure changed", + "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html" + + "#include-realm-type-in-setting", + "nodes have authentication realm configuration which must be updated at time of upgrade to 7.0: " + nodesFound); + } + return null; + } + static DeprecationIssue httpPipeliningCheck(List nodeInfos, List nodeStats) { List nodesFound = nodeInfos.stream() .filter(nodeInfo -> nodeInfo.getSettings().hasValue(HttpTransportSettings.SETTING_PIPELINING.getKey())) diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java index 05ee019bac3cb..a791a9e930f76 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java @@ -114,6 +114,17 @@ public void testTribeNodeCheck() { assertSettingsAndIssue(tribeSetting, randomAlphaOfLength(5), expected); } + public void testAuthenticationRealmTypeCheck() { + String realm = randomAlphaOfLengthBetween(1, 20); + String authRealmType = "xpack.security.authc.realms." + realm + ".type"; + DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + "Security realm settings structure changed", + "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html" + + "#include-realm-type-in-setting", + "nodes have authentication realm configuration which must be updated at time of upgrade to 7.0: [node_check]"); + assertSettingsAndIssue(authRealmType, randomAlphaOfLength(5), expected); + } + public void testHttpPipeliningCheck() { DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL, "HTTP pipelining setting removed as pipelining is now mandatory",