Last active
December 13, 2024 06:09
-
-
Save pertsevds/723c27f42d2224db0ceaa69aa48d009b to your computer and use it in GitHub Desktop.
Fail2ban Cockpit filter and jail
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
Filter "/etc/fail2ban/filter.d/cockpit.conf": | |
# Fail2Ban filter for Cockpit | |
# | |
[Definition] | |
failregex = pam_unix\(cockpit:auth\): authentication failure;.*rhost=<HOST> | |
datepattern = ^%%b %%d %%H:%%M:%%S | |
# DEV Notes: | |
# Author: Dmitriy Pertsev | |
Jail "/etc/fail2ban/jail.local": | |
[cockpit] | |
enabled = true | |
port = 9090 | |
logpath = %(syslog_authpriv)s | |
backend = %(default_backend)s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was looking for a working example.
Very useful, thanks.
Edit:
For the jail configuration file I tried using /etc/fail2ban/jail.d/cockpit.conf instead of /etc/fail2ban/jail.local : works.