FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
Stephen_G
Moderator
Moderator
Article Id 243135
Description This article explains how to display the number of the policy responsible for blocking websites through the web filter profile.
Scope Any currently supported version of FortiGate.
Solution

It is possible make a blocked page display the policy number when a web filter profile is used in that policy. This can be achieved by modifying the replacement message of that profile.

 

In this article, a static URL filter has been configured to block Fortinet sites:

 

Stephen_G_0-1673961912942.png

 

Modify 'URL Block Page' in a Replacement Message of choice from the 'Replacement Messages' section under 'System'. This replacement message will be displayed for static URL filtering.

 

Stephen_G_1-1673962065988.png

 

To change it, right-click on the section to modify and select 'Insert Tag':

 

Stephen_G_2-1673962102746.png

 

 

After that, add the 'POLICY_ID' tag. This tag will be replaced with the ID of the blocking policy when the message appears. The '123' will appear after the 'POLICY_ID' tag is added.

 

Stephen_G_3-1673962141428.png

 

It is also possible to modify the message. In this case, the 'Description' message was changed to 'Policy'.

 

Stephen_G_4-1673962172488.png

 

 

After, users bound by the policy trying to access a blocked site will see the message with the policy ID number:

 

Stephen_G_5-1673962219815.png

 

Inspection mode must be set to 'proxy' for a replacement message to work.

 

In the CLI:

 

# config firewall policy

    edit 1

        set name "Blocked Polciy"

        set uuid 31626864-96e7-51ed-cf75-6d016b7df25e

        set srcintf "lan"

        set dstintf "wan"

        set action accept

        set srcaddr "all"

        set dstaddr "all"

        set schedule "always"

        set service "ALL"

        set inspection-mode proxy

        set utm-status enable

        set ssl-ssh-profile "certificate-inspection"

        set webfilter-profile "default"

        set logtraffic all

        set nat enable

    next

end

 

The blocked site configured in the block notification web profile looks like this:

 

Stephen_G_6-1673962312946.png

 

Related article:

https://community.fortinet.com/t5/FortiGate/Technical-Tip-Block-notification-replacement-message-wit...