Skip to content

Commit

Permalink
make /static-checks/audit-sample-rules RHEL-10 compatible
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Jaburek <[email protected]>
  • Loading branch information
comps authored and mildas committed Oct 7, 2024
1 parent 2ac9eab commit 9fafb5b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions static-checks/audit-sample-rules/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9fafb5b

Please sign in to comment.