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

Blocking specific IP addresses

I was after some advice as to the best method of blocking web access from specific IP addresses to my web server, that is located in a DMZ.
Currently I do not have the HTTP proxy enabled.


This thread was automatically locked due to age.
  • BigO, you've been around here for a long time, so I suspect this is more complicated than it seems.  Can you give us an idea of where these IPs are, how many you want to block and how they are reaching the web server now?

    Cheers - Bob
  • BigO, you've been around here for a long time....

    If only that meant that I knew what I was doing. [;)]

    Basically, all I want to be able to do is block the IP addresses of "undesirable" web servers from probing my web server.
    My logs have identified some servers that contantly probe/attack mine. I don't really like that and want to block those IP addresses at the firewall.

    What I was asking for was advice on "best practice" for doing this.
    As I said; I am not currently using the web proxy but I would turn it on if it provides a better way to block addresses than creating individual packet filter rules.

    I am open to suggestions; hence this post.
  • The simplest way to implement this, currently, is to create a Network Definition of Type Group (call it Blocked Attackers, etc.), and add the IPs you wish to block as individual host definitions to the group as needed.  Create a Packet Filter Rule, put it at position one, with the group you created (I'll call it Blocked Attackers in this example)... Blocked Attackers -> ANY (service) -> ANY set to Drop... optionally you can enable logging as well.
  • Hi, you can define Network Definitions for the attackers, and then define a Network Group and put them in it, and then make 1 PacketFilter rule to drop the traffic, and put it ahead of any Allow rules for the DMZ.

    Barry
  • Barry and Bruce; thanks for the replies.
    That is what I thought, and the way I had intended to solve this problem.
    It would be really nice if there was a simple "black list" option instead of having to create a network definition for each IP address I want to block. Maybe in a future release....
    Thanks again guys.
  • My plan was to make a packet filter rule in position 1 that will give exceptions to my blocks. (Kaspersky which is in Russia.) Packet filter rule 2 would be all my blocks. (China, Russia etc.)

    I must be doing something wrong, because I am unable to get any packet filter I make to work.

    For a very simple test, I created a network definition called "_blocked by default" with a test network of 65.0.0.0/8 (MSN was my test subject.)

    I then created a packet filter rule at the top that says:
    if the 
    ..Internal network --- on any service
    has a destination of 
    .._Blocked by default
    then 
    drop

    Yet, after I turn this rule on, I can still get to MSN.com. 

    I have attached pictures of my settings.

    What am I doing wrong?

    Thanks,

    C68
  • Hi, are you using the proxies?
    (Proxies' filters come before the packetfilter page's filters.)

    Barry
  • Yes, I am using the proxy.  I thought about that, but I do not have MSN listed anywhere.  Blocked or Allowed.

    I uploaded a screen shot of the proxy filter action I am assigned to.  I also checked the no where else was MSN even mentioned. 

    Yet, turning off the proxy stops me from getting to MSN.  Turning it back on allows me to get there.

    If I want to block all traffic (coming from or going to) to china and Russia and use the proxy... how will I do this if they proxy allows me to get to these sites before the packet filter is allowed to block them??

    Thanks,

    C68
  • If you have networks that you want to block, put them in the transparent mode skiplist (only works if you're running in transparent mode).  You seem to NOT have any packet filter rules allowing port-80 traffic, so packets from servers in the transparent mode skiplist will not be allowed.  If, however, you are allowing outbound port-80 traffic, then you'll need a blocking rule placed above (before) the allow rule.

    Cheers - Bob
    PS If you've been using the transparent mode skiplist to allow unproxied traffic with certain hosts and have had the "Allow" box checked, then you'll need to create a packet filter rule allowing this traffic.

    PPS I think Coder knows this, but for others who read this, remember that the Astaro is a stateful firewall, so the traffic you need to allow is only the outbound traffic - the "requests" for the URLs - responses are reecognized by the Astaro connection tracker (conntrack) and allowed to pass.
  • I am aware that Astaro is a stateful firewall and that unless someone on the inside started the "conversation" the incoming packets will be blocked on all ports unless given permission to come in. 

    However, I want to stop any internal PC from being able to connect to any IP in the China, Russia range.  I want this for several reasons, but the three biggest are:

    1. If a PC were to get infected, I do not want it to be able to talk to it's C&C server. While not all C&C servers will be in China or Russia, a good number are. Since the infection would start the conversation, the firewall would allow it. 

    2. Many fraud/malware/phishing sites are in China and Russia as well.  If I block my network from these IP's the chance of going to one of these types of site is reduced. 

    3. If a PC were to get exploited, many of the exploits try to download other malware from servers in China and Russia. While not all of these servers are in China or Russia, this would still help to lower the chance of further exploitation. 

    In a traditional setup, not a UTM setup, the firewall has last say on traffic.  It would seem that in a UTM the firewall would have last say in traffic but look at exceptions that would allow this network out to this IP. 

    After some quick testing...

    It appears that Transparent with authentication block access to these sites, but even with an allow MSN.com in my filter actions, that site is still blocked.  If I add a Packet Filter that allows msn.com and place that filter at the top, it should allow it, but it is not letting me out to MSN!!!

    What gives?

    I will test it out more after work... tomorrow.

    Thanks!

    C68