Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class SslConfigurationKeys {
public static final String TRUSTSTORE_SECURE_PASSWORD = "truststore.secure_password";
/**
* The password for the file configured in {@link #TRUSTSTORE_PATH}, as a non-secure setting.
* The use of this setting {@link #isDeprecated(String) is deprecated}.
* The use of this setting {@link #isDeprecatedWarning(String) is deprecated}.
*/
public static final String TRUSTSTORE_LEGACY_PASSWORD = "truststore.password";
/**
Expand All @@ -82,7 +82,7 @@ public class SslConfigurationKeys {
public static final String KEYSTORE_SECURE_PASSWORD = "keystore.secure_password";
/**
* The password for the file configured in {@link #KEYSTORE_PATH}, as a non-secure setting.
* The use of this setting {@link #isDeprecated(String) is deprecated}.
* The use of this setting {@link #isDeprecatedWarning(String) is deprecated}.
*/
public static final String KEYSTORE_LEGACY_PASSWORD = "keystore.password";
/**
Expand All @@ -92,7 +92,7 @@ public class SslConfigurationKeys {
public static final String KEYSTORE_SECURE_KEY_PASSWORD = "keystore.secure_key_password";
/**
* The password for the key within the {@link #KEYSTORE_PATH configured keystore}, as a non-secure setting.
* The use of this setting {@link #isDeprecated(String) is deprecated}.
* The use of this setting {@link #isDeprecatedWarning(String) is deprecated}.
* If no key password is specified, it will default to the keystore password.
*/
public static final String KEYSTORE_LEGACY_KEY_PASSWORD = "keystore.key_password";
Expand Down Expand Up @@ -121,11 +121,14 @@ public class SslConfigurationKeys {
public static final String KEY_SECURE_PASSPHRASE = "secure_key_passphrase";
/**
* The password to read the configured {@link #KEY}, as a non-secure setting.
* The use of this setting {@link #isDeprecated(String) is deprecated}.
* The use of this setting {@link #isDeprecatedWarning(String) is deprecated}.
*/
public static final String KEY_LEGACY_PASSPHRASE = "key_passphrase";

private static final Set<String> DEPRECATED_KEYS = new HashSet<>(
/**
* Warning severity deprecated keys
*/
private static final Set<String> DEPRECATED_WARNING_KEYS = new HashSet<>(
Arrays.asList(TRUSTSTORE_LEGACY_PASSWORD, KEYSTORE_LEGACY_PASSWORD, KEYSTORE_LEGACY_KEY_PASSWORD, KEY_LEGACY_PASSPHRASE)
);

Expand Down Expand Up @@ -161,10 +164,10 @@ public static List<String> getSecureStringKeys() {
}

/**
* @return {@code true} if the provided key is a deprecated setting
* @return {@code true} if the provided key is a deprecated setting at warning severity
*/
public static boolean isDeprecated(String key) {
return DEPRECATED_KEYS.contains(key);
public static boolean isDeprecatedWarning(String key) {
return DEPRECATED_WARNING_KEYS.contains(key);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public class ReindexSslConfig {

static {
Setting.Property[] defaultProperties = new Setting.Property[] { Setting.Property.NodeScope, Setting.Property.Filtered };
Setting.Property[] deprecatedProperties = new Setting.Property[] { Setting.Property.Deprecated, Setting.Property.NodeScope,
Setting.Property[] deprecatedProperties = new Setting.Property[] { Setting.Property.DeprecatedWarning, Setting.Property.NodeScope,
Setting.Property.Filtered };
for (String key : SslConfigurationKeys.getStringKeys()) {
String settingName = "reindex.ssl." + key;
final Setting.Property[] properties = SslConfigurationKeys.isDeprecated(key) ? deprecatedProperties : defaultProperties;
final Setting.Property[] properties = SslConfigurationKeys.isDeprecatedWarning(key) ? deprecatedProperties : defaultProperties;
SETTINGS.put(settingName, simpleString(settingName, properties));
}
for (String key : SslConfigurationKeys.getListKeys()) {
String settingName = "reindex.ssl." + key;
final Setting.Property[] properties = SslConfigurationKeys.isDeprecated(key) ? deprecatedProperties : defaultProperties;
final Setting.Property[] properties = SslConfigurationKeys.isDeprecatedWarning(key) ? deprecatedProperties : defaultProperties;
SETTINGS.put(settingName, listSetting(settingName, Collections.emptyList(), Function.identity(), properties));
}
for (String key : SslConfigurationKeys.getSecureStringKeys()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private BootstrapSettings() {
public static final Setting<Boolean> MEMORY_LOCK_SETTING =
Setting.boolSetting("bootstrap.memory_lock", false, Property.NodeScope);
public static final Setting<Boolean> SYSTEM_CALL_FILTER_SETTING =
Setting.boolSetting("bootstrap.system_call_filter", true, Property.Deprecated, Property.NodeScope);
Setting.boolSetting("bootstrap.system_call_filter", true, Property.DeprecatedWarning, Property.NodeScope);
public static final Setting<Boolean> CTRLHANDLER_SETTING =
Setting.boolSetting("bootstrap.ctrlhandler", true, Property.NodeScope);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static APIBlock readFrom(StreamInput input) throws IOException {
public static final String SETTING_HISTORY_UUID = "index.history.uuid";
public static final String SETTING_DATA_PATH = "index.data_path";
public static final Setting<String> INDEX_DATA_PATH_SETTING =
new Setting<>(SETTING_DATA_PATH, "", Function.identity(), Property.IndexScope, Property.Deprecated);
new Setting<>(SETTING_DATA_PATH, "", Function.identity(), Property.IndexScope, Property.DeprecatedWarning);
public static final String INDEX_UUID_NA_VALUE = "_na_";

public static final String INDEX_ROUTING_REQUIRE_GROUP_PREFIX = "index.routing.allocation.require";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public abstract class SecureSetting<T> extends Setting<T> {
/** Determines whether legacy settings with sensitive values should be allowed. */
private static final boolean ALLOW_INSECURE_SETTINGS = Booleans.parseBoolean(System.getProperty("es.allow_insecure_settings", "false"));

private static final Set<Property> ALLOWED_PROPERTIES = EnumSet.of(Property.Deprecated, Property.Consistent);
private static final Set<Property> ALLOWED_PROPERTIES = EnumSet.of(Property.Deprecated, Property.DeprecatedWarning,
Property.Consistent);

private static final Property[] FIXED_PROPERTIES = {
Property.NodeScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
public static final Setting<Boolean> CACHE_REPOSITORY_DATA = Setting.boolSetting(
"cache_repository_data",
true,
Setting.Property.Deprecated
Setting.Property.DeprecatedWarning
);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class LifecycleSettings {
true, Setting.Property.NodeScope);
public static final Setting<TimeValue> LIFECYCLE_STEP_MASTER_TIMEOUT_SETTING =
Setting.positiveTimeSetting(LIFECYCLE_STEP_MASTER_TIMEOUT, TimeValue.timeValueSeconds(30), Setting.Property.Dynamic,
Setting.Property.NodeScope, Setting.Property.Deprecated);
Setting.Property.NodeScope, Setting.Property.DeprecatedWarning);
// This setting configures how much time since step_time should ILM wait for a condition to be met. After the threshold wait time has
// elapsed ILM will likely stop waiting and go to the next step.
// Also see {@link org.elasticsearch.xpack.core.ilm.ClusterStateWaitUntilThresholdStep}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public final class MonitoringField {
public static final Setting<TimeValue> HISTORY_DURATION = timeSetting("xpack.monitoring.history.duration",
TimeValue.timeValueHours(7 * 24), // default value (7 days)
HISTORY_DURATION_MINIMUM, // minimum value
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);
Setting.Property.Dynamic, Setting.Property.NodeScope,
Setting.Property.DeprecatedWarning);

private MonitoringField() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class LdapUserSearchSessionFactorySettings {
public static final Setting.AffixSetting<String> SEARCH_ATTRIBUTE = Setting.affixKeySetting(
RealmSettings.realmSettingPrefix(LDAP_TYPE), "user_search.attribute",
key -> new Setting<>(key, LdapUserSearchSessionFactorySettings.DEFAULT_USERNAME_ATTRIBUTE, Function.identity(),
Setting.Property.NodeScope, Setting.Property.Deprecated));
Setting.Property.NodeScope, Setting.Property.DeprecatedWarning));

public static final Setting.AffixSetting<String> SEARCH_BASE_DN
= RealmSettings.simpleString(LDAP_TYPE, "user_search.base_dn", Setting.Property.NodeScope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class PoolingSessionFactorySettings {

public static final Function<String, Setting.AffixSetting<SecureString>> LEGACY_BIND_PASSWORD = RealmSettings.affixSetting(
"bind_password", key -> new Setting<>(key, "", SecureString::new,
Setting.Property.NodeScope, Setting.Property.Filtered, Setting.Property.Deprecated));
Setting.Property.NodeScope, Setting.Property.Filtered, Setting.Property.DeprecatedWarning));

public static final Function<String, Setting.AffixSetting<SecureString>> SECURE_BIND_PASSWORD = realmType ->
Setting.affixKeySetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class SessionFactorySettings {

public static final Function<String, Setting.AffixSetting<TimeValue>> TIMEOUT_TCP_READ_SETTING = RealmSettings.affixSetting(
"timeout.tcp_read", key -> Setting.timeSetting(key, TimeValue.MINUS_ONE, Setting.Property.NodeScope,
Setting.Property.Deprecated));
Setting.Property.DeprecatedWarning));

public static final Function<String, Setting.AffixSetting<TimeValue>> TIMEOUT_RESPONSE_SETTING = RealmSettings.affixSetting(
"timeout.response", key -> Setting.timeSetting(key, TimeValue.MINUS_ONE, Setting.Property.NodeScope));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class SSLConfigurationSettings {
Setting.affixKeySetting("xpack.security.authc.realms." + realmType + ".", "ssl.key", X509KeyPairSettings.KEY_PATH_TEMPLATE);

public static final Function<String, Setting<SecureString>> LEGACY_TRUSTSTORE_PASSWORD_TEMPLATE = key ->
new Setting<>(key, "", SecureString::new, Property.Deprecated, Property.Filtered, Property.NodeScope);
new Setting<>(key, "", SecureString::new, Property.DeprecatedWarning, Property.Filtered, Property.NodeScope);
public static final Setting<SecureString> LEGACY_TRUSTSTORE_PASSWORD_PROFILES = Setting.affixKeySetting("transport.profiles.",
"xpack.security.ssl.truststore.password", LEGACY_TRUSTSTORE_PASSWORD_TEMPLATE);
public static final Function<String, Setting.AffixSetting<SecureString>> LEGACY_TRUST_STORE_PASSWORD_REALM = realmType ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class X509KeyPairSettings {
Optional::ofNullable, Setting.Property.NodeScope, Setting.Property.Filtered);

static final Function<String, Setting<SecureString>> LEGACY_KEYSTORE_PASSWORD_TEMPLATE = key -> new Setting<>(key, "",
SecureString::new, Setting.Property.Deprecated, Setting.Property.Filtered, Setting.Property.NodeScope);
SecureString::new, Setting.Property.DeprecatedWarning, Setting.Property.Filtered, Setting.Property.NodeScope);
static final Function<String, Setting<SecureString>> KEYSTORE_PASSWORD_TEMPLATE = key -> SecureSetting.secureString(key,
LEGACY_KEYSTORE_PASSWORD_TEMPLATE.apply(key.replace("keystore.secure_password", "keystore.password")));

Expand All @@ -44,7 +44,7 @@ public class X509KeyPairSettings {
new Setting<>(key, s -> null, Optional::ofNullable, Setting.Property.NodeScope, Setting.Property.Filtered);

static final Function<String, Setting<SecureString>> LEGACY_KEYSTORE_KEY_PASSWORD_TEMPLATE = key -> new Setting<>(key, "",
SecureString::new, Setting.Property.Deprecated, Setting.Property.Filtered, Setting.Property.NodeScope);
SecureString::new, Setting.Property.DeprecatedWarning, Setting.Property.Filtered, Setting.Property.NodeScope);
static final Function<String, Setting<SecureString>> KEYSTORE_KEY_PASSWORD_TEMPLATE = key ->
SecureSetting.secureString(key, LEGACY_KEYSTORE_KEY_PASSWORD_TEMPLATE.apply(key.replace("keystore.secure_key_password",
"keystore.key_password")));
Expand All @@ -56,7 +56,7 @@ public class X509KeyPairSettings {
Optional::ofNullable, Setting.Property.NodeScope, Setting.Property.Filtered);

static final Function<String, Setting<SecureString>> LEGACY_KEY_PASSWORD_TEMPLATE = key -> new Setting<>(key, "",
SecureString::new, Setting.Property.Deprecated, Setting.Property.Filtered, Setting.Property.NodeScope);
SecureString::new, Setting.Property.DeprecatedWarning, Setting.Property.Filtered, Setting.Property.NodeScope);
static final Function<String, Setting<SecureString>> KEY_PASSWORD_TEMPLATE = key ->
SecureSetting.secureString(key, LEGACY_KEY_PASSWORD_TEMPLATE.apply(key.replace("secure_key_passphrase",
"key_passphrase")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class EqlPlugin extends Plugin implements ActionPlugin, CircuitBreakerPlu
"xpack.eql.enabled",
true,
Setting.Property.NodeScope,
Setting.Property.Deprecated
Setting.Property.DeprecatedWarning
);

public EqlPlugin() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin
true, Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);

public static final Setting<Boolean> MIGRATION_DECOMMISSION_ALERTS = boolSetting("xpack.monitoring.migration.decommission_alerts",
false, Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);
false, Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.DeprecatedWarning);

public static final LicensedFeature.Momentary MONITORING_CLUSTER_ALERTS_FEATURE =
LicensedFeature.momentary("monitoring", "cluster-alerts", License.OperationMode.STANDARD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ public class MonitoringService extends AbstractLifecycleComponent {
*/
public static final Setting<Boolean> ELASTICSEARCH_COLLECTION_ENABLED =
Setting.boolSetting("xpack.monitoring.elasticsearch.collection.enabled", true,
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.DeprecatedWarning);

/**
* Dynamically controls enabling or disabling the collection of Monitoring data from Elasticsearch as well as other products
* in the stack.
*/
public static final Setting<Boolean> ENABLED =
Setting.boolSetting("xpack.monitoring.collection.enabled", false,
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.DeprecatedWarning);

/**
* Sampling interval between two collections (default to 10s)
*/
public static final Setting<TimeValue> INTERVAL =
Setting.timeSetting("xpack.monitoring.collection.interval", TimeValue.timeValueSeconds(10), MIN_INTERVAL,
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.DeprecatedWarning);

/** State of the monitoring service, either started or stopped **/
private final AtomicBoolean started = new AtomicBoolean(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class Collector {
*/
public static final Setting<List<String>> INDICES =
listSetting(collectionSetting("indices"), emptyList(), Function.identity(), Property.Dynamic, Property.NodeScope,
Setting.Property.Deprecated);
Property.DeprecatedWarning);

private final String name;
private final Setting<TimeValue> collectionTimeoutSetting;
Expand Down Expand Up @@ -171,6 +171,6 @@ protected static String collectionSetting(final String settingName) {

protected static Setting<TimeValue> collectionTimeoutSetting(final String settingName) {
String name = collectionSetting(settingName);
return timeSetting(name, TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope, Property.Deprecated);
return timeSetting(name, TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope, Property.DeprecatedWarning);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class IndexRecoveryCollector extends Collector {
*/
public static final Setting<Boolean> INDEX_RECOVERY_ACTIVE_ONLY =
boolSetting(collectionSetting("index.recovery.active_only"), false, Setting.Property.Dynamic, Setting.Property.NodeScope,
Setting.Property.Deprecated);
Setting.Property.DeprecatedWarning);

private final Client client;

Expand Down
Loading