Skip to content

Commit fd5bfec

Browse files
committed
Ignore /proc/sys/fs/binfmt_misc by default
1 parent d10119b commit fd5bfec

5 files changed

Lines changed: 13 additions & 7 deletions

File tree

disk/assets/configuration/spec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ files:
2626
description: |
2727
Instruct the check to always add these patterns to `mount_point_blacklist`.
2828
value:
29-
example: []
29+
example:
30+
- /proc/sys/fs/binfmt_misc$
3031
type: array
3132
items:
3233
type: string

disk/datadog_checks/disk/data/conf.yaml.default

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ init_config:
1616
## @param mount_point_global_blacklist - list of strings - optional
1717
## Instruct the check to always add these patterns to `mount_point_blacklist`.
1818
#
19-
# mount_point_global_blacklist: []
19+
# mount_point_global_blacklist:
20+
# - /proc/sys/fs/binfmt_misc$
2021

2122
## Every instance is scheduled independent of the others.
2223
#

disk/datadog_checks/disk/disk.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,8 @@ def get_default_device_blacklist():
438438

439439
@staticmethod
440440
def get_default_mount_mount_blacklist():
441-
return []
441+
return [
442+
# https://github.com/DataDog/datadog-agent/issues/1961
443+
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1049
444+
'/proc/sys/fs/binfmt_misc$'
445+
]

disk/tests/test_filter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_bad_config_string_regex():
3939
assert_regex_equal(c._device_whitelist, re.compile('test', IGNORE_CASE))
4040
assert_regex_equal(c._device_blacklist, re.compile('test', IGNORE_CASE))
4141
assert_regex_equal(c._mount_point_whitelist, re.compile('test', IGNORE_CASE))
42-
assert_regex_equal(c._mount_point_blacklist, re.compile('test', IGNORE_CASE))
42+
assert_regex_equal(c._mount_point_blacklist, re.compile('test|/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
4343

4444

4545
def test_ignore_empty_regex():
@@ -58,7 +58,7 @@ def test_ignore_empty_regex():
5858
assert_regex_equal(c._device_whitelist, re.compile('test', IGNORE_CASE))
5959
assert_regex_equal(c._device_blacklist, re.compile('test', IGNORE_CASE))
6060
assert_regex_equal(c._mount_point_whitelist, re.compile('test', IGNORE_CASE))
61-
assert_regex_equal(c._mount_point_blacklist, re.compile('test', IGNORE_CASE))
61+
assert_regex_equal(c._mount_point_blacklist, re.compile('test|/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
6262

6363

6464
def test_exclude_bad_devices():
@@ -191,7 +191,7 @@ def test_legacy_config():
191191

192192
assert_regex_equal(c._file_system_blacklist, re.compile('iso9660$|test$', re.I))
193193
assert_regex_equal(c._device_blacklist, re.compile('test1$|test2', IGNORE_CASE))
194-
assert_regex_equal(c._mount_point_blacklist, re.compile('test', IGNORE_CASE))
194+
assert_regex_equal(c._mount_point_blacklist, re.compile('/proc/sys/fs/binfmt_misc$|test', IGNORE_CASE))
195195

196196

197197
def test_legacy_exclude_disk():

disk/tests/test_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_default_options():
2626
assert check._device_whitelist is None
2727
assert check._device_blacklist is None
2828
assert check._mount_point_whitelist is None
29-
assert check._mount_point_blacklist is None
29+
assert check._mount_point_blacklist == re.compile('/proc/sys/fs/binfmt_misc$', re.I)
3030
assert check._tag_by_filesystem is False
3131
assert check._device_tag_re == []
3232
assert check._service_check_rw is False

0 commit comments

Comments
 (0)