Skip to content

Configure SSSD to Expire SSH Known Hosts

An XCCDF Rule

Description

SSSD should be configured to expire keys from known SSH hosts after seconds. To configure SSSD to known SSH hosts, set ssh_known_hosts_timeout to under the [ssh] section in /etc/sssd/sssd.conf. For example:
[ssh]
ssh_known_hosts_timeout = 

Rationale

If cached authentication information is out-of-date, the validity of the authentication information may be questionable.

ID
xccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout
Severity
Medium
References
Updated

Remediation Templates

A Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q sssd-common && { [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; }; then
var_sssd_ssh_known_hosts_timeout='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_sssd_ssh_known_hosts_timeout" use="legacy"/>'


# sssd configuration files must be created with 600 permissions if they don't exist

An Ansible Snippet

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-80366-8
  - NIST-800-53-CM-6(a)