second commit

This commit is contained in:
2026-08-19 22:33:19 +02:00
parent 411812e954
commit 199f306993
107 changed files with 5984 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
- name: restart fail2ban
ansible.builtin.service:
name: fail2ban
state: restarted

View File

@ -0,0 +1,38 @@
---
# Zweite Verteidigungslinie gegen Brute-Force zusaetzlich zum
# Anwendungs-Rate-Limiting (Konzept 6.2). Ueberwacht die Uvicorn-/nginx-
# Access-Logs auf gehaeufte 401-Antworten vom Login-Endpunkt.
- name: fail2ban installieren
ansible.builtin.apt:
name: fail2ban
state: present
update_cache: true
- name: Filter fuer Jumphost-Login-Fehlversuche
ansible.builtin.copy:
dest: /etc/fail2ban/filter.d/jumphost-login.conf
owner: root
group: root
mode: "0644"
content: |
[Definition]
failregex = ^.*"POST /auth/login(/totp)? HTTP/.*" 401 .*client_ip=<HOST>.*$
^.*"POST /auth/login(/totp)? HTTP/.*" 401 .*<HOST>.*$
ignoreregex =
- name: Jail fuer Jumphost-Login aktivieren
ansible.builtin.copy:
dest: /etc/fail2ban/jail.d/jumphost.conf
owner: root
group: root
mode: "0644"
content: |
[jumphost-login]
enabled = true
filter = jumphost-login
logpath = /var/log/jumphost/access.log
maxretry = 8
findtime = 300
bantime = 1800
notify: restart fail2ban