gitea: the jail also bans what gitea's sshd refuses #232

Merged
mesh-admin merged 1 commits from jschoubben/gitea-ssh-jail AGit into main 2026-10-02 21:23:45 +00:00
Owner

Gitea's jail already reads the gitea container's journal (CONTAINER_NAME=gitea) and covers port 222, but its filter only matched web-login failures. Gitea's sshd logs into the same journal, and brute-force on port 222 went unbanned (167 attempts/hour, jail showed 0 failures). Adds two patterns, one per attempt so nothing is counted twice: 'Invalid user X from HOST port N' and 'User X from HOST not allowed because ...'. Tested with fail2ban-regex against 24h of the real journal: 946 matches (878 + 68), and 0 matches on the 134 accepted-publickey lines. mesh-controller's catalogue checks pass against the manifest.

Gitea's jail already reads the gitea container's journal (CONTAINER_NAME=gitea) and covers port 222, but its filter only matched web-login failures. Gitea's sshd logs into the same journal, and brute-force on port 222 went unbanned (167 attempts/hour, jail showed 0 failures). Adds two patterns, one per attempt so nothing is counted twice: 'Invalid user X from HOST port N' and 'User X from HOST not allowed because ...'. Tested with fail2ban-regex against 24h of the real journal: 946 matches (878 + 68), and 0 matches on the 134 accepted-publickey lines. mesh-controller's catalogue checks pass against the manifest.
jschoubben added 1 commit 2026-10-02 21:23:37 +00:00
The jail read gitea's container journal, which carries its sshd's lines,
but matched only the web login. 167 ssh attempts an hour from the
internet went unbanned. Two patterns, one per attempt: an unknown user,
and a user sshd refuses; tested against a day of the real log, 946
matches and none on an accepted login.
mesh-admin merged commit 0fd722e829 into main 2026-10-02 21:23:45 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#232