ComplianceAsCode / ComplianceAsCode/content

SSH Client Alive Count Max and Interval not updated on default sshd_config

Open
#11,000 1 comment 1 reaction 0 assignees View on GitHub
Ansible triaged
Dominant language
Shell
Stars
2.8k
Forks
828
Avg merge
3d 8m
Merged PRs (30d)
80

Description

#### Description of problem:

After running the playbook, following 2 values are not set in /etc/ssh/sshd_config on a new install RHEL 8.8 machine:

ClientAliveInterval 900
ClientAliveCountMax 0

****

#### SCAP Security Guide Version:

#### Operating System Version:

RHEL 8.8 x86_64

#### Steps to Reproduce:

1.
2.
3.
4.

#### Actual Results:

#### Expected Results:

#### Additional Information/Debugging Steps:

The regex to insert correct line, e.g. for ClientAliveCountMax assumes this attribute is defined:

- name: Insert correct line to /etc/ssh/sshd_config
lineinfile:
path: /etc/ssh/sshd_config
create: true
regexp: (?i)^\s*ClientAliveCountMax\s+
line: ClientAliveCountMax {{ var_sshd_set_keepalive }}

While in the default sshd_config, it's commented out:

#ClientAliveCountMax 3

Need to update the regex to cater for this case?

regexp: (?i)^[#\s]*ClientAliveCountMax\s+

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.