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 1630739 - Rules not applicable to containers are not marked as "machine only" anymore
Summary: Rules not applicable to containers are not marked as "machine only" anymore
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: scap-security-guide
Version: 7.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Watson Yuuma Sato
QA Contact: Matus Marhefka
Mirek Jahoda
URL:
Whiteboard:
Depends On:
Blocks: 1648377 1698752
TreeView+ depends on / blocked
 
Reported: 2018-09-19 07:12 UTC by Matus Marhefka
Modified: 2019-08-06 13:04 UTC (History)
8 users (show)

Fixed In Version: scap-security-guide-0.1.43-4.el7
Doc Type: Bug Fix
Doc Text:
.`scap-security-guide` now correctly skips rules that are not applicable to containers and container images SCAP Security Guide content can be used to scan containers and container images now. Rules that are not applicable to containers and container images have been marked with a specific CPE identifier. As a result, the evaluation of these rules is skipped automatically, and the result `not applicable` is reported when scanning containers and container images.
Clone Of:
: 1698752 (view as bug list)
Environment:
Last Closed: 2019-08-06 13:04:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2198 0 None None None 2019-08-06 13:04:20 UTC

Description Matus Marhefka 2018-09-19 07:12:10 UTC
Description of problem:
After remediating a container image using 'atomic scan --remediate' the initramfs file is generated inside the image at "boot/initramfs-...". We should check the rule responsible for generating this file (probably some grub2* rule) and disable it for containers.

It would be also good to have some script in upstream to list container-only rules which we can use for auditing.


Version-Release number of selected component (if applicable):
scap-security-guide-0.1.40-3.el7.noarch
openscap-container-7.6.0-1


How reproducible:
always


Actual results:
initramfs is generated inside a remediated container image.


Expected results:
initramfs is NOT generated inside a remediated container image.

Comment 2 Matus Marhefka 2018-11-21 09:09:11 UTC
The original report is a consequence of the following upstream issue:
https://github.com/ComplianceAsCode/content/issues/3569

Comment 3 Matus Marhefka 2018-11-21 09:23:46 UTC
The issue was caused by a structure reorganization in the upstream SSG project. Rules which were marked with the "cpe:/a:machine" lost this CPE during reorganization and became "applicable" when scanning/remediating container images. This causes `atomic scan` to scan/remediate rules which should be "not applicable" to containers which results in errors.

Comment 5 Matus Marhefka 2018-11-21 09:30:36 UTC
Issue is fixed in upstream: https://github.com/ComplianceAsCode/content/pull/3576

Comment 6 Watson Yuuma Sato 2018-11-22 10:17:55 UTC
We should also consider reviewing added rules and for their machine/container applicability.

Comment 10 Marek Haicman 2019-04-03 10:12:11 UTC
Current result is inconsistent - some of the rules are not (audit, grub2 and sysctl rules are not marked as machine only). Moving back to assigned.

Comment 11 Watson Yuuma Sato 2019-04-08 12:25:19 UTC
The following patches correct inconsistencies of machine only applicability:
https://github.com/ComplianceAsCode/content/pull/4240
https://github.com/ComplianceAsCode/content/pull/4246

Comment 12 Gabriel Gaspar Becker 2019-04-08 12:48:18 UTC
The following patches mark as machine only rules which are not applicable to container:
https://github.com/ComplianceAsCode/content/pull/4240
https://github.com/ComplianceAsCode/content/pull/4246

Patches from PR's mentioned in this comment are already backported.

Comment 19 Gabriel Gaspar Becker 2019-04-17 07:51:41 UTC
Following additional modifications are required to fix the issue.

All SELinux related rules should be marked as machine only:
https://github.com/ComplianceAsCode/content/pull/4280

Subsequent rules also need to be marked as machine only:
service_rexec_disabled:notchecked
service_rlogin_disabled:notchecked

service_abrtd_disabled:pass
service_autofs_disabled:pass
service_avahi-daemon_disabled:pass
service_bluetooth_disabled:pass
service_cups_disabled:pass
service_dhcpd_disabled:pass
service_dovecot_disabled:pass
service_httpd_disabled:pass
service_kdump_disabled:pass
service_named_disabled:pass
service_nfs_disabled:pass
service_ntpdate_disabled:pass
service_oddjobd_disabled:pass
service_qpidd_disabled:pass
service_rdisc_disabled:pass
service_rhnsd_disabled:pass
service_rpcbind_disabled:pass
service_rsh_disabled:pass
service_smb_disabled:pass
service_snmpd_disabled:pass
service_squid_disabled:pass
service_telnet_disabled:pass
service_tftp_disabled:pass
service_vsftpd_disabled:pass
service_ypbind_disabled:pass
service_zebra_disabled:pass

Comment 20 Gabriel Gaspar Becker 2019-04-23 09:26:54 UTC
Both PR's address the remaining issues.

https://github.com/ComplianceAsCode/content/pull/4280
https://github.com/ComplianceAsCode/content/pull/4290

Comment 24 errata-xmlrpc 2019-08-06 13:04:08 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-2019:2198


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