Deny URL check
The Deny URL check examines and blocks connections to URLs that are commonly accessed by hackers and malicious code. This check contains a list of URLs that are common targets of hackers or malicious code and that rarely if ever appear in legitimate requests. You can also add URLs or URL patterns to the list. The Deny URL check prevents attacks against various security weaknesses known to exist in web server software or on many websites.
The Deny URL check takes priority over the Start URL check, and thus denies malicious connection attempts even when a Start URL relaxation would normally allow a request to proceed.
In the Modify Deny URL Check dialog box, on the General tab you can enable or disable the Block, Log, and Statistics actions.
If you use the command-line interface, you can enter the following command to configure the Deny URL Check:
set appfw profile <name> -denyURLAction [**block**] [**log**] [**stats**] [**none**] <!--NeedCopy-->
You can create and configure your own deny URLs only in the NetScaler GUI.
- Navigate to Security > NetScaler Web App Firewall > Profiles.
- Select a profile for which you want to add a deny URL and click Edit.
- In the NetScaler Web App Firewall Profile page, select Relaxation Rules from the Advanced Settings section.
Select Deny URL and click Edit.
- In the Deny URL Rules page, click Add.
Specify the following details and click Create.
- Deny URL - A regular expression to define a deny URL.
- Comments - Description for the expression.
- Resource ID - Unique ID to identify the deny URL rule.
- Click Close.
- In the NetScaler Web App Firewall Profile page, click Done.
Following are examples of Deny URL expressions:
Do not allow users to access the image server at images.example.com directly:
Do not allow users to access CGI (.cgi) or PERL (.pl) scripts directly:
^http://www[.]example[.]com/([0-9A-Za-z][0-9A-Za-z_-]*/)* [0-9A-Za-z][0-9A-Za-z_.-]*[.](cgi|pl)$ <!--NeedCopy-->
Here is the same deny URL, modified to support non-ASCII characters:
^http://www[.]example[.]com/(([0-9A-Za-z]|x[0-9A-Fa-f][0-9A-Fa-f]) ([0-9A-Za-z_-]|x[0-9A-Fa-f][0-9A-Fa-f])*/)*([0-9A-Za-z]|x[0-9A-Fa-f][0-9A-Fa-f]) ([0-9A-Za-z_-]|x[0-9A-Fa-f][0-9A-Fa-f])*[.](cgi|pl)$ <!--NeedCopy-->
Regular expressions are powerful. Especially if you are not thoroughly familiar with PCRE-format regular expressions, double-check any regular expressions you write. Make sure that they define exactly the URL or pattern that you want to block, and nothing else. Careless use of wildcards, and especially of the dot-asterisk (.*) metacharacter/wildcard combination, can have results that you do not want, such as blocking access to web content that you did not intend to block.