Zum Inhalt springen

Fail2ban/Nextcloud: Unterschied zwischen den Versionen

Aus Foxwiki
Keine Bearbeitungszusammenfassung
DanielZorin (Diskussion | Beiträge)
Zeile 1: Zeile 1:


== fail2ban nextcloud install ==
== Installation für Nextcloud AIO ==
 
Die Anmeldelogins für die Weboberfläche von Nextcloud AIO befinden sich im Mount-Pfad des Volumes:
''/var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/nextcloud.log''
 
0. Installieren Sie das Paket fail2ban.<syntaxhighlight lang="bash" highlight="1" copy="" line="">
0. Installieren Sie das Paket fail2ban.<syntaxhighlight lang="bash" highlight="1" copy="" line="">
  sudo apt install fail2ban
  sudo apt install fail2ban

Version vom 3. November 2025, 14:56 Uhr

Installation für Nextcloud AIO

Die Anmeldelogins für die Weboberfläche von Nextcloud AIO befinden sich im Mount-Pfad des Volumes: /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/nextcloud.log

0. Installieren Sie das Paket fail2ban.

 sudo apt install fail2ban

1. Erstellen Sie die Datei /etc/fail2ban/filter.d/nextcloud.conf:

[Definition]
_groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*)
failregex = ^\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Login failed:
            ^\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Trusted domain error.
datepattern = ,?\s*"time"\s*:\s*"%%Y-%%m-%%d[T ]%%H:%%M:%%S(%%z)?"

2. Erstellen Sie die Datei /etc/fail2ban/jail.d/nextcloud.local:

[nextcloud]
backend = auto
enabled = true
port = 80,443
protocol = tcp
filter = nextcloud
maxretry = 2
bantime = 3m
findtime = 5m
logpath = /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/nextcloud.log
chain=DOCKER-USER
action = iptables-multiport[name=nextcloud, port="80,443", chain="DOCKER-USER"]

3. Fail2ban neu starten

sudo systemctl restart fail2ban