ispCP - Board - Support
[ERLEDIGT] PMA besser absichern - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega International Area (/forum-22.html)
+--- Forum: German Corner (/forum-26.html)
+---- Forum: Archiv (/forum-54.html)
+---- Thread: [ERLEDIGT] PMA besser absichern (/thread-2376.html)

Pages: 1 2 3 4 5 6


RE: PMA besser absichern - fulltilt - 02-10-2008 08:29 PM

joximu Wrote:man müsste wohl pma dazu bringen, etwas spezielles ins Log zu schrieben, bei fehlerhafter Anmeldung...

also geloggt wird ja:
/var/log/apache2/users/admin.webserver.tld-access.log
Code:
192.168.0.5 - - [10/Feb/2008:11:16:23 +0100] "POST /tools/pma/index.php HTTP/1.1" 302 -

In /etc/fail2ban/filter.d liegt eine apache-auth.conf
mit dieser failregex:
Code:
failregex = [[]client <HOST>[]] user .*(?:: authentication failure|not found)

Habe in der jail.conf folgendes hinzugefügt:
Code:
[pma]
enabled = true
port = http
filter = apache-auth
logpath = /var/log/apache2/users/admin.webserver.tld-access*.log
maxretry = 3

Tut sich aber nichts ... ich könnte so Monate lang versuchen das Passwort zu knacken :-)

Muss da noch irgend ein auth mod im Apache aktiviert werden ... da sind ne Menge davon available Big Grin


RE: PMA besser absichern - Rene - 02-10-2008 08:42 PM

fulltilt Wrote:Tut sich aber nichts ... ich könnte so Monate lang versuchen das Passwort zu knacken :-)

Ja das ist klar, vergleich doch mal:

fulltilt Wrote:also geloggt wird ja:
/var/log/apache2/users/admin.webserver.tld-access.log
Code:
192.168.0.5 - - [10/Feb/2008:11:16:23 +0100] "POST /tools/pma/index.php HTTP/1.1" 302 -

und:

fulltilt Wrote:In /etc/fail2ban/filter.d liegt eine apache-auth.conf
mit dieser failregex:
Code:
failregex = [[]client <HOST>[]] user .*(?:: authentication failure|not found)

wie joximu schon sagt:

joximu Wrote:man müsste wohl pma dazu bringen, etwas spezielles ins Log zu schrieben, bei fehlerhafter Anmeldung...



RE: PMA besser absichern - fulltilt - 02-10-2008 08:58 PM

Ja - soweit klar ...
Habe aber auch mal andere Logins auf einem Testweb probiert (conf entsprechend angepasst) ...
Da wird auch nichts geblockt, daher frage ich mich ob da ein Apache Modul noch aktiviert werden muss ...
Bislang klappt nur FTP und SSH.


RE: PMA besser absichern - Rene - 02-10-2008 09:03 PM

fulltilt Wrote:Habe aber auch mal andere Logins auf einem Testweb probiert (conf entsprechend angepasst) ...

darf man fragen wie die conf und die fehlermeldung aussieht?

fulltilt Wrote:Da wird auch nichts geblockt, daher frage ich mich ob da ein Apache

also soweit ich weiß eigentlich nicht...


RE: PMA besser absichern - fulltilt - 02-10-2008 09:25 PM

Hi Rene,

In der access.log taucht seit dem vhcs Update gar nichts auf, bin auf einer Testmaschine .. vieleicht habe ich da irgendwo einen Fehler drin.


RE: PMA besser absichern - joximu - 02-10-2008 09:27 PM

pma macht (in der ispcp Version) keinen apache-auth. das wird alles mit php gemacht. Der Apache spielt da nicht mit und darum auch nicht die apache-auth regexp...


RE: PMA besser absichern - Rene - 02-10-2008 10:46 PM

so ich hab es geschafft, bei mir geht es so:

jail.conf:
Code:
[pma]

enabled = true
port    = https
filter    = pma
logpath = /var/log/apache*/users/*access.log
maxretry = 3

pma.conf:
Code:
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
#
# $Revision: 471 $
#

[Definition]

# Option:  failregex
# Notes.:  regex to match the password failure messages in the logfile. The
#          host must be matched by a group named "host". The tag "<HOST>" can
#          be used for standard IP/hostname matching.
# Values:  TEXT
#
failregex = <HOST> - -.*"POST /pma/index.php HTTP/1.1" 302 -

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex =



RE: PMA besser absichern - fulltilt - 02-10-2008 10:58 PM

Rene Wrote:so ich hab es geschafft, bei mir geht es so:

Hammer - habe es auch noch noch nicht aufgegeben, mit dem 302 hatte ich auch schon probiert ...

Hut ab Wink
Code:
failregex = <HOST> - -.*"POST /pma/index.php HTTP/1.1" 302 -

Jetzt können wir wohl ruhiger schlafen Big Grin


RE: PMA besser absichern - Zothos - 02-10-2008 11:12 PM

ab ins wiki damit Smile


RE: PMA besser absichern - fulltilt - 02-10-2008 11:26 PM

Hi Rene,

habe gerade bemerkt dass die failregex noch erweitert werden muss, weil PMA auch unter:

/tools/pma/index.php

erreichbar ist.

Die fail2ban logs sind bei mir vorhanden:
Code:
2008-02-10 14:26:56,803 fail2ban.actions: WARNING [pma] Ban 192.168.0.5
2008-02-10 14:27:03,993 fail2ban.actions: WARNING [pma] 192.168.0.5 already banned

Kann die Loginseite aber weiterhin aufrufen ...
Könnte das daran liegen das ich hier eine VM verwende?