Skip to content

Commit

Permalink
address
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Sep 24, 2020
1 parent b286be2 commit 54a400d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion disk/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ files:
Instruct the check to always add these patterns to `mount_point_blacklist`.
value:
example:
- /proc/sys/fs/binfmt_misc$
- (/host)?/proc/sys/fs/binfmt_misc$
type: array
items:
type: string
Expand Down
2 changes: 1 addition & 1 deletion disk/datadog_checks/disk/data/conf.yaml.default
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ init_config:
## Instruct the check to always add these patterns to `mount_point_blacklist`.
#
# mount_point_global_blacklist:
# - /proc/sys/fs/binfmt_misc$
# - (/host)?/proc/sys/fs/binfmt_misc$

## Every instance is scheduled independent of the others.
#
Expand Down
2 changes: 1 addition & 1 deletion disk/datadog_checks/disk/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,5 +441,5 @@ def get_default_mount_mount_blacklist():
return [
# https://github.com/DataDog/datadog-agent/issues/1961
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1049
'/proc/sys/fs/binfmt_misc$'
'(/host)?/proc/sys/fs/binfmt_misc$'
]
6 changes: 3 additions & 3 deletions disk/tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_bad_config_string_regex():
assert_regex_equal(c._device_whitelist, re.compile('test', IGNORE_CASE))
assert_regex_equal(c._device_blacklist, re.compile('test', IGNORE_CASE))
assert_regex_equal(c._mount_point_whitelist, re.compile('test', IGNORE_CASE))
assert_regex_equal(c._mount_point_blacklist, re.compile('test|/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
assert_regex_equal(c._mount_point_blacklist, re.compile('test|(/host)?/proc/sys/fs/binfmt_misc$', IGNORE_CASE))


def test_ignore_empty_regex():
Expand All @@ -58,7 +58,7 @@ def test_ignore_empty_regex():
assert_regex_equal(c._device_whitelist, re.compile('test', IGNORE_CASE))
assert_regex_equal(c._device_blacklist, re.compile('test', IGNORE_CASE))
assert_regex_equal(c._mount_point_whitelist, re.compile('test', IGNORE_CASE))
assert_regex_equal(c._mount_point_blacklist, re.compile('test|/proc/sys/fs/binfmt_misc$', IGNORE_CASE))
assert_regex_equal(c._mount_point_blacklist, re.compile('test|(/host)?/proc/sys/fs/binfmt_misc$', IGNORE_CASE))


def test_exclude_bad_devices():
Expand Down Expand Up @@ -191,7 +191,7 @@ def test_legacy_config():

assert_regex_equal(c._file_system_blacklist, re.compile('iso9660$|test$', re.I))
assert_regex_equal(c._device_blacklist, re.compile('test1$|test2', IGNORE_CASE))
assert_regex_equal(c._mount_point_blacklist, re.compile('/proc/sys/fs/binfmt_misc$|test', IGNORE_CASE))
assert_regex_equal(c._mount_point_blacklist, re.compile('(/host)?/proc/sys/fs/binfmt_misc$|test', IGNORE_CASE))


def test_legacy_exclude_disk():
Expand Down
2 changes: 1 addition & 1 deletion disk/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_default_options():
assert check._device_whitelist is None
assert check._device_blacklist is None
assert check._mount_point_whitelist is None
assert check._mount_point_blacklist == re.compile('/proc/sys/fs/binfmt_misc$', IGNORE_CASE)
assert check._mount_point_blacklist == re.compile('(/host)?/proc/sys/fs/binfmt_misc$', IGNORE_CASE)
assert check._tag_by_filesystem is False
assert check._device_tag_re == []
assert check._service_check_rw is False
Expand Down

0 comments on commit 54a400d

Please sign in to comment.