When the log action is enabled, the Buffer Overflow security check violations are logged in the audit log as APPFW_BUFFEROVERFLOW_URL, APPFW_BUFFEROVERFLOW_COOKIE, and APPFW_BUFFEROVERFLOW_HDR violations. The Web App Firewall supports both Native and CEF log formats. You can also send the logs to a remote syslog server.
If you use the GUI to review the logs, you can use the click-to-deploy feature to apply relaxations indicated by the logs.
To access the log messages by using the command line
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining to the Buffer overflow violations:
> **Shell**
> **tail -f /var/log/ns.log | grep APPFW_BUFFEROVERFLOW**
Example of a CEF log message showing bufferOverflowMaxCookieLength violation in non-block mode
Oct 22 17:35:20 <local0.info> 10.217.31.98 CEF:0|Citrix|NetScaler|NS11.0|APPFW|**APPFW_BUFFEROVERFLOW_COOKIE**|6|src=10.217.253.62 geolocation=Unknown spt=41198 method=GET request=http://aaron.stratum8.net/FFC/sc11.html **msg=Cookie header length(43) is greater than maximum allowed(16).** cn1=119 cn2=465 cs1=owa_profile cs2=PPE1 cs3=wvOOOb+cJ2ZRbstZpyeNXIqLj7Y0001 cs4=ALERT cs5=2015 **act=not blocked**
Example of a CEF log message showing bufferOverflowMaxURLLength violation in non-block mode
Oct 22 18:39:56 <local0.info> 10.217.31.98 CEF:0|Citrix|NetScaler|NS11.0|APPFW|**APPFW_BUFFEROVERFLOW_URL**|6|src=10.217.253.62 geolocation=Unknown spt=19171 method=GET request=http://aaron.stratum8.net/FFC/sc11.html **msg=URL length(39) is greater than maximum allowed(20).** cn1=707 cn2=402 cs1=owa_profile cs2=PPE0 cs3=kW49GcKbnwKByByi3+jeNzfgWa80000 cs4=ALERT cs5=2015 **act=not blocked**
Example of a Native Format Log message showing bufferOverflowMaxHeaderLength violation in block mode
Oct 22 18:44:00 <local0.info> 10.217.31.98 10/22/2015:18:44:00 GMT ns 0-PPE-2 : default APPFW **APPFW_BUFFEROVERFLOW_HDR** 155 0 : 10.217.253.62 374-PPE2 khhBEeY4DB8V2D3H2sMLkXmfWnA0002 owa_profile **Header(User-Agent) length(82) is greater than maximum allowed(10)** : http://aaron.stratum8.net/ **<blocked>**
To access the log messages by using the GUI
The GUI includes a useful tool (Syslog Viewer) for analyzing the log messages. You have multiple options for accessing the Syslog Viewer:
-
Navigate to the Application Firewall > Profiles, select the target profile, and click Security Checks. Highlight the Buffer Overflow row and click Logs. When you access the logs directly from the Buffer Overflow Security Check of the profile, the GUI filters out the log messages and displays only the logs pertaining to these security check violations.
-
You can also access the Syslog Viewer by navigating to NetScaler® > System > Auditing. In the Audit Messages section, click the Syslog messages link to display the Syslog Viewer, which displays all log messages, including other security check violation logs. This is useful for debugging when multiple security check violations might be triggered during request processing.
-
Navigate to Application Firewall > policies > Auditing. In the Audit Messages section, click the Syslog messages link to display the Syslog Viewer, which displays all log messages, including other security check violation logs.
The XML based Syslog Viewer provides various filter options for selecting only the log messages that are of interest to you. To select log messages for the Buffer Overflow check, filter by selecting APPFW in the drop-down list options for Module. The Event Type list offers three options, APPFW_BUFFEROVERFLOW_URL, APPFW_BUFFEROVERFLOW_COOKIE, and APPFW_BUFFEROVERFLOW_HDR, to view all the log messages pertaining to buffer overflow security check. You can select one or more options to further refine your selection. For example, if you select the APPFW_BUFFEROVERFLOW_COOKIE check box and click the Apply button, only log messages pertaining to the Buffer Overflow security check violations for the Cookie header appear in the Syslog Viewer. If you place the cursor in the row for a specific log message, multiple options, such as Module, Event Type, Event ID, and Client IP, appear below the log message. You can select any of these options to highlight the corresponding information in the log message.
Click-to-Deploy: The GUI provides click-to-deploy functionality, which is currently supported only for the buffer overflow log messages pertaining to the URL Length violations. You can use the Syslog Viewer to not only view the triggered violations, but also run informed decisions based on the observed lengths of the blocked messages. If the current value is too restrictive and is triggering false positives, you can select a message and deploy it to replace the current value with the URL length value seen in the message. The log messages must be in CEF log format for this operation. If the relaxation can be deployed for a log message, a check box appears at the right edge of the Syslog Viewer box in the row. Select the check box, and then select an option from the Action list to deploy the relaxation. Edit & Deploy, Deploy, and Deploy All are available as Action options. You can use the APPFW_BUFFEROVERFLOW_URL filter to isolate all the log messages pertaining to the configured URL length violations.
If you select an individual log message, all three action options Edit & Deploy, Deploy, and Deploy All are available. If you select Edit & Deploy, the Buffer Overflow settings dialogue is displayed. The new URL length that was observed in the request is inserted into the Maximum URL length input field. If you click Close without any edits, the current configured values remain unchanged. If you click the OK button, the new value of the Maximum URL length replaces the previous value.
The block, log and stats action check boxes are unchecked in the displayed Buffer Overflow settings dialogue, and need to be reconfigured if you select the Edit & Deploy option. Make sure to enable these check boxes before clicking OK, otherwise the new URL length gets configured but the actions are set to none.
If you select the check boxes for multiple log messages, you can use the Deploy or Deploy All option. If the deployed log messages have different URL lengths, the configured value gets replaced by the highest URL Length value observed in the selected messages. Deploying the rule results only in changing the bufferOverflowMaxURLLength value. Configured actions are retained and remain unchanged.
To use Click-to-Deploy functionality in the GUI
-
In the Syslog Viewer, select APPFW in the Module options.
-
Enable the APPFW_BUFFEROVERFLOW_URL check box as the Event Type to filter corresponding log messages.
-
Enable the check box to select the rule.
-
Use the Action drop-down list of options to deploy the relaxation.
-
Navigate to Application Firewall > Profiles, select the target profile, and click Security Checks to access the Buffer Overflow settings pane to verify that the Maximum URL Length value is updated.