Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1547107

Summary: textfilecontent* probes do not work in offline mode
Product: Red Hat Enterprise Linux 7 Reporter: Matus Marhefka <mmarhefk>
Component: openscapAssignee: Jan Černý <jcerny>
Status: CLOSED ERRATA QA Contact: Matus Marhefka <mmarhefk>
Severity: high Docs Contact:
Priority: high    
Version: 7.5CC: matyc, mhaicman, mpreisle, mthacker, openscap-maint, wsato
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1566588 (view as bug list) Environment:
Last Closed: 2018-10-30 11:44:40 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: 1566588    

Description Matus Marhefka 2018-02-20 14:26:39 UTC
Description of problem:
First remediate the rhel7 base image:
# atomic scan --remediate --scan_type configuration_compliance --scanner_args profile=xccdf_org.ssgproject.content_profile_stig-rhel7-disa registry.access.stage.redhat.com/rhel7:latest
[...]
Remediating rule 5/33: 'xccdf_org.ssgproject.content_rule_aide_scan_notification'
grep: /etc/crontab: No such file or directory
grep: /etc/cron.d: No such file or directory
grep: /etc/cron.weekly: No such file or directory
grep: /etc/cron.monthly: No such file or directory
[...]

Successfully built remediated image 59a77dc246e5 from 4b8676171c27e9a36ee91e8769626779323ac2c49bbd99b0436a3d2af5e7758f.

Files associated with this scan are in /var/lib/atomic/openscap/2018-02-20-07-36-00-508269.


Now scan the remediated image using atomic scan and oscap-docker and check the result of the "Configure Notification of Post-AIDE Scan Details" rule:
# atomic scan --scan_type configuration_compliance --scanner_args profile=xccdf_org.ssgproject.content_profile_stig-rhel7-disa 59a77dc246e5 &>atomic.log
# grep "Configure Notification of Post-AIDE Scan Details" atomic.log -A2
     Configure Notification of Post-AIDE Scan Details
     Severity: Moderate
       XCCDF result: fail
# oscap-docker image 59a77dc246e5 xccdf eval --profile xccdf_org.ssgproject.content_profile_stig-rhel7-disa ssg-rhel7-ds.xml &>oscap.log
(NOTE: ssg-rhel7-ds.xml is a datastream file from the openscap-docker image and is from scap-security-guide-0.1.36-7.el7.noarch)
# grep "Configure Notification of Post-AIDE Scan Details" oscap.log -A3
Title   Configure Notification of Post-AIDE Scan Details
Rule    xccdf_org.ssgproject.content_rule_aide_scan_notification
Ident   CCE-80374-2
Result  pass

Cron is installed on the host system, but not on the remediated container image:
# rpm -qa | grep cron
crontabs-1.11-6.20121102git.el7.noarch
cronie-anacron-1.4.11-19.el7.x86_64
cronie-1.4.11-19.el7.x86_64
# docker run --rm -it registry.access.redhat.com/rhel7 rpm -qa | grep cron
#

Uninstall cron from the host and run the scan using oscap-docker again:
# yum remove -y cronie
# oscap-docker image 59a77dc246e5 xccdf eval --profile xccdf_org.ssgproject.content_profile_stig-rhel7-disa ssg-rhel7-ds.xml &>oscap.log
# grep "Configure Notification of Post-AIDE Scan Details" oscap.log -A3
Title   Configure Notification of Post-AIDE Scan Details
Rule    xccdf_org.ssgproject.content_rule_aide_scan_notification
Ident   CCE-80374-2
Result  fail

And the rule is now correctly reported as fail. It is also _IMPORTANT_ to note that when scanning the original container image (registry.access.stage.redhat.com/rhel7:latest), oscap-docker correctly reports fail for the rule. So this only happens when scanning a remediated container image.


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

openscap-docker-7.5.0-2 (container image used by atomic scan)
atomic-1.20.1-9.git436cf5d.el7.x86_64
docker-1.12.6-71.git3e8e77d.el7.x86_64



How reproducible:
100%

Comment 2 Marek Haicman 2018-03-26 22:34:18 UTC
This rule is using textfilecontent54 probe. For technical details what is happening, please see https://github.com/OpenSCAP/openscap/issues/1001

Comment 5 Matus Marhefka 2018-04-10 09:33:13 UTC
The following commit needs to be investigated and reverted:
https://github.com/OpenSCAP/openscap/commit/908d002c68e43a3d3c3bede128c535fbee815a10

Comment 6 Matus Marhefka 2018-04-10 09:38:26 UTC
Upstream issue:
https://github.com/OpenSCAP/openscap/issues/1001

The original description in this bug is a consequence of this problem.

Comment 7 Watson Yuuma Sato 2018-04-12 14:19:26 UTC
Fix upstream: https://github.com/OpenSCAP/openscap/pull/1002

Comment 12 errata-xmlrpc 2018-10-30 11:44:40 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, 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-2018:3302