Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some cases in test_ignore_valid, to check entire disk ignore #1000

Merged
merged 2 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,20 @@
attributes:
- check_all: 'yes'
- FIM_MODE
# conf 12
- tags:
- ignore_disk
apply_to_modules:
- test_ignore_valid
sections:
- section: syscheck
elements:
- disabled:
value: 'no'
- directories:
value: "/testdir1,/testdir2"
attributes:
- check_all: 'yes'
- FIM_MODE
- ignore:
value: "/"
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,20 @@
attributes:
- check_all: 'yes'
- FIM_MODE
# conf 12
- tags:
- ignore_disk
apply_to_modules:
- test_ignore_valid
sections:
- section: syscheck
elements:
- disabled:
value: 'no'
- directories:
value: "c:\\testdir1,c:\\testdir2"
attributes:
- check_all: 'yes'
- FIM_MODE
- ignore:
value: "c:\\."
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def get_configuration(request):
(testdir1, 'mytest', "test", True, {'negation_regex'}),
(testdir1, 'othername', "test", False, {'negation_regex'}),
(testdir1, 'file1', "test", False, {'incomplete_regex'}),
(testdir1_ignore_folder, 'file2', "test", False, {'incomplete_regex'})
(testdir1_ignore_folder, 'file2', "test", False, {'incomplete_regex'}),
(testdir1, 'file1', "test", False, {'ignore_disk'})
])
def test_ignore_subdirectory(folder, filename, content, triggers_event,
tags_to_apply, get_configuration,
Expand Down Expand Up @@ -114,8 +115,8 @@ def test_ignore_subdirectory(folder, filename, content, triggers_event,
callback=callback_detect_event,
error_message='Did not receive expected '
'"Sending FIM event: ..." event').result()
assert event['data']['type'] == 'added', f'Event type not equal'
assert event['data']['path'] == os.path.join(folder, filename), f'Event path not equal'
assert event['data']['type'] == 'added', 'Event type not equal'
assert event['data']['path'] == os.path.join(folder, filename), 'Event path not equal'
else:
while True:
ignored_file = wazuh_log_monitor.start(timeout=global_parameters.default_timeout * 2,
Expand Down