diff --git a/config/opensearch.yml.example b/config/opensearch.yml.example index 014e2224c0..3144e1ab2a 100644 --- a/config/opensearch.yml.example +++ b/config/opensearch.yml.example @@ -40,7 +40,7 @@ plugins.security.roles_mapping_resolution: MAPPING_ONLY # Specify the default password for the admin user # Note: This setting is required for using the default admin user account -plugins.security.authcz.admin.password: +plugins.security.bootstrap.admin.password: ############## REST Management API configuration settings ############## # Enable or disable role based access to the REST management API diff --git a/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java b/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java index 31a02ba4c6..e4db3a8685 100644 --- a/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java +++ b/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java @@ -289,7 +289,7 @@ public OpenSearchSecurityPlugin(final Settings settings, final Path configPath) transportPassiveAuthSetting = new TransportPassiveAuthSetting(settings); System.out.println("Checking is default password is empty"); - if (settings.get(ConfigConstants.SECURITY_AUTHCZ_ADMIN_DEFAULT_PASSWORD) == null) { + if (settings.get(ConfigConstants.SECURITY_BOOTSTRAP_ADMIN_DEFAULT_PASSWORD) == null) { throw new RuntimeException("A default admin password must be provided in the opensearch.yml file."); } System.out.println("Default password is not empty"); @@ -1211,7 +1211,7 @@ public List> getSettings() { settings.add(Setting.simpleString(ConfigConstants.SECURITY_CERT_OID, Property.NodeScope, Property.Filtered)); settings.add( - Setting.simpleString(ConfigConstants.SECURITY_AUTHCZ_ADMIN_DEFAULT_PASSWORD, Property.NodeScope, Property.Filtered) + Setting.simpleString(ConfigConstants.SECURITY_BOOTSTRAP_ADMIN_DEFAULT_PASSWORD, Property.NodeScope, Property.Filtered) ); settings.add( diff --git a/src/main/java/org/opensearch/security/support/ConfigConstants.java b/src/main/java/org/opensearch/security/support/ConfigConstants.java index 95f3e7d419..9cf120136c 100644 --- a/src/main/java/org/opensearch/security/support/ConfigConstants.java +++ b/src/main/java/org/opensearch/security/support/ConfigConstants.java @@ -139,7 +139,7 @@ public class ConfigConstants { public static final String SECURITY_INTERCLUSTER_REQUEST_EVALUATOR_CLASS = "plugins.security.cert.intercluster_request_evaluator_class"; public static final String OPENDISTRO_SECURITY_ACTION_NAME = OPENDISTRO_SECURITY_CONFIG_PREFIX + "action_name"; - public static final String SECURITY_AUTHCZ_ADMIN_DEFAULT_PASSWORD = "plugins.security.authcz.admin.password"; + public static final String SECURITY_BOOTSTRAP_ADMIN_DEFAULT_PASSWORD = "plugins.security.bootstrap.admin.password"; public static final String SECURITY_AUTHCZ_ADMIN_DN = "plugins.security.authcz.admin_dn"; public static final String SECURITY_CONFIG_INDEX_NAME = "plugins.security.config_index_name"; public static final String SECURITY_AUTHCZ_IMPERSONATION_DN = "plugins.security.authcz.impersonation_dn"; diff --git a/src/test/java/org/opensearch/security/test/SingleClusterTest.java b/src/test/java/org/opensearch/security/test/SingleClusterTest.java index d08af386e7..b104a672c6 100644 --- a/src/test/java/org/opensearch/security/test/SingleClusterTest.java +++ b/src/test/java/org/opensearch/security/test/SingleClusterTest.java @@ -80,7 +80,7 @@ protected void setup( Settings nodeOverride, boolean initSecurityIndex ) throws Exception { - Settings settings = Settings.builder().put(nodeOverride).put("plugins.security.authcz.admin.password", "testPassword").build(); + Settings settings = Settings.builder().put(nodeOverride).put("plugins.security.bootstrap.admin.password", "testPassword").build(); setup(initTransportClientSettings, dynamicSecuritySettings, settings, initSecurityIndex, ClusterConfiguration.DEFAULT); } @@ -100,7 +100,7 @@ private Settings ccs(Settings nodeOverride) throws Exception { if (remoteClusterHelper != null) { Assert.assertNull("No remote clusters", remoteClusterInfo); remoteClusterInfo = remoteClusterHelper.startCluster(minimumSecuritySettings(Settings.EMPTY), ClusterConfiguration.SINGLENODE); - Settings.Builder builder = Settings.builder().put(nodeOverride).put("plugins.security.authcz.admin.password", "passwordForTests") + Settings.Builder builder = Settings.builder().put(nodeOverride).put("plugins.security.bootstrap.admin.password", "passwordForTests") .putList("cluster.remote.cross_cluster_two.seeds", remoteClusterInfo.nodeHost + ":" + remoteClusterInfo.nodePort); return builder.build(); } else {