highaccess-controlverified ✓rollback-safe
Configure SSH to use FIPS-approved ciphers (Ubuntu)
ssh-ciphers-fips-ubuntu · UBUNTU ≥ 22 · 1 impl
Description
The SSH daemon must be configured to use only FIPS 140-3 approved ciphers for session encryption. Ubuntu's approved cipher set differs from RHEL's (it excludes aes192-ctr), so this rule carries the Ubuntu-specific allowlist and remediation value.
Rationale
FIPS-approved ciphers have been validated for cryptographic strength. Restricting the SSH daemon to the Ubuntu-approved set ensures encrypted sessions cannot be downgraded to a weaker algorithm.
Check → Remediate
Checkcommand
command -v sshd >/dev/null 2>&1 || exit 0
ciphers=$(sshd -T 2>/dev/null | awk '/^ciphers /{print $2}')
if [ -z "$ciphers" ]; then
echo "FAIL: could not read effective ciphers (sshd -T needs root)"
exit 1
fi
if echo "$ciphers" | tr ',' '\n' | grep -qvE '^(aes128-ctr|aes256-ctr|aes128-gcm@openssh\.com|aes256-gcm@openssh\.com)$'; then
echo "FAIL: non-FIPS cipher in effective config: $ciphers"
exit 1
fi
echo "OK: $ciphers"
- expected_exit:
- 0
Remediateconfig_set_dropin
- dir:
- /etc/ssh/sshd_config.d
- file:
- 00-kensa-fips-ciphers.conf
- key:
- Ciphers
- value:
- aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr
- restart:
- sshd
Framework references
STIG
V-270667 / UBTU-24-100820V-260531 / UBTU-22-255050
NIST 800-53
SC-8SC-13
Live verification
ubuntu22:checkubuntu24:checkubuntu26:check
#ssh#fips#ciphers#cryptography#stig