Skip to content

Instantly share code, notes, and snippets.

@sparse91
Created February 22, 2019 07:31
Show Gist options
  • Save sparse91/2d56227ba1efd10b0c3aa13b1e9281a2 to your computer and use it in GitHub Desktop.
Save sparse91/2d56227ba1efd10b0c3aa13b1e9281a2 to your computer and use it in GitHub Desktop.
Fail2Ban filter for sslh demultiplexed ssh - Doesn't (and cannot) detect auth errors, but many connection attempts from the same origin is reason enough to block - Works on Arch Linux
[sslh-ssh]
enabled = true
filter = sslh-ssh
maxretry = 10
backend = systemd
bantime = 1w
action = firewallcmd-rich-rules[name=sslh,port="443"]
[INCLUDES]
[DEFAULT]
[Definition]
failregex = ^.+ sslh\-select\[.+\]: ssh:connection from <HOST>:.+ to .+ forwarded from .+ to .+:ssh\s*$
journalmatch = _SYSTEMD_UNIT=sslh-select.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment