Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Security and Privacy
FedoraForum Search

Forgot Password? Join Us!

Security and Privacy Sadly, malware, spyware, hackers and privacy threats abound in today's world. Let's be paranoid and secure our penguins, and slam the doors on privacy exploits.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 31st January 2008, 12:23 PM
vonedaddy Offline
Registered User
 
Join Date: Oct 2007
Posts: 139
fail2ban - no IP what now?

I have an FTP server (vsftp on fedora 8) running with fail2ban (which works incredible by the way) and it has been up and secure for over a month without any issues. Fail2ban bans about 3 - 5 IP addresses daily, most from China. Anyway I have a script that emails me the logs every more, this morning I see someone trying to get in, but there is no IP therefore fail2ban can no do its thing.

From /var/log/secure:

Jan 31 07:00:49 bighat vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator
Jan 31 07:00:54 bighat vsftpd: pam_unix(vsftpd:auth): check pass; user unknown
Jan 31 07:00:54 bighat vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=Administrator rhost=atlas.econet.cz
Jan 31 07:00:54 bighat vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator


As you see a domain instead of the usual IP address comes up. This stops fail2bans effectiveness, does anyone know how I can get this domain to be blocked automatically. Or is there an option I can put in fail2ban config to also add domains to the ban list?

Any help or ideas would be appreciated.
Reply With Quote
  #2  
Old 31st January 2008, 01:50 PM
Evil_Bert's Avatar
Evil_Bert Offline
Retired Again - Administrator
 
Join Date: Nov 2007
Location: Reality
Posts: 3,034
Well, I haven't actually used Fail2ban, but technically, iptables (which is called by Fail2ban) will work with either hostname or IP address, though using names is a bad idea since DNS resolution may fail or be very slow.

According to this HOWTO, Fail2ban passes either hostname or IP address to iptables which creates the appropriate rule.

To get round any hostname resolution issues, you'll have to look for an option either in the daemon being protected (e.g. sshd) to log IP addresses not hostnames (preferable, I would think), or in Fail2ban to do a DNS lookup before passing to iptables (I'm not sure if this is possible).

For example, in your sshd_config file (I think the default is supposed to be /etc/ssh/sshd_config), there should be an option called 'UseDNS', which defaults to 'yes'. This causes sshd to resolve IP addresses (and check the hostname maps back to the IP address). Given the ease with which addresses can be spoofed, even to one matching an real host, and since you're using Fail2ban as your primary defence mechanism, you should consider setting this option to 'no'.
__________________
.
Marching to the beat of his own conundrum.
Reply With Quote
Reply

Tags
fail2ban

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fail2ban & dovecot tomh1000 Security and Privacy 1 1st September 2009 01:30 PM
fail2ban issue antonyna Security and Privacy 4 28th August 2009 04:52 PM
Where do I get fail2ban, denyhost, etc.. paulga Using Fedora 2 2nd May 2009 09:45 PM
fail2ban question pobbz Using Fedora 0 22nd November 2007 06:33 AM
fail2ban don't work on fc6 :( sp00ky Using Fedora 4 25th July 2007 12:12 PM


Current GMT-time: 11:06 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat