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:
config firewall address
edit _geo-Reserved
set type geography
set country ZZ
nextedit _geo-Anonymous-Proxy
set type geography
set country A1
nextedit _geo-Satellite-Provider
set type geography
set country A2
nextedit _geo-Other-Country
set type geography
set country O1
nextedit _geo-Andorra
set type geography
set country AD
nextedit _geo-United-Arab-Emirates
set type geography
set country AE
nextedit _geo-Afghanistan
set type geography
set country AF
nextedit _geo-Antigua-and-Barbuda
set type geography
set country AG
nextedit _geo-Anguilla
set type geography
set country AI
nextedit _geo-Albania
set type geography
set country AL
nextedit _geo-Armenia
set type geography
set country AM
nextedit _geo-Netherlands-Antilles
set type geography
set country AN
nextedit _geo-Angola
set type geography
set country AO
nextedit _geo-Asia/Pacific-Region
set type geography
set country AP
nextedit _geo-Antarctica
set type geography
set country AQ
nextedit _geo-Argentina
set type geography
set country AR
nextedit _geo-American-Samoa
set type geography
set country AS
nextedit _geo-Austria
set type geography
set country AT
nextedit _geo-Australia
set type geography
set country AU
nextedit _geo-Aruba
set type geography
set country AW
nextedit _geo-Aland-Islands
set type geography
set country AX
nextedit _geo-Azerbaijan
set type geography
set country AZ
nextedit _geo-Bosnia-and-Herzegovina
set type geography
set country BA
nextedit _geo-Barbados
set type geography
set country BB
nextedit _geo-Bangladesh
set type geography
set country BD
nextedit _geo-Belgium
set type geography
set country BE
nextedit _geo-Burkina-Faso
set type geography
set country BF
nextedit _geo-Bulgaria
set type geography
set country BG
nextedit _geo-Bahrain
set type geography
set country BH
nextedit _geo-Burundi
set type geography
set country BI
nextedit _geo-Benin
set type geography
set country BJ
nextedit _geo-Saint-Bartelemey
set type geography
set country BL
nextedit _geo-Bermuda
set type geography
set country BM
nextedit _geo-Brunei-Darussalam
set type geography
set country BN
nextedit _geo-Bolivia
set type geography
set country BO
nextedit _geo-Bonaire,-Saint-Eustatius-and-Saba
set type geography
set country BQ
nextedit _geo-Brazil
set type geography
set country BR
nextedit _geo-Bahamas
set type geography
set country BS
nextedit _geo-Bhutan
set type geography
set country BT
nextedit _geo-Bouvet-Island
set type geography
set country BV
nextedit _geo-Botswana
set type geography
set country BW
nextedit _geo-Belarus
set type geography
set country BY
nextedit _geo-Belize
set type geography
set country BZ
nextedit _geo-Canada
set type geography
set country CA
nextedit _geo-Cocos-(Keeling)-Islands
set type geography
set country CC
nextedit _geo-Congo,-The-Democratic-Republic-of-the
set type geography
set country CD
nextedit _geo-Central-African-Republic
set type geography
set country CF
nextedit _geo-Congo
set type geography
set country CG
nextedit _geo-Switzerland
set type geography
set country CH
nextedit _geo-Cote-dIvoire
set type geography
set country CI
nextedit _geo-Cook-Islands
set type geography
set country CK
nextedit _geo-Chile
set type geography
set country CL
nextedit _geo-Cameroon
set type geography
set country CM
nextedit _geo-China
set type geography
set country CN
nextedit _geo-Colombia
set type geography
set country CO
nextedit _geo-Costa-Rica
set type geography
set country CR
nextedit _geo-Cuba
set type geography
set country CU
nextedit _geo-Cape-Verde
set type geography
set country CV
nextedit _geo-Curacao
set type geography
set country CW
nextedit _geo-Christmas-Island
set type geography
set country CX
nextedit _geo-Cyprus
set type geography
set country CY
nextedit _geo-Czech-Republic
set type geography
set country CZ
nextedit _geo-Germany
set type geography
set country DE
nextedit _geo-Djibouti
set type geography
set country DJ
nextedit _geo-Denmark
set type geography
set country DK
nextedit _geo-Dominica
set type geography
set country DM
nextedit _geo-Dominican-Republic
set type geography
set country DO
nextedit _geo-Algeria
set type geography
set country DZ
nextedit _geo-Ecuador
set type geography
set country EC
nextedit _geo-Estonia
set type geography
set country EE
nextedit _geo-Egypt
set type geography
set country EG
nextedit _geo-Western-Sahara
set type geography
set country EH
nextedit _geo-Eritrea
set type geography
set country ER
nextedit _geo-Spain
set type geography
set country ES
nextedit _geo-Ethiopia
set type geography
set country ET
nextedit _geo-Europe
set type geography
set country EU
nextedit _geo-Finland
set type geography
set country FI
nextedit _geo-Fiji
set type geography
set country FJ
nextedit _geo-Falkland-Islands-(Malvinas)
set type geography
set country FK
nextedit _geo-Micronesia,-Federated-States-of
set type geography
set country FM
nextedit _geo-Faroe-Islands
set type geography
set country FO
nextedit _geo-France
set type geography
set country FR
nextedit _geo-Gabon
set type geography
set country GA
nextedit _geo-United-Kingdom
set type geography
set country GB
nextedit _geo-Grenada
set type geography
set country GD
nextedit _geo-Georgia
set type geography
set country GE
nextedit _geo-French-Guiana
set type geography
set country GF
nextedit _geo-Guernsey
set type geography
set country GG
nextedit _geo-Ghana
set type geography
set country GH
nextedit _geo-Gibraltar
set type geography
set country GI
nextedit _geo-Greenland
set type geography
set country GL
nextedit _geo-Gambia
set type geography
set country GM
nextedit _geo-Guinea
set type geography
set country GN
nextedit _geo-Guadeloupe
set type geography
set country GP
nextedit _geo-Equatorial-Guinea
set type geography
set country GQ
nextedit _geo-Greece
set type geography
set country GR
nextedit _geo-South-Georgia-and-the-South-Sandwich-Islands
set type geography
set country GS
nextedit _geo-Guatemala
set type geography
set country GT
nextedit _geo-Guam
set type geography
set country GU
nextedit _geo-Guinea-Bissau
set type geography
set country GW
nextedit _geo-Guyana
set type geography
set country GY
nextedit _geo-Hong-Kong
set type geography
set country HK
nextedit _geo-Heard-Island-and-McDonald-Islands
set type geography
set country HM
nextedit _geo-Honduras
set type geography
set country HN
nextedit _geo-Croatia
set type geography
set country HR
nextedit _geo-Haiti
set type geography
set country HT
nextedit _geo-Hungary
set type geography
set country HU
nextedit _geo-Indonesia
set type geography
set country ID
nextedit _geo-Ireland
set type geography
set country IE
nextedit _geo-Israel
set type geography
set country IL
nextedit _geo-Isle-of-Man
set type geography
set country IM
nextedit _geo-India
set type geography
set country IN
nextedit _geo-British-Indian-Ocean-Territory
set type geography
set country IO
nextedit _geo-Iraq
set type geography
set country IQ
nextedit _geo-Iran,-Islamic-Republic-of
set type geography
set country IR
nextedit _geo-Iceland
set type geography
set country IS
nextedit _geo-Italy
set type geography
set country IT
nextedit _geo-Jersey
set type geography
set country JE
nextedit _geo-Jamaica
set type geography
set country JM
nextedit _geo-Jordan
set type geography
set country JO
nextedit _geo-Japan
set type geography
set country JP
nextedit _geo-Kenya
set type geography
set country KE
nextedit _geo-Kyrgyzstan
set type geography
set country KG
nextedit _geo-Cambodia
set type geography
set country KH
nextedit _geo-Kiribati
set type geography
set country KI
nextedit _geo-Comoros
set type geography
set country KM
nextedit _geo-Saint-Kitts-and-Nevis
set type geography
set country KN
nextedit _geo-Korea,-Democratic-People’s-Republic-of
set type geography
set country KP
nextedit _geo-Korea,-Republic-of
set type geography
set country KR
nextedit _geo-Kuwait
set type geography
set country KW
nextedit _geo-Cayman-Islands
set type geography
set country KY
nextedit _geo-Kazakhstan
set type geography
set country KZ
nextedit _geo-Lao-People’s-Democratic-Republic
set type geography
set country LA
nextedit _geo-Lebanon
set type geography
set country LB
nextedit _geo-Saint-Lucia
set type geography
set country LC
nextedit _geo-Liechtenstein
set type geography
set country LI
nextedit _geo-Sri-Lanka
set type geography
set country LK
nextedit _geo-Liberia
set type geography
set country LR
nextedit _geo-Lesotho
set type geography
set country LS
nextedit _geo-Lithuania
set type geography
set country LT
nextedit _geo-Luxembourg
set type geography
set country LU
nextedit _geo-Latvia
set type geography
set country LV
nextedit _geo-Libyan-Arab-Jamahiriya
set type geography
set country LY
nextedit _geo-Morocco
set type geography
set country MA
nextedit _geo-Monaco
set type geography
set country MC
nextedit _geo-Moldova,-Republic-of
set type geography
set country MD
nextedit _geo-Montenegro
set type geography
set country ME
nextedit _geo-Saint-Martin
set type geography
set country MF
nextedit _geo-Madagascar
set type geography
set country MG
nextedit _geo-Marshall-Islands
set type geography
set country MH
nextedit _geo-Macedonia
set type geography
set country MK
nextedit _geo-Mali
set type geography
set country ML
nextedit _geo-Myanmar
set type geography
set country MM
nextedit _geo-Mongolia
set type geography
set country MN
nextedit _geo-Macao
set type geography
set country MO
nextedit _geo-Northern-Mariana-Islands
set type geography
set country MP
nextedit _geo-Martinique
set type geography
set country MQ
nextedit _geo-Mauritania
set type geography
set country MR
nextedit _geo-Montserrat
set type geography
set country MS
nextedit _geo-Malta
set type geography
set country MT
nextedit _geo-Mauritius
set type geography
set country MU
nextedit _geo-Maldives
set type geography
set country MV
nextedit _geo-Malawi
set type geography
set country MW
nextedit _geo-Mexico
set type geography
set country MX
nextedit _geo-Malaysia
set type geography
set country MY
nextedit _geo-Mozambique
set type geography
set country MZ
nextedit _geo-Namibia
set type geography
set country NA
nextedit _geo-New-Caledonia
set type geography
set country NC
nextedit _geo-Niger
set type geography
set country NE
nextedit _geo-Norfolk-Island
set type geography
set country NF
nextedit _geo-Nigeria
set type geography
set country NG
nextedit _geo-Nicaragua
set type geography
set country NI
nextedit _geo-Netherlands
set type geography
set country NL
nextedit _geo-Norway
set type geography
set country NO
nextedit _geo-Nepal
set type geography
set country NP
nextedit _geo-Nauru
set type geography
set country NR
nextedit _geo-Niue
set type geography
set country NU
nextedit _geo-New-Zealand
set type geography
set country NZ
nextedit _geo-Oman
set type geography
set country OM
nextedit _geo-Panama
set type geography
set country PA
nextedit _geo-Peru
set type geography
set country PE
nextedit _geo-French-Polynesia
set type geography
set country PF
nextedit _geo-Papua-New-Guinea
set type geography
set country PG
nextedit _geo-Philippines
set type geography
set country PH
nextedit _geo-Pakistan
set type geography
set country PK
nextedit _geo-Poland
set type geography
set country PL
nextedit _geo-Saint-Pierre-and-Miquelon
set type geography
set country PM
nextedit _geo-Pitcairn
set type geography
set country PN
nextedit _geo-Puerto-Rico
set type geography
set country PR
nextedit _geo-Palestinian-Territory
set type geography
set country PS
nextedit _geo-Portugal
set type geography
set country PT
nextedit _geo-Palau
set type geography
set country PW
nextedit _geo-Paraguay
set type geography
set country PY
nextedit _geo-Qatar
set type geography
set country QA
nextedit _geo-Reunion
set type geography
set country RE
nextedit _geo-Romania
set type geography
set country RO
nextedit _geo-Serbia
set type geography
set country RS
nextedit _geo-Russian-Federation
set type geography
set country RU
nextedit _geo-Rwanda
set type geography
set country RW
nextedit _geo-Saudi-Arabia
set type geography
set country SA
nextedit _geo-Solomon-Islands
set type geography
set country SB
nextedit _geo-Seychelles
set type geography
set country SC
nextedit _geo-Sudan
set type geography
set country SD
nextedit _geo-Sweden
set type geography
set country SE
nextedit _geo-Singapore
set type geography
set country SG
nextedit _geo-Saint-Helena
set type geography
set country SH
nextedit _geo-Slovenia
set type geography
set country SI
nextedit _geo-Svalbard-and-Jan-Mayen
set type geography
set country SJ
nextedit _geo-Slovakia
set type geography
set country SK
nextedit _geo-Sierra-Leone
set type geography
set country SL
nextedit _geo-San-Marino
set type geography
set country SM
nextedit _geo-Senegal
set type geography
set country SN
nextedit _geo-Somalia
set type geography
set country SO
nextedit _geo-Suriname
set type geography
set country SR
nextedit _geo-South-Sudan
set type geography
set country SS
nextedit _geo-Sao-Tome-and-Principe
set type geography
set country ST
nextedit _geo-El-Salvador
set type geography
set country SV
nextedit _geo-Sint-Maarten
set type geography
set country SX
nextedit _geo-Syrian-Arab-Republic
set type geography
set country SY
nextedit _geo-Swaziland
set type geography
set country SZ
nextedit _geo-Turks-and-Caicos-Islands
set type geography
set country TC
nextedit _geo-Chad
set type geography
set country TD
nextedit _geo-French-Southern-Territories
set type geography
set country TF
nextedit _geo-Togo
set type geography
set country TG
nextedit _geo-Thailand
set type geography
set country TH
nextedit _geo-Tajikistan
set type geography
set country TJ
nextedit _geo-Tokelau
set type geography
set country TK
nextedit _geo-Timor-Leste
set type geography
set country TL
nextedit _geo-Turkmenistan
set type geography
set country TM
nextedit _geo-Tunisia
set type geography
set country TN
nextedit _geo-Tonga
set type geography
set country TO
nextedit _geo-Turkey
set type geography
set country TR
nextedit _geo-Trinidad-and-Tobago
set type geography
set country TT
nextedit _geo-Tuvalu
set type geography
set country TV
nextedit _geo-Taiwan
set type geography
set country TW
nextedit _geo-Tanzania,-United-Republic-of
set type geography
set country TZ
nextedit _geo-Ukraine
set type geography
set country UA
nextedit _geo-Uganda
set type geography
set country UG
nextedit _geo-United-States-Minor-Outlying-Islands
set type geography
set country UM
nextedit _geo-United-States
set type geography
set country US
nextedit _geo-Uruguay
set type geography
set country UY
nextedit _geo-Uzbekistan
set type geography
set country UZ
nextedit _geo-Holy-See-(Vatican-City-State)
set type geography
set country VA
nextedit _geo-Saint-Vincent-and-the-Grenadines
set type geography
set country VC
nextedit _geo-Venezuela
set type geography
set country VE
nextedit _geo-Virgin-Islands,-British
set type geography
set country VG
nextedit _geo-Virgin-Islands,-U.S.
set type geography
set country VI
nextedit _geo-Vietnam
set type geography
set country VN
nextedit _geo-Vanuatu
set type geography
set country VU
nextedit _geo-Wallis-and-Futuna
set type geography
set country WF
nextedit _geo-Samoa
set type geography
set country WS
nextedit _geo-Yemen
set type geography
set country YE
nextedit _geo-Mayotte
set type geography
set country YT
nextedit _geo-South-Africa
set type geography
set country ZA
nextedit _geo-Zambia
set type geography
set country ZM
nextedit _geo-Zimbabwe
set type geography
set country ZW
nextend
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.
Leave a Reply