Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

we re facing issue with fail2ban.

Our setup for example:

jail.conf:

[nginx-404]

enabled = true
port    = http,https
filter  = nginx-404
logpath = /var/log/nginx/*access.log
maxretry = 5
findtime = 300
action = mail

than action:

[Definition]

actionstart =
actionstop =
actioncheck =

actionban = printf %%b "Hi,

            The IP <ip> has just been banned by Fail2Ban after
            <failures> attempts against <name>.

            Regards,

            Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from `uname -n`" <dest>

actionunban =

After restart service or reboot system. It send immediately all bans which were done before.

Is there any solution to stop sending hundreds notifications after restart ? Thanks for anyadvice.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
586 views
Welcome To Ask or Share your Answers For Others

1 Answer

Is there any solution to stop sending hundreds notifications after restart ?

Yes. Just specify norestored = true in your action. See PR #1669 for more info.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...