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.
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) }
endHow 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:
| directive | Banner |
|---|---|
| notify | action: reload, service: sshd.service |
| resource | sshd_setting |
| value | /etc/issue.net |
| verify | sshd -t -f %{path} |
pavois harden plan localwhere 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
| Standard | Reference | Type | Version | Confidence |
|---|---|---|---|---|
| NIST | 3.1.9 | supporting | 800-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.