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

Fix discrepancies in installed files configuration in manager installed via .deb/.rpm #27410

Merged
8 changes: 2 additions & 6 deletions .github/actions/check_files/check_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ def printReport(expected_items, not_listed, not_fully_match, current_items, matc

print("Scanning started...")

failed = False

# Separate expected items into exact matches and patterns
exact_matches = {}
glob_patterns = {}
Expand All @@ -462,7 +460,6 @@ def printReport(expected_items, not_listed, not_fully_match, current_items, matc
difference_dict = file_diff(
expected_item_fields, file_object, size_check)
if len(difference_dict) != 0:
failed = True
# Track differences using the current file name as a key
not_fully_match[current_file_name] = difference_dict

Expand All @@ -479,17 +476,16 @@ def printReport(expected_items, not_listed, not_fully_match, current_items, matc
difference_dict = file_diff(
expected_item_fields, file_object, size_check)
if len(difference_dict) != 0:
failed = True
# Use (pattern, current_file_name) as a key to track differences
not_fully_match[current_file_name] = difference_dict

# 3. If no patterns matched, consider it a "not found" case
if not matched:
failed = True
not_listed[current_file_name] = file_object

print("Scanning finished")
printReport(expected_items, not_listed,
not_fully_match, current_items, matches, report_path)

if failed:
if len(current_items) < len(expected_items) or len(not_listed) != 0 or len(not_fully_match) != 0:
sys.exit("Failed: Results didn't match the expected output")
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ full_filename,owner_name,group_name,mode,type,prot_permissions,size_bytes,size_e
/var/ossec/ruleset/sca/cis_ubuntu18-04.yml*,root,wazuh,640,file,-rw-r-----,,
/var/ossec/ruleset/sca/cis_ubuntu20-04.yml*,root,wazuh,640,file,-rw-r-----,,
/var/ossec/ruleset/sca/cis_ubuntu22-04.yml*,root,wazuh,640,file,-rw-r-----,,
/var/ossec/ruleset/sca/cis_ubuntu24-04.yml*,root,wazuh,640,file,-rw-r-----,,
/var/ossec/ruleset/sca/cis_win10_enterprise.yml*,root,wazuh,640,file,-rw-r-----,,
/var/ossec/ruleset/sca/cis_win11_enterprise.yml*,root,wazuh,640,file,-rw-r-----,,
/var/ossec/ruleset/sca/cis_win2012_non_r2.yml*,root,wazuh,640,file,-rw-r-----,,
Expand Down
Loading