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

Blocked country, how to allow incoming from specific address?

Hello,

I was getting regular port sniffing attempts from certain USA ip locations (colocrossing for example). So I changed my firewall rules to block all incoming from USA in the countries setting.

I have run into one problem that I cannot figure out (and I'm still trying to wrap my brain around the UTM as a whole, so please bare with me).

I use a service call (free) that gathers live data from my aquarium controller. One of the main features (that I use), is that it "polls" my controller once every 15 minutes, and sends me a text/email if it loses connectivity.  This has saved my butt quite a few times now.

It's a simple php script that queries my controller (think ping, but with http).
The odd part is that if I load the URL that it tests against in a browser (from outside my home network) it loads perfectly fine (it asks for credentials as expected).  However, the website that tests this link fails.

This ONLY happens after I enable country blocking.

I have an aquarium controller that sits on port 80 (192.168.0.100). I've got a DynDNS address (it's actually no-ip.com address) that points to this controller.

I've created the following definitions:

(actual IPs are private and up to the owner of ***X.net to give out).

n1.***x.net  - Host > 74.x.x.1   

n2.***x.net - Host > 74.x.x.2

***xx.net - Network Group > n1.***xx.com & n2.***xx.com

for public example, lets say its called :

firewall.somefqdn.com

I've tried the following:

Country Blocking Exception:

Skip blocking from > USA
for traffic coming from these sources > ***xx.com
using these services > http

I've then tried doing a DNAT :

Traffic from >> ***xx.net
Using Service >> http
Going to >> firewall.somefqdn.com

Change destination to >> 192.168.0.100
Automatic firewall rule enabled

no go...


I've also tried an SNAT (only because I don't really understand how the UTM does it's address translation) :

Traffic from >> ***xx.net
Using Service >> http
Going to >> firewall.somefqdn.com

Change source to >> External (WAN)

Automatic firewall rule enabled

no go.

I'm kinda stumped.


This thread was automatically locked due to age.
  • There's a couple of things going on here.

    First is that Country Blocking is the first thing checked by the UTM, so if something is being blocked by country blocking, no other service (NAT, proxy, etc) will override it.

    Second is that from what I've heard, Country Blocking exceptions are broken again.  Unfortunately, I've no means of testing this currently.  Maybe Bob or Barry can give this a quick test.  What version UTM are you running?
  • There's a couple of things going on here.

    First is that Country Blocking is the first thing checked by the UTM, so if something is being blocked by country blocking, no other service (NAT, proxy, etc) will override it.

    Second is that from what I've heard, Country Blocking exceptions are broken again.  Unfortunately, I've no means of testing this currently.  Maybe Bob or Barry can give this a quick test.  What version UTM are you running?


    UTM 9.307-6 (latest from what I'm aware of).

    If I enable an "exception" in the country blocking with the following it works:

    Skip blocking of these countries: USA
    for traffic going TO these destination networks: ANY
    using these services: http

    That works, however if I specify any specific addresses as the destination (either IP or FQDN) it continuously fails.


    Once I got it to work (with the above ANY option), I went and removed the DNAT/firewall rules that I created, and it kept working.  So it makes sense that the country blocking is the only processing occuring.

    Luckily I have access to test this from both USA and Canada (where I reside).
  • Ok, good exceptions are working again then.

    Since you mention SNAT, I'm guessing you have and use an IP range.  Are you only using a single WAN IP in these transactions on your end?

    County Blocking is applied both inbound and outbound, by default.  This means you may have to do both from and to exceptions.

    Address checking is based on IP.  When using FQDNs, DNS lookups are performed.  Are n1.***X.com and n2 always static IPs or do they change over time and do they only resolve to a single IP or multiple?  Have you created them as host, dns host, or dns group type objects?  You'll need to do some digging on all of the IPs used by ***X.
  • Ok, good exceptions are working again then.

    Since you mention SNAT, I'm guessing you have and use an IP range.  Also, County Blocking is applied both inbound and outbound, by default.

    Address checking is based on IP.  When using FQDNs, DNS lookups are performed.  Are n1.***X.com and n2 always static IPs or do they change over time and do they only resolve to a single IP or multiple?  Have you created them as host, dns host, or dns group type objects?


    Yes, they resolve back to the correct IPs (single, and hasn't changed in years).

    I've actually tried all 3 with no success (thinking it might be a DNS resolution issue). Created each as an IP only, also with DNS host (both with and without reverse lookup enabled) and a group that included all of the above.
  • FYI, I edited my last post a bit and added more.  Are you seeing the drops in the full firewall log?  Any odd IPs show in the logs for these transactions?  For testing purposes, we could try FROM/TO ***X entire netblock.
  • FYI, I edited my last post a bit and added more.  Are you seeing the drops in the full firewall log?  Any odd IPs show in the logs for these transactions?  For testing purposes, we could try FROM/TO ***X entire netblock.


    Just ran a check, not additional (unexpected IPs are being shown in the firewall log). I clearly see the Country Block doing its thing, but not from an unexpected IP.

    Now, it's being blocked on what seems like the inbound IP, but with a dynamic ports:

    (example of the firewall log)

    Country Blocked TCP 74.X.X.90:44360 -> 192.168.0.100:80
  • Source ports are normally random, this is how networking works.  Did you create your own service definition for this or use the built-in one (HTTP:  TCP  1:65535 → 80)?  If you created your own with the source as 80, it won't work.
  • Source ports are normally random, this is how networking works.  Did you create your own service definition for this or use the built-in one (HTTP:  TCP  1:65535 → 80)?  If you created your own with the source as 80, it won't work.


    Nope, using the default http built-in one.
  • How about

    Skip blocking of these countries: USA
    for traffic going TO these destination networks: 74.X.X.0/24 (network definition object)
    using these services: HTTP

    Bear in mind that this will only affect outbound, not inbound.  For inbound it would be traffic coming FROM that netblock.
  • How about

    Skip blocking of these countries: USA
    for traffic going TO these destination networks: 74.X.X.0/24 (network definition object)
    using these services: HTTP

    Bear in mind that this will only affect outbound, not inbound.  For inbound it would be traffic coming FROM that netblock.


    I've just tried setting both (TO and FROM) and no go.

    Just to make sure I'm creating the object correctly:

    Name : 74.X.X.0/24
    Type : Network
    IPv4 : 74.X.X.0
    Netmask : /24