Skip to content

Commit 694229f

Browse files
authored
Deprecate bootstrap.system_call_filter (#72834)
We are going to require system call filters. This commit is the first step in that journey, which is to deprecate the setting that allows disabling system call filters.
1 parent 39c2ea2 commit 694229f

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

docs/reference/migration/migrate_8_0/settings.asciidoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,20 @@ value for `node.roles`.
224224
Discontinue use of the removed settings. Specifying these settings in
225225
`elasticsearch.yml` will result in an error on startup.
226226
====
227+
228+
[[system-call-filter-setting]]
229+
.System call filter setting deprecated
230+
[%collapsible]
231+
====
232+
*Details* +
233+
Elasticsearch uses system call filters to remove its ability to fork another
234+
process. This is useful to mitigate remote code exploits. These system call
235+
filters are enabled by default, and controlled via the setting
236+
`bootstrap.system_call_filter`. Starting in Elasticsearch 8.0, system call
237+
filters will be required. As such, the setting `bootstrap.system_call_filter` is
238+
deprecated and will be removed in Elasticsearch 8.0.
239+
240+
*Impact* +
241+
Discontinue use of the removed setting. Specifying this setting in Elasticsearch
242+
configuration will result in an error on startup.
243+
====

server/src/main/java/org/elasticsearch/bootstrap/BootstrapSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private BootstrapSettings() {
2323
public static final Setting<Boolean> MEMORY_LOCK_SETTING =
2424
Setting.boolSetting("bootstrap.memory_lock", false, Property.NodeScope);
2525
public static final Setting<Boolean> SYSTEM_CALL_FILTER_SETTING =
26-
Setting.boolSetting("bootstrap.system_call_filter", true, Property.NodeScope);
26+
Setting.boolSetting("bootstrap.system_call_filter", true, Property.Deprecated, Property.NodeScope);
2727
public static final Setting<Boolean> CTRLHANDLER_SETTING =
2828
Setting.boolSetting("bootstrap.ctrlhandler", true, Property.NodeScope);
2929

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ private DeprecationChecks() {
3232
static List<Function<ClusterState, DeprecationIssue>> CLUSTER_SETTINGS_CHECKS =
3333
Collections.emptyList();
3434

35-
static List<BiFunction<Settings, PluginsAndModules, DeprecationIssue>> NODE_SETTINGS_CHECKS = Collections.emptyList();
35+
static List<BiFunction<Settings, PluginsAndModules, DeprecationIssue>> NODE_SETTINGS_CHECKS =
36+
List.of(NodeDeprecationChecks::checkBootstrapSystemCallFilterSetting);
3637

3738
static List<Function<IndexMetadata, DeprecationIssue>> INDEX_SETTINGS_CHECKS =
3839
List.of(IndexDeprecationChecks::oldIndicesCheck, IndexDeprecationChecks::translogRetentionSettingCheck);

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package org.elasticsearch.xpack.deprecation;
99

1010
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
11+
import org.elasticsearch.bootstrap.BootstrapSettings;
1112
import org.elasticsearch.common.settings.Setting;
1213
import org.elasticsearch.common.settings.Settings;
1314
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
@@ -17,6 +18,14 @@
1718

1819
public class NodeDeprecationChecks {
1920

21+
static DeprecationIssue checkBootstrapSystemCallFilterSetting(final Settings settings, final PluginsAndModules pluginsAndModules) {
22+
return checkRemovedSetting(
23+
settings,
24+
BootstrapSettings.SYSTEM_CALL_FILTER_SETTING,
25+
"https://www.elastic.co/guide/en/elasticsearch/reference/7.13/breaking-changes-7.13.html#deprecate-system-call-filter-setting"
26+
);
27+
}
28+
2029
private static DeprecationIssue checkDeprecatedSetting(
2130
final Settings settings,
2231
final PluginsAndModules pluginsAndModules,

x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,38 @@
77

88
package org.elasticsearch.xpack.deprecation;
99

10+
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
11+
import org.elasticsearch.bootstrap.BootstrapSettings;
1012
import org.elasticsearch.common.settings.Setting;
1113
import org.elasticsearch.common.settings.Settings;
1214
import org.elasticsearch.test.ESTestCase;
1315
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1416

17+
import java.util.List;
18+
1519
import static org.hamcrest.Matchers.equalTo;
20+
import static org.hamcrest.Matchers.hasItem;
1621
import static org.hamcrest.Matchers.not;
1722
import static org.hamcrest.Matchers.nullValue;
1823

1924
public class NodeDeprecationChecksTests extends ESTestCase {
2025

26+
public void testCheckBootstrapSystemCallFilterSetting() {
27+
final boolean boostrapSystemCallFilter = randomBoolean();
28+
final Settings settings =
29+
Settings.builder().put(BootstrapSettings.SYSTEM_CALL_FILTER_SETTING.getKey(), boostrapSystemCallFilter).build();
30+
final PluginsAndModules pluginsAndModules = new PluginsAndModules(List.of(), List.of());
31+
final List<DeprecationIssue> issues =
32+
DeprecationChecks.filterChecks(DeprecationChecks.NODE_SETTINGS_CHECKS, c -> c.apply(settings, pluginsAndModules));
33+
final DeprecationIssue expected = new DeprecationIssue(
34+
DeprecationIssue.Level.CRITICAL,
35+
"setting [bootstrap.system_call_filter] is deprecated and will be removed in the next major version",
36+
"https://www.elastic.co/guide/en/elasticsearch/reference/7.13/breaking-changes-7.13.html#deprecate-system-call-filter-setting",
37+
"the setting [bootstrap.system_call_filter] is currently set to [" + boostrapSystemCallFilter + "], remove this setting");
38+
assertThat(issues, hasItem(expected));
39+
assertSettingDeprecationsAndWarnings(new Setting<?>[]{BootstrapSettings.SYSTEM_CALL_FILTER_SETTING});
40+
}
41+
2142
public void testRemovedSettingNotSet() {
2243
final Settings settings = Settings.EMPTY;
2344
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");

0 commit comments

Comments
 (0)