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.
mdecesare
Staff
Staff
Article Id 282117
Description This article describes how to create two different replacement messages to the same web filter profile but with two or more different categories.
Scope FortiGate.
Solution

The solution will be provided within the CLI command and replacement message-group with custom-message.

 

In order to apply different replacement messages for two different categories for the same web filter profile, it is first necessary to enable the replacement-group feature in the GUI to make it visible with the following:

 

config system global
    set gui-replacement-message-groups enable
end

 

Then it is necessary to create the replacement-group for each category like below:

 

config system replacemsg-group

edit "myreplace"

set comment ''

set group-type utm

config custom-message

edit "hacking"

set buffer "<html><body><h1>This site belongs to hacking blocked category</h1></body></html>"

set header http

set format html

next

edit "stream"

set buffer "<html><body><h1>This site belongs to streaming and media blocked category</h1></body></html>"

set header http

set format html

next

end

next

end

 

After, create the web filter profile such as in the following configuration, where a custom message is used for the blocked categories 'Hacking' and 'Stream and media' and apply it to the policy.

 

config webfilter profile
    edit "block-replacement"
        set replacemsg-group "myreplace"
            config ftgd-wf

            unset options
                config filters
                    edit 3
                        set category 3
                        set action block
                        set override-replacemsg "hacking"
                    next
                    edit 25
                        set category 25
                        set action block
                        set override-replacemsg "stream"
                    next
                end
          end
    next

end

 

See the following documentation for further information on the replacement group:

Replacement message groups.