Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

fail2ban + iptables "already banned"

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
Philippe23
Tux's lil' helper
Tux's lil' helper
Posts: 130
Joined: Wed Dec 20, 2006 3:28 pm
Location: Central NY

fail2ban + iptables "already banned"

  • Quote

Post by Philippe23 » Sat Mar 01, 2014 6:32 pm

Hey, I'm looking for suggestions of what I might have misconfigured. I get a fair amount of these from fail2ban:
Feb 28 12:15:01 localhost fail2ban.actions[4327]: INFO [sasl-iptables] 49.48.2.132 already banned
Feb 28 12:50:50 localhost fail2ban.actions[4327]: INFO [sasl-iptables] 113.193.130.89 already banned
Feb 28 18:46:56 localhost fail2ban.actions[4327]: INFO [courier-iptables] 95.163.107.210 already banned
I get them for pretty much all of my jail rules. Here's my jail.local, minus the comments:
[DEFAULT]
ignoreip = 127.0.0.1
bantime = 28800
findtime = 600
maxretry = 10
backend = auto

[postfix-iptables]
enabled = true
filter = postfix
action = iptables[name=POSTFIX,port=smtp]
iptables[name=POSTFIX,port=submission]
iptables[name=POSTFIX,port=smtps]
sendmail-geoip[name=POSTFIX,dest=fail2ban@XXX.com]
logpath = /var/log/messages
maxretry = 9

[sasl-iptables]
enabled = true
filter = postfix-sasl
action = iptables[name=POSTFIX-SASL,port=smtp]
iptables[name=POSTFIX-SASL,port=submission]
iptables[name=POSTFIX-SASL,port=smtps]
sendmail-geoip[name=POSTFIX-SASL,dest=fail2ban@XXX.com]
logpath = /var/log/messages
maxretry = 9

[courier-iptables]
enabled = true
filter = courierlogin
action = iptables[name=COURIER,port=imap]
iptables[name=COURIER,port=imaps]
iptables[name=COURIER,port=pop3]
iptables[name=COURIER,port=pop3s]
sendmail-geoip[name=COURIER,dest=fail2ban@XXX.com]
logpath = /var/log/messages
maxretry = 9
And my iptables INPUT chain:
Chain INPUT (policy DROP)
target prot opt source destination
fail2ban-COURIER tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:995
fail2ban-POSTFIX tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:465
fail2ban-POSTFIX-SASL tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:465
fail2ban-COURIER tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:995
fail2ban-POSTFIX tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:465
fail2ban-POSTFIX-SASL tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:465
dolts all -- 0.0.0.0/0 0.0.0.0/0
REJECT all -- 169.254.0.0/16 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 172.16.0.0/12 0.0.0.0/0 reject-with icmp-port-unreachable
...
Anybody see what I'm missing?
Top
666threesixes666
Veteran
Veteran
User avatar
Posts: 1248
Joined: Tue May 31, 2011 9:46 pm
Location: 42.68n 85.41w
Contact:
Contact 666threesixes666
Website

  • Quote

Post by 666threesixes666 » Sat Mar 01, 2014 6:55 pm

your perception is what is off..... the ip is already banned, and they are attacking more, and fail2ban is trying to ban them again but they are already banned.
http://www.funtoo.org/
Top
Philippe23
Tux's lil' helper
Tux's lil' helper
Posts: 130
Joined: Wed Dec 20, 2006 3:28 pm
Location: Central NY

  • Quote

Post by Philippe23 » Sat Mar 01, 2014 7:19 pm

That sure makes it sound like something is wrong, since they shouldn't be able to try again ... they're banned. It appears the ban is not being very effective for some reason in my setup.
Top
666threesixes666
Veteran
Veteran
User avatar
Posts: 1248
Joined: Tue May 31, 2011 9:46 pm
Location: 42.68n 85.41w
Contact:
Contact 666threesixes666
Website

  • Quote

Post by 666threesixes666 » Sat Mar 01, 2014 7:45 pm

mmmm this brings up the point that our fail2ban wiki article need sites to provide test attacks..... you fix it, im sick of fixing that thing...
http://www.funtoo.org/
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Mar 01, 2014 8:40 pm

If you suspect something is wrong with your filter rules, then please show them. Use iptables-save -c.
Top
Philippe23
Tux's lil' helper
Tux's lil' helper
Posts: 130
Joined: Wed Dec 20, 2006 3:28 pm
Location: Central NY

  • Quote

Post by Philippe23 » Sun Mar 02, 2014 12:46 am

I think I figured it out. Since I had multiple iptables actions for each rule, but they all had the same name, but different ports. I think that was causing only the first (or last) being created. I switched to iptables-multiport instead. I'm going to see how that goes.
Top
Philippe23
Tux's lil' helper
Tux's lil' helper
Posts: 130
Joined: Wed Dec 20, 2006 3:28 pm
Location: Central NY

  • Quote

Post by Philippe23 » Fri Mar 21, 2014 12:14 pm

Yeah, that seemed to have fixed it. I haven't had an already banned message since I made the change 20+ days ago.
Top
666threesixes666
Veteran
Veteran
User avatar
Posts: 1248
Joined: Tue May 31, 2011 9:46 pm
Location: 42.68n 85.41w
Contact:
Contact 666threesixes666
Website

  • Quote

Post by 666threesixes666 » Fri Mar 21, 2014 5:56 pm

migrate to sshguard, fail2ban is producing false negatives..... i made a wiki of sshguard

https://wiki.gentoo.org/wiki/Sshguard
http://www.funtoo.org/
Top
Post Reply

8 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic