From 9fafb5b9525744ff6f3bef2c179bdeec5b60929d Mon Sep 17 00:00:00 2001 From: Jiri Jaburek Date: Thu, 3 Oct 2024 11:42:08 +0200 Subject: [PATCH] make /static-checks/audit-sample-rules RHEL-10 compatible Signed-off-by: Jiri Jaburek --- static-checks/audit-sample-rules/test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static-checks/audit-sample-rules/test.py b/static-checks/audit-sample-rules/test.py index c286df9..c390945 100755 --- a/static-checks/audit-sample-rules/test.py +++ b/static-checks/audit-sample-rules/test.py @@ -6,7 +6,7 @@ import yaml from pathlib import Path -from lib import util, results, oscap +from lib import util, results, versions, oscap # extract audit rules filepaths + contents from the datastream XML @@ -89,7 +89,13 @@ def report_diff(*args, ds_contents, sample_contents, filename, **kwargs): results.report(*args, **kwargs, logs=[diff_file]) -audit_sample_dir = Path('/usr/share/audit/sample-rules') +if versions.rhel >= 10: + # https://github.com/linux-audit/audit-userspace/commit/eb2b95f23 + # provided by a new audit-rules package + audit_sample_dir = Path('/usr/share/audit-rules') +else: + audit_sample_dir = Path('/usr/share/audit/sample-rules') + audit_sample_files = {f.name for f in audit_sample_dir.iterdir()} remediations = get_ds_remediations()