highaccess-controlunverified
Ensure the SSH client uses only FIPS-approved MACs
ssh-client-macs-fips · RHEL ≥ 8 · 1 impl
Description
The SSH client MACs in /etc/crypto-policies/back-ends/openssh.config must be exactly the DoD/FIPS 140-3 approved set — the SHA-2 HMAC algorithms and their ETM variants — with no weaker algorithm (e.g. hmac-sha1) present.
Rationale
A weak or non-approved MAC lets an attacker who can position themselves on the network tamper with or forge SSH message integrity. Restricting the client to FIPS-approved SHA-2 HMACs closes that avenue.
Check → Remediate
Checkcommand
cfg=/etc/crypto-policies/back-ends/openssh.config
approved="hmac-sha2-256,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-512-etm@openssh.com"
line=$(grep -iE '^[[:space:]]*MACs[[:space:]]' "$cfg" 2>/dev/null | awk '{print $2}' | tail -1)
if [ -z "$line" ]; then
echo "FAIL: no MACs line in $cfg"
exit 1
fi
got=$(printf '%s' "$line" | tr ',' '\n' | sort | paste -sd, -)
if [ "$got" = "$approved" ]; then
echo "OK: SSH client MACs are exactly the FIPS-approved set"
exit 0
fi
echo "FAIL: SSH client MACs are '$line' (expected only the FIPS-approved SHA-2 set)"
exit 1
- expected_exit:
- 0
Remediatemanual
- note:
- The client MACs are derived from the system crypto policy. Set the FIPS policy and reinstall crypto-policies so the openssh back-end is regenerated: update-crypto-policies --set FIPS dnf -y reinstall crypto-policies (See rule crypto-policy-fips for the system-wide policy.)
Framework references
STIG
V-281012 / RHEL-10-300050V-270178 / RHEL-09-255070V-272482 / RHEL-08-010296
NIST 800-53
AC-17SC-13
#ssh#client#macs#fips#crypto-policy#stig