Geography objects – Deny by location

Over the past six months, there has been a noticeable increase in a Port and IP scanning attempts from various geographic locations. By restricting the firewalls to specific IP addresses and setting up alerts, we were able to identify this trend. Interestingly, we have also observed attempts using random usernames rather than common ones like admin or generic username. The next step is to create a local-in-policy to block access-based Geographic locations. Please refer to link for instructions on creating a local-in-policy.

Now you will have a “deny by location” group. Adding the objects one by one can become cumbersome as there are too many. Also depending on how many attempts you have. After some research, I found someone had taken the time to create selective objects which made it easier. Thank you for this.

To add the objects, log onto the firewall and then open a CLI session.

Run the following command:

This will add each object. It should look like this. The underscore sets the objects on the top of the list, so it is easy to find.

Thereafter, you can just add it to the “deny by location” group or it can be used for any other policy.

NOTE: In the above command, there is an object for South Africa, which is my location. I would not want to block my own traffic, so be careful when bulk adding the objects to a deny or block rule.

1 Trackback / Pingback

  1. Fortinet Vulnerability: The Importance of Locking Down Access - Expert In the Cloud

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.