Created on
‎04-24-2020
12:45 AM
Edited on
‎07-14-2023
02:15 AM
By
Stephen_G
Description
This article describes how to block IP based HTTPS web site access when a static URL filter is configured in a web filter profile.
Scope
Any version of FortiGate.
Solution
This article assumes the existence of a web filter profile that's configured with static URL filters.
With this web filter profile applied to a firewall policy, the end user is able to browse to a HTTPS web site when accessed as 'https://1.1.1.1' which is not part of the allowed URL listed in static URL filters.
Below is the config of the web filter profile named 'blockprofile'.
No FortiGuard Category based filter is enabled. Only a Static URL filter is configured with few allowed URLs, where anything else is blocked as per the 'Block' Wildcard entry shown in the bottom of this screenshot:


From the CLI:

In Proxy mode, the 'ip-of-server' will be extracted from the TCP handshake, and will be matched against the urlfilter entries in the following order:
- HTTP-GET 'host' header.
- ip-of-server.
The following results are observed when the URL filter is set to block 1.1.1.1* as a wildcard entry:
Command | Result |
curl -o /dev/null -vL --resolve one.one.one.one:80:1.1.1.1 http://one.one.one.one | Blocked - matched ip-of-server. |
curl -o /dev/null -vL --resolve one.one.one.one:80:1.1.1.1 http://1.1.1.1 | Blocked - matched host header. |
curl -o /dev/null -vk --resolve one.one.one.one:443:1.1.1.1 https://one.one.one.one | Blocked - matched ip-of-server. |
curl -o /dev/null -vk --resolve one.one.one.one:443:1.1.1.1 https://1.1.1.1 | Blocked - matched SNI. |
In Flow mode, the inspection will occur with single pass behavior. Only the http-get 'host' header will be matched against the URLfilter entries.
Command | Result |
curl -o /dev/null -vL --resolve one.one.one.one:80:1.1.1.1 http://one.one.one.one | Allowed - no match. |
curl -o /dev/null -vL --resolve one.one.one.one:80:1.1.1.1 http://1.1.1.1 | Blocked - matched host header. |
curl -o /dev/null -vk --resolve one.one.one.one:443:1.1.1.1 https://one.one.one.one | Allowed - no match. |
curl -o /dev/null -vk --resolve one.one.one.one:443:1.1.1.1 https://1.1.1.1 | Blocked - matched SNI. |