← All rules
SOCLE-CLD-SSH-010// SSHmediumeffective runtime

Disable SSH TCP Forwarding

Forces AllowTcpForwarding no so authenticated SSH clients cannot tunnel arbitrary TCP connections through the server.

Checked against the resolved running state (e.g. sshd -T, sysctl, systemctl show), catches drop-ins and Includes a file read would miss. Caveat: runtime ≠ persistence; a value correct now may not survive a reboot.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 1 standard

Pavois asserts the effective configuration, the live, resolved state, not a file. File-based scanners (OVAL/SCAP, Lynis) miss Includes, drop-ins and runtime defaults; this check sees what is actually applied.

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

TCP forwarding (ssh -L/-R/-D) lets an authenticated user turn the SSH server into a relay: it can be used to pivot into otherwise-unreachable internal hosts, bypass firewall segmentation, or build a back-door tunnel for exfiltration. Unless there is an operational requirement, disabling TCP forwarding removes this tunneling and lateral-movement capability.

What Pavois checks

Pavois reads the effective value from sshd -T, after all Includes, /etc/ssh/sshd_config.d/ drop-ins and Match blocks. A Match stanza can re-enable forwarding for specific users; only the resolved output reveals that, unlike a read of /etc/ssh/sshd_config.

describe command('sshd -T') do
  its('stdout') { should match(/^allowtcpforwarding\s+no$/i) }
end

How to verify it is applied

Run sshd -T | grep -i '^allowtcpforwarding'. Expected output is allowtcpforwarding no.

Inspect & investigate

Refused forward requests are logged via journalctl -u sshd or in /var/log/secure, e.g. lines mentioning refused local port forward when a client attempts a tunnel.

Remediation

Pavois's harden plan writes the sshd_setting directive AllowTcpForwarding no in a managed drop-in, validates with sshd -t, then reloads the ssh service. Apply it with pavois harden apply.

Pavois applies this with its own harden engine, the plan below, not a shell script:

directiveallowtcpforwarding
notifyaction: reload, service: ssh.service
resourcesshd_setting
valueno
verifysshd -t -f %{path}
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

Before applying, confirm no workflow relies on SSH tunnels: database access via ssh -L, SOCKS proxying via ssh -D, remote-forward callbacks via ssh -R, or tools that proxy through a jump host. If any are needed, scope an exception with a Match block rather than re-enabling globally. Plain shell logins are unaffected and the reload keeps current sessions alive.

Standards mapping

StandardReferenceTypeVersionConfidence
PCI DSS2.2.6supporting4.0.1medium

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references