Do Not Allow SSH Environment Options
An XCCDF Rule
Description
Ensure that users are not able to override environment variables of the SSH daemon.The default SSH configuration disables environment processing. The appropriate configuration is used if no value is set for
PermitUserEnvironment
.
To explicitly disable Environment options, add or correct the following
/etc/ssh/sshd_config
:
PermitUserEnvironment no
Rationale
SSH environment options potentially allow users to bypass access restriction in some configurations.
- ID
- xccdf_org.ssgproject.content_rule_sshd_do_not_permit_user_env
- Severity
- Medium
- References
- Updated
Remediation Templates
A Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then
if [ -e "/etc/ssh/sshd_config" ] ; then
LC_ALL=C sed -i "/^\s*PermitUserEnvironment\s\+/Id" "/etc/ssh/sshd_config"
else
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CJIS-5.5.6
- DISA-STIG-RHEL-08-010830