Bug 2232607

Summary: anssi_bp28_high profile's audit rules are invalid on aarch64 architecture
Product: Red Hat Enterprise Linux 8 Reporter: Matus Marhefka <mmarhefk>
Component: scap-security-guideAssignee: Vojtech Polasek <vpolasek>
Status: CLOSED MIGRATED QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.9CC: ggasparb, matyc, mhaicman, mlysonek
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: aarch64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
Cause: The following SCAP rules configuring Audit included in ANSSI BP28 High profile are applied on aarch64 platform, although they are invalid on this architecture. - audit_rules_unsuccessful_file_modification_creat - audit_rules_unsuccessful_file_modification_open - audit_rules_file_deletion_events_rename - audit_rules_file_deletion_events_rmdir - audit_rules_file_deletion_events_unlink - audit_rules_dac_modification_chmod - audit_rules_dac_modification_chown - audit_rules_dac_modification_lchown Consequence: Audit fails to start because its configuration contains invalid syscalls. Workaround (if any): There are two ways how to workaround this: 1. Remove mentioned rules from the datastream via tailoring. 2. edit files in /etc/audit/rules.d and remove the "-S <syscall>" snippets for the following syscalls: - creat - open - rename - rmdir - unlink - chmod - chown - lchown Result: The Audit will be able to start and compliance of the system will not be affected in any way.
Story Points: ---
Clone Of:
: 2235606 (view as bug list) Environment:
Last Closed: 2023-08-31 09:10:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2235606    

Description Matus Marhefka 2023-08-17 14:03:21 UTC
Description of problem:
anssi_bp28_high profile's audit rules are invalid on aarch64 architecture.


Version-Release number of selected component (if applicable):
scap-security-guide-0.1.69-1.el8


How reproducible:
deterministic


Steps to Reproduce:
1. Remediate installed system using ANSSI High profile:
oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_anssi_bp28_high --progress --remediate /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
2. Examine auditd service status


Actual results:
# systemctl status -l auditd
● auditd.service - Security Auditing Service
   Loaded: loaded (/usr/lib/systemd/system/auditd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2023-08-17 09:43:05 EDT; 8min ago
     Docs: man:auditd(8)
           https://github.com/linux-audit/audit-documentation
  Process: 769 ExecStartPost=/sbin/augenrules --load (code=exited, status=1/FAILURE)
  Process: 759 ExecStart=/sbin/auditd (code=exited, status=0/SUCCESS)
 Main PID: 766 (auditd)
    Tasks: 2 (limit: 8799)
   Memory: 7.6M
   CGroup: /system.slice/auditd.service
           └─766 /sbin/auditd

Aug 17 09:43:04 hpe-apollo-cn99xx-14-vm-30.khw4.lab.eng.bos.redhat.com systemd[1]: Starting Security Auditing Service...
Aug 17 09:43:04 hpe-apollo-cn99xx-14-vm-30.khw4.lab.eng.bos.redhat.com auditd[766]: No plugins found, not dispatching events
Aug 17 09:43:04 hpe-apollo-cn99xx-14-vm-30.khw4.lab.eng.bos.redhat.com auditd[766]: Init complete, auditd 3.0.7 listening for events (startup state enable)
Aug 17 09:43:05 hpe-apollo-cn99xx-14-vm-30.khw4.lab.eng.bos.redhat.com augenrules[801]: Syscall name unknown: creat
Aug 17 09:43:05 hpe-apollo-cn99xx-14-vm-30.khw4.lab.eng.bos.redhat.com augenrules[801]: There was an error in line 7 of /etc/audit/audit.rules
====

# augenrules --load
Syscall name unknown: creat
There was an error in line 7 of /etc/audit/audit.rules
====

# head -n7 /etc/audit/audit.rules
## This file is automatically generated from /etc/audit/rules.d
-D


-w /etc/selinux/ -p wa -k MAC-policy
-a always,exit -F arch=b32 -S creat -S ftruncate -S open -S openat -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=access
-a always,exit -F arch=b64 -S creat -S ftruncate -S open -S openat -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=access
====

Even after removing the offending line there are still other errors so audit rules on aarch64 architecture need to be revisited and fixed.


Expected results:
`augenrules --load` successfully loads all configured audit rules.


Additional info:

Comment 1 Matus Marhefka 2023-08-17 14:05:46 UTC
This issue was hidden as we are also missing service_auditd_enabled rule in the profile, the rule needs to be added into all ANSSI profiles which configure audit.

Comment 3 RHEL Program Management 2023-08-31 09:08:21 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-08-31 09:10:03 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.

Users watching this BZ may not be automatically added to the Jira ticket.  Be sure to add yourself to the Watchers field in the Jira issue if you desire to continue following this issue.