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 2020626 - The sshd_enable_warning_banner rule creates bogus file /etc/ssh/sshd_config.d/hardening
Summary: The sshd_enable_warning_banner rule creates bogus file /etc/ssh/sshd_config.d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: scap-security-guide
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Watson Yuuma Sato
QA Contact: Milan Lysonek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-05 12:40 UTC by Jan Pazdziora (Red Hat)
Modified: 2022-05-17 13:54 UTC (History)
6 users (show)

Fixed In Version: scap-security-guide-0.1.60-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 13:53:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-101855 0 None None None 2021-11-05 12:41:14 UTC
Red Hat Product Errata RHBA-2022:2610 0 None None None 2022-05-17 13:53:54 UTC

Description Jan Pazdziora (Red Hat) 2021-11-05 12:40:26 UTC
Description of problem:

When remediating with the sshd_enable_warning_banner rule in the OSPP profile, file /etc/ssh/sshd_config.d/hardening gets created which does affect the configuration because /etc/ssh/sshd_config states

  Include /etc/ssh/sshd_config.d/*.conf

so it only processes files with .conf extension.

Polluting filesystem with with unnecessary empty files is not nice.

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

scap-security-guide-0.1.57-5.el9

How reproducible:

Deterministic.

Steps to Reproduce:
1. Check content of /etc/ssh/sshd_config.d with
   ls -la /etc/ssh/sshd_config.d
2. Remediate the sshd_enable_warning_banner rule:
   oscap xccdf eval --remediate --profile xccdf_org.ssgproject.content_profile_ospp --rule xccdf_org.ssgproject.content_rule_sshd_enable_warning_banner /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
3. Check content of /etc/ssh/sshd_config.d again with
   ls -la /etc/ssh/sshd_config.d

Actual results:

total 8
drwx------. 2 root root   28 Nov  5 07:33 .
drwxr-xr-x. 4 root root 4096 Nov  5 07:35 ..
-rw-------. 1 root root  719 Oct 25 05:46 50-redhat.conf

WARNING: Datastream component 'scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL9.xml' points out to the remote 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL9.xml'. Use '--fetch-remote-resources' option to download it.
WARNING: Skipping 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL9.xml' file which is referenced from datastream
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL9.xml file which is referenced from XCCDF content
Title	Enable SSH Warning Banner
Rule	xccdf_org.ssgproject.content_rule_sshd_enable_warning_banner
Ident	CCE-90807-9
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL9.xml file which is referenced from XCCDF content
Result	fail
 --- Starting Remediation ---
Title	Enable SSH Warning Banner
Rule	xccdf_org.ssgproject.content_rule_sshd_enable_warning_banner
Ident	CCE-90807-9
Result	fixed

total 12
drwx------. 2 root root   87 Nov  5 07:36 .
drwxr-xr-x. 4 root root 4096 Nov  5 07:36 ..
-rw-r--r--. 1 root root   18 Nov  5 07:36 00-complianceascode-hardening.conf
-rw-------. 1 root root  719 Nov  5 07:36 50-redhat.conf
-rw-r--r--. 1 root root    0 Nov  5 07:36 hardening

Expected results:

total 8
drwx------. 2 root root   28 Nov  5 07:33 .
drwxr-xr-x. 4 root root 4096 Nov  5 07:35 ..
-rw-------. 1 root root  719 Oct 25 05:46 50-redhat.conf

WARNING: Datastream component 'scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL9.xml' points out to the remote 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL9.xml'. Use '--fetch-remote-resources' option to download it.
WARNING: Skipping 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL9.xml' file which is referenced from datastream
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL9.xml file which is referenced from XCCDF content
Title	Enable SSH Warning Banner
Rule	xccdf_org.ssgproject.content_rule_sshd_enable_warning_banner
Ident	CCE-90807-9
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL9.xml file which is referenced from XCCDF content
Result	fail
 --- Starting Remediation ---
Title	Enable SSH Warning Banner
Rule	xccdf_org.ssgproject.content_rule_sshd_enable_warning_banner
Ident	CCE-90807-9
Result	fixed

total 10
drwx------. 2 root root   87 Nov  5 07:36 .
drwxr-xr-x. 4 root root 4096 Nov  5 07:36 ..
-rw-r--r--. 1 root root   18 Nov  5 07:36 00-complianceascode-hardening.conf
-rw-------. 1 root root  719 Nov  5 07:36 50-redhat.conf

-- the hardening file not present.

Additional info:

Comment 4 Matěj Týč 2021-12-15 10:52:43 UTC
Fixed by a rebase in 0.1.58

Comment 18 errata-xmlrpc 2022-05-17 13:53: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 (new packages: scap-security-guide), 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-2022:2610


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