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 2152208 - The stig rule xccdf_org.ssgproject.content_rule_sudo_require_reauthentication fails due to space in in the "timestamp_timeout" value
Summary: The stig rule xccdf_org.ssgproject.content_rule_sudo_require_reauthentication...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: scap-security-guide
Version: 8.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Vojtech Polasek
QA Contact: Jiri Jaburek
Jan Fiala
URL:
Whiteboard:
Depends On:
Blocks: 2168066 2168067 2168068
TreeView+ depends on / blocked
 
Reported: 2022-12-09 18:41 UTC by Ameya Patil
Modified: 2023-05-16 10:05 UTC (History)
9 users (show)

Fixed In Version: scap-security-guide-0.1.66-1.el8
Doc Type: Bug Fix
Doc Text:
.The `sudo_require_reauthentication` SCAP Security Guide rule accepts correct spacing in `sudoers` Previously, a bug in the checking of the `xccdf_org.ssgproject.content_rule_sudo_require_reauthentication` rule caused it to require specific spacing between the `timestamp_timeout` key and its value in the `/etc/sudoers` file and the `/etc/sudoers.d` directory. Consequently, valid and compliant syntax caused the rule to fail incorrectly. With this update, the check for `xccdf_org.ssgproject.content_rule_sudo_require_reauthentication` has been updated to accept blank spaces around the equal sign. As a result, the rule accepts correct and compliant definitions of `timestamp_timeout` with any of the following spacing formats: * `Defaults timestamp_timeout = 5` * `Defaults timestamp_timeout= 5` * `Defaults timestamp_timeout =5` * `Defaults timestamp_timeout=5`
Clone Of:
: 2168066 2168067 2168068 (view as bug list)
Environment:
Last Closed: 2023-05-16 08:39:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-141798 0 None None None 2022-12-09 18:42:25 UTC
Red Hat Product Errata RHBA-2023:2869 0 None None None 2023-05-16 08:40:27 UTC

Description Ameya Patil 2022-12-09 18:41:29 UTC
Description of problem:

One of our customer observed that as part of stig scan , the scap rule - xccdf_org.ssgproject.content_rule_sudo_require_reauthentication which is used to check if value of "Default timestamp_timeout" is set or not , fails when there is a space character in between the value

For example the rules fails when there is a space around the "timestamp_timeout=value"

Fails:       Defaults timestamp_timeout = 1
Fails:       Defaults timestamp_timeout= 1
Passes:      Defaults timestamp_timeout=1

I tested and found that visudo is able to parse this in all three scenarios and also verified that all three scenarios the sudo does work with the configured value.

Due to this, the rule should be able to Pass in in all three scenarios.


Version-Release number of selected component (if applicable):
scap-security-guide-0.1.63-4.el8.noarch

How reproducible:
Everytime

Steps to Reproduce:

1. Edit /etc/sudoers files and add a line "Defaults timestamp_timeout = 1" i.e. space around the "=" sign and run the oscap scan and it will fail.

~~~
# oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_stig --rule xccdf_org.ssgproject.content_rule_sudo_require_reauthentication /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
WARNING: Datastream component 'scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL8.xml.bz2' points out to the remote 'https://access.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml.bz2'. Use '--fetch-remote-resources' option to download it.
WARNING: Skipping 'https://access.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml.bz2' file which is referenced from datastream
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL8.xml.bz2 file which is referenced from XCCDF content
--- Starting Evaluation ---

Title   The operating system must require Re-Authentication when using the sudo command. Ensure sudo timestamp_timeout is appropriate - sudo timestamp_timeout
Rule    xccdf_org.ssgproject.content_rule_sudo_require_reauthentication
Ident   CCE-87838-9
Result  fail
~~~

2. Now change the visudo file so there is no spaces around "=" i.e. "timestamp_timeout=1" and run the oscap scan for this rule and it will pass.
~~~
# oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_stig --rule xccdf_org.ssgproject.content_rule_sudo_require_reauthentication /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
WARNING: Datastream component 'scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL8.xml.bz2' points out to the remote 'https://access.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml.bz2'. Use '--fetch-remote-resources' option to download it.
WARNING: Skipping 'https://access.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml.bz2' file which is referenced from datastream
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL8.xml.bz2 file which is referenced from XCCDF content
--- Starting Evaluation ---

Title   The operating system must require Re-Authentication when using the sudo command. Ensure sudo timestamp_timeout is appropriate - sudo timestamp_timeout
Rule    xccdf_org.ssgproject.content_rule_sudo_require_reauthentication
Ident   CCE-87838-9
Result  pass
~~~


Actual results:
The scan fails when there is space between key/value pair for timestamp_timeout

Expected results:
The scan should pass even when there is space around the timestamp_timeout as visudo parses it correctly and sudo also behaves correctly in this cases.


Additional info:

Comment 2 Watson Yuuma Sato 2022-12-12 15:36:18 UTC
Moving to post: https://github.com/ComplianceAsCode/content/pull/9923

Comment 19 errata-xmlrpc 2023-05-16 08:39:27 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-2023:2869


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