Fail2banが私のカスタムフィルタを起動しないのはなぜですか?

Fail2banが私のカスタムフィルタを起動しないのはなぜですか?

fail2ban-regex私のフィルタはJan 14 07:39:41 myhost01 sshd[26433]: Connection closed by authenticating user root 127.0.0.1 port 56216 [preauth]内部で68回一致しましたが、auth.log一致するfail2ban-client status sshd-preauthフィルタとアクションがゼロに表示されていることを確認しました。私は何を見逃していますか?

Jail.d/custom.local
[sshd-preauth]

enabled = true
logpath = /var/log/auth.log
backend = auto
banaction = disable-user
maxretry = 1
findtime = 1m
filter  = sshd-preauth
filter.d/sshd-preauth.conf
[INCLUDES]
before = common.conf

[DEFAULT]

_daemon = sshd
__pref = (?:(?:error|fatal): (?:PAM: )?)?
__suff = (?: \[preauth\])?\s*
__on_port_opt = (?: port \d+)?(?: on \S+(?: port \d+)?)?
__alg_match = (?:(?:\w+ (?!found\b)){0,2}\w+)

[Definition]
prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID>%(__pref)s<F-CONTENT>.+</F-CONTENT>$
failregex = ^Connection closed by authenticating user root (?P<ip4>(?:\d{1,3}\.){3}\d{1,3}) port \d+ \[preauth\]$
datepattern = {^LN-BEG}
action.d/disableuser.conf
[Definition]
actionstart = touch /tmp/01234
actionstop =
actioncheck = 
actionban = touch /tmp/OSSEC
actionunban = touch /tmp/UNBAN
FAIL2BAN - 正規表現
fail2ban-regex /var/log/auth.log /etc/fail2ban/filter.d/sshd-preauth.conf  

Running tests

Use   failregex filter file : sshd-preauth, basedir: /etc/fail2ban
Use      datepattern : Default Detectors
Use         log file : /var/log/auth.log
Use         encoding : UTF-8


Results

Failregex: 68 total
|-  #) [# of hits] regular expression
|   1) [68] ^Connection closed by authenticating user root (?P<ip4>(?:\d{1,3}\.){3}\d{1,3}) port \d+ \[preauth\]$
`-

Ignoreregex: 0 total

Date template hits:
|- [# of hits] date format
|  [865] {^LN-BEG}(?:DAY )?MON Day %k:Minute:Second(?:\.Microseconds)?(?: ExYear)?
`-

Lines: 865 lines, 0 ignored, 68 matched, 797 missed
[processed in 0.06 sec]

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

修正する

sshlocalhostの代わりにLANからコンピュータに移動すると、Fail2banフィルタがトリガされます。したがって、localhostを確認するように設定したにもかかわらず、fail2banlocalhostログは無視されます。jail.conf

jail.conf

[DEFAULT] 
ignorself = false
ignoreip =

これはFail2banの既知の制限事項ですか、それとも回避策はありますか?

アップデート2(ソリューション)

fall2banには2つのエラーがあります。構成変数はignoreselfの代わりにignoreselfでなければなりません。 v0.10.3 未満のバージョンにもバグがあります。最新のfall2banバージョンでは、今うまく動作します。

ベストアンサー1

おすすめ記事