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

Enable SSH Warning Banner

Configures sshd to display a legal warning banner before login by setting Banner /etc/issue.

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 →
FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0
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

A pre-authentication warning banner reinforces policy awareness during login and supports possible legal action against intruders by removing any claim of unauthorized-access ambiguity. Many regulatory frameworks require such consent/notice text. Pointing Banner at /etc/issue ensures every interactive SSH session presents the approved notice. (Systems whose ownership should stay non-obvious can use a banner that avoids easy attribution.)

What Pavois checks

Pavois reads the effective banner value from sshd -T, the daemon's resolved configuration. A scan of /etc/ssh/sshd_config could miss a value set in an Included drop-in under /etc/ssh/sshd_config.d/, sshd -T reflects exactly which banner the running daemon will present.

describe command('sshd -T') do
  its('stdout') { should match(/^banner\s+\/etc\/issue(\.net)?$/i) }
end

How to verify it is applied

Run sudo sshd -T | grep -i banner. The expected output is banner /etc/issue. You can also open a fresh ssh connection and confirm the banner text is displayed before the password prompt.

Inspect & investigate

Banner presentation itself is not logged, but the surrounding connection and authentication events are recorded by sshd in /var/log/secure (RHEL family); follow with journalctl -u sshd -f. The banner file content is /etc/issue.

Remediation

No automated remediation is defined for this rule (remediation is empty), so it must be applied manually: set Banner /etc/issue in /etc/ssh/sshd_config (or a drop-in in /etc/ssh/sshd_config.d/), ensure /etc/issue contains the approved warning text, validate with sshd -t, then reload the service (systemctl reload sshd).

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

directiveBanner
notifyaction: reload, service: sshd.service
resourcesshd_setting
value/etc/issue.net
verifysshd -t -f %{path}
pavois harden plan local

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

Impact & precautions

Without a banner, users receive no legal/usage notice and prosecution of intruders is harder; the gap is compliance- and policy-oriented rather than a direct technical exposure. Applying it is low-risk. Precaution: keep the banner text generic, do not reveal hostname, OS version, or other details an attacker could use for reconnaissance, and remember /etc/issue is also shown at the local console. Reloading sshd (not restarting) keeps existing sessions alive, so there is no lockout risk.

Standards mapping

StandardReferenceTypeVersionConfidence
NIST3.1.9supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium

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