Bug 1876483

Summary: OpenSCAP SSG remediation slows performance with individual rules in auditd
Product: Red Hat Enterprise Linux 8 Reporter: Anthony Hogbin <ahogbin>
Component: scap-security-guideAssignee: Watson Yuuma Sato <wsato>
Status: CLOSED ERRATA QA Contact: Matus Marhefka <mmarhefk>
Severity: medium Docs Contact: Jan Fiala <jafiala>
Priority: medium    
Version: 8.2CC: ggasparb, jafiala, matyc, mhaicman, tscherf, wsato
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: scap-security-guide-0.1.57-2.el8 Doc Type: Enhancement
Doc Text:
.Performance of remediations for Audit improved by grouping similar system calls Previously, Audit remediations generated an individual rule for each system call audited by the profile. This led to large numbers of audit rules, which degraded performance. With this enhancement, remediations for Audit can group rules for similar system calls with identical fields together into a single rule, which improves performance. Examples of system calls grouped together: ---- -a always, exit -F arch=b32 -S chown, fchown, fchownat, lchown -F auid>=1000 -F auid!=unset -F key=perm_mod ---- ---- -a always, exit -F arch=b32 -S unlink, unlinkat, rename, renameat, rmdir -F auid>=1000 -F auid!=unset -F key=delete ---- ---- -a always, exit -F arch=b32 -S chown, fchown, fchownat, lchown -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccesful-perm-change ---- ---- -a always, exit -F arch=b32 -S unlink, unlinkat, rename, renameat -F auid>=1000 -F auid!=unset -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete ----
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 18:43:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anthony Hogbin 2020-09-07 10:11:45 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Build Identifier: 

Remediating a host creates many individual rules resulting in a loss of performance;
Manually combining rules is resulting in better performance;
Doing this removes the point of remediation by SSG



Reproducible: Always

Steps to Reproduce:
1. Example of 10,000 chmod's on the same file
2. Test with no rules;
3. Test with the SSG remediation of 166 individual rules;
4. Test with audit rules combined down to 44 rules.
Actual Results:  
No rules: 6.2 seconds
SSG remediated 166 audit rules: 10.5 seconds
Manually combined 44 audit rules: 8 seconds

Expected Results:  
Ideally the OpenSCAP SSG would have taken steps to optimize these rules and reduce them to as few as possible to prevent the necessity for human involvement.

Comment 11 Anthony Hogbin 2021-04-26 09:56:55 UTC
@Vojtech Polasek  - I am waiting on an update from the customer - but they have been asked / nudged again - I will be chasing up again in the TAM call this week.

Comment 13 Watson Yuuma Sato 2021-08-19 13:47:46 UTC
This patch (https://github.com/ComplianceAsCode/content/pull/7329) improves the Ansible and Bash remediations to group similar syscalls together.

Comment 27 errata-xmlrpc 2021-11-09 18:43:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (scap-security-guide bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4265