Created on ‎04-24-2020 12:06 AM Edited on ‎11-29-2024 12:37 AM By Jean-Philippe_P
Description
This article describes how to disable the FortiGuard used ports 8008, 8010, and 8020 from being exposed externally when using static NAT.
Explanation regarding these ports:
Also for other ports used by FortiGuard or others, we can use the solutions below.
When static NAT is configured to publish service port other than HTTPS with proxy inspection-mode UTM enable results in opening ports 8008, 8010, and 8020. Port 8015 is opened if flow-based inspection mode is used. (FortiGuard) to external, below is the sample of configuration :
config firewall vip
edit "Email_Web"
set extip 10.56.243.92
set extintf "any"
set mappedip "10.1.0.67"
next
end
config firewall policy
edit 2
set srcintf "port1"
set dstintf "port3"
set srcaddr "all"
set dstaddr "Email_Web"
set action accept
set schedule "always"
set service "ALL_ICMP" "SMTP"
set utm-status enable
set inspection-mode proxy
set ssl-ssh-profile "certificate-inspection"
set emailfilter-profile "default"
set ips-sensor "default"
set logtraffic all
set fsso disable
next
Scope
FortiGate.
Solution
config firewall ssl-ssh-profile
edit "custom"
config https
set status disable
end
config ftps
set ports 990
set status deep-inspection
end
config imaps
set ports 993
set status deep-inspection
end
config pop3s
set ports 995
set status deep-inspection
end
config smtps
set ports 465
set status deep-inspection
end
config ssh
set ports 22
set status disable
end
end
config firewall policy
edit 2
set srcintf "port1"
set dstintf "port3"
set srcaddr "all"
set dstaddr "Email_Web"
set action accept
set schedule "always"
set service "ALL_ICMP" "SMTP"
set utm-status enable
set inspection-mode proxy
set ssl-ssh-profile "custom"<-
set emailfilter-profile "default"
set ips-sensor "default"
set logtraffic all
set fsso disable
next
If the same VIP is hosting HTTPS service, an additional firewall policy is required above the existing policy as in the below example.
config firewall policy
edit 3
set srcintf "port1"
set dstintf "port3"
set srcaddr "all"
set dstaddr "Email_Web"
set action accept
set schedule "always"
set service "HTTPS"
set utm-status enable
set ssl-ssh-profile "certificate-inspection"
set ips-sensor "default"
set logtraffic all
set fsso disable
next
Solution 2:
config firewall service custom
edit "8010"
set tcp-portrange 8010
next
config firewall policy
edit 6
set name "blockvip"
set uuid c95523f6-0cc2-51ec-9088-bd948d796fe5
set srcintf "port1"
set dstintf "port3"
set srcaddr "all"
set dstaddr "Email_Web"
set schedule "always"
set service "8010" <-
set logtraffic disable
set match-vip enable <-
next
It is possible to check on the debug flow matching the denied Firewall Policy:
id=20085 trace_id=1 func=iprope_fwd_auth_check line=803 msg="after iprope_captive_check(): is_captive-0, ret-matched, act-drop, idx-6"
id=20085 trace_id=1 func=fw_forward_handler line=630 msg="Denied by forward policy check (policy 6)"<-
Note:
After closing the VIP ports 8008, 8010, 8015, and 8020 make sure the tests are done from a computer that is not behind another FortiGate as FortiGate will intercept the traffic causing a false positive result.
If it requires to be done behind another FortiGate, it is necessary to disable those ports by 'set close-ports enable temporarily' and disable it back once testing is completed.
If the firewall is running in NGFW mode and the port has been changed to 9015:
config webfilter fortiguard
set ovrd-auth-port-https-flow 9015<-
end
The device located behind the firewall which is accessible at https://1.1.1.1:8015, is blocked by Web Filter Block Override.
From the test, port 8015 should be open in the following cases:
For more information regarding the use of the command set match-vip, see these articles:
Technical Tip: DENY Policy for Virtual IP Firewall Policy
Technical Tip: Firewall does not block incoming (WAN to LAN) connection even though deny policy
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.