root-ubuntu: exempt only SSH peers that actually logged in - #109
Merged
Merged
Conversation
_fail2ban_ssh_peers took every established connection to sshd, and a brute-forcer mid-attempt holds one too, so it could be written into ignoreip for good. A peer now counts only if sshd logged 'Accepted ... from' it (auth.log, or the journal without one). Also wait up to 10s for the sshd jail after a restart before warning it did not load: the first rollout warned while fail2ban was still starting. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan25 finding(s) HIGH/CRITICAL: 4 | MEDIUM: 12 | LOW: 9
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #107, from rolling it out to dev2.
_fail2ban_ssh_peersadded every established sshd connection toignoreip. A brute-forcer in the middle of an attempt holds one too, so it could be exempted permanently. A peer now counts only if sshd loggedAccepted … from <ip>for it (auth.log, or the journal on a box without it). On dev2 the peer it picked up was164.92.111.224= scan.crawlproof.com logging in by key, so nothing bad got through; the hole was real regardless.Tests: new "connected but never logged in is not exempted" case, and the ignoreip test now needs Accepted lines, including
keyboard-interactive/pam. 184/184.🤖 Generated with Claude Code