Solved

CentOS:  free server flood protection via YUM

Posted on 2014-03-03
8
876 Views
Last Modified: 2014-03-03
Hi All,

I've been running a CentOS server for a few years and recently it's been targeted by spammers.

Several of my customers have catch all email addresses, that are being spammed like crazy.

Is there any free software i can install preferably via YUM (or with a lot of help) that will limit the number of times an IP can connect?  e.g. no one should be connection more than 10 times a minute.


Many thanks
0
Comment
Question by:detox1978
  • 3
  • 2
  • 2
8 Comments
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39901953
I was in about the same position and switched to SpamExperts.
Not free, but reduced the spam on my server by 99%.

Just make sure to configure it to send a daily report for each of your client's domains with the quarantined mails, or you will miss regular mail. Not much (I get maybe 2 false positives per week, out of 2-3000 emails) but you'll save yourself some headaches if your clients can manage the quarantine by themselves.

HTH,
Dan
0
 
LVL 2

Author Comment

by:detox1978
ID: 39901965
This isnt so much spam as it it idiots flooding my email server.  They must be using it for backscatter or something.  So all i need is a way to auto block IP's that are clearly flooding my ip
0
 
LVL 58

Expert Comment

by:Gary
ID: 39901971
There are things like fail2ban etc but 10 requests in a minute is nothing - imagine a webpage with 10 images - get the idea.
If you can track the IP's, you may be better just adding them individually to the firewall.

The kind of software you are looking for would end up banning real visitors.
What email software are you using?

I use Postfix which is pretty good at stopping it
http://www.howtoforge.com/block_spam_at_mta_level_postfix

But this will always be an ongoing battle...
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 39901979
Why not use iptables for that?
You can use it to block brute force attacks, so it should be able to block IP's that connect to your mail server.

For ex
iptables -A INPUT -p tcp --dport 25 -i eth0 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 25 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 10 -j DROP

Open in new window

will drop IPs with more than 10 connections/minute made to port 25.
0
 
LVL 2

Author Comment

by:detox1978
ID: 39901992
thanks for the tips.

I've disabled the catch all forwarding, so hopefully they will go away.

I'll add the iptable rule in a few days when I re enable it.


Thanks
0
 
LVL 2

Author Comment

by:detox1978
ID: 39902168
Fail2ban appears to auto populate iptables
0
 
LVL 58

Expert Comment

by:Gary
ID: 39902318
Yes, you can set up rules for it, but Dan's is a much simpler solution.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CentOS/RHEL 7 Linux maillog worldwide readable 2 64
VMware Workstation 12 Player 16 74
Setting up static IP - Ubuntu server 16.04 12 62
Bash script - Exit out of choice loop 2 29
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question