Created on
08-23-2024
02:57 AM
Edited on
02-17-2025
02:50 AM
By
Jean-Philippe_P
Description | This article describes how to Block/Allow URLs that contain a specific string with a Web Application Firewall. |
Scope | FortiGate, Web Application Firewall. |
Solution |
set pattern "<any_string>"
This article describes how to use WAF to allow or block any URL that contains the desired string. Open the CLI and then create a WAF profile. Each profile should have its name and then set a name for each use case.
Copy the following CLI commands into the CLI window of the FortiGate.
It is also possible to copy the following CLI commands and replace <profile_exception> with the desired name for the signature-exception profile. Then replace <test_string> with the string desired to trigger the signature exception (regex is allowed). Then set the action to <block/allow> url when test_string is present.
config waf profile
It can also be configured using constraint exception:
config waf profile next
To configure URL access rules to define the HTTP requests that are allowed or denied based on their hostname and URL:
config waf profile edit "<Profile_Name>" next end
To check the WAF profile configuration:
show waf profile <Profile_Name> <-- To show only a specific WAF profile. show waf profile <-- To show all WAF profiles. |
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 2025 Fortinet, Inc. All Rights Reserved.