Skip to content

Commit 7b6e714

Browse files
authored
Remove obsolete security settings (#40496)
Removes the deprecated accept_default_password setting. This setting become redundant when default passwords were removed from 6.0, but the setting was kept for BWC. Removes native role store cache settings. These have been unused since 5.2 but were kept for BWC.
1 parent 33af548 commit 7b6e714

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

docs/reference/migration/migrate_8_0.asciidoc

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ coming[8.0.0]
1515
* <<breaking_80_discovery_changes>>
1616
* <<breaking_80_mappings_changes>>
1717
* <<breaking_80_snapshots_changes>>
18+
* <<breaking_80_security_changes>>
1819

1920
//NOTE: The notable-breaking-changes tagged regions are re-used in the
2021
//Installation and Upgrade Guide
@@ -41,3 +42,4 @@ include::migrate_8_0/analysis.asciidoc[]
4142
include::migrate_8_0/discovery.asciidoc[]
4243
include::migrate_8_0/mappings.asciidoc[]
4344
include::migrate_8_0/snapshots.asciidoc[]
45+
include::migrate_8_0/security.asciidoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[float]
2+
[[breaking_80_security_changes]]
3+
=== Security changes
4+
5+
[float]
6+
==== The `accept_default_password` setting has been removed
7+
8+
The `xpack.security.authc.accept_default_password` setting has not had any affect
9+
since the 6.0 release of {es}. It has been removed and cannot be used.
10+
11+
[float]
12+
==== The `roles.index.cache.*` settings have been removed
13+
14+
The `xpack.security.authz.store.roles.index.cache.max_size` and
15+
`xpack.security.authz.store.roles.index.cache.ttl` settings have
16+
been removed. These settings have been redundant and deprecated
17+
since the 5.2 release of {es}.
18+

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java

-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ public static List<Setting<?>> getSettings(boolean transportClientMode, List<Sec
618618
// authentication and authorization settings
619619
AnonymousUser.addSettings(settingsList);
620620
settingsList.addAll(InternalRealmsSettings.getSettings());
621-
NativeRolesStore.addSettings(settingsList);
622621
ReservedRealm.addSettings(settingsList);
623622
AuthenticationService.addSettings(settingsList);
624623
AuthorizationService.addSettings(settingsList);

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java

-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.elasticsearch.env.Environment;
1818
import org.elasticsearch.threadpool.ThreadPool;
1919
import org.elasticsearch.xpack.core.XPackSettings;
20-
import org.elasticsearch.xpack.core.security.SecurityField;
2120
import org.elasticsearch.xpack.core.security.authc.AuthenticationResult;
2221
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
2322
import org.elasticsearch.xpack.core.security.authc.esnative.ClientReservedRealm;
@@ -51,9 +50,6 @@ public class ReservedRealm extends CachingUsernamePasswordRealm {
5150
public static final String TYPE = "reserved";
5251

5352
private final ReservedUserInfo bootstrapUserInfo;
54-
public static final Setting<Boolean> ACCEPT_DEFAULT_PASSWORD_SETTING = Setting.boolSetting(
55-
SecurityField.setting("authc.accept_default_password"), true, Setting.Property.NodeScope, Setting.Property.Filtered,
56-
Setting.Property.Deprecated);
5753
public static final Setting<SecureString> BOOTSTRAP_ELASTIC_PASSWORD = SecureSetting.secureString("bootstrap.password",
5854
KeyStoreWrapper.SEED_SETTING);
5955

@@ -250,7 +246,6 @@ private Version getDefinedVersion(String username) {
250246
}
251247

252248
public static void addSettings(List<Setting<?>> settingsList) {
253-
settingsList.add(ACCEPT_DEFAULT_PASSWORD_SETTING);
254249
settingsList.add(BOOTSTRAP_ELASTIC_PASSWORD);
255250
}
256251
}

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java

-14
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
import org.elasticsearch.client.Client;
2727
import org.elasticsearch.common.Nullable;
2828
import org.elasticsearch.common.bytes.BytesReference;
29-
import org.elasticsearch.common.settings.Setting;
30-
import org.elasticsearch.common.settings.Setting.Property;
3129
import org.elasticsearch.common.settings.Settings;
32-
import org.elasticsearch.common.unit.TimeValue;
3330
import org.elasticsearch.common.util.concurrent.ThreadContext;
3431
import org.elasticsearch.common.xcontent.ToXContent;
3532
import org.elasticsearch.common.xcontent.XContentBuilder;
@@ -69,7 +66,6 @@
6966
import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN;
7067
import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
7168
import static org.elasticsearch.xpack.core.ClientHelper.stashWithOrigin;
72-
import static org.elasticsearch.xpack.core.security.SecurityField.setting;
7369
import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.ROLE_TYPE;
7470
import static org.elasticsearch.xpack.security.support.SecurityIndexManager.SECURITY_INDEX_NAME;
7571

@@ -83,11 +79,6 @@
8379
*/
8480
public class NativeRolesStore implements BiConsumer<Set<String>, ActionListener<RoleRetrievalResult>> {
8581

86-
// these are no longer used, but leave them around for users upgrading
87-
private static final Setting<Integer> CACHE_SIZE_SETTING =
88-
Setting.intSetting(setting("authz.store.roles.index.cache.max_size"), 10000, Property.NodeScope, Property.Deprecated);
89-
private static final Setting<TimeValue> CACHE_TTL_SETTING = Setting.timeSetting(setting("authz.store.roles.index.cache.ttl"),
90-
TimeValue.timeValueMinutes(20), Property.NodeScope, Property.Deprecated);
9182
private static final Logger logger = LogManager.getLogger(NativeRolesStore.class);
9283

9384
private final Settings settings;
@@ -413,11 +404,6 @@ static RoleDescriptor transformRole(String id, BytesReference sourceBytes, Logge
413404
}
414405
}
415406

416-
public static void addSettings(List<Setting<?>> settings) {
417-
settings.add(CACHE_SIZE_SETTING);
418-
settings.add(CACHE_TTL_SETTING);
419-
}
420-
421407
/**
422408
* Gets the document's id field for the given role name.
423409
*/

0 commit comments

Comments
 (0)