Skip to content

Commit

Permalink
Add new test case for duplicate registry entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Manuel Fresneda Rodriguez authored and vikman90 committed Jan 13, 2021
1 parent 2a846a9 commit bc79bc4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,23 @@
attributes:
- report_changes: "no"
- arch: "64bit"
# Single registry and a list of registries
- tags:
- single_registry_and_list
apply_to_modules:
- test_registry_ambiguous_duplicated_entries
sections:
- section: syscheck
elements:
- disabled:
value: 'no'
- windows_registry:
value: WINDOWS_REGISTRY_1
attributes:
- check_all: "yes"
- arch: "64bit"
- windows_registry:
value: WINDOWS_REGISTRY_LIST
attributes:
- check_all: "yes"
- arch: "64bit"
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@
key = "HKEY_LOCAL_MACHINE"
subkey_1 = "SOFTWARE\\test_key1"
subkey_2 = "SOFTWARE\\test_key2"
subkey_3 = "SOFTWARE\\test_key3"
subkey_4 = "SOFTWARE\\test_key4"

test_regs = [os.path.join(key, subkey_1),
os.path.join(key, subkey_2)
os.path.join(key, subkey_2),
os.path.join(key, subkey_3),
os.path.join(key, subkey_4)
]

registry_list = "{},{},{},{}".format(test_regs[0], test_regs[1], test_regs[2], test_regs[3])

conf_params = {'WINDOWS_REGISTRY_1': test_regs[0],
'WINDOWS_REGISTRY_2': test_regs[1],
'WINDOWS_REGISTRY_LIST': registry_list,
'RESTRICT_1': "overwritten_restrict$",
'RESTRICT_2': "restrict_test_|test_key"
}
Expand Down Expand Up @@ -77,6 +84,11 @@ def get_configuration(request):
(subkey_1, KEY_WOW64_64KEY, ['restrict_test_key'], ['restrict_test_value'], checkers_key_1, {'complex_entries'}),
(subkey_2, KEY_WOW64_64KEY, ['random_key'], ['random_value'], checkers_key_2, {'complex_entries'}),
(subkey_2, KEY_WOW64_32KEY, ['random_key'], ['random_value'], checkers_key_2, {'complex_entries'}),
(subkey_1, KEY_WOW64_64KEY, ['random_key'], ['test_value'], key_all_attrs, {'single_registry_and_list'}),
(subkey_2, KEY_WOW64_64KEY, ['random_key'], ['test_value'], key_all_attrs, {'single_registry_and_list'}),
(subkey_3, KEY_WOW64_64KEY, ['random_key'], ['test_value'], key_all_attrs, {'single_registry_and_list'}),
(subkey_4, KEY_WOW64_64KEY, ['random_key'], ['test_value'], key_all_attrs, {'single_registry_and_list'}),
])
def test_duplicate_entries(key, subkey, arch, key_list, value_list, checkers, tags_to_apply,
get_configuration, configure_environment, restart_syscheckd, wait_for_fim_start):
Expand Down

0 comments on commit bc79bc4

Please sign in to comment.