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 1599179 - Inconsistent memcache_timeout, ssh_known_hosts_timeout wrt man sssd.conf
Summary: Inconsistent memcache_timeout, ssh_known_hosts_timeout wrt man sssd.conf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: scap-security-guide
Version: 7.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Gabriel Gaspar Becker
QA Contact: Watson Yuuma Sato
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-09 06:26 UTC by amitkuma
Modified: 2020-01-08 12:57 UTC (History)
4 users (show)

Fixed In Version: scap-security-guide-0.1.43-10.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
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 amitkuma 2018-07-09 06:26:10 UTC
Description of problem:
ssg-rhel7-ds.xml reports inconsistent values wrt sssd.conf
ssg-rhel7-ds.xml recommends:
memcache_timeout = 86400
ssh_known_hosts_timeout = 86400

sssd.conf default
memcache_timeout = 300
ssh_known_hosts_timeout = 180


Version-Release number of selected component (if applicable):
scap-security-guide-0.1.36-9.el7_5.noarch

How reproducible:
Always

Steps to Reproduce:
1.check above values in sssd.conf and ssg-rhel7-ds.xml
2.
3.

Actual results:
scap-security-guide is not in sync with sssd.conf

Expected results:
scap-security-guide should be in sync with sssd.conf

Additional info:

Comment 4 Jan Černý 2019-03-07 08:43:55 UTC
Granting devel ack because it's fixed by rebase to 0.1.43.

Comment 7 Gabriel Gaspar Becker 2019-05-14 15:06:31 UTC
Issues found during verification (package version: scap-security-guide-0.1.43-4.el7.noarch, RHEL version: RHEL-7.7-20190502.1):

1. OSPP profile selects the rule sssd_ssh_known_hosts_timeout and uses the default variable value (180 in this case). But fails in checking the configuration.
------------------------------------------>8------------------------------
$cat /etc/sssd/sssd.conf
[nss]
ssh_known_hosts_timeout = 1234

oscap xccdf eval --profile ospp --rule xccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout --results /tmp/results.xml /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml 
WARNING: This content points out to the remote resources. Use `--fetch-remote-resources' option to download them.
WARNING: Skipping https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL7.xml.bz2 file which is referenced from XCCDF content
Title   Configure SSSD to Expire SSH Known Hosts
Rule    xccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout
Ident   CCE-80366-8
E: oscap:     Error occured when comparing a variable 'oval:ssg-var_sssd_ssh_known_hosts_timeout:var:1' value '180' with collected item entity = '
'
Result  fail

OpenSCAP Error: Conversion of the string "
" to an integer (64 bits) failed: Invalid argument [oval_cmp.c:111]

----------------------------------------->8---------------------------------

The value is not being retrieved correctly from configuration file during OVAl check.

The fix is similar to:
https://github.com/ComplianceAsCode/content/commit/af819c18d6fab5468280455d2034b15877914dac#diff-92d3eba374b2aeaa33d38dc538007ef0

The regular expression for oval variable extraction needs to be updated to:
^[\s]*\[ssh](?:[^\n\[]*\n+)+?[\s]*sssd_ssh_known_hosts_timeout[\s]*=[\s]*(\d+)$

Only ansible playbook remediation is available. Include bash remediation similar to sssd_memcache_timeout 

-----

2. Variable used in OCIL is not being expanded correctly as seen in following logs:

Rule: linux_os/guide/services/sssd/sssd_ssh_known_hosts_timeout/rule.yml
$cat ssg-rhel7-ds.xml | grep -A 4 "sudo grep ssh_known_hosts_timeout /etc/sssd/sssd.conf"

	$ sudo grep ssh_known_hosts_timeout /etc/sssd/sssd.conf
	If configured properly, output should be
	ssh_known_hosts_timeout = 
	      Is it the case that it does not exist or is not configured properly?
	      </ns0:question_text>
	--
	$ sudo grep ssh_known_hosts_timeout /etc/sssd/sssd.conf
	If configured properly, output should be
	ssh_known_hosts_timeout = 
	      Is it the case that it does not exist or is not configured properly?
	      </ns0:question_text>


Rule: linux_os/guide/services/sssd/sssd_memcache_timeout/rule.yml
$cat ssg-rhel7-ds.xml | grep -A 4 "sudo grep memcache_timeout /etc/sssd/sssd.conf"

	$ sudo grep memcache_timeout /etc/sssd/sssd.conf
	If configured properly, output should be memcache_timeout = .
	      Is it the case that it does not exist or is not configured properly?
	      </ns0:question_text>
		</ns0:boolean_question>
	--
	$ sudo grep memcache_timeout /etc/sssd/sssd.conf
	If configured properly, output should be memcache_timeout = .
	      Is it the case that it does not exist or is not configured properly?
	      </ns0:question_text>
		</ns0:boolean_question>


Moving status back to ASSIGNED.

Comment 8 Gabriel Gaspar Becker 2019-05-17 14:41:40 UTC
Fixed upstream: https://github.com/ComplianceAsCode/content/pull/4352

Comment 10 Gabriel Gaspar Becker 2019-05-21 08:12:22 UTC
Issue number 2 from comment7 is not considered by the latest fix (scap-security-guide-0.1.43-8.el7), the issue turned out to be an unrelated problem. New upstream issue was created: https://github.com/ComplianceAsCode/content/issues/4354

Comment 12 Watson Yuuma Sato 2019-05-22 12:59:45 UTC
The Ansible remediation is using wrong variable to remediate.

Comment 13 Gabriel Gaspar Becker 2019-05-23 07:51:40 UTC
This patch fixes the problem with ansible remediation using wrong variable: https://github.com/ComplianceAsCode/content/pull/4365

Comment 17 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.