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 2130185

Summary: Offline remediation of fstab permissions fails in Image Builder
Product: Red Hat Enterprise Linux 8 Reporter: Evgeny Kolesnikov <ekolesni>
Component: scap-security-guideAssignee: Vojtech Polasek <vpolasek>
Status: CLOSED ERRATA QA Contact: Milan Lysonek <mlysonek>
Severity: high Docs Contact: Petr Hybl <phybl>
Priority: high    
Version: 8.7CC: cbesson, ggasparb, jcerny, jjaburek, matyc, mhaicman, mjahoda, mlysonek, vpolasek, wsato
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/ComplianceAsCode/content/issues/9342
Whiteboard:
Fixed In Version: scap-security-guide-0.1.69-1.el8 Doc Type: Bug Fix
Doc Text:
.Images can now be configured with security profiles SCAP Security Guide rules that configure mount point options have been reworked, and you can now use them also for hardening images when building an operating system image in image builder. As a result, you can now build images with partition configuration aligned with a specific security profile.
Story Points: ---
Clone Of:
: 2228448 2228476 (view as bug list) Environment:
Last Closed: 2023-11-14 15:36:38 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: 2228448, 2228476    
Deadline: 2023-08-28   

Description Evgeny Kolesnikov 2022-09-27 12:38:21 UTC
Description of problem:
When remediating any of the Restrict Partition Mount Options the remediation fails in offline mode i.e. xccdf_org.ssgproject.content_rule_mount_option_dev_shm_noexec. The remediation script checks the /proc/mounts which is unavailable even if the fstab file has been created.

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

How reproducible:


Steps to Reproduce:
1. Configure a blueprint with moutnpoint options and oscap configuration
2. Build image with osbuild-composer

Actual results:
Remediation does not run at all for this since the evaluation result is unknown.

Expected results:
Offline remediation of the /etc/fstab file

Additional info:

I: oscap: Evaluating definition 'oval:ssg-mount_option_home_nodev:def:1': Add nodev Option to /home.
I: oscap:   Evaluating partition test 'oval:ssg-test_home_partition_nodev_optional_yes:tst:1': nodev on /home optional yes.
I: oscap:     Querying partition object 'oval:ssg-object_home_partition_nodev_optional_yes:obj:1', flags: 0.
I: oscap:     Creating new syschar for partition_object 'oval:ssg-object_home_partition_nodev_optional_yes:obj:1'.
I: oscap:     I will run partition_probe_main:
E: oscap:     Can't open /proc/mounts: errno=2, No such file or directory.
W: oscap:     Can't receive message: 125, Operation canceled.
E: oscap:     Recv: retry limit (0) reached.
I: oscap:   Test 'oval:ssg-test_home_partition_nodev_optional_yes:tst:1' evaluated as (null).

Upstream issue: https://github.com/ComplianceAsCode/content/issues/9342

Comment 2 Evgeny Kolesnikov 2023-04-25 10:32:20 UTC
The way we evaluate and remediate mount point options in CaC content
has been changed to accommodate 'offline' systems. The content would
now properly detect mount point configuration and change it
accordingly in the IB pipeline environment.

https://github.com/ComplianceAsCode/content/pull/10200

Comment 3 Christophe Besson 2023-07-20 12:10:47 UTC
One of our customers is experiencing the issue while applying CIS Level 1 Server while using osbuild-composer for RHEL 8.8 as well as RHEL 9.2.
It also has to be fixed for RHEL 9.

Setting the severity as High as we have no workaround to suggest.

Comment 22 errata-xmlrpc 2023-11-14 15:36:38 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 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-2023:7056