Skip to content

feat(roles/fail2ban): enable the Apache jails on hosts clients reach directly - #779

Merged
markuslf merged 2 commits into
mainfrom
feat/fail2ban-apache-jails
Nov 18, 2026
Merged

markuslf merged 2 commits into
mainfrom
feat/fail2ban-apache-jails

Conversation

@markuslf

Copy link
Copy Markdown
Member
  • fail2ban enables the Apache jails that still match httpd 2.4 (apache-auth, apache-fakegooglebot, apache-modsecurity, apache-nohome, apache-noscript, apache-overflows, php-url-fopen) on hosts with /var/log/httpd. It leaves them out where apache_httpd__mod_remoteip_internal_proxy lists a proxy. fail2ban__jails_apache_enabled overrides this.
  • The sshd jail runs with mode = aggressive.
  • skip_if_nologs = true is set.
  • apache_httpd, moodle and nextcloud log vHosts in combined instead of linuxfabrikio.

Each jail was measured on Rocky 8, 9 and 10. The Molecule fail2ban/install scenario is green on rocky8 (proxy case), rocky9 and rocky10, and fail2ban/remove is green on rocky10.

🤖 Generated with Claude Code

…directly

On hosts with /var/log/httpd the role enables apache-auth,
apache-fakegooglebot, apache-modsecurity, apache-nohome, apache-noscript,
apache-overflows and php-url-fopen, unless apache_httpd__mod_remoteip_internal_proxy
lists a proxy; fail2ban__jails_apache_enabled overrides this. sshd runs the
filter in aggressive mode, and a jail without a log file no longer keeps
fail2ban from starting (skip_if_nologs).

Jails measured against httpd 2.4.37/2.4.62/2.4.63, bash 4.4/5.1/5.2 and
OpenSSH 8.0/8.7/9.9 on Rocky 8, 9 and 10; apache-shellshock and selinux-ssh
left out (dead, or counting sshd failures twice), apache-badbots and
apache-botsearch stay opt-in (unmaintained lists).
@markuslf
markuslf merged commit 31b2dc4 into main Nov 18, 2026
11 checks passed
@markuslf
markuslf deleted the feat/fail2ban-apache-jails branch November 18, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant