Bug 2176008

Summary: "Add xxx Option to /var/log" and "Add xxx Option to /var/log/audit" should return "notapplicable" when no dedicated mount point is used
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: scap-security-guideAssignee: Vojtech Polasek <vpolasek>
Status: MODIFIED --- QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 8.7CC: ggasparb, jcerny, jjaburek, matyc, mhaicman, mlysonek, peter.vreman, ravpatil, wsato
Target Milestone: rcKeywords: AutoVerified, Triaged, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: scap-security-guide-0.1.69-1.el8 Doc Type: Bug Fix
Doc Text:
Cause: Following SCAP rules relevant to /var/log and /var/log/audit partitions were evaluated / remediated without first checking if the appropriate disk partition exists: - mount_option_var_log_audit_nodev - mount_option_var_log_audit_noexec - mount_option_var_log_audit_nosuid - mount_option_var_log_nodev - mount_option_var_log_noexec - mount_option_var_log_nosuid Consequence: Although directories /var/log or /var/log/audit were not mount points for individual partitions, rules were still evaluated and they were reported as failing in the final report. But they should not be evaluated at all. Fix: An applicability check was added so that if /var/log or /var/log/audit are not mount points for individual partitions, rules are not evaluated. Result: Rules are marked as "not applicable" in the final report.
Story Points: ---
Clone Of:
: 2228473 2228474 (view as bug list) Environment:
Last Closed: 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: 2228473, 2228474    

Description Renaud Métrich 2023-03-07 06:57:24 UTC
Description of problem:

Currently executing rules "Add xxx Option to /var/log" and "Add xxx Option to /var/log/audit" on a system which is not configured with separate partitions returns "fail", whereas it should return "notapplicable".

Version-Release number of selected component (if applicable):

scap-security-guide-0.1.66-2.el8_7

How reproducible:

Always

Steps to Reproduce:
1. Execute "Add xxx Option to /var/log" rule on a system which doesn't have a /var/log partition

Actual results:

fail

Expected results:

notapplicable

Additional info:

PR has been submitted. Screenshots before / after PR attached.

Comment 6 Jan Černý 2023-05-09 12:29:33 UTC
In upstream, a "mount" applicability platform has been introduced by https://github.com/ComplianceAsCode/content/pull/10431. This platform has been added to rules for /tmp and /var/tmp mount options. What remains to be done there is to add the "mount" platform to the rules concerning /var/log and /var/log/audit, and also possibly to all other similar rules where it would make sense, as suggested in https://github.com/ComplianceAsCode/content/issues/10504.

Comment 7 Jan Černý 2023-07-04 10:52:01 UTC
A PR that introduces mount platforms to other rules has been merged to upstream: https://github.com/ComplianceAsCode/content/pull/10794