RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1574586 - OSCAP rule xccdf_org.ssgproject.content_rule_audit_rules_login_event remediation is not detected
Summary: OSCAP rule xccdf_org.ssgproject.content_rule_audit_rules_login_event remediat...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: scap-security-guide
Version: 7.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Vojtech Polasek
QA Contact: Gabriel Gaspar Becker
URL:
Whiteboard:
Depends On:
Blocks: 1594286
TreeView+ depends on / blocked
 
Reported: 2018-05-03 15:29 UTC by Zdenek Pytela
Modified: 2023-12-15 16:04 UTC (History)
9 users (show)

Fixed In Version: scap-security-guide-0.1.49-1.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-29 19:52:12 UTC
Target Upstream Version: 2020-07-07
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3431831 0 None None None 2018-05-03 15:36:30 UTC
Red Hat Knowledge Base (Solution) 3898761 0 None None None 2019-02-11 10:02:04 UTC
Red Hat Product Errata RHBA-2020:3909 0 None None None 2020-09-29 19:52:34 UTC

Description Zdenek Pytela 2018-05-03 15:29:06 UTC
Description of problem:
OSCAP rule xccdf_org.ssgproject.content_rule_audit_rules_login_event
fails with Result: error
even after the remediation has been applied.

Version-Release number of selected component (if applicable):
RHEL 7.5
openscap-scanner-1.2.16-6.el7.x86_64
scap-security-guide-0.1.36-7.el7.noarch


How reproducible:
always

Steps to Reproduce:
1. yum install openscap-scanner scap-security-guide
2. oscap xccdf eval --results /tmp/results.xml --remediate --fetch-remote-resources --profile xccdf_org.ssgproject.content_profile_pci-dss /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml


Actual results:
...
Title   Record Attempts to Alter Logon and Logout Events
Rule    xccdf_org.ssgproject.content_rule_audit_rules_login_events
Ident   CCE-27204-7
Result  fail
...
Title   Record Attempts to Alter Logon and Logout Events
Rule    xccdf_org.ssgproject.content_rule_audit_rules_login_events
Ident   CCE-27204-7
Result  error
...

Expected results:
Result  fixed


Additional info:
There are 3 audit rules in place:

# cat /etc/audit/rules.d/logins.rules 
-w /var/log/tallylog -p wa -k logins
-w /var/run/faillock/ -p wa -k logins
-w /var/log/lastlog -p wa -k logins

In RHEL 7.4 GA, the remediation is detected properly and the test passes.

Comment 4 Watson Yuuma Sato 2018-11-22 12:23:02 UTC
This might have been fixed, there are some patches upstream, we should check it:
 - https://github.com/ComplianceAsCode/content/pull/2628
 - https://github.com/ComplianceAsCode/content/pull/3118
 - https://github.com/ComplianceAsCode/content/pull/3232

Comment 6 Renaud Métrich 2019-02-11 09:52:44 UTC
The fix consists indeed in removing the trailing / in "/var/run/faillock/".
This has already been integrated into scap-security-guide-0.1.40-12.el7.noarch but th description of the rule has not been updated:

linux_os/guide/system/auditing/auditd_configure_rules/audit_login_events/audit_rules_login_events_faillock.rule:

description: |-
    The audit system already collects login information for all users
    and root. If the <tt>auditd</tt> daemon is configured to use the 
    <tt>augenrules</tt> program to read audit rules during daemon startup (the
    default), add the following lines to a file with suffix <tt>.rules</tt> in the 
    directory <tt>/etc/audit/rules.d</tt> in order to watch for attempted manual
    edits of files involved in storing logon events:
    <pre>-w /var/run/faillock/ -p wa -k logins</pre>
    If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt>
    utility to read audit rules during daemon startup, add the following lines to
    <tt>/etc/audit/audit.rules</tt> file in order to watch for unattempted manual
    edits of files involved in storing logon events:
    <pre>-w /var/run/faillock/ -p wa -k logins</pre>

--> see the trailing / above (2 occurrences)


Same for linux_os/guide/system/auditing/auditd_configure_rules/audit_login_events/audit_rules_login_events.rule

This confuses the user.

Comment 8 Watson Yuuma Sato 2019-05-07 09:43:55 UTC
Description of rule audit_rules_login_events is fixed in https://github.com/ComplianceAsCode/content/pull/3232, shipped in 0.1.41
Description of rule audit_rules_login_events_faillock is fixed in https://github.com/ComplianceAsCode/content/commit/a46f13be3cc68f50f509f476a82972a8261a6886, shipped in 0.1.42

The remediations seem to have been fixed by patche above, but rule still errors in 7.7.

Comment 10 Watson Yuuma Sato 2019-06-27 14:03:51 UTC
Note from Basil, on https://bugzilla.redhat.com/show_bug.cgi?id=1723994, that can help fix this issue.

"CCE-27129-6 appears to be a problem with the fix_audit_syscall_rule function.
The function will return a 0 or 1 which determines the pass/fail of the CCE, and this function does not enter a case to change $retval to 1 if the rule exists."

Comment 11 Vojtech Polasek 2019-11-14 08:02:36 UTC
The remediation is fixed in upstream:
https://github.com/ComplianceAsCode/content/pull/4886

Comment 16 errata-xmlrpc 2020-09-29 19:52:12 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-2020:3909


Note You need to log in before you can comment on or make changes to this bug.