NEC-389: Every host's journal is mostly sshd noise from port 22 open to the internet #359
No reviewers
Labels
No labels
area:docs
area:identity
area:ops
area:plugin
area:server
channel:community
channel:direct
channel:owned
channel:press
channel:social
dependencies
e2ee-constrained
gate:at-ga
gate:pre-ga
marketing
parity
relay:absent
relay:planned
relay:requested
relay:supported
risk:additive
risk:contract
risk:none
security
usability
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Nectenda/nectenda!359
Loading…
Reference in a new issue
No description provided.
Delete branch "worktree-nec-389-every-hosts-journal-is-mostly-sshd-noise"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task: NEC-389 — https://projectron.nerchure.com/tasks/411
Port 22 is open to the internet on every host. On eu1 sshd wrote about 28,500 journal lines a day, almost all of them scanners failing to log in, and all of it counts against the 3 GB cap that holds 30 days of the server's own logs. Reading eu1 also showed password login was on (
passwordauthentication yes). Root was safe only becausePermitRootLogindefaults towithout-password.Two drop-ins are added to
host-files.txtfor every kind:deploy/ssh/00-nectenda.confallows keys only. sshd keeps the first value it reads, so the file is named to sort before cloud-init's. That ends the password guessing, about two thirds of eu1's sshd lines.deploy/ssh/log-filter.confis aLogFilterPatterns=deny-list on ssh.service. It is written from eu1's 40 most common line shapes and drops the lines from connections that never logged in. Logins, sessions and anything never measured are kept. systemd 255 matches against the line with itssshd[pid]:prefix still on, so the patterns anchor after that prefix.install-deployer.shrunssshd -tbefore reloading sshd, and puts the previous file back if sshd rejects the new one or the reload fails.--checkreadssshd -T -C, for root and for a user that does not exist, and the filter systemd has loaded. The ops box's cloud-init writes both files, gzipped to stay under Hetzner's 32 KiB. All of this was rehearsed on real systemd 255 and OpenSSH 9.6p1, and mutation-checked.Merging changes no host. The production steps, with what each prints and how to undo it, are in the spec under "After merge".
deploy/README.mdhas a new section, "ssh on the hosts".🤖 Generated with Claude Code
https://claude.ai/code/session_01EV8ztZCfAWqDxDxgtz8LMp
Spec:
docs/changes/NEC-389-ssh-log-noise/spec.mdChangelog
NONE