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

Block subnet before hitting WAF

Hi,

Does anybody know how/if I can block an IP/Subnet before traffic, originating from that IP/Subnet, arrives at the WAF/Reverse Proxy server?

I created a block rule for one IP address, saying;
From IP - Service ANY - Destination ANY - Action DROP
And I put it on top of the rule set.

And still, when accessing the website that's behind the WAF/Reverse proxy, they get to see the webpage. And it's not browser cache or someting, I actually see the lines appear in the live log of WAF.

When I block the entire country where that IP originates from, yes, than traffic is blocked. But that's not what I want, I want to be able to block traffic from one IP or one Subnet.

Thanks!
Regards,
Erwin.


This thread was automatically locked due to age.
  • Hi Erwin,

    you could create a dnat rule that drops this traffic. 
    Alternativ , you can use the new Access control feature in site pass routing.

    regards
    mod
  • Hi Erwin,

    you could create a dnat rule that drops this traffic. 
    Alternativ , you can use the new Access control feature in site pass routing.

    regards
    mod


    Hi Mod,

    Thanks for your reply. Can you explain the dnat rule a bit more?
    Will a dnat get hit before the webserver protection rule/profile is? 
    And what should I do, Nat traffic to a non-existing IP address?

    I tried that Access Control feature. The problem there is that the allow part is been checked on before the deny part. And allow says "any" so deny is ignored. 
    As you understand without a doubt, it's undoable to add all IPv4 subnets, except one, to the allow list...

    Thanks!
  • Hi erwin,

    for Access control in SPR:
    Just delete any in allowed networks.

    for dnat:
    create a blackhole route (Inteface/Routing -> static routing -> add blackhole route to fake ip.
    create a dnat rule with source = ip/subnet that you want to block, service = any, destination = external ip, change destination to fake ip.

    regards
    mod
  • Hi erwin,

    for Access control in SPR:
    Just delete any in allowed networks.

    for dnat:
    create a blackhole route (Inteface/Routing -> static routing -> add blackhole route to fake ip.
    create a dnat rule with source = ip/subnet that you want to block, service = any, destination = external ip, change destination to fake ip.

    regards
    mod


    Hi Mod,

    I'm going to look into the dnat/blackhole route. When I remove ANY from the allowed networks nobody can access the site anymore...
    Thanks!
  • What Version you are running? In 9.307 Access control without any in allowed networks is working.
  • Erwin, I just learned about this new Allow/Deny capability.  Normally, the UTM works in such a way that 'Denied Networks' would take precedence over 'Allowed Networks'.  Please tell us if that is indeed the case.

    Cheers - Bob
  • Bob, I've just deleted the any object in allowed Networks. This is working for me. 


    Regards
    Mod
  • Hi,
    @Mod,
    I'm using 9.307-6 and when I delete ANY from the allowed list nobody can access the site. Strange if the behaviour is different with you...

    @Bob,
    It seems like you're right. That wasn't what I experienced yesterday. Now I leave ANY in allowed and the subnet I want to block in deny and now the UTM blocks access to the site from that subnet. It only takes a few seconds for the UTM to apply the settings, but now it seems to do what I want. [:)]

    Thanks!
  • Hi,
    @Mod,
    I'm using 9.307-6 and when I delete ANY from the allowed list nobody can access the site. Strange if the behaviour is different with you..

    !

    that's Strange, I'll Test this one More time
  • I don't know why this was working for me, in my first test. Now, it's working as expected. Maybe, I've made my test too quickly.

    Bob you are right!

    Regards
    mod