Skip to contentSkip to conversation

SpamHaus DROP list in Netfilter

DISCUSSION Julien Vehent 2 participants 4 messages Dec 16, 2008 – Dec 17, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi All,

I was wondering how I could integrate the spamhaus drop list
(http://www.spamhaus.org/drop/drop.lasso) into my Netfilter rules.

The list is not too long, so I thought putting it directly into a new chain would be doable without degrading too much the performances. Somebody also told me to use a chains tree, but I wonder if this is necessary considering the size of the list...

Has anybody done this before ?

Thanks,
Julien

Signature · 1 line
www.linuxwall.info
#2 lore raw
In reply to a message not in the archive
Quoted 14 lines · Michael Schwartzkopff

Am Dienstag, 16. Dezember 2008 15:27 schrieben Sie:

Quoted 13 lines

Hi All,

I was wondering how I could integrate the spamhaus drop list
(http://www.spamhaus.org/drop/drop.lasso) into my Netfilter rules.

The list is not too long, so I thought putting it directly into a new chain
would be doable without degrading too much the performances. Somebody also
told me to use a chains tree, but I wonder if this is necessary considering
the size of the list...

Quoted 7 lines
Quoted 4 lines

Has anybody done this before ?

Thanks,
Julien

google von "iptables spamhaus" gives you the site:

http://robotterror.com/site/wiki/aggressive_spam_and_zombie_blocking_via_spamhaus_org_drop_and_iptables

Quoted 5 lines

on the first place.

Cheers,

Dear Doctor,

Thanks for your tremendous help for adding a rule in a chain...... :/

My question, however, concerns more the performances issue. This list will be checked for every single TCP-SYN or UDP packet that goes through the kernel, and if the first byte is something like 128 , it's definitely useless to try all the 91.*

But implementing a tree of chains in netfilter is also quite a pain in the ass. So before choosing a solution, I would like the opinion of the community.

Best regards,

Julien

Signature · 1 line
www.linuxwall.info
#3 lore raw
Quoted 34 lines · Julien Vehent
Quoted 14 lines · Michael Schwartzkopff

Am Dienstag, 16. Dezember 2008 15:27 schrieben Sie:

Quoted 13 lines

Hi All,

I was wondering how I could integrate the spamhaus drop list
(http://www.spamhaus.org/drop/drop.lasso) into my Netfilter rules.

The list is not too long, so I thought putting it directly into a new chain
would be doable without degrading too much the performances. Somebody also
told me to use a chains tree, but I wonder if this is necessary considering
the size of the list...

Quoted 7 lines
Quoted 4 lines

Has anybody done this before ?

Thanks,
Julien

google von "iptables spamhaus" gives you the site:

http://robotterror.com/site/wiki/aggressive_spam_and_zombie_blocking_via_spamhaus_org_drop_and_iptables

Quoted 5 lines

on the first place.

Cheers,

Dear Doctor,

Thanks for your tremendous help for adding a rule in a chain...... :/

Quoted 8 lines

My question, however, concerns more the performances issue. This list will be checked for every single TCP-SYN or UDP packet that goes through the kernel, and if the first byte is something like 128 , it's definitely useless to try all the 91.*

But implementing a tree of chains in netfilter is also quite a pain in the ass. So before choosing a solution, I would like the opinion of the community.

This sounds like a job for the "iphash" map of the ipset netfilter extension. Only one rule in your ruleset and a hash-table with the addresses to block.

c'ya
sven

Signature · 1 line
The lights are fading out, once more...
#4 lore raw
Quoted 18 lines · Sven-Haegar Koch
Quoted 16 lines · Julien Vehent
Quoted 14 lines · Michael Schwartzkopff

Am Dienstag, 16. Dezember 2008 15:27 schrieben Sie:

Quoted 13 lines

Hi All,

I was wondering how I could integrate the spamhaus drop list
(http://www.spamhaus.org/drop/drop.lasso) into my Netfilter rules.

The list is not too long, so I thought putting it directly into a new chain
would be doable without degrading too much the performances. Somebody also
told me to use a chains tree, but I wonder if this is necessary considering
the size of the list...

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

Has anybody done this before ?

Thanks,
Julien

google von "iptables spamhaus" gives you the site:

http://robotterror.com/site/wiki/aggressive_spam_and_zombie_blocking_via_spamhaus_org_drop_and_iptables

Quoted 21 lines
Quoted 16 lines
Quoted 5 lines

on the first place.

Cheers,

Dear Doctor,

Thanks for your tremendous help for adding a rule in a chain...... :/

My question, however, concerns more the performances issue. This list will
be checked for every single TCP-SYN or UDP packet that goes through the kernel, and if the first byte is something like 128 , it's definitely useless to try all the 91.*

Quoted 4 lines

But implementing a tree of chains in netfilter is also quite a pain in the
ass. So before choosing a solution, I would like the opinion of the community.

Quoted 7 lines

This sounds like a job for the "iphash" map of the ipset netfilter extension. Only one rule in your ruleset and a hash-table with the addresses to block.

c'ya
sven

OK ! So, this is what ipset is for ! I discovered this tool during the last userday conference and was wondering how to use it.

I guess "nethash" is what I'm looking for :

Different size netblocks: nethash
ipset -N hash2 nethash
ipset -A hash2 192.168.1.0/24
ipset -A hash2 10.1.8.0/21

I will look more deeply at this. Thanks for the pointer.

Signature · 1 line
www.linuxwall.info