This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simple IP/IP range blacklist ?

Is there a simple way in ASL to create a "blacklist" ? A list of IPs and domain that should allways be dropped when they apears as either source or destination ?

I'm trying to fend off a machine that is either infected by some virus or whose user is actively scanning my network blocks. I've already called their ISP and they have conected the admin but the flow of probes doesn't stop.


This thread was automatically locked due to age.
Parents
  • Create a network group definition called Banned_Hosts.
    Create a host definition for each of the banned IPs and put them in this new group.
    Create a packet filter rule to drop all traffic from the Banned_Hosts group. Log it at your option.
  • Thank you for your answer. I already thought about doing all that but  it really makes it hard to manage the ACL afterward.

    If there was a way to enter an arbitrary list of IPs (or better: IP/netmask pairs) in a network definition, that would fit the bill...

    Oh well, I guess it's not really possible.
  • You can always add or subtract host definitions from the Banned_Hosts group. That's the advantage of creating the Group. You just edit the contents of the group not the packet filter rules/
  • Oh, now I see. Sorry, I missunderstood your first message. Yes, that should work fine [:)]

    Thank you
  • ASL would drop these packets anyway if they're targeted at non-open services. However, if you're forwarding port 21 to your FTP server, then this is what you want.
    HOWEVER, if you're using a proxy (SMTP for instance) The "Banned_Hosts" solution won't work since ASL creates it's own rules to accept incoming traffic to the SMTP proxy.
    There are some work arounds but they vary based on what proxies you're using etc.
  • [ QUOTE ]
    ASL would drop these packets anyway if they're targeted at non-open services. However, if you're forwarding port 21 to your FTP server, then this is what you want.
    HOWEVER, if you're using a proxy (SMTP for instance) The "Banned_Hosts" solution won't work since ASL creates it's own rules to accept incoming traffic to the SMTP proxy.
    There are some work arounds but they vary based on what proxies you're using etc. 

    [/ QUOTE ]

    The reason I ask is that there are some hosts that I don't want to allow in my network EVER. Reason usually being that they have been several intrusion attempt or attempts to dissrupt normal service from these IP range but also, in a couple of case, because I simply don't want the owner of these netblocks to have anything to do with  my network.

    The proxy thing is easy enough to manage: I'll just add a rule to drop all incomming traffic from these banned hosts to and from the external interface: that will prevent them from acessing the proxy as well (and since I'm not using any reverese proxy, it shouldn't even be necessary)

    But thank you for the suggestion
  • Some way of specifying a large list of blocked IP's would be a great feature.

    For instance, our ISP's charge for traffic that arrives from interstate, but ISP to ISP traffic within our city is free of charge.  There is a *large* list of IP/masks which specifies the free traffic networks.  Be great to be able to implement something like this.

    (100's of entries)
  • A blocked host in the packet filter rules won't effect your proxy. So, your way handling it won't work.
  • You could load them using the ipfilter.local table in /etc/init.d
  • [ QUOTE ]
    A blocked host in the packet filter rules won't effect your proxy. So, your way handling it won't work. 

    [/ QUOTE ]

    How so ? If I forbid connection between the local IP and the blacklisted hosts, that should stop the proxy. If it doesn't then there is something seriously broken on the filtrering rules.
  • For example.
    I use the SMTP proxy.
    I want to block incoming SMTP traffic from host 151.197.20.10.
    Creating a host definition 151.197.20.10 and packet filter rule to block traffic from 151.197.20.10 on port 25 won't stop them from sending mail.
    When the SMTP proxy is enabled ASL creates an iptables rule like this.
    iptables -A AUTO_INPUT -s any -d any --dport 25 ACCEPT
    This rule is interpreted before your DROP rule that is in USR_INPUT, and therefore the SMTP proxy still gets the mail.
Reply
  • For example.
    I use the SMTP proxy.
    I want to block incoming SMTP traffic from host 151.197.20.10.
    Creating a host definition 151.197.20.10 and packet filter rule to block traffic from 151.197.20.10 on port 25 won't stop them from sending mail.
    When the SMTP proxy is enabled ASL creates an iptables rule like this.
    iptables -A AUTO_INPUT -s any -d any --dport 25 ACCEPT
    This rule is interpreted before your DROP rule that is in USR_INPUT, and therefore the SMTP proxy still gets the mail.
Children
No Data