[solved] fail2ban unter Debian 13

ITWK

Member
Hi all, ich bekomme unter Debian13 fail2ban nicht zum arbeiten. Ich habe zum Test postfix und postfix-sasl enabled. In der fail2ban.log wird auch angezeigt das alles gestartet ist, aber es wird weder ein ban gesetzt noch in der Log gelistet. iptables -L zeigt auch kein f2b an. Was kanbn noch falsch sein. Finde keinen Fehler. Jmd. eine Idee?
Auch habe ich eingestellt im TEST:
ignoreip = 127.0.0.1/8
bantime = 1440
maxretry = 1
backend = auto #systemd ist es

banaction = iptables-multiport
banaction_allports = iptables-allports

[postfix]
enabled = true
# To use another modes set filter parameter "mode" in jail.local:
mode = more
filter = postfix
#port = smtp,465,submission
port = smtp,submission,imap,imaps,pop3,pop3s
#logpath = %(postfix_log)s
logpath = /var/log/mail.log
#backend = %(postfix_backend)s
 
banaction = iptables-multiport
banaction_allports = iptables-allports
Debian 13 arbeitet nicht mehr mit iptables, sondern mit nftables. Ändere mal in:
Code:
banaction = nftables[type=multiport]
banaction_allports = nftables[type=allports]
 
hi nexus, ok dachte gibt weiterhin beides, da noch iptables als Paket verfügbar ist. Habe es mal abgeändert. Müsste aber nicht dennoch der ban Fund in fail2ban.log auftauchen?

Irgendwie passiert dennoch nichts:
fail2ban-client status postfix
Status for the jail: postfix
|- Filter
| |- Currently failed: 0
| |- Total failed: 0
| `- Journal matches: _SYSTEMD_UNIT=postfix.service _SYSTEMD_UNIT=[email protected]
`- Actions
|- Currently banned: 0
|- Total banned: 0
`- Banned IP list:

fail2ban-client status postfix-sasl
Status for the jail: postfix-sasl
|- Filter
| |- Currently failed: 0
| |- Total failed: 0
| `- Journal matches: _SYSTEMD_UNIT=postfix.service _SYSTEMD_UNIT=[email protected]
`- Actions
|- Currently banned: 0
|- Total banned: 0
`- Banned IP list:

die regex ist ok der Pfad auch, denn er findet beim Test alles, nur in der log ist nichts und in der Firewall auch nicht....
fail2ban-regex /var/log/mail.log /etc/fail2ban/filter.d/postfix.conf

Running tests
=============

Use filter file : postfix, basedir: /etc/fail2ban
Use datepattern : {^LN-BEG} : Default Detectors
Use log file : /var/log/mail.log
Use encoding : ISO-8859-1


Results
=======

Prefregex: 1241 total
| ^(?:\[\])?\s*(?:<[^.]+\.[^.]+>\s+)?(?:\S+\s+)?(?:kernel:\s?\[ *\d+\.\d+\]:?\s+)?(?:@vserver_\S+\s+)?(?:(?:(?:\[\d+\])?:\s+[\[\(]?postfix\b([^\[\s]+)?(?:\(\S+\))?[\]\)]?:?|[\[\(]?postfix\b([^\[\s]+)?(?:\(\S+\))?[\]\)]?:?(?:\[\d+\])?:?)\s+)?(?:\[ID \d+ \S+\]\s+)?(?:\w+: )?(?:(?:milter-)?reject:|(?:improper command pipelining|too many errors) after \S+) (?P<content>.+)$
`-

Failregex: 1012 total
|- #) [# of hits] regular expression
| 1) [928] ^[A-Z]{4,} from [^[]*\[<HOST>\](?::\d+)?: [45][50][04] [45]\.\d\.\d+ (?:(?:<[^>]*>)?: )?(?:(?:Helo command|(?:Sender|Recipient) address) rejected: )?(?:Service unavailable|Access denied|(?:Client host|Command|Data command) rejected|Relay access denied|Malformed DNS server reply|(?:Host|Domain) not found|need fully-qualified hostname|match|[Uu](?:ser unknown|ndeliverable address))\b
| 2) [84] ^from [^[]*\[<HOST>\](?::\d+)?:?
`-

Ignoreregex: 0 total

Date template hits:
|- [# of hits] date format
| [279667] {^LN-BEG}ExYear(?P<_sep>[-/.])Month(?P=_sep)Day(?:T| ?)24hour:Minute:Second(?:[.,]Microseconds)?(?:\s*Zone offset)?
`-

Lines: 279667 lines, 0 ignored, 1012 matched, 278655 missed
[processed in 22.33 sec]

Missed line(s): too many to print. Use --print-all-missed to print all 278655 lines

vsftpd funktioniert, da findet er was aber postfix und postfix-sasl nichts. nichtmal bei mode = aggressive
verstehe ich nicht da ständig im log unkorrekte logins kommen etc.
Liegt es an sytemd das er hier versucht statt der logs irgendwie das andere zu lesen? wenn ja, kann man das umsellen? Fettgedruckt...
fail2ban-client status postfix
Status for the jail: postfix
|- Filter
| |- Currently failed: 0
| |- Total failed: 0
| `- Journal matches: _SYSTEMD_UNIT=postfix.service _SYSTEMD_UNIT=[email protected]
`- Actions
|- Currently banned: 0
|- Total banned: 0
`- Banned IP list:
root@mail:~# fail2ban-client status vsftpd
Status for the jail: vsftpd
|- Filter
| |- Currently failed: 0
| |- Total failed: 6
| `- File list: /var/log/vsftpd.log
`- Actions
|- Currently banned: 0
|- Total banned: 1
`- Banned IP list:
Weil

root@mail:~# journalctl -u postfix
No journal files were found.
...daher soll er ja die log nutzen, da dort alles drin steht...
ps -p 1 -o comm=
init
 
Last edited:
Back
Top