Technical Tip: Impact of Local-In Policies and Trusted Hosts Configuration on FortiGate Access
| Description | This article explains how the local-in policy and trusted hosts configuration on FortiGate affects service connections to the FortiGate unit and administrative access to that device. |
| Scope | FortiGate. |
| Solution | The trusted hosts configuration for system administrators defines a set of IP addresses or subnets permitted to access the device’s administrative interfaces, such as the web GUI or CLI. This feature helps enhance security by restricting administrative access to trusted sources only.
Below is an example of the trusted host configured on a FortiGate:
config system admin
With this setting, only traffic from the source 10.128.202.253 will be allowed for administrative access to FortiGate.
A local-in policy in FortiGate controls all the traffic destined for the device itself in general, including access to administrative interfaces. It defines rules that regulate which traffic can reach FortiGate unit and critical services offered by the unit. This protects the device from unauthorized access and attacks.
The following is an example of the local-in-policy configured on FortiGate to accept the traffic coming from port1 and the network 10.128.202.0/24 to access FortiGate's port1 IP(10.21.4.84) using HTTP service (TCP port 80 by default) and HTTPS service (TCP port 443 by default). Check 'config firewall service custom HTTP' and HTTPS to make sure those service definitions fit what's expected).
config firewall local-in-policy edit 2 set schedule "always" end
An alternative way to configure a local-in policy to block access from all IPs except a specific allowed network using a single policy.
config firewall local-in-policy edit 1 set intf "port1" set srcaddr "Allowed Network" set srcaddr-negate enable <----- This command will negate the rule. It will only allow IPs specified in 'Allowed Network' and then deny all other IP addresses. set dstaddr "wan_ip_fgt" set action deny set service "HTTP" "HTTPS" set schedule "always" set status enable next end
edit "wan_ip_fgt"
In this example, traffic from source 10.128.202.254 to 10.21.4.84:443 is allowed by local-in policy number 1, but is blocked by FortiGate because the 'trusted hosts' configuration allows only a single IP 10.128.202.253 to access the FortiGate using HTTP/HTTPS.
diagnose sniffer packet any " host 10.21.4.84 and port 443 " 4 0 l In summary:
Note:
Starting from Fortios v7.6.0, Local-in policies can be created in the GUI. See Technical Tip: Creating a Local-In policy (IPv4 and IPv6) on GUI. |
