You are on page 1of 186

ACOS 5.1.

0
Web Application Firewall Guide
for A10 Thunder® Series
13 December 2019
© 2019 A10 NETWORKS, INC. CONFIDENTIAL AND PROPRIETARY- ALL RIGHTS RESERVED
Information in this document is subject to change without notice.

PATENT PROTECTION
A10 Networks products are protected by patents in the U.S. and elsewhere. The following website is provided to satisfy the
virtual patent marking provisions of various jurisdictions including the virtual patent marking provisions of the America
Invents Act. A10 Networks' products, including all Thunder Series products, are protected by one or more of U.S. patents and
patents pending listed at:

https://www.a10networks.com/company/legal-notices/a10-virtual-patent-marking

TRADEMARKS
A10 Networks trademarks are listed at:

https://www.a10networks.com/company/legal-notices/a10-trademarks

CONFIDENTIALITY
This document contains confidential materials proprietary to A10 Networks, Inc. This document and information and ideas
herein may not be disclosed, copied, reproduced or distributed to anyone outside A10 Networks, Inc. without prior written
consent of A10 Networks, Inc.

A10 NETWORKS INC. SOFTWARE LICENSE AND END USER AGREEMENT


Software for all A10 Networks products contains trade secrets of A10 Networks and its subsidiaries and Customer agrees
to treat Software as confidential information.

Anyone who uses the Software does so only in compliance with the terms of the End User License Agreement (EULA), pro-
vided later in this document or available separately. Customer shall not:

1. Reverse engineer, reverse compile, reverse de-assemble, or otherwise translate the Software by any means.
2. Sub-license, rent, or lease the Software.

DISCLAIMER
This document does not create any express or implied warranty about A10 Networks or about its products or services,
including but not limited to fitness for a particular use and non-infringement. A10 Networks has made reasonable efforts to
verify that the information contained herein is accurate, but A10 Networks assumes no responsibility for its use. All informa-
tion is provided "as-is." The product specifications and features described in this publication are based on the latest informa-
tion available; however, specifications are subject to change without notice, and certain features may not be available upon
initial product release. Contact A10 Networks for current information regarding its products or services. A10 Networks’ prod-
ucts and services are subject to A10 Networks’ standard terms and conditions.

ENVIRONMENTAL CONSIDERATIONS
Some electronic components may possibly contain dangerous substances. For information on specific component types,
please contact the manufacturer of that component. Always consult local authorities for regulations regarding proper dis-
posal of electronic components in your area.

FURTHER INFORMATION
For additional information about A10 products, terms and conditions of delivery, and pricing, contact your nearest A10 Net-
works location, which can be found by visiting www.a10networks.com.
Table of Contents

Overview ...................................................................................................................................... 9
WAF Overview.........................................................................................................................9
WAF External Logging ..........................................................................................................10
Protection Against Common Web Attacks .........................................................................10
Buffer Overflow Attacks ........................................................................................................................... 10
Cookie Tampering ...................................................................................................................................... 10
Forceful Browsing ...................................................................................................................................... 11
Web Form Security Attacks ..................................................................................................................... 11
WAF Security Models ...........................................................................................................11
Positive Security Model ............................................................................................................................ 11
Negative Security Model .......................................................................................................................... 12
Request Protection...............................................................................................................12
Compare Request URI to White List and Black List ............................................................................ 12
White List .............................................................................................................................................. 12
Black List .............................................................................................................................................. 12
URL Check ................................................................................................................................................... 13
Scan Request for Threats ........................................................................................................................ 14
Bot Check ............................................................................................................................................. 15
Form Field Consistency Check ........................................................................................................ 15
Referer Check ...................................................................................................................................... 15
HTTP Protocol Compliance Check .................................................................................................. 15
HTML Cross-Site Scripting (XSS) Check ........................................................................................ 16
Buffer Overflow Check ....................................................................................................................... 17
HTML SQL Injection Check ............................................................................................................... 17
Allowed HTTP Methods Check ........................................................................................................ 17
Maximum Cookies Check .................................................................................................................. 18
Maximum Headers Check ................................................................................................................. 19
Session Checks ................................................................................................................................... 19
Password Security .............................................................................................................................. 19
Open Redirect Mitigation ................................................................................................................... 21
Normalization Enhancements for URL Options ........................................................................... 23
WAF XML Checks ...................................................................................................................................... 25
XML Format Checks ........................................................................................................................... 26
XML Validation Checks ...................................................................................................................... 26
XML Limit Checks ............................................................................................................................... 28
XML Cross-Site Scripting Checks .................................................................................................... 30
XML SQL Injection Checks ................................................................................................................ 31
WAF SOAP Checks .................................................................................................................................... 32
SOAP Format Checks ......................................................................................................................... 32

page 3
ACOS 5.1.0 Web Application Firewall Guide
Contents

SOAP Validation Checks .................................................................................................................... 33


WAF JSON Checks .................................................................................................................................... 35
JSON Format Checks ......................................................................................................................... 35
JSON Limit Checks ............................................................................................................................. 36
Geo-location Based Blocking ................................................................................................................... 36
Filter Requests Using an HTTP Policy ............................................................................................ 37
Filter Requests Using an ACL ........................................................................................................... 40
Configuring the WAF with aFleX Scripts ............................................................................................... 40
WAF aFleX Commands ...................................................................................................................... 41
WAF Events .......................................................................................................................................... 42
Response Protection............................................................................................................42
Mask Sensitive Content ............................................................................................................................ 43
CCN Mask ............................................................................................................................................. 43
SSN Mask ............................................................................................................................................. 43
PCRE Mask ........................................................................................................................................... 44
Cloak Responses ....................................................................................................................................... 44
Send Instrumented Responses .............................................................................................................. 44
Cross Site Request Forgery Check .................................................................................................. 45
Form Field Consistency Check ........................................................................................................ 45
Cookie Encryption ............................................................................................................................... 45
PCI 6.6 Compliance ..............................................................................................................46
ACOS WAF achieves ICSA Certification ................................................................................................ 46
How Does the ACOS WAF Achieve PCI DSS Compliance? ............................................................... 46

WAF Operational Modes ............................................................................................................. 49


Overview................................................................................................................................49
Learning Mode ............................................................................................................................................ 51
Passive Mode ............................................................................................................................................. 53
Active Mode ................................................................................................................................................ 54
Setting the WAF Operational Mode .....................................................................................56

Configuring the WAF Using the GUI ............................................................................................ 57


Configuration Overview........................................................................................................57
Bind the WAF Template to the Virtual Port .........................................................................58
Add/Edit a WAF Template....................................................................................................60
Configuring HTTP Protocol Checks ....................................................................................................... 60
Configuring HTTP Limit Checks ............................................................................................................. 62
Configuring Request Checks ................................................................................................................... 62
Configuring Cookie Security .................................................................................................................... 64
Configuring Cookie Security .................................................................................................................... 65
Configuring Evasion Checks .................................................................................................................... 67
Configuring Web Service Security .......................................................................................................... 69
Configuring Server Filter Checks ............................................................................................................ 71
Configuring Data Leak Prevention .......................................................................................................... 73
Configuring Form Protection and Password Security ....................................................................... 74
Configuring Brute Force Security ........................................................................................................... 76

page 4
ACOS 5.1.0 Web Application Firewall Guide
Contents

Create a WAF File .................................................................................................................78


Configure an HTTP Policy Template ...................................................................................80
WAF Reporting......................................................................................................................82
Configure External Logging (recommended) ......................................................................85
Configure Log Servers .............................................................................................................................. 85
Add Server to Service Group .................................................................................................................... 87
Configure the Logging Template ............................................................................................................ 89
Apply the Log Template to the WAF Template .................................................................................... 89

Configuring the WAF Using the CLI ............................................................................................ 91


Required Configuration ........................................................................................................91
Create a WAF Template ........................................................................................................................... 91
Bind the WAF Template to the HTTP/HTTPS Virtual Port ................................................................ 92
OWASP Top 10 Compliance .................................................................................................................... 92
CLI Configuration ................................................................................................................................ 92
External Logging Configuration ...........................................................................................93
Optional Configuration .........................................................................................................94
Set Deployment Mode .............................................................................................................................. 95
Customize WAF Policy Files .................................................................................................................... 95
Configure Security Checks for Requests .............................................................................................. 96
Configure Security Checks for Responses .........................................................................................100

WAF Event Logging .................................................................................................................. 103


WAF Event Types and Where They Are Logged............................................................... 103
Log Format......................................................................................................................... 105
WAF Log Examples............................................................................................................ 108
Basic Log Message .................................................................................................................................108
Bot Check ..................................................................................................................................................109
Learning Mode ..........................................................................................................................................110

WAF Policy Files ...................................................................................................................... 111


Pre-Loaded WAF Policies .................................................................................................. 111
Request Protection ..................................................................................................................................112
Bot Check ...........................................................................................................................................112
XSS Check ..........................................................................................................................................112
SQL Injection Attack Check .............................................................................................................112
URI Black List .....................................................................................................................................113
URI White List ....................................................................................................................................114
Response Protection ...............................................................................................................................114
Allowed HTTP Response Codes ....................................................................................................114
Customize WAF Policy Files ............................................................................................. 115
Syntax Check ............................................................................................................................................115
Using the CLI .............................................................................................................................................115
Configure Policy Files .......................................................................................................................115
Syntax Checks ...................................................................................................................................116

page 5
ACOS 5.1.0 Web Application Firewall Guide
Contents

Manage Files ......................................................................................................................................116


Writing PCRE Expressions .....................................................................................................................117
General Guidelines ............................................................................................................................117
Example Applications ....................................................................................................................... 119

Overriding a WAF Template ...................................................................................................... 121


Configure an HTTP Policy Template ................................................................................ 121
Use the GUI to Configure an HTTP Policy Template ........................................................................122
Use the CLI to Configure an HTTP Policy Template .........................................................................123
Bind the HTTP Policy Template to the Virtual Port ......................................................... 123
Use the GUI to Bind the HTTP Policy Template to a Virtual Port ...................................................123
Use the CLI to Bind the HTTP Policy Template to a Virtual Port ....................................................123

WAF Statistics ......................................................................................................................... 125


Displaying WAF Statistics................................................................................................. 125
Use the GUI to View WAF Statistics .....................................................................................................125
Use the CLI to View WAF Statistics .....................................................................................................125
Clearing WAF Statistics .................................................................................................... 125
Use the GUI to Clear WAF Statistics ....................................................................................................125
Use the CLI to Clear WAF Statistics .....................................................................................................126

WAF Deployment and Logging Examples ................................................................................. 127


Initial Configuration........................................................................................................... 127
Logging Configuration ............................................................................................................................127
WAF Template Configuration ................................................................................................................128
HTTP Virtual Port Configuration ...........................................................................................................128
Learning ............................................................................................................................. 129
Enable Learning Mode ............................................................................................................................130
Generate Traffic ................................................................................................................................130
View External Log .............................................................................................................................130
View WAF Template Settings .........................................................................................................131
Generate Allowed URL Paths for the URL Check .............................................................................. 131
Configuration Example ....................................................................................................................132
Save Template Settings .........................................................................................................................134
Response Header Filtering................................................................................................ 134
Enable Header Response Filtering .......................................................................................................135
View External Log ....................................................................................................................................135
SQLIA Check ...................................................................................................................... 136
Enable the SQLIA Check .........................................................................................................................136
View External Log ....................................................................................................................................136
Cross-site Scripting Check................................................................................................ 136
Enable the XSS Check .............................................................................................................................136
View External Log ....................................................................................................................................137
Cookie Encryption.............................................................................................................. 137

page 6
ACOS 5.1.0 Web Application Firewall Guide
Contents

WAF Template Reference ......................................................................................................... 139

WAF CLI Command Reference ................................................................................................. 151


WAF Template Commands ............................................................................................... 151
waf .................................................................................................................................................152
waf template ............................................................................................................................... 152
csp .................................................................................................................................................163
form-protection .......................................................................................................................... 163
form-check .................................................................................................................................. 164
show waf stats ...........................................................................................................................164
clear waf stats ............................................................................................................................175
WAF File Management Commands.................................................................................. 176
waf policy check .........................................................................................................................176
waf policy copy ...........................................................................................................................177
waf policy delete .........................................................................................................................177
waf policy edit .............................................................................................................................178
waf policy max-filesize ..............................................................................................................178
waf policy rename ......................................................................................................................178
waf wsdl check ...........................................................................................................................179
waf wsdl copy .............................................................................................................................179
waf wsdl delete ...........................................................................................................................179
waf wsdl edit ...............................................................................................................................180
waf wsdl max-filesize ................................................................................................................180
waf wsdl rename ........................................................................................................................180
waf xml-schema check .............................................................................................................181
waf xml-schema copy ...............................................................................................................181
waf xml-schema delete .............................................................................................................181
waf xml-schema edit .................................................................................................................182
waf xml-schema max-filesize ..................................................................................................182
waf xml-schema rename ..........................................................................................................182
show waf policy .......................................................................................................................... 183

page 7
ACOS 5.1.0 Web Application Firewall Guide
Contents

page 8
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Overview

Overview

This chapter contains the following topics:

• WAF Overview

• WAF External Logging

• Protection Against Common Web Attacks

• WAF Security Models

• Request Protection

• Response Protection

• PCI 6.6 Compliance

WAF Overview
The A10 Networks product line provides additional security for your web servers with the Web Applica-
tion Firewall (WAF) feature. The WAF filters communication between users and web applications to
protect web servers and sites from unauthorized access and malicious programs. This new layer of
security examines incoming user requests, output from web servers, and access to website content to
safeguard against web attacks and protect sensitive information hosted on web servers.

The WAF protects against the following main threats to web servers:

• Unauthorized access and control of the web server – There are various attacks designed to grant
an attacker access to and control of a web server. If an attack is successful, the unauthorized
user can deface existing web pages, provide SMTP services to send spam, or launch distributed
denial-of-service (DDoS) attacks.
In addition, the attacker can use the compromised server to host content directly, or act as a proxy
for content hosted on another server. This type of attack can enable unauthorized users to host
illegal, online activities using your web server resources.
• Unauthorized retrieval of sensitive information – These attacks are intended to provide unautho-
rized retrieval or leakage of sensitive information from your websites or back-end databases.

The WAF is configured via a WAF template, which includes built-in basic and policy-based security
checks for convenient and quick deployment. Within the WAF template, you can enforce security
checks to immediately provide a foundational level of protection against common threats.

page 9
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF External Logging FFee
e

Websites are further protected from attack through checks that are defined by customizable WAF pol-
icy files. You can configure WAF policy files for advanced countermeasures to common attacks, such
as SQL injection attacks or bots.

WAF External Logging


The WAF includes the option for external logging of data plane events and external or local logging of
control plane events. For optimal interoperability, the WAF uses the Common Event Format (CEF), an
open standard used by other security appliances and network devices. WAF logging is supported over
UDP and TCP. You can configure external logging to a group of one or more log servers. You can easily
add more log servers if needed, simply by adding them to the log server group.

(For more information, see “WAF Event Logging” on page 103.)

Protection Against Common Web Attacks


The WAF protects your web servers from common threats which can compromise the security of web-
sites or leak sensitive information. The following sections briefly describe common threats and WAF
security checks you can use to counter these attacks. More detail is provided later in this guide.

Buffer Overflow Attacks


A buffer overflow attack occurs when a web server receives excessively long pieces of information (for
example, URLs, headers, or cookies).

If the system does not have the filters enforced to block these requests, a buffer overflow can trigger
the underlying operating system to slow down or crash. This form of attack compromises a web server
and can permit unauthorized users to access sensitive information.

The WAF can prevent buffer overflow attacks by setting an accepted maximum for aspects of an HTTP
request and blocking requests which exceed the configured limit. This includes normalization of the
URL. (For details on URL normalization, see “url-options option – This command is used to nor-
malize requested URLs.” on page 98.)

Cookie Tampering
Cookie tampering occurs when a user sends a modified cookie to a web server in an attempt to access
unauthorized content. To protect against cookie tampering, enable the Cookie Encryption check within
the WAF template.

page 10
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Security Models

Forceful Browsing
Forceful browsing occurs when a user bypasses the hyperlinks of a website to access the URLs of a
website directly. This method is normally used to gain access to private pages, but can be used in con-
junction with other attacks to compromise a web server. To protect against forceful browsing, enable
the URL check for your website. (See “URL Check” on page 13.)

Web Form Security Attacks


A web form security attack uses the form of a web page to issue commands to a website. The web
form may be modified to include hidden fields, HTML, or injected code to compromise the security of a
web server. A web form security attack commonly occurs through the following methods:

• SQL Injection Attacks (SQLIA) – An SQL Injection Attack uses a web form or other mechanism to
send active SQL commands or SQL special characters to the website’s SQL database. An SQL
Injection Attack can trigger the back-end SQL database to execute SQL commands, allowing
attackers to retrieve sensitive information from the database. The WAF includes the SQL Injec-
tion Check template option and default “sqlia_defs” policy file to provide immediate protection
from SQL Injection Attacks.
• Cross-Site Scripting (XSS) Attacks – A cross-site scripting (XSS) attack attempts to use Javas-
cript commands to modify web page content or obtain hidden properties from a website. XSS
can compromise the security of a web server or allow an attacker to retrieve sensitive informa-
tion. The WAF includes the XSS Check template option and default “jscript_defs” policy file to pro-
vide immediate protection from XSS attacks.

WAF Security Models


The WAF combats common attacks against web servers with an array of security checks to filter
inbound HTTP requests. In addition to managing requests, you can apply WAF security checks to
modify the responses sent back to users.

The WAF operates based on both a positive security model and negative security model to maximize
protection.

Positive Security Model


The WAF supports several operational modes, one of which is Learning Mode. In Learning Mode, you
send known, “trusted” traffic (HTTP/HTTPS requests) to the WAF. The WAF automatically sets the val-
ues for certain checks based on the traffic.

page 11
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

All operational modes support the White List Check. During the White List Check, the WAF compares
the URI of a user request against the URI patterns in the White List policy file. If there is match, the WAF
performs additional checks.

(For more information, see “WAF Operational Modes” on page 49.)

Negative Security Model


One of the additional checks performed by the WAF is comparison of the traffic to the patterns in the
Black List policy file. If there is a match, the WAF generates a data event log message. If Active Mode is
enabled, the WAF also drops the traffic.

Request Protection
The WAF scans request elements for possible threats or malicious content. Based on the responsive
action that is configured for each security check, the WAF denies the client request completely or
sanitizes the request of malicious content and forwards the sanitized request to the web server.

The WAF filters inbound traffic through the following security checks.

Compare Request URI to White List and Black List


The WAF examines incoming user requests against the URI White Lists and Black Lists. These lists
define rules to explicitly allow or deny traffic:

White List
The URI White List defines acceptable destination URIs allowed for incoming requests. The White List
Check compares the URI of an incoming request against the rules contained in the URI White List pol-
icy file. Connection requests are accepted only if the URI matches a rule in the URI White List. For more
information, see “URI White List” on page 114.

Black List
A URI Black List is a WAF policy file that lists exclusion criteria for incoming requests. If the URI of an
incoming request matches a rule in the URI Black List, the request is automatically blocked.

The URI Black List works in combination with the URI White List to restrict accessible URIs on a web-
site. If a URI matches acceptance criteria within the URI White List, a connection is blocked automati-

page 12
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

cally if it meets a rule in the separate URI Black List. For more information, see “URI Black List” on
page 113.

The following diagram displays the processing order for incoming requests:

FIGURE 1 Screen URI requests

In this illustration, the WAF filters 3 HTTP requests. Of these, request #3 does not meet any criteria in
the WAF template’s URI White List and is blocked.

The remaining requests are compared against the WAF template’s URI Black List and blocked if they
match at least one URI Black List rule. Of these, request #2 is denied. Request #1 is the only request
that is processed for additional security checks.

URL Check
In addition to the URI White List and Black List, you can enable the URL Check to restrict users to a lim-
ited set of URL paths on your website. The URL Check allows clients to access a specific set of accept-
able URLs that were added to the URL-check policy file while the WAF is deployed in Learning Mode.

page 13
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

Once this policy file is generated, you can manually edit the contents before switching the WAF deploy-
ment mode from Learning to Active. At this point, users are prevented from accessing any URLs that
are not listed in this generated policy file.

NOTE: For a deployment example that includes configuration of the URL Check,
see “Generate Allowed URL Paths for the URL Check” on page 131.

If the URL Check is enforced in the WAF template, the accessible web pages must appear as hyperlinks
on your website to appear in the list. This means users can access the pages on your website that
appear as hyperlinks, but they are prevented from accessing private pages through “forceful browsing”.
For more information, see “Forceful Browsing” on page 11.

NOTE: In the example shown in Figure 1 on page 13, the URL Check would
achieve the same degree of security if a hyperlink is only provided to the
page “/site_images.jpg”.

Scan Request for Threats


If a client request passes the URI White and Black List Checks, the WAF scans aspects of the HTTP
request (method, version, URI, query string, headers, cookies, and content) for threats. If the security
check discovers malicious content, the request is either denied or sanitized of the threat and forwarded
to the web server. These security checks are described in more detail below.

FIGURE 2 Scan requests

page 14
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

Bot Check
The Bot Check option uses the “bot_defs” WAF policy file for search definitions of known bot agents. If
the Bot Check is enabled in the WAF template and a match is found with the “bot_defs” file, the request
is denied automatically.

You can copy the “bot_defs” file and modify the copy to include or remove bot search terms. For more
information about WAF policy files, see “WAF Policy Files” on page 111.

Form Field Consistency Check


The Form Field Consistency Check verifies that all of the form fields and their data types that are sent
to the client as part of the form are returned unmodified in subsequent requests from the client. This
check helps protect against hijacked forms to which malicious code may have been added.

Referer Check
The Referer Check validates that the referer header in a request contains web form data from the spec-
ified web server, rather than from an outside website. This check helps to protect against CSRF
attacks. If a request fails the Referer Check, the WAF redirects the request to a safe URL. The safe URL
is any URL that you specify during configuration.

When you configure the Referer Check, you specify the domain names from which you want to allow
traffic. When ACOS receives a request addressed to the virtual port that is using the WAF, the WAF
examines the Referer field of the request.

You can select one of the following options for the Referer Check:

• Enable (full checking) – Select the Enable option to enable full checking. To pass the full check,
the request must contain a Referer header field, and the field must contain at least one of the
domain names you specify during configuration.
• Only-if-present checking – Enable this option to check the referer header of a request only when a
referer header is present. Unlike the full checking option, the only-if-present option ensures that a
request does not fail the Referer Check automatically because there is no referer header in the
request.

HTTP Protocol Compliance Check


Regardless of deployment mode, the WAF template automatically enforces a basic, default set of
HTTP protocol checks. Enable the HTTP Protocol Compliance Check to perform the following suite of
additional checks for protocol compliance:

• POST request with Content-Length: 0

page 15
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

NOTE: The WAF issues sends a warning message to the logging servers if a
POST request (that is not chunked) has a content length of 0.

• Header name with no header value

• Several Content-Length headers

NOTE: A request containing more than one Content-Length header might indi-
cate that the request is part of an HTTP response-splitting attack.

• Chunked request with Content-Length header

• Body in GET or HEAD requests

• No Host header in HTTP/1.1 request

• Host header contains IP address

• Content length should be a positive number

• Bad HTTP version

• Maximum number of headers

• Bad host header value

• Maximum number of cookies

• Invalid character in Host header

• Header contains NULL character

• Header contains high-ASCII character

• POST with invalid Content-Length header

HTML Cross-Site Scripting (XSS) Check


The HTML XSS Check defends against cross-site scripting (XSS) attacks. The WAF searches the head-
ers, cookies, and POST bodies of user requests for possible Javascript commands.

If the WAF discovers a potential cross-site scripting attack, the request is either blocked or sanitized
through the removal of potentially malicious content and forwarded for processing. For more informa-
tion about XSS, see “Web Form Security Attacks” on page 11.

NOTE: This check uses the “jscript_defs” WAF policy file for Javascript attack
patterns. If your website uses Javascript-based content that accesses or
modifies content on an outside server, A10 Networks recommends mod-
ifying the “jscript_defs” file to generate the appropriate exceptions, so
that this check does not block legitimate activity.

page 16
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

Buffer Overflow Check


The WAF can check various elements in an HTTP request to prevent buffer overflow. You can specify
the check to examine one or more of the following aspects of a request:

• Cookie length, name length, and/or value length

• Header length, name length, and/or value length

• Parameter length, name length, and/or value length

• Maximum parameters

• URL length

• POST content size

• Line length

• Query length

HTML SQL Injection Check


The HTML SQL Injection Check scans incoming requests for strings that resemble SQL commands or
SQL special characters. If the WAF discovers a match, the request is either blocked or sanitized of SQL-
code and forwarded for processing.

NOTE: The HTML SQL Injection Check scans incoming requests for attack pat-
terns listed in the “sqlia_defs” WAF file. Copy this file and apply the cop-
ied file to the check to customize attack pattern search criteria for the
HTML SQL Injection Check. (See “SQL Injection Attack Check” on
page 112.)

Allowed HTTP Methods Check


The Allowed HTTP Methods Check ensures that HTTP requests contain only the HTTP methods that
are allowed by the WAF template. By default, only the following methods are allowed: GET, POST

You can allow one or more of the following HTTP methods:

• GET

• POST

• HEAD

• PUT

• OPTIONS

page 17
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

• DELETE

• TRACE

• CONNECT

• PURGE

Support for Additional WebDAV HTTP Methods

Web Distributed Authoring and Versioning (WebDAV) is an extension to the HTTP protocol that is used
to allow Internet users to modify files on remote a resource (e.g., a web server), using HTTP as the
communication medium.

The WAF can be configured to accept several new WebDAV HTTP methods which allows WebDAV
traffic to pass through the WAF without being dropped. In releases prior to ACOS 4.0, the WAF had to
be disabled on all relevant connections prior to attempting to use the WebDAV methods.

As part of the ACOS enhancements, the WAF supports the following new WebDAV HTTP methods, in
addition to the originally-supported GET and POST methods:

• PROPFIND – retrieves the hierarchical information, and properties, for a directory containing
a set of resources
• PROPPATCH – modifies multiple properties for a set of a resources with a single operation
• MKCOL – creates a directory for the resources
• COPY – copies a resource from one URI to another
• MOVE – moves a resource from one URI to another
• LOCK – locks a resource (can be either shared or exclusive lock)
• UNLOCK – removes the lock from a resource
• * DP parsing of the new method string

The WAF can be configured to accept these new methods by using the allowed-http-methods CLI
command within a WAF template and then specifying which of the WebDAV HTTP methods that will be
allowed to pass through the WAF.

NOTE: WAF configuration is allowed on shared and on service partitions.

Maximum Cookies Check


The Maximum Cookies Check ensures that a client request does not contain more than the maximum
allowed number of cookies. By default, the maximum number of cookies allowed in a request is 20.

page 18
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

Maximum Headers Check


The Maximum Headers Check ensures that a client request does not contain more than the maximum
allowed number of headers. By default, the maximum number of headers allowed in a request is 20.

Session Checks
To increase the security of the session between the ACOS device and the clients, the WAF offers
cookie-based session checks, or “session tracking”.

With this option enabled, the WAF uses a cookie to track user sessions. When a request is received
from a client for the first time, ACOS creates a unique ID for the session, stores it in a table, and inserts
the ID into a cookie that is returned to the client. Subsequent requests from this client are then vali-
dated against the session ID. If the session ID does not match the saved ID, or if the ID is coming from
a different IP address than that of the original client, then the request is rejected.

Details:

• Session Tracking for WAF sessions is disabled by default.

• When enabled, you must specify the Session Lifetime to determine the amount of time the ses-
sion ID will remain valid. By default, the session lifetime is 600 seconds (10 minutes), but you can
enter a range from 1–86400 seconds (24 hours).
• The session cookie is named “awaf-sid”, and it is inserted into the header of the response sent by
ACOS.
• The header appears in the following format:
Set-Cookie: awaf-sid=<session-id>; path=/' max-age=<session-lifetime>

Password Security
The WAF offers several additional password security options to control how passwords are treated
when traversing the WAF.

Deny Unmasked Passwords

When a user types a password into an HTML form’s password field, the characters are typically hidden
by another character, such as an asterisk. In this way, the password characters are masked when
typed by the user. This masking prevents an observer from stealing the password and using it at a later
time to access the user’s account.

The WAF can guard against this type of “shoulder surfing” by leveraging the “password” field type.
When the deny-non-masked-passwords option is enabled, the WAF will deny the web server’s
attempt to send a form unless the field type is set to “password”.

page 19
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

If the form field is named “password” (or “secret”), then the field type also needs to be set to “password”
to ensure that the password characters will be hidden when typed by the end user. (Other field types,
such as “text”, will not hide the password characters as they are being entered by the user.)

The example below shows a form that would be denied by the WAF. Note that the form field type is set
to “text”, and the form name is set “Password”. The WAF would block the web server’s attempt to send
this form because the “input type=text” means the user’s password would not be hidden or masked as
it was being typed and would thus be vulnerable to theft.

<form>
Password: <input type="text" name="Password">
</form>

The second example below shows a form that would be allowed by the WAF, because even though the
field is named “Password”, the field type has also been set to “password”, meaning the form field would
mask the characters typed by a user.

<form>
Password: <input type="password" name="Password">
</form>

To configure the WAF to prevent web servers from sending non-secure password forms to a client, use
the deny-non-masked-passwords CLI command at the WAF template configuration level.

Deny Passwords Sent Over an Unencrypted Connection

You can configure the WAF to block user passwords that are sent over a non-encrypted connection. If
the connection between the client and the WAF is secured with SSL/TLS, then the user password is
allowed. However, if the client attempts to submit to a form field where “input type=password”, and if
the connection is not encrypted with SSL/TLS, then the WAF will block the transmission.

NOTE: Even if this option is enabled, the user’s password may have already
been compromised while in transit, because the WAF blocks transmis-
sion of the password only after the client has already entered it over an
unsecured connection. In such cases, the user’s password could have
already been compromised before reaching the WAF.

You can enable this option to prevent the WAF from allowing the transmission of user passwords over
non-SSL-encrypted connections by entering the deny-non-ssl-passwords CLI command at the WAF
template configuration level.

Deny Passwords if Autocomplete is Enabled

Modern browsers can store user passwords and make an attempt at guessing at the password values
when the user encounters a website that requires entering his or her password into a web form field.
This autocomplete behavior is controlled by the “autocomplete=on/off” attribute, which is typically
associated with the HTML form text fields.

page 20
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

While end users may appreciate this “autocomplete” behavior because it simplifies the process of log-
ging into websites, the convenience comes at the cost of making the user’s password and the overall
security of the login process, less secure.

In order to control the browser’s behavior, administrators can increase the network security by config-
uring the WAF to reject the web server form if the field type is set to “password” and if the “autocom-
plete=on/off” attribute is set to “on”.

To configure this option and prevent the WAF from allowing the transmission of user passwords when
the “autocomplete=on/off” attribute is set to “on”, use the deny-password-autocomplete CLI com-
mand at the WAF template configuration level.

Open Redirect Mitigation


The Open Redirect Mitigation feature offers protection against the threat of “unvalidated redirects or
forwards”, which is listed as one of the Open Web Application Security Project (OWASP) “Top 10 List” of
most severe security risks for 2013.

An unvalidated redirect occurs when a hacker uses social networking (such as email, Facebook, Twit-
ter) to trick unsuspecting users into clicking on a malicious hyperlink as part of a phishing scam.
Although the hyperlink appears to be from a trusted website, it contains code that redirects users to a
forged website where users may be tricked into submitting their login credentials (username/pass-
word), credit card numbers, security codes, or other sensitive information. Once this information is
acquired, hackers may then use it to access their accounts or attack their systems.

Although OWASP groups “unvalidated redirects or forwards” together as a single threat, these are actu-
ally two separate-but-related threats. As such, the WAF has different ways to mitigate both types of
attacks:

• “forwards” – With this type of threat, users become victims when they are forwarded to a mali-
cious URL which tricks them into surrendering their login credentials. This particular risk can be
mitigated through the use of the URL check feature, which is discussed here: “URL Check” on
page 13
• “unvalidated redirects” – Described in detail below.

The WAF protects users against the threat of “unvalidated redirects” by pre-learning a white-list of
acceptable locations to which users can safely be redirected. If one of the web servers attempts to redi-
rect a user to a location that does not appear in the redirect white-list, then the WAF blocks the redirect.

The Open Redirect Mitigation feature must be enabled using the redirect-wlist CLI command. The
command is used at the WAF template configuration level, and the first time the command is used, the
WAF must be deployed in Learning Mode.

NOTE: If you attempt to use the command for the first time while the WAF is
deployed in Active Mode or Passive Mode (and before the redirect white-

page 21
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

list has been created during Learning Mode), then you will receive an
error message stating that “redirect-wlist cannot be turned on with
empty list.”

Valid traffic is then injected into the WAF, which then investigates each “redirect” response packet
received from the backend web servers, where a redirect response packet is defined as any packet hav-
ing a status code ranging from 300–308.

The WAF extracts the value from the Location field of the header of the response packet and stores it in
its internal database.

When the WAF deployment mode is subsequently changed from Learning Mode to Active Mode (or
Passive Mode), the location information in the database is transferred to a persistent file called “redi-
rect_wlist_”. The filename will have the name of the WAF template as its prefix. For example, the WAF
template “test” would have a policy file called “_test_redirect_wlist_”.

Details:

The behavior of this option depends on which deployment mode the WAF is in:

• Learning Mode – The option must be enabled for the first time while the WAF is deployed in
Learning Mode. The information is saved in the ACOS device’s local database. At this time, the
white-list file has not yet been created, so if you wish to modify the redirect white-list, you must
change to Active or Passive Mode. Note that no action is performed upon traffic during Learning
Mode, other than using the traffic to build the redirect white-list.
• Active Mode – Once the redirect white-list is created while the WAF is deployed in Learning Mode,
you can then change the deployment mode to Active Mode. At this point, the database is used as
a white-list of allowed location headers in redirect packets. If a response from the web server
contains a redirect which is not in the white-list, the WAF will deny (drop) the response and send
the client a “403 forbidden” reply.
• Passive Mode – If the option is enabled while the WAF is deployed in Passive Mode, the WAF
leverages the existing redirect white-list to inspect traffic, but it takes no action, in terms of block-
ing traffic, and simply increases the counters and generates logs for hypothetical actions that
would be taken if the WAF were in Active and not Passive Mode.

Configuration

To prevent unvalidated redirects, use the following CLI command at WAF template configuration level:

redirect-wlist

NOTE: The WAF must be deployed in Learning Mode the first time the com-
mand is used. Once the redirect white-list is created, you can then switch
to Passive Mode or Active Mode.

page 22
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

Display Statistics

You can display statistics for this redirect-wlist option using the show waf stats virtual-server-
name portnum CLI command, as shown in the example below, which offers three dedicated counters
associated with the redirect white-list:

ACOS#show waf stats vip2 80


...
Redirect White List Check
- Learned 8
- Success 2
- Failed 0
...

The output in this example is for the WAF template that is bound to vip2, port 80. The table below
describes the relevant fields in the command output.

TABLE 1 show waf stats fields


Field Description
Redirect White List Redirect counters:

• Learned – Number of redirect locations learned during Learning Mode and added to
the redirect white-list.

• Success – Number of requests that matched a URI entry in the redirect white-list and
were accepted.

• Failed – Number of requests that did not match a URI entry in the redirect white-list
and were blocked.

Normalization Enhancements for URL Options


ACOS support URL normalization, which is a process of standardizing the appearance of URLs to
remove inconsistencies from one URL to another.

For example, one URL might use lower-case characters, while another URL could use a mix of upper-
case and lower-case characters. A simple corrective normalization scheme could be used to convert
the URL with the mixed set of upper-case and lower-case characters to use only lower-case characters,
as shown below.

• Before normalization: HTTP://www.Example.com/

• After normalization: http://www.example.com/

page 23
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

This process of normalizing URLs is sometimes used by search engines to make comparisons of sev-
eral URLs easier. By standardizing the appearance of URLs and reducing them to canonical form, it is
easier to ensure the same URL is not cataloged twice by a web crawler.

The WAF uses URL normalization to protect web servers from certain types of attacks, which can hide
in the non-normalized, recursive encoding of the data. One example of such an attack is the so-called
“directory traversal attack,” which exploits non-sanitized file names to gain access to sensitive directo-
ries or files.

URL Options

In addition to normalizing upper-case and lower-case, the WAF can also make the following changes to
internal URLs sent from backend servers:

• Decode Entities – Decode entities, such as &lt; &#xx; &#ddd; &xXX in an internal URL.

• Decode Escaped Characters – Decode escape characters, such as \r \n \"\xXX in an internal URL.

• Decode HEX Characters – Decode hexadecimal characters, such as \%xx and \%u00yy in an
internal URL.
• Remove Comments – Remove comments from an internal URL.

• Remove Self References – Remove self-references, such as /./ and /path/../ from an internal
URL.
• Remove Spaces – Remove spaces from an internal URL.

page 24
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

WAF XML Checks


ACOS 4.0 offers enhancements to the WAF that allow it to scrub client requests containing eXtensible
Markup Language (XML) code for anomalies. XML is commonly used for data exchange, but hackers
may exploit security holes in the XML code to attack servers.

It is important to inspect and validate client requests containing XML code to protect the backend serv-
ers from XML transactions that could allow hackers to bypass application security, provide malicious
input, and potentially slow down or crash the servers.

When the new WAF XML checks are enabled, the WAF checks client requests for XML, and if present,
the WAF then validates the structure of the XML document using a trusted XML schema file. In doing
so, this helps to ensure that the content of the client’s XML request is well-formed and does not contain
any potential threats.

Types of XML Checks

In this release, the WAF offers the following types of XML checks:

• XML Format Checks – This option uses the xml-format-check command and examines the XML
format of incoming requests and blocks requests that are not well-formed.
• XML Validation Checks – This option uses the xml-validation CLI command to validate the XML
content in a request in order to check it against an XML Schema file or WSDL file. Running such
checks on incoming XML content prevents an attacker from using specially-constructed (and
invalid) XML messages to circumvent the web application’s standard security checks. If the WAF
discovers that the XML content fails the validation check, then the WAF blocks the request.
• XML Limit Checks – This option uses the xml-limit CLI to command enforce parsing limits in
order to protect the servers from various denial-of-service (DoS) attacks, such as XML bombs
and Transform Injections, both of which are defined in greater detail below.
• XML Cross-Site Scripting Checks – This option uses the xml-xss-check CLI command to exam-
ine the headers and bodies of incoming XML requests for Javascript keywords that might indi-
cate possible cross-site scripting attacks. If the request contains a positive match, then the WAF
blocks the request.
• XML SQL Injection Checks – This option uses the xml-sqlia-check CLI command to examine the
headers and bodies of incoming requests for inappropriate SQL special characters and keywords
that might indicate an SQL Injection Attack. If found, the WAF blocks those requests.

page 25
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

XML Format Checks


The XML format check examines the format of incoming requests, and blocks requests if the XML con-
tent is not well-formed. The option can be enabled with the following CLI command at the WAF tem-
plate configuration level:

xml-format-check

The XML format check verifies that incoming requests containing XML code are in compliance with the
XML 1.0 specification, which can be found at the following URL: http://www.w3.org/TR/REC-xml/

The XML Format Check evaluates incoming XML documents for compliance with the following rules:

• XML documents must contain only properly-encoded Unicode characters

• The document may contain no special XML syntax characters. For example, none of the follow-
ing characters can be included in the XML document, unless used as markup: , “<“, “>”, and "&”
• The XML document must contain all beginning and end tags. All begin, end, and empty element
tags must be nested correctly. The XML document must not be missing any element tags, and it
cannot contain overlapping element tags.
• A single root element must contain all the other elements in the XML document.

XML Validation Checks


The XML Validation Check is used to prevent an attacker from using invalid XML messages that have
been specially-constructed to evade application security.

The XML Validation Check examines client requests containing XML content to make sure that the
XML messages are valid.
If a client request contains an XML message, and the XML validation check option is enabled, then the
incoming request will be compared with an XML schema file.

An XML schema is an XML document which describes the desired structure of other XML document.
The XML schema goes beyond just defining proper XML syntax, and it defines things such as which
elements or attributes can appear in an XML document, as well as the number, order, and relationship
of child elements. It can also determine the data types associated with the various elements and attri-
butes that appear in an XML document.

If an incoming request is compared with the XML schema, and the WAF determines that the request is
not valid, then it is deemed a threat and the WAF blocks the request.

The option can be enabled using the following CLI command at the WAF template configuration level:

xml-validation xml-schema [resp-val] xml-schema-file-name

page 26
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

XML Schema Validation

The WAF can validate XML messages using an XML schema file. You must upload the XML schema
file that you plan to use for validation. The XML schema file can be uploaded using the import com-
mand at the global config level of the CLI:

import xml-schema local-filename [use-management-port] file-name url

The use-mgmt-port option allows you to indicate the use of the management interface as the source
interface for the connection to the device.

The url option specifies the file transfer protocol, username, and directory path. You can enter the
entire URL on the command line, or you can press Enter to display a prompt for each part of the URL. If
you enter the entire URL and a password is required, you will still be prompted to enter the password.
To enter the entire URL:

• tftp://host/file

• ftp://[user@]host[:port]/file

• scp://[user@]host/file

• sftp://[user@]host/file

If you need to modify an existing XML schema file, you can do so using the following CLI command at
the global config level:

waf xml-schema edit local-filename

If you need to remove an existing schema file, you can do so using the following CLI command at the
global config level:

waf xml-schema delete local-filename

Response Validation

By default, the WAF does not validate server responses. In order to validate responses from a protected
web application, the resp-val option should be selected.

WSDL Validation

The WAF can validate SOAP messages (based on XML) using a Web Services Description Language
(WSDL) document.

For more information about WSDL Validation, please see “WAF SOAP Checks” on page 32.

page 27
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

XML Limit Checks


When the xml-limit-check option is configured, the WAF XML parser will enforce parsing limits in
order to protect backend servers against various types of denial-of-service (DoS) attacks, which are
designed to exhaust system memory or CPU resources. Some examples of DoS attacks that can be
prevented this way are XML Bombs and Transform Injections.

XML Bomb

An XML Bomb is a denial of service attack that takes advantage of the fact that entity references in
XML documents must be expanded for evaluation. Such attacks can achieve this goal by adding extra
entity entries to the XML document, and then defining subsequent entities, which are based on the
expanded values of the previous entity. Entity expansion is a normal and required action for XML docu-
ments, so hackers can take advantage of this loophole by using it to exhaust system memory and CPU
resources. If it is left unchecked, such an attack could really slow performance thus causing servers to
crash.

The WAF can address this issue by placing a maximum limit on the number of entity expansions that
are allowed in an XML document. Similarly, a maximum limit can be imposed on the number of levels
of entity recursion. Together, imposing these types of limits on XML documents can contain and miti-
gate the harmful effects of an XML Bomb.

Transform Injection

Transform Injections are a different type of denial of service attack, and they work by taking advantage
of XSLT flow-control functions, and by creating infinite loops, or perhaps redundant transforms, which
will eventually exhaust the available memory and CPU resources that the server can offer.

To mitigate the effects of Transform Injection attacks, the WAF can be configured to place limits on the
maximum depth of child element pairs, the amount of data contained in an element pair, and the maxi-
mum size of an XML document.

Configuring XML Limit Parameters to Thwart XML Bombs and Transform Injections

To prevent XML Bombs, Transform Injections, and other types of DoS attacks from consuming exces-
sive system resources, ACOS provides the following CLI command, which can be used at the WAF tem-
plate configuration level.

xml-limit parameter limit

The xml-limit command can be completed using any of the parameters shown below:

• max-attr number

Limits the maximum number of attributes each individual element is allowed to have.
number – Maximum number of children allowed per element. Range is 1–256. Default is 256.

page 28
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

• max-attr-name-len number

Limits the maximum length of each attribute name.


number – Maximum number of characters allowed per element. Range is 1–2048. Default is 128.
• max-attr-value-len number

Limits the maximum length of each attribute value.


number – Maximum number of characters allowed per attribute. Range is 1–4096. Default is 128.
• max-cdata-len number

Limits the length of the CDATA section for each element.


number – Maximum length of CDATA section for element. Range is 1–65535. Default is 65535.
• max-elem number

Limits the maximum number of any one type of element per XML document.
number – Number of elements allowed. Range is 1–8192. Default is 1024.
• max-elem-child number

Limits the maximum number of children each element is allowed, and includes other elements,
character information, and comments.
number – Maximum number of children allowed per element. Range is 1–4096. Default is 1024.
• max-elem-depth depth

Limits the maximum number of nested levels in each element.


depth – Maximum number of levels allowed. Range is 1–4096. Default is 256.
• max-elem-name-len length

Limits the maximum length of name of each element.


length – Maximum length of each element, and includes the XML path, which is in the following
format:
http://<site>/<path>/page.xml
Range is 1–65535. Default is 128.
• max-entity-exp number

Limits the number of entity expansions allowed.


number – Maximum number of entity expansions allowed. Range is 0–1024. Default is 1024.
• max-entity-exp-depth number

Limits the maximum depth of nested entity expansions.


number – Maximum depth of entity expansions allowed. Range is 0–32. Default is 32.

page 29
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

• max-namespace number

Limits the number of namespace declarations in XML document.


number – Maximum number of namespace declarations allowed. Range is 0–256. Default is 16.
• max-namespace-uri-len number

Limits the URL length for each namespace declaration.


number – Maximum URL length allowed for each namespace declaration. Range is 0–1024.
Default is 256.

XML Cross-Site Scripting Checks


The XML cross-site scripting check examines the headers and bodies of incoming XML requests for
Javascript keywords that might indicate possible cross-site scripting attacks and blocks those
requests.

The option can be enabled with the following CLI command at the WAF template configuration level:

xml-xss-check

The policy file for xml-xss-check is taken from the xss-check option, which must also be configured.
See “XSS Check” on page 112 for additional details.

The WAF checks the incoming request against the “jscript_defs” WAF policy file, which contains a list of
common Javascript commands. If the client request detects a positive match against the Javascript
commands in this policy file, then the message will be rejected. The WAF does not currently support
the ability to modify the contents in XML requests that are denied.

CLI Example

The xml-xss-check depends on configuring the xml-format-check and the xss-check within the WAF
template. The xss-check is configured to reject requests with a positive match to the filtering criteria.
The WAF template “tempwaf1” is bound to VIP “vs101”.

waf template tempwaf1


template logging syslog
xml-format-check
xml-xss-check
xss-check reject

slb virtual-server vs101 10.12.0.101


port 80 http
source-nat pool nat_IPv4
service-group sg-http
template waf tempwaf1

page 30
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

XML SQL Injection Checks


To prevent XML SQL Injection Checks, the WAF examines the headers and bodies of incoming requests
for inappropriate SQL special characters or keywords that might indicate the presence of an SQL Injec-
tion Attack. If the check finds any of the forbidden special characters or keywords, then the WAF will
block those requests and prevent them from reaching the servers. This option can be enabled using the
following CLI command at the WAF template configuration level:

xml-sqlia-check

The policy file for xml-sqlia-check is taken from sqlia-check, which must also be configured. See “SQL
Injection Attack Check” on page 112 for additional details.

The WAF checks the incoming request against the rules contained in the WAF policy file “sqlia_defs”. If
the client request detects a positive match against the rules in the policy file, then the message will be
rejected. The WAF does not currently support the ability to modify the contents in XML requests that
are denied.

CLI Example

The xml-sqlia-check depends on configuring the xml-format-check and the sqlia-check within the
WAF template “tempwaf2”. The sqlia-check is configured to reject requests with a positive match to the
filtering criteria. The WAF template “tempwaf2” is bound to VIP “vs102”.

waf template tempwaf2


sqlia-check reject
template logging syslog
xml-format-check
xml-sqlia-check
slb virtual-server vs102 10.12.0.101
port 80 http
source-nat pool nat_IPv4
service-group sg-http
template waf tempwaf2

page 31
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

WAF SOAP Checks

What is SOAP?

The Simple Object Access Protocol (SOAP) was created to allow platform-independent communication
between web services. SOAP is based on XML and typically relies on HTTP to transmit messages.

Prior to SOAP, most applications would communicate using remote procedure calls (RPCs). When
attempting to send an RPC over the Internet to a web server, problems could occur because RPCs
would often get blocked by overzealous firewalls.

SOAP gained popularity because it offered a way for web applications to communicate over the Inter-
net without the messages being intercepted by firewalls. This is by virtue of the fact that SOAP relies on
HTTP to transmit messages, and HTTP is supported by virtually all Internet browsers and servers.

Structure of a SOAP Message

A SOAP message is an ordinary XML document that contains the following elements:

• An Envelope element, which identifies this XML document as being a SOAP message

• A Header element, which contains the header information

• A Body element, which contains the call and response information

• A Fault element, which contains errors and status information

Types of SOAP Checks

In this release, the WAF offers the following types of SOAP checks:

• SOAP Format Checks – This option uses the soap-format-check CLI command and examines
the format of incoming SOAP requests and blocks those which are not well-formed.
• SOAP Validation Checks – This option uses the xml-validation wsdl CLI command to validate
the SOAP content in a request in order to check it against a WSDL file. If the WAF discovers that
the SOAP content fails the validation check, then the WAF blocks the request.

SOAP Format Checks


The SOAP Format Check enhancement scrubs client requests that use SOAP for anomalies that could
indicate the presence of an attack.

While it is not recommended, SOAP format checks can be enabled independently of XML checks. Most
of the time, however, SOAP format checks are done in tandem with XML format checks, which makes
sense, because SOAP is based on XML.

page 32
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

As a matter of best practices, when enabling SOAP format checks (using the soap-format-check
option), you should also enable XML format checks (using the xml-format-check option). The reason
for this is that the WAF always does the XML checks first and then adds additional SOAP checks.

For additional information on XML format checks, see “WAF XML Checks” on page 25.

What is a SOAP Format Check?

The SOAP Format Check scrubs incoming client requests to ensure that the SOAP requests are struc-
tured in the proper format, as defined by the World Wide Web consortium in the following Recommen-
dation:

http://www.w3.org/TR/2007/REC-soap12-part1-20070427/

The SOAP format check performs the following evaluations:

• Verifies that messages have the appropriate sections (e.g., Message, Header, Body, Fault, etc.)
and that these sections appear in the correct order.
• Verifies that the envelope uses the correct namespace (http://www.w3.org/2003/05/soap-enve-
lope).
• Verifies that defined attributes, such as role, encodingStyle, Code, etc., follow the defined format.

You can enable SOAP format checks using the following CLI command at the WAF template configura-
tion level:

soap-format-check

NOTE: As mentioned above, the xml-format-check option should also be


enabled when enabling the soap-format-check option.

SOAP Validation Checks


The WAF can validate SOAP messages using a Web Services Description Language (WSDL) document.
WSDL is an XML document that is typically used to describe the behavior of a web service.

In contrast with the XML schema file (which defines how the data in an XML document is structured),
the WSDL document is for SOAP documents. (Please ignore for a moment the confusing fact that
SOAP documents are based on XML1.)

The WSDL file describes functionality of a SOAP document by defining which operations are available
and how the data should be structured. The WSDL file contains the operation, such as the methods
provided by a web service, and the document describes which data types (int, float, etc) the method
can accept. Validating a SOAP document using a WSDL file ensures that the method being called is
defined for the current direction, and that the message conforms to the schema for that message.

page 33
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

The WSDL validation option can be enabled using the following CLI command at the WAF template
configuration level:

xml-validation wsdl [resp-val] wsdl-file

You must upload the WSDL file you will use for validation. The WSDL file can be uploaded using the
import command at the global config level of the CLI:

import wsdl local-filename [use-management-port] file-name url

The use-mgmt-port option allows you to indicate the use of the management interface as the source
interface for the connection to the device.

The url option specifies the file transfer protocol, username, and directory path. You can enter the
entire URL on the command line, or you can press Enter to display a prompt for each part of the URL. If
you enter the entire URL and a password is required, you will still be prompted to enter the password.
To enter the entire URL:

• tftp://host/file

• ftp://[user@]host[:port]/file

• scp://[user@]host/file

• sftp://[user@]host/file

If you need to modify an existing WSDL file, you can do so using the following CLI command at the
global config level:

waf wsdl edit local-filename

If you need to remove an existing WSDL file, you can do so using the following CLI command at the
global config level:

waf wsdl delete local-filename

Response Validation

By default, the WAF does not validate server responses. In order to validate responses from a protected
web application, the resp-val option should be selected.

1.
To explain why the command is “xml-validation wsdl” and not “soap-validation”, consider that WSDL is an extension to the
XML Schema and it assumes the presence of some type of XML RPC headers. Therefore, WSDL does not include their
definition in each schema file, but it extends the XML Schema to allow for an association to occur for specific calls to spe-
cific URIs, assuming the contents of the headers.

page 34
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

WAF JSON Checks


In ACOS 4.0, the WAF is enhanced by adding support for parsing and verifying JSON data in HTTP
POST operations. The WAF supports the ability to run a format check on requests containing JSON
data. This helps to ensure that the content of the request is well-formed. In addition, the WAF supports
the ability to impose JSON parsing limits in order to protect web servers from various types of denial-
of-service (DoS) attacks.

Types of JSON Checks

In this release, the WAF offers the following types of JSON checks:

• JSON Format Checks – This option uses the json-format-check command and examines the
JSON format of incoming requests and blocks requests that are not well-formed.
• JSON Limit Checks – This option uses the json-limit CLI to command enforce parsing limits in
order to protect the servers from various denial-of-service (DoS) attacks.

JSON Format Checks


The JSON format check examines the format of incoming requests, and blocks requests if the JSON
content is not well-formed.

The JSON format check verifies that incoming requests containing JSON code are in compliance with
RFC 4627.

This document can be found at the following URL: http://www.ietf.org/rfc/rfc4627.txt

Compliance Criteria

The JSON Format Check evaluates incoming requests for compliance with the following criteria:

• The JSON document must contain only properly-encoded Unicode characters.

• Strings must contain matching quotations and properly escaped characters.

• All objects must contain matching braces {}, and a set of members must be separated by com-
mas.
• Every object member must contain a name and value, separated by a colon.

• All arrays must contain matching brackets [], and a set of values must be separated by commas.

• Numbers must be properly formatted.

This option can be enabled using the following CLI command at the WAF template configuration level:

json-format-check

page 35
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

JSON Limit Checks


When the json-limit option is configured, the WAF JSON parser will enforce parsing limits in order to
protect backend servers against various types of denial-of-service (DoS) attacks, which are designed to
exhaust system memory or CPU resources.

Configuring JSON Limit Parameters to Prevent DoS Attacks

To prevent DoS attacks from consuming excessive system resources, ACOS provides the following CLI
command, which can be used at the WAF template configuration level.

json-limit parameter limit

The json-limit command can be completed using any of the parameters shown below:

• max-array-value-count number

Limits the maximum number of values within a single array.


number – Maximum number of values in an array. Range is 0–4096. Default is 256.
• max-depth number

Limits the maximum depth in a JSON value.


number – Maximum recursion depth in a JSON value. Range is 0–4096. Default is 16.
• max-object-member-count number

Limits the number of members in a JSON object.


number – Maximum number of values allowed. Range is 0–4096. Default is 256.
• max-string number

Limits the length of a string in a JSON request for a name or a value.


number – Maximum length of a string in bytes. Range is 0–4096. Default is 64.

Geo-location Based Blocking


This feature enables an administrator to configure the WAF to block attacks based upon the geo-loca-
tion information of incoming requests. You can block an attack originating from a country, region, or
state that has a known history of being a hotspot for various types of WAF-preventable attacks.

This capability allows you to limit which countries can access your resources based upon the geo-loca-
tion information associated with a request. You can create an HTTP policy that would permit or deny
traffic based upon a combination of threshold events and geo-location information.

The WAF Geo-location Based Blocking feature allows you filter incoming client requests using two dif-
ferent approaches.

page 36
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

• “Filter Requests Using an HTTP Policy” on page 37

• “Filter Requests Using an ACL” on page 40

Filter Requests Using an HTTP Policy


The WAF Geo-location Based Blocking can use HTTP policies to detect and act upon traffic from differ-
ent regions. You can use this option to apply a different WAF template to requests coming from differ-
ent regions.

The WAF geo-location feature uses an HTTP policy to apply a WAF template to an incoming request.
The geo-location database (such as an IANA file) can identify which part of the world a certain request
came from. The IANA database contains the mappings between geographic regions and IP address
ranges, as assigned by the Internet Assigned Numbers Authority. (For more information about the
IANA database, see the Global Server Load Balancing Guide.)

Using the IANA database, the WAF can evaluate incoming requests and determine that, for example, a
request with an IP of 222.111.222.111 is from, say, the North Korea. Perhaps this is a region with ram-
pant cyber-criminal activity. In order to prevent hackers from this region from being able to access your
web servers and steal credit card numbers, the WAF can be configured to detect traffic from this
region, and if there is a match, the traffic could be denied. Alternatively, if this region is known to use
XML bombs, then perhaps a WAF template could be applied to the traffic that would offer protection
from XML bombs and other DoS attacks using the XML Limit Checks.

If an HTTP-policy file is used with a WAF template, and if the WAF is in Learning Mode, you can identify
the sources of various attacks. You can configure the relevant geo-locations in the HTTP-policy file and
direct the traffic through different WAF templates. This produces statistics for the different regions,
and these statistics can be used to identify the top countries where attacks are sourced from.

Configuration Using the CLI

You can enable the WAF Geo-location blocking feature by using the new geo-location keyword at the
HTTP policy configuration level.

ACOS-Inside-Primary(config)(NOLICENSE)#slb template http-policy name1


ACOS-Inside-Primary(config-http-policy)(NOLICENSE)#?
clear Clear or Reset Functions
cookie-name name of cookie to match
do To run exec commands in config mode
end Exit from configure mode
exit Exit from configure mode or sub mode
geo-location Geolocation name
...

page 37
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

CLI Example

This example shows how to configure the WAF geo-location feature using an HTTP policy. The policy
can be used to allow or deny traffic based on geo-location information. This example creates the geo-
location information for a region in China, and for a region in the United States, and does not rely on the
IANA database.

First, we will configure the GSLB geo-location IP address range for the first region (e.g., Beijing, China)

gslb geo-location Beijing.China


ip 172.16.3.62 172.16.3.62

Configure the GSLB geo-location IP address range for the second region (e.g., San Jose, USA)

gslb geo-location Sanjose.USA


ip 172.16.3.63 mask 255.255.255.255

Configure the real server IP and port information for server “s1”:

slb server s1 172.17.3.48


port 80 tcp
port 443 tcp
port 514 udp

Configure the real server IP and port information for server “s2”:

slb server s2 172.17.3.49


port 80 tcp
port 443 tcp
port 514 udp

Create the service group “sg-http-p1” and add server “s1”:

slb service-group sg-http-p1 tcp


member s1 80

Create the service group “sg-http-p2” and add server “s2”:

slb service-group sg-http-p2 tcp


member s2 80

Set up the service group “syslog” and add server “s2”:

slb service-group syslog udp

page 38
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

member s2 514

Set up the logging template and bind it to the service group “syslog”:

slb template logging syslog


service-group syslog

Create the WAF template “waf-1", with the max parameters set to 3, and logging template called “sys-
log”:

waf template waf-1


max-parameters 3
template logging syslog

Create the WAF template “waf-2”, with credit card number masking enabled, and logging template
called “syslog”:

waf template waf-2


ccn-mask
template logging syslog

Create the http-policy template called “geo-policy-http-ipv4”, and within that HTTP policy template,
enable the geo-location feature for the first region you created (i.e. Beijing, China). Bind it to the service-
group “sg-http-p1”, and bind that to WAF template “waf-1”. Similarly, enable the geo-location feature for
the second region you created (i.e. San Jose, USA), and bind it to the service-group “sg-http-p2”, and
bind that to WAF template “waf-2”:

slb template http-policy geo-policy-http-ipv4


geo-location Beijing.China service-group sg-http-p1 template waf waf-1
geo-location Sanjose.USA service-group sg-http-p2 template waf waf-2

Create the slb virtual-server configuration “vs101”, with port 80 (HTTP), and set up the source-nat pool
“nat_IPv4”, and bind both service-groups “sg-http-p1” and “sg-http-p2”. Then, bind the HTTP-policy tem-
plate we created earlier, and bind the two waf templates.

slb virtual-server vs101 10.11.0.101


port 80 http
source-nat pool nat_IPv4
service-group sg-http-p1
service-group sg-http-p2
template http-policy geo-policy-http-ipv4
template waf waf-1
template waf waf-2

page 39
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Request Protection FFee
e

With the above configurations, the HTTP request destined to virtual server “vs101” port 80 from clients
belonging to geo-location Beijing.China will be checked against template waf waf-1. Clients belonging
to geo-location Sanjose.USA will be checked against template waf waf-2.

Filter Requests Using an ACL


The WAF Geo-location feature also allows you to block client requests using an Access Control List
(ACL). When this feature is enabled, the WAF will evaluate client requests using the source address of
the incoming request, and then it will either permit or deny traffic if there is a match.

You can configure WAF geo-location based blocking using an ACL by creating an access control list
and using the geo-location keyword.

This example shows how to configure an IPv4 access-list with geo-location rules that would permit all
traffic to and from the United States, while denying all traffic to or from North Korea:

ACOS(config)#ip access-list geo_acl_ipv4


ACOS(config-access-list:geo_acl_ipv4)#permit geo-location Sanjose.USA any any
ACOS(config-access-list:geo_acl_ipv4)#deny geo-location Pyongyang.NorthKorea any any

Configuring the WAF with aFleX Scripts


You can configure several key areas of the WAF using aFleX scripts. This interface is provide in addition
to the CLI and GUI, and it provides a new way to configure the WAF by allowing you to set up a variety
of WAF trigger events.

Additional new events:

• request violation – Violations are triggered anywhere in the code where ACOS is logging a WAF
action, such as deny, sanitize, ignore a real error, and so on. (This applies to client requests.)
• response violation – Violations are triggered anywhere in the code where ACOS is logging a WAF
action, such as deny, sanitize, ignore a real error, and so on. (This applies to server responses.)
• WAF deny – A deny action is triggered when there is a final deny action being applied (violations
may be overridden as described below)

Examples of possible violations:

• WebDAV - In prior releases, ACOS contained a hard-coded list of HTTP methods that the WAF
would allow to traverse. Prior to ACOS 4.0, the WebDAV methods were not part of this list, so
whenever a WAF was applied in a customer environment in which WebDAV methods were used,
the WAF would end up rejecting all of the requests that used the WebDAV methods. The work-
around was to avoid configuring WAF on this virtual port.
However, this release adds aFleX, which in turn means that the administrator can write an aFleX
script that triggers on request violation. The WAF will check the violation ID and determine that this

page 40
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Request Protection

is a violation of the allowed methods rule. Upon learning this, the WAF will call the WAF::disable
method, which will temporarily disable WAF processing (for this connection only).
• There are some cases where specific URL patterns (or other sorts of data) match some of the
expressions which are used by black lists, SQLIA, XSS, or any other pattern-matching rules used
by the WAF. A user can be aware of such false-positive violations, and bypass this violation for
the false-positive that triggered the event.

Possible Actions:

If the WAF detects traffic that violates one or more rules, aFleX commands can be configured to seize
upon this trigger in order to perform one of the following actions upon that traffic:

• Allow - This action is triggered by a violation event when the WAF is deployed in Passive Mode
and Learning Mode.
• Deny - This action is triggered by a violation event when the WAF is deployed in Active Mode.

• Mask - This action is triggered for the event WAF_RESPONSE_VIOLATION, but only for the follow-
ing select features, such as ssn-mask, ccn-mask, and pcre-mask.
• Redirect - This action is triggered under violation events for the referer-check feature if the WAF is
deployed in Active Mode.
• Sanitize - This action is triggered for the WAF_REQUEST_VIOLATION event for features that sup-
port the ability to sanitize traffic, such as xss-check, sqlia-check. The action can also be triggered
for the WAF_RESPONSE_VIOLATION event.

WAF aFleX Commands


In ACOS 4.0, the WAF supports the following new aFleX commands:

• WAF::disable – Disables WAF processing for the connection during which the aFleX script is trig-
gered.
• WAF::enable – Re-enables WAF processing for the connection during which the aFleX script is
triggered.
• WAF::mode – Returns the current deployment mode in which WAF is configured (active, passive
or learning).
• WAF::template – Returns the name of the active WAF template.
• WAF::violation – Returns or logs information related to WAF violation events.

For syntax associated with these aFleX commands, please see the “WAF Commands” section in the
aFleX Reference.

page 41
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Response Protection FFee
e

WAF Events
The following Web Application Firewall (WAF) events are available:

• WAF_REQUEST_DENY – Triggered whenever a WAF request is denied in active deployment


mode.
• WAF_REQUEST_VIOLATION – Triggered whenever a violation occurs in a WAF request.
• WAF_RESPONSE_VIOLATION – Triggered whenever a violation occurs in a WAF response.

For syntax and a list of events associated with these aFleX commands, please see the “WAF Events” in
the aFleX Reference.

Response Protection
The WAF inspects the content of outbound HTTP responses and hides aspects that can equip an
attacker with valuable information. The WAF template can further protect web servers with the follow-
ing options for HTTP responses:

• Mask Sensitive Content – Strings in a response are examined for patterns of sensitive content,
such as credit card numbers or US social security numbers. If the WAF discovers a pattern of
potentially sensitive information, the string is masked with an alternative character.
• Cloak Response Headers – The WAF removes content from HTTP response headers that can
disclose vulnerabilities about the web server.
• Return Instrumented Responses – If a web form is included in outbound responses, the WAF can
tag form fields with a nonce value before sending the reply to the outside user. The WAF then
checks subsequent requests for the nonce, to protect against CSRF.

The following sections describe these steps in more detail.

page 42
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Response Protection

Mask Sensitive Content


To protect sensitive content, the WAF masks strings in the communication between an end-user and
web server using the following options.

FIGURE 3 Mask sensitive content

CCN Mask
The Credit-card Number (CCN) Mask checks web server responses for end-user credit card numbers.
This check protects user credit card information from being intercepted and viewed by unauthorized
parties. For example, the CCN mask replaces all but the final group of digits in the card number with “x”
characters. A credit card number of 4111-1111-1111-1111 would become “xxxx-xxxx-xxxx-1111”.

To protect user credit card information, you should configure the CCN mask for each accepted type of
credit card.

NOTE: A10 Networks recommends enabling this check for URLs that access or
transfer credit card information. For example, shopping websites with a
check-out page or websites that access back-end databases which con-
tain customer credit card numbers. This check is unnecessary if the
website does not have access to or use credit card information.

SSN Mask
Similar to a CCN mask, a Social-security Number (SSN) Check masks web server replies for US social
security numbers. If enabled, the SSN check mask searches strings which appear to match the format
of US social security numbers and replaces all but the last 4 digits of the string with “x” characters.

page 43
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Response Protection FFee
e

PCRE Mask
In addition to the preconfigured CCN and SSN checks described above, you can configure custom
masks using Perl Compatible Regular Expressions (PCRE) syntax. For example, you can configure a
mask that checks for driver’s license numbers. (For more information, see “Writing PCRE Expressions”
on page 117.)

You can configure the portions of matching strings to keep, and which portions to mask. You also can
customize the mask character (“X” by default).

NOTE: You do not need to create a specialized PCRE mask to hide US social
security numbers or credit card information. Instead, simply enable the
SSN or CCN mask options that are provided in the WAF template.

Cloak Responses
The WAF can strip HTTP response headers to “cloak” server information that can equip a hacker to tar-
get an attack on your web servers. For example, the WAF can cloak an HTTP response header to hide
what operating system is running on your servers. Information such as this can enable a hacker to
more narrowly target your servers with attacks that are specific to the servers’ operating systems. You
can cloak server information with the following WAF template options:

• Filter Response Headers – Checks responses coming from the web server and removes headers
with server identifying information. For example:
• Server
• X-Runtime
• X-Powered-By
• X-AspNet-Version
• X-AspNetMvc-Version
• Hide Response Codes – Conceals 4xx and 5xx response codes for outbound responses from a
web server and returns a generic error code instead. This option hides error codes which can pro-
vide an attacker with information to specifically target web server vulnerabilities.
The WAF sends an error page in response. You can configure the response error page in the Deny-
Action security check section of the WAF template.

Send Instrumented Responses


You can configure the WAF to return instrumented responses with form tags for user-modifiable fields.

page 44
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Response Protection

Cross Site Request Forgery Check


The Cross Site Request Forgery (CSRF) Check tags the fields of a web form sent by a website to end-
users with a nonce (a unique, unpredictable number for one-time use). The WAF examines the web
forms sent in user requests to ensure that the supplied nonce is correct.

NOTE: You can use the Referer Check to further help prevent CSRF attacks.

FIGURE 4 Instrumented responses

Form Field Consistency Check


The Form Field Consistency Check applies to both requests from clients and responses from servers.
When this check is enabled, the WAF stores information about the intended format for web form input
fields before sending the form to clients. The WAF then checks that the response from clients supply
content to the web form that adheres to the correct format. For example, checking that a valid entry is
used for drop-down menus or that a radio button is selected versus supplying a string for that form
field.

Cookie Encryption
This check protects against cookie tampering by encrypting cookies before sending server replies to
end-users. Clients are then unable to view the content of encrypted cookies, which clients could other-
wise modify to gain illegal access. If the encrypted cookie is modified, then decryption of the tampered
cookie will fail when it is sent back from the client and the request will be rejected.

You can enable encryption based on specific cookie names or for all cookies that match a PCRE
expression. The encryption uses a secret string to decrypt and encrypt cookies that are transferred
between the web server and client. (For a configuration example, see “WAF Deployment and Logging
Examples” on page 127.)

page 45
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
PCI 6.6 Compliance FFee
e

PCI 6.6 Compliance


The ACOS Web Application Firewall enables organizations to satisfy Payment Card Industry Data Secu-
rity Standard (PCI DSS) requirement 6.6. The PCI Security Standards Council has developed a frame-
work to help organizations that process, transmit, or store payment card data to secure cardholder
information. The PCI DSS, the keystone of the PCI Security Standards Council’s compliance standards,
sets forth twelve high level requirements designed to protect payment card data, including guidelines
to detect, prevent, and respond to security incidents. By deploying the ACOS Web Application Firewall,
organizations can quickly and easily achieve PCI 6.6 compliance.

ACOS WAF achieves ICSA Certification


While the PCI SSC does not officially certify Web Application Firewalls, similar recognition can be
achieved through third-party companies, such as the International Computer Security Association
(ICSA) Labs.

A10 Networks has achieved WAF certification from ICSA Labs. This certification can help assure net-
work administrators that the ACOS WAF meets the requirements, as stated in PCI DSS section 6.6
“Compliance for Web Apps”, the text of which appears below:

For public-facing web applications, address new threats and vulnerabilities on an ongoing basis and
ensure these applications are protected against known attacks by either of the following methods:

• Reviewing public-facing web applications via manual or automated application vulnerability


security assessment tools or methods, at least annually and after any changes.

NOTE: Note: This assessment is not the same as the vulnerability scans per-
formed for Requirement 11.2.

• Installing an automated technical solution that detects and prevents web-based attacks (for
example, a web-application firewall) in front of public-facing web applications, to continually
check all traffic.

For more information, you can access the PCI DSS at https://www.pcisecuritystandards.org/docu-
ments/PCI_DSS_v3.pdf

How Does the ACOS WAF Achieve PCI DSS Compliance?


PCI compliance essentially means that the WAF meets a long list of requirements. The exact set of
requirements can vary, depending on where a particular device is located in the network, as well as
which services the device offers. For the ACOS WAF, a partial list of important highlights includes the
ability to do the following:

page 46
ACOS 5.1.0 Web Application Firewall Guide
Feedback
PCI 6.6 Compliance

• Restrict access to a resource (such as a web server) based on the IP address from which the
request originated
• Restrict access to particular data at the network boundaries

• Hide sensitive information, such as credit card numbers, when this data crosses a network
boundary
• Limit or prevent configuration changes (and logging each configuration change as it happens)

• Protect and store log messages

More information about PCI DSS compliance can be found at the following link:
https://www.pcisecuritystandards.org/documents/information_supplement_6.6.pdf

page 47
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
PCI 6.6 Compliance FFee
e

page 48
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Overview

WAF Operational Modes

This chapter describes the WAF operational modes and how to use them to deploy the WAF.

Overview
The WAF supports the following operational modes:

• Learning – Learning Mode provides a way to initially set the thresholds for certain WAF checks
based on known, valid traffic.
• Passive – Passive Mode provides passive WAF operation. All enabled WAF checks are applied,
but no WAF action is performed upon matching traffic. This mode is useful in staging environ-
ments to identify false positives for filtering.
• Active – This is the standard operational mode. You must use Active Mode if you want the WAF
to sanitize or drop traffic based on the configured WAF policies.

Figure 5 shows a typical work flow for WAF deployment, using these modes.

CAUTION: While Learning or Passive Mode is in operation, the WAF does not block
any traffic. Only Active Mode blocks traffic.

Notes:

• Use of the Learning and Passive Modes is recommended during the deployment process.

• To block traffic, you must deploy the WAF in Active Mode.

• To access WAF data event messages, logging to external servers is required. See “WAF Event
Logging” on page 103.
• When the WAF is deployed in either learning or passive mode, traffic is not blocked. However,
event log messages will list the response action (deny, allow, or sanitize) that is configured in the
WAF template. In addition, WAF counters will continue to increment as if the WAF is deployed in
active mode.

page 49
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Overview FFee
e

FIGURE 5 Typical Deployment Scenario

The following sections provide more details about each mode.

page 50
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Overview

Learning Mode
Learning Mode provides a way to dynamically set certain WAF options based on traffic.

When you enable Learning Mode in a WAF template, ACOS resets the following WAF security check val-
ues to zero:

• Maximum Headers – set to 0

• Maximum Cookies – set to 0

• Buffer Overflow (max-url-len, max-hdrs-len, max-cookie-len, and max-post-size) – all set to 0

• Allowed HTTP Methods – set to null

• URL Check (closure list) – set to null

Figure 6 shows an example of the Learning Mode.

FIGURE 6 WAF Learning Mode

1. In Figure 6, a WAF template is configured and is bound to the HTTP/HTTPS virtual port on the
ACOS device. The domain name mapped to the VIP address by DNS is “www.example.com”.
2. Known, valid traffic is then sent to the WAF. As traffic is received by the virtual port to which the
WAF template is bound, ACOS updates the settings for the WAF parameters listed above.
In this example, the following HTTP request is sent:

page 51
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Overview FFee
e

GET / HTTP/1.1
Host: www.example.com
Connection: close
User-Agent: Mozilla/5.0
Accept-Encoding: gzip
Accept: text/html
Cache-Control: no-cache

NOTE: The HTTP header "Cache-Control: no-cache" cannot be inserted if the


form element is positioned beyond 128KB in the HTML.

3. When the WAF receives the request, Learning Mode updates the following checks in the WAF tem-
plate:
Buffer Overflow Check:
• Maximum headers = 7
• Max-url-len = 15
• Max-hdrs-len = 23
Allowed HTTP Methods Check = GET
URL Check (not shown in example)
4. To “lock in” the WAF template settings, change to a different mode (for example, Passive Mode or
Active Mode). You can fine-tune the template settings later, if needed.

Notes

• Beginning in ACOS release 4.0, the WAF will display the learned values in the running-configura-
tion only after the WAF deployment mode is changed from Learning Mode to Active Mode or Pas-
sive Mode. The reason for this change in behavior relative to prior releases, is that ACOS 4.0
introduces the Configuration Manager (CM), which acts like an internal “staging area” for the con-
figuration changes. Such config changes are temporarily save to short-term memory and will
remain there until an operation is committed, which happens when the WAF is switched from
Learning Mode to Passive or Active Mode. In previous releases, config changes were saved
directly into the running-config file, and there was no internal staging area.
• Before enabling Learning Mode, make sure the WAF is not receiving production traffic. Security
checks in the WAF template are not enforced during Learning Mode and the WAF will not deny
any requests, even if a request fails a security check.
• If the setting for a check reaches its maximum configurable value, the check is set at that value.
The setting value does not increase.
• The URL Check file is not created until the mode is changed from Learning to Passive or Active.
You cannot modify the URL check file while Learning Mode is enabled.
• For an example of Learning Mode, see “WAF Deployment and Logging Examples” on page 127.

page 52
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Overview

Passive Mode
Passive Mode logs traffic that matches a WAF policy file or check, but does not perform any action on
matching traffic. While the WAF is operating in Passive Mode, you can monitor the data event log mes-
sages sent to remote logging servers, and fine-tune your template settings so that valid traffic is not
mistakenly blocked by the WAF.

Typically, Passive Mode is used in a production network to check for false positives while real produc-
tion traffic is running. A false positive occurs when valid traffic matches a WAF check, and would be
dropped during Active Mode operation.

Figure 7 shows an example of Passive Mode.

FIGURE 7 WAF Passive Mode

This example shows a “false positive” match on the max-cookies check. In this example, the WAF tem-
plate allows a maximum of 3 cookie headers within a given request.

1. Client sends request to server.


2. Server replies. The reply contains some cookies inserted by the server.
3. The client sends a new request and inserts the cookies sent by the server in the request.
4. The WAF template allows a maximum of 3 cookies (3 separate cookie headers) in a given client
request. Because the client’s request contains more than 3 cookies, the request fails the max-
cookies check, and a data event log message is sent to the external log server. However, because
the WAF is operating in Passive Mode, the traffic is allowed.

page 53
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Overview FFee
e

Notes:

• Because the WAF is operating in Passive Mode, the client request is sent to the server instead of
being dropped. In Active Mode, the request would be dropped.
• To access WAF data event messages, logging to external servers is required. See “WAF Event
Logging” on page 103.
• During Passive Mode operation, data event logs for matching traffic will state that the traffic was
denied even though the traffic in fact is allowed. However, all WAF data event messages include
the operational mode.

Active Mode
Active Mode enforces the policies (definition files) and security checks that are enabled in the WAF
template bound to the virtual port. If the action configured for a specific check is to drop traffic that
matches the check, the traffic is dropped.

Figure 8 shows an example of Active Mode.

FIGURE 8 WAF Active Mode

In this example, a client POST request contains SQL code.

1. The client sends a request. The request contains SQL code. The request is an attempt to inject SQL
code onto the server.

page 54
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Overview

2. The WAF SQL Injection Check detects the SQL. Based on the configuration, the WAF rejects
(drops) the request.
3. The WAF sends a log message to the log server.

Figure 9 shows a walk-through of the WAF process as it examines the client’s request.

FIGURE 9 WAF Active Mode - walk-through

page 55
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Setting the WAF Operational Mode FFee
e

1. First, the WAF checks the request URI against the entries in the White List. In this case, the URI
matches. The request passes to the next phase, the Black List check.
2. The request URI does not match any of the Black List entries, so is passed to the next phase, the
request checks.
3. The request passes the Allowed-HTTP-methods Check. However, the request fails the SQL Injec-
tion Check and is denied.

Setting the WAF Operational Mode


The WAF operational mode is one of the options you can configure within the WAF template. For con-
figuration information, see either of the following chapters:

• “Configuring the WAF Using the GUI” on page 57

• “Configuring the WAF Using the CLI” on page 91

page 56
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Configuration Overview

Configuring the WAF Using the GUI

The WAF operates on traffic that is addressed to the virtual IP address (VIP) and HTTP/HTTPS virtual
port of your website. To apply WAF protection to the virtual port, basic configuration is required.
Additional, advanced configuration is optional.

This chapter describes how to configure the WAF using the GUI.

Configuration Overview
This section summarizes the configuration tasks for the WAF. The following sections provide detailed
steps for each task.

To apply WAF security controls to a virtual port:

1. Configure a WAF template.


2. Bind the WAF template to the virtual port.
3. (Recommended) Configure external logging. ACOS supports logging of WAF events only to
external log servers. WAF events are not logged in the ACOS device’s local log buffer. (See “Config-
ure External Logging (recommended)” on page 85.)

Notes:

• External logging is the only mechanism supported for accessing WAF data plane log messages.

• The WAF comes with predefined WAF policy files. Modify policy rules in the URI White and Black
Lists, or add search definitions used for the Bot Check, SQLIA check and so on. For more
information, see “WAF Policy Files” on page 111. A10 Networks highly recommends
modifying the WAF policy files to meet your specific security requirements.
• Optionally, you can pair the WAF template with an HTTP policy template to enforce WAF security
checks based on URL, host, or cookie. (See “Overriding a WAF Template” on page 121.)
• For examples of advanced WAF configuration, see “WAF Deployment and Logging Examples” on
page 127.

page 57
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Bind the WAF Template to the Virtual Port FFee
e

Bind the WAF Template to the Virtual Port


Bind WAF Policy page contains the list of virtual servers, virtual servers with HTTP/HTTPS virtual
ports, and the HTTP policies binded to the virtual ports. The form allows to bind different HTTP policy
templates to the virtual port. Edit the match conditions to bind the HTTP policy to the WAF template.
To bind a WAF template to an HTTP or HTTPS virtual service port:

1. Hover over Security on the menu bar, then select WAF.


2. On ‘Bind WAF Template’ click, the Bind WAF Form, the sliding window will open.
3. Select which virtual server Name, vPorts, WAF-templates and HTTP policy templates to be
bound to the vPort.
4. Edit either URL or Host match conditions by clicking the three dots icon for each row. An option is
available to add new URL or host match condition.
5. Save: Edit the HTTP policy template bound to the vPort, edit the HTTP policy
Match Conditions under the HTTP policy template, and the WAF template bound to the virtual
port (vPort) and click Save.
6. Select the WAF Bindings tab, if not already selected.

FIGURE 10 WAF Bindings tab

A table of WAF binding appears. A WAF binding is the combination of a virtual IP address, or “VIP”
and a virtual port with service type HTTP or HTTPS.
7. Click +Bind WAF Template.
8. A new Bind WAF Policy page appears, as follows:

page 58
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Bind the WAF Template to the Virtual Port

FIGURE 11 Security > WAF > WAF Bindings > Bind WAF Policy

9. Click the VIP drop-down menu and select a pre-configured VIP to bind.
For a VIP to appear in the VIP drop-down list with the virtual server names, it must be configured
with one or more HTTP/HTTPS virtual ports.
10.Based on the VIP that you select, the vPort: (port and protocol) field automatically updates. You
can also click the vPort drop-down menu and select a different port/protocol combination from
the list of HTTP or HTTPS ports associated with this VIP.
11.Click the WAF Template drop-down menu and select the desired WAF template from the list.
Alternatively, click the WAF Template tab to +Add a new WAF Template for this WAF service.
(See Add/Edit a WAF Template.)
12.Click the HTTP Policy drop-down menu and select the desired HTTP template.
Alternatively, click the New HTTP Policy Template button to configure a new template. (See
“Configure an HTTP Policy Template” on page 80.)
13.Click the Save button to complete the WAF service configuration.

page 59
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

Add/Edit a WAF Template


NOTE: Remove all CGNv6 configurations before making SLB configurations
(including WAF, aFlex, AAM, GSLB and Overlay)

Use the following steps to configure a WAF template.

1. Hover over Security on the menu bar, then select WAF.


2. Select the WAF Templates tab.
3. Click +Add WAF Template.
The WAF template configuration page appears, with the General tab selected, as shown below:

FIGURE 12 WAF Template – General

1. In the Name field, enter a name for the template.


2. Configure all the settings for WAF and click Save to save the template.

Configuring HTTP Protocol Checks


1. Click the HTTP Protocol Checks option in the Add/Edit WAF Template page. The related
configuration options open up.
2. Click the Allowed HTTP Version field, to open up a drop-down, displays the following multiple
configurations selection list. Select one or more HTTP version (1.0, 1.1, 2.0 and so on) that are
allowed to appear in client requests:

page 60
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

• Versions Allowed: Click left arrow to update the HTTP versions that you want to allow.
• All Versions: Select the required HTTP version from all available versions.
3. Click the Allowed HTTP Headers field, to open up a drop-down, displays the following multiple
configurations selection list:
• Headers Allowed: Click left arrow to update the HTTP headers that you want to allow.
• All Headers: Select the allowed HTTP headers from all available HTTP headers.
4. List of allowed Allowed HTTP Methods. The allowed HTTP Methods drop down displays the
following multiple configurations selection list:
• Methods Allowed: Click left arrow to update the HTTP headers that you want to allow.
• All Methods: Select the allowed HTTP headers from all available HTTP headers.

FIGURE 13 WAF Template – HTTP Protocol Checks

5. Select the other parameters displayed using the sliding On/Off button. For details for each field,
refer the GUI Online Help.

page 61
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

6. Click Save to save the HTTP protocol settings.

Configuring HTTP Limit Checks


1. Click the HTTP Limit Checks option in the Add/Edit WAF Template page. The related
configuration options open up. This displays the list of security options that can be used to
prevent the attempts to flood the resources with excessive request parameters through WAF.
2. Configure the limit checks for related HTTP parameters. For details on each parameter, see the
context help and the related Online Help on GUI.

FIGURE 14 HTTP Limit Check Options

Configuring Request Checks


1. Click the Request Checks option in the Add/Edit WAF Template page. The related
configuration options open up.

page 62
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

FIGURE 15 WAF Template – Request Checks

2. Select the Bot Check On/Off button to check the user-agent of incoming requests for known bots.
This check uses the list of defined bots in the “bot_defs” WAF policy file. For more information, see
“Bot Check” on page 112.
3. Select the Referer Check On/Off button to enable referer checks, or clear the On/Off button to
disable. The referer check validates that the referer header in a request contains web form data
from the specified web server, rather than from an outside website, and helps protect against
CSRF attacks. Referer Check behavior is as follows:
• Enabled – When enabled, the WAF always validates the referer header. Requests will fail the
check if there is no referer header or if the referer header is not valid.
• Disabled – The WAF will not validate requests based on the referer header.
4. Select the URI Black List Check On/Off button to enable. Select the WAF Black List File
drop-down menu that appears, and select the name of a configured WAF policy file. This option
enforces the rules contained within a WAF policy file for the URI blacklist.The default WAF policy
file is “uri_blist_defs”. For more information about URI blacklists, see “URI Black List” on page 113.
5. Select the URI White List Check On/Off button to enable. Click the WAF White List File
drop-down menu that appears, and select the name of a configured WAF policy file. This option
enforces the rules contained within a WAF policy file for the URI white-list. The default WAF policy
file is “uri_wlist_defs”. For more information about URI white-lists, see “URI White List” on page 114.
6. Configure the options under Injection Checks On/Off button to prevent access to your website
directly through SQL injection or XSS Injection attacks.

page 63
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

7. In the SQL Injection Attack Check radio button, specify whether the WAF will Sanitize or
Reject requests that do not pass the SQL Injection Attack check. This option is used to check for
harmful SQL strings and protects against SQL injection attacks.
• Select Reject to deny the user request.
• Select Sanitize to forward the request to the web server after removing the offending SQL
strings from the message.
8. Select either of the above radio buttons to display the SQL Injection Attack Policy File
drop-down menu. Click this drop-down and select the policy file to perform SQL Injection Attack
checks. By default, the WAF uses the list of defined SQL commands in the “sqlia_defs” WAF policy
file. For more information, see “SQL Injection Attack Check” on page 112.
9. The XSS Check uses “jscript_defs” WAF policy file to examine the content of URL, cookies,
headers, and POST bodies of client requests. By default, the radio button is disabled, but you can
select one of the following actions:
• Sanitize – select this to remove the XSS script from the message and forward the message to
the web server.
• Reject – select this to deny the request.
10.Select the XSS Check Policy File from the drop-down menu. By default, the XSS Check uses the
list of defined Javascript commands from the “jscript_defs” WAF policy file. (See “XSS Check” on
page 112.)
11.Select the Session Check On/Off button to enable session checks. When this option is enabled,
the WAF creates a unique ID that is inserted into a cookie and embedded in the server’s response
to the client. Future requests from the same client are validated against this ID, and if the tracking
ID (or IP address) does not match, then the request is rejected.
12.In the Session Check Lifetime field, enter a value ranging from 1–1440 minutes. The default
session lifetime is 10 minutes. For more information about Session Checks, see “Session Checks”
on page 19.
13.Click Save to save your changes.

Configuring Cookie Security


1. Click the HTTP Cookie Security option in the Add/Edit WAF Template page. The related
configuration options open up.
2. Configure the parameters and settings related to Cookie Security as per description and details on
GUI Online Help.

page 64
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

FIGURE 16 Cookie Security

3. Click Save to save your changes.

Configuring Cookie Security


1. Select the Cookie Encryption Checks tab to display the list of security options that can be used
to prevent cookie tampering.
A window similar to that shown below appears.

page 65
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

FIGURE 17 WAF Template – Cookie Encryption Checks

2. In the Tampering Protection drop-down, select Encrypt or Do Not Encrypt option. This option
protects against cookie tampering encrypting the cookies by a specific name or for all cookies that
match a PCRE expression.
3. If Encrypt option is selected, the Encryption Secret field is displayed. Enter the encryption
keyword in this field.
4. In the Applies to field, select the All Cookies or Session Cookies Only option which will be
used to encrypt and decrypt the cookies. The encryption uses a secret pass phrase to decrypt and
encrypt cookies that are transferred between the web server and client.
5. On/Off the HTTP Only and Secure button to enable tampering protection to HTTP or HTTPS
traffic.

page 66
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

FIGURE 18 Set Cookie Security from Server

6. To set cookies security from server, click the drop-down arrow next to Set-Cookies from Server.
7. Enter the keyword Name, Encryption Secret keyword, and select HTTP or HTTPS options.
8. Click Save to save your changes.

Configuring Evasion Checks


1. Select the Evasion Checks tab to display the list of security options that can be used to bypass a
WAF rule. A window similar to that shown below appears.

FIGURE 19 Configuring Evasion Checks

2. Set Apache White Space to ON to enable check for whitespace characters in URLs.

page 67
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

3. Set Decode Entities to ON, to enable decoding of entities, such as &lt; &#xx; &#ddd; &xXX, in an
internal URL.
4. Set Decode Escaped Characters to ON to enable decoding of escaped characters, such as \r \n
\” \xXX, in an internal URL.
5. Set Decode Unicode Characters to ON to check for evasion attempt using encoding of unicode
characters to bypass security.
6. Set Decode Plus Characters to ON to check for evasion attempt using encoding of spaces with
+ characters.
7. Set Directory Traversal to ON to check for directory traversal attempt.
8. Set High ASCII Bytes to ON to check for evasion attempt using ASCII bytes with values > 127.
9. Set Invalid Hex Encoding to ON to check for evasion attempt using invalid hex characters (not in
0-9,a-f)
10.Set Multiple Encoding Levels to check for evasion attempt using multiple levels of encoding
(0 - 7),
11.Set Multiple Slashes to check for evasion attempt using multiple slashes/backslashes.
12.Set Remove Comments to ON to remove comments from internal URL.
13.Set Remove Spaces to ON to remove spaces from internal URL.
14.Click Save to save your changes.

page 68
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

Configuring Web Service Security


1. Select the Web Services Checks tab to display the list of security options that can be used to
configure JSON and XML checks. A window similar to that shown below appears.

FIGURE 20 WAF Template – Web Services Checks

2. Select the Enforce JSON compliance, On/Off button to set the WAF scrub
incoming requests containing JSON code to verify compliance with RFC 4627. Requests will be
blocked if the JSON content is not well- formed.

page 69
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

JSON Limits:
When the following JSON Limit options are configured, the WAF JSON parser will enforce parsing
limits to protect back end servers from denial-of-service (DoS) attacks that are designed to
exhaust system memory or CPU resources.
3. In the JSON Limit - Max Array Value Count field, enter the maximum number of values in a
single array.
The default value is 256, but you can set a number ranging from 0–4096.
4. In the JSON Limit - Max Depth field, enter the maximum recursion depth in a JSON value.
The default value is 16, but you can set a number ranging from 0–4096.
5. In the JSON Limit - Max Object Member Count field, enter the maximum number of members
in a JSON object.
The default value is 256, but you can set a number ranging from 0–4096.
6. In the JSON Limit - Max String field, enter the maximum length of a string (in bytes) for a name
or a value in a JSON request.
The default value is 64, but you can set a number ranging from 0–4096.
7. The XSS Check uses “jscript_defs” WAF policy file to examine the content of URL, cookies,
headers, and POST bodies of client requests. By default, the radio button is disabled, but you can
select one of the following actions:
• Sanitize – select this to remove the XSS script from the message and forward the message to
the web server.
• Reject – select this to deny the request.

8. Select the XML SQLIA Check On/Off button to check XML data against the SQLIA policy file. The
XML cross-site scripting check examines the headers and bodies of incoming XML requests for
SQL keywords that might indicate possible cross-site scripting attacks and blocks those requests.
9. Select the XML XSS Check On/Off button to check XML data against the XSS policy file. The
XML cross-site scripting check examines the headers and bodies of incoming XML requests for
Javascript keywords that might indicate possible cross-site scripting attacks and blocks those
requests. (See “XML Cross-Site Scripting Checks” on page 30 for details.)
10.Select the XML Format Check On/Off button to check the HTTP body of the message for XML
format compliance. Incoming requests containing XML code are checked for compliance with the
XML 1.0 specification. (See “XML Format Checks” on page 26 for details.)
11.In the XML Limit - Max Attributes field, enter the maximum number of attributes each individ-
ual element is allowed to have.
The default is 256, but you can enter an integer from 0-256.
12.In the XML Limit - Attribute Max Length field, enter the maximum number of characters
allowed per element.
The default is 128, but you can enter an integer from 0-2048.

page 70
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

13.In the XML Limit - Attribute Text Max Length field, enter the maximum number of characters
allowed per attribute.
The default is 128, but you can enter an integer from 0-4096.
14.In the XML Limit - CDATA Section Max Length field, enter the maximum length of CDATA sec-
tion for each element.
The default is 65535, but you can enter an integer from 0-65535.
15.In the XML Limit - Max XML Elements field, enter the maximum number of any one type of ele-
ment per XML document.
The default is 1024, but you can enter an integer from 0-8192.
16.In the XML Limit - Max Element Children field, enter the maximum number of children each
element is allowed to have, including other elements, character information, and comments. The
default is 1024, but you can enter an integer from 0-4096.
17.In the XML Limit - Max Element Depth field, enter the maximum number of nested levels in
each element.
The default is 256, but you can enter an integer from 0-4096.
18.In the XML Limit - Max Element Name Length field, enter the maximum name length for each
element, including the XML path.
The default is 128, but you can enter an integer from 0-65535.
19.In the XML Limit - Max Entity Expansions field, enter the maximum number of entity expan-
sions allowed.
The default is 1024, but you can enter an integer from 0-1024.
20.In the XML Limit - Max Entity Nested Depth field, enter the maximum depth of nested entity
expansions.
The default is 32, but you can enter an integer from 0-32.
21.In the XML Limit - Max Namespace Declarations field, enter the maximum number of name-
space declarations in an XML document. The default is 16, but you can enter an integer from 0-
256.
22.In the XML Limit - Max Namespace URI Length field, enter the maximum URI length allowed
for each namespace declaration.
The default is 256, but you can enter an integer from 0-1024.
23.Click Save to save your changes.

Configuring Server Filter Checks


1. Select the Server Filter Checks tab to display the list of security options that can be used to
block or prevent the outbound responses from web server to client. A window similar to that
shown below appears.

page 71
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

FIGURE 21 WAF Template – Server Filter Checks

2. Select the Filter Response Headers On/Off button to remove the web server’s identifying
headers in outgoing responses.
3. Select the Hide Response Codes On/Off button to enable this option to cloak 4xx and 5xx
response codes for outbound responses from the web server. By default, this check uses the
“allowed_resp_codes” WAF policy file for a list of acceptable HTTP response codes. However, you
can click the Hide Response Codes file drop-down menu that appears to specify a different file.
For more information, see “Allowed HTTP Response Codes” on page 114.
4. Select the Redirect Whitelist On/Off button to enable protection against unvalidated redirects,
which can occur if a hacker uses social networking to trick unsuspecting users into clicking on a
malicious hyperlink. The WAF must be deployed in Learning Mode when the redirect-wlist CLI
command is used for the first time so the list of acceptable locations can be built up. The WAF
pre-learns a white-list of acceptable locations to which users can safely be redirected. If one of the
web servers gets hacked and attempts to redirect a user to a location that does not appear in the
redirect white-list, then the WAF blocks the redirect. See “Open Redirect Mitigation” on page 21 for
details.
5. Click Save to save your changes.

page 72
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

Configuring Data Leak Prevention


1. Select Data Leak Prevention to display the configurable content filtering options.
A window similar to that shown below appears.

FIGURE 22 WAF Template – Data Leak Prevention

2. Click Response Cloaking drop-down arrow.


3. Set Filter Response Codes to ON to remove web server's identifying headers in outgoing
responses.
4. Set Hide Response Codes to ON to cloak response codes for outbound responses from the Web
server to enable this option to cloak 4xx and 5xx response codes for outbound responses from the
web server. By default, this check uses the “allowed_resp_codes” WAF policy file for a list of
acceptable HTTP response codes. However, click the Hide Response Codes file
drop-down menu to specify a different file. For more information, see “Allowed HTTP Response
Codes” on page 114.
5. In Content Filter Checks, select the CCN Mask On/Off button to examine strings of outbound
replies from the web server for patterns of numerical characters that resemble credit card
numbers (CCN). If the WAF identifies a credit card number, the WAF replaces all but the last four
digits of credit card numbers with “x” characters.

NOTE: View counters for the CCN check from the CLI. These counters display
the number of masked credit card numbers for various bank providers.

page 73
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

6. Select the SSN Mask On/Off button if you want the WAF to scan HTTP responses for strings that
resemble US Social Security numbers and masks all but the last four digits of the string with “x”
characters in a response.
7. Click PCRE Mask drop-down. PCRE Mask hides strings that match the specified PCRE pattern.
(See “Writing PCRE Expressions” on page 117 for details.) In the PCRE fields, enter the following
values:
• PCRE Pattern – Masks patterns in a response that match the specified PCRE pattern.
• PCRE Mask Character – Selects a character to masked the matched pattern of a string. By
default, strings are masked with an “X” character.
• PCRE Keep Start – Sets the number of unmasked characters at the beginning of the string. This
can be 0-65535, the default is 0.
• PCRE Keep End – Sets the number of unmasked characters at the end of the string. This can be
0-65535, the default is 0.

NOTE: You can configure PCRE patterns to match only on string of fixed length.
For this reason, wild-card characters that can mask excessively long
strings (* and +) are not supported.

If either the asterisk (*) or plus symbol (+) is detected during the syntax check, the syn-
tax check will automatically fail. To use an expression that matches an actual “*” or
“+” character, use an escape character (\) before the matched symbol. For example, to
search for the actual asterisk (*) or plus character (+), enter “\*” or “\+”.

8. Click Save to save your changes.

Configuring Form Protection and Password Security


1. Select the Form Checks tab to display the list of security options that can be used to configure
web form options. A window similar to that shown below appears.

page 74
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

FIGURE 23 WAF Template – Form Protection

2. Select the CSRF Check On/Off button to tag the fields of a web form with a nonce (a unique
FormID). This check protects against cross-site request forgery (CSRF).
3. Select the Form Consistency Check On/Off button to check that the user input to a web form
field conforms to the intended format for that entry. For example, it checks that a radio button is
selected versus supplying a string for that form field. WAF also parses HTTP bodies encoded as
multipart/form-data. Extracted form fields are verified against previously parsed HTML forms.
4. Select the Forms Not Using POST On/Off button to deny HTTP requests containing forms if the
method used is anything other than POST.
5. Select the Non-SSL Forms On/Off button to deny user passwords sent over a non-encrypted
connection. If the connection between the client and the WAF is secured with SSL/TLS, the user
password is allowed, but if the client attempts to submit to a form field where “input type=pass-
word”, and if the connection is not encrypted with SSL/TLS, the WAF blocks the transmission. (For
more information, see “Deny Passwords Sent Over an Unencrypted Connection” on page 20.)
6. Select the Caching of Form Responses On/Off button to add “no-cache directives” when the
HTTP response contains <form> tags. “no-cache” behavior is enforced when headers are added:
(1) Cache-Control: no-cache, no-store, must-revalidate, (2) Pragma: no-cache, (3) Expires: 0

NOTE: The HTTP header "Cache-Control: no-cache" cannot be inserted if the


form element is positioned beyond 128KB in the HTML.

page 75
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Add/Edit a WAF Template FFee
e

7. Select the Non-masked password fields On/Off button to prevent “shoulder surfing” by denying
the web server’s attempt to send a form through the WAF unless the field type for the password
field has been set to “password”. (See “Deny Unmasked Passwords” on page 19.)
8. Select the Autocompleted Passwords On/Off button to deny web server attempts to transmit
the form if one of the form fields type is set to “password” and if the “autocomplete=on/off”
attribute is set to “on”. Enabling this option blocks browser “autocomplete” behavior. Although
convenient for users, password auto-completion weakens security allowing browsers to store user
passwords in order to later guess the user’s password for some websites. (For more information,
see “Deny Passwords if Autocomplete is Enabled” on page 20.)
9. Select the Non-SSL Passwords On/Off button to deny HTTP requests containing forms if the
transmission protocol used is anything other than SSL (TLS).
10.Click Save to save your changes.

Configuring Brute Force Security


1. Select the Brute Force Security tab to display the list of security options that can be used to
configure web form options. A window similar to that shown below appears.

FIGURE 24 Configure Brute Force Security parameters

2. Enable Brute Force Check for this template.


3. Enabling Global option will cause the WAF to maintain a single counter for all clients, as opposed
to having a separate counter for each client. When this option is Selected, all clients will be locked
out for the configured lockout period, once the lockout-limit is reached. Similarly, all responses will
include a challenge once the challenge-limit is reached.

page 76
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Add/Edit a WAF Template

4. Specify Challenge Limit, the maximum number of triggers that can occur within the test period.
If this limit is breached, the WAF initiates all of the configured challenge-actions against the client.
If this field is set to zero, this effectively disables the feature, as the challenge will never be sent.
5. Specify Lockout Limit field to specify the number of triggers that can occur within the test
period. If the limit is exceeded, then the WAF will deny all requests from this client. If the lockout
limit is set to zero, then clients will never be locked out. The lockout-limit is a learned parameter, so
it will be set to the maximum number of triggers within a test period seen during learning mode.
6. Specify Lockout Period, the number of seconds that a client will be locked out after breaching a
threshold. If the lockout period is set to zero, then the client will be locked out for the remainder of
the current test period. In this way, this option acts similar to a general rate limit.
7. Enable Response Codes to enable the WAF policy to define which response codes will trigger
brute force checking.
8. Select the Response Codes File the WAF policy used to define which response codes will trigger
brute force checking.Select a policy file that will be used for matching prior to setting this
parameter, as none of the default listed files (e.g., bot_defs) would work. The policy file must
contain a set of regular expressions that will be matched against the response status-code.
9. Enable the Response Headers WAF policy to define which response headers will trigger brute
force checking.
10.Select a predefined Response Headers File with the WAF policy that will be used to define
which response headers will trigger brute force checking. You must supply a policy file that will be
used for matching prior to setting this parameter, as none of the default listed files (e.g., bot_defs)
would work. The policy file must contain a set of regular expressions that will be matched against
the response headers.
11.\Enable Response String WAF policy to define which response line messages will trigger brute
force checking.
12.Select the Response String File WAF policy used to define which response line messages will
trigger brute force checking. You must supply a policy file that will be used for matching prior to
setting this parameter, as none of the default listed files (e.g., bot_defs) would work. The policy file
must contain a set of regular expressions that will be matched against the response status-line.
13.Specify the Test Period number of seconds for brute-force event counting.

page 77
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Create a WAF File FFee
e

Create a WAF File


You can create a WAF files that will be used to parse incoming requests that contain XML, SOAP, of
JSON code.

1. Hover over Security on the menu bar, then select WAF.


2. Select the WAF Files tab. A table of WAF files appears, similar to that shown in Figure 25 below.

FIGURE 25 Security > WAF > WAF Files

3. Enter a value in the Max Filesize field. Enter a value from 16–256 (KBytes). The default value is
32Kb.
4. Click Create to create a new WAF Policy.
5. Select the one of the following tabs:
• WAF Policies – see “WAF Policy Files” on page 111 for background information.
The WAF Policy table lists the default policy files, such as “bot_defs”, “jscript_defs”, and
“sqlia_defs”. If the Bot Checks, Cross-Site Scripting (XSS) Check, or SQL Injection Checks are
enabled in a WAF template, the policy files can be used to scrub incoming requests. For exam-
ple, if the Bot Check option is enabled in the WAF template and a match is found on an incom-
ing request (using the “bot_defs” file), the request we be denied automatically. You can copy the

page 78
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Create a WAF File

“bot_defs” file and modify the contents to include or remove bot search terms. Simply click the
Edit link, make changes, and save the new copy.
To configure, click the Create button in the WAF Policy section. A window similar to that shown
in Figure 25 on page 78 appears.
~ Select the Local radio button, to enter the name and definition, and then click Create.
~ Select the Remote radio button, to enter the name, transport protocol (e.g., TFTP, FTP, SCP,
SFTP), Host IP/FQDN, Port, Location, and user credentials (user/password) for the server where
the file is located. Then click Create.
• XML Schemas – see “WAF XML Checks” on page 25 for background information.
To configure, click the Create button in the XML Schemas section.
~ Select the Local radio button, then enter the name and definition, and click Create.
~ Select the Remote radio button, enter the name, transport protocol, Host IP/FQDN, and path
to the file. Then click Create.
• SOAP WSDLs – see “WAF SOAP Checks” on page 32 for background information.
To configure, click the Create button in the SOAP WSDL section.
~ Select the Local radio button, then enter the name and definition, and then click Create.
~ Select the Remote radio button, enter the name, transport protocol (e.g., TFTP, FTP, SCP,
SFTP), Host IP/FQDN, Port, Location, and option credentials (user/password) for the server
where the file is located. Then click Create.

FIGURE 26 WAF > Files > (WAF Policy/XML Scheme/SOAP WSDL) > Create

6. Click the Update button.

page 79
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Configure an HTTP Policy Template FFee
e

Configure an HTTP Policy Template


You can configure ACOS to override the WAF settings applied to the HTTP/HTTPS virtual port with
another set of WAF settings, using an HTTP policy template. You can configure rules in the HTTP
template to match on URLs, hostnames, or cookie names in traffic.

For a general discussion of configuring an HTTP Policy Template, see “Overriding a WAF Template” on
page 121.

Configure an HTTP Policy Template to Override a WAF Template

You can configure an HTTP policy template as follows:

1. Hover over Security on the menu bar, then select WAF.


2. Select the HTTP Policy tab. A table listing the configured HTTP Policies appears.
3. Click the HTTP Policy drop down button to create a new HTTP Policy Template, or simply click
Edit link by clicking the three dots icon for each row in the Actions column. The HTTP Policy
window appears.
4. Hosts:
Click +Add Host under Host section.

FIGURE 27 HTTP Policy

page 80
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Configure an HTTP Policy Template

5. The Name field is not editable, since this example show how to update an existing HTTP policy
template.
6. In the Match Condition field, enter the condition associated with this HTTP Policy.
7. In the WAF Template section of the window, select the WAF template to bind.
8. Click the check mark under +Add Host, to save the host.

URLs
9. Under URLs section,
Configure Match Conditions on URLs, or WAF Template settings. Client requests that match a
rule in the HTTP policy template are handled using the alternative WAF template that you bind to
the HTTP policy template.
10.To configure rules for matching:
a. Click the Match Condition drop-down list and select the match operation:
• Starts With
• Ends With
• Contains
• Equals
These match options are always applied in the order shown above, regardless of the order in
which the rules appear in the configuration. The WAF template associated with the rule that
matches first is used.
If a template has more than one rule with the same match option (equals, starts-with, contains,
or ends-with) and a URL matches on more than one of them, the most-specific match is always
used.
b. From the WAF drop-down menu, select the WAF template to which to bind this HTTP policy
template. The WAF template you select will be used for traffic that matches the rule.
c. Click the check mark under Add URL button.
d. Repeat this process for each rule you wish to add to the HTTP Policy.
11.Click the Add button to save your changes.

page 81
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Reporting FFee
e

WAF Reporting
ACOS offers a reporting feature that allows you to view WAF statistics through the web GUI. Currently,
this information can be displayed using the following WAF report types:

• Top URL – indicates the most frequently accessed URLs during a specified time interval.
• Top Violation – indicates the most common WAF violations that occurred during a specified
time interval. This report provides information similar to the violations listed under the Global
Stats page, such as SQL Injection Attacks and Buffer Overflows.
• Top Attacker – indicates source IP where most attacks originate during a specified interval.

WAF Reporting provides complex information in a visual format, making it easier to see, for example,
the types of attacks that might be occurring, when they occurred, how long they lasted, and the size or
magnitude of the attack. Similarly, WAF Reporting can show you which URLs are being accessed on
your network and the times of day this is happening.

To generate a WAF Report, follow the procedure below:

1. Hover over Security on the menu bar, then select WAF.


2. Select the Reporting tab.
A window similar to that shown in Figure 28 appears.

FIGURE 28 WAF > Reporting (Top 10 URLs over Last Day)

page 82
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Reporting

3. Click the Report Type drop-down menu and select one of the following menu items: Top URL, Top
Violation, or Top Attacker.
4. In the Top N field, enter a number between 1and 20. Example: 10 results in a “Top 10” report.
5. Click the Time Interval drop-down menu and select one of the following tabs:
• Last Hour
• Last Day
• Last Week
• Last Month
• Last Year
• Select Period – specify the Unit (Minute, Hour, Day, Week, Month) and then enter the Period.
• Select Date Time – enter Start and End Times. Select a date from the calendar window.
The granularity of the history shown in a WAF report varies depending on the time interval
specified. Reports with shorter durations, (for example, the Last Day) will include more granular
information than reports that are spread out over a month.
6. Click the Apply button to generate your desired chart/graph.
A window similar to that shown in Figure 28 appears. This example displays the Top 10 Violations.

FIGURE 29 WAF Report with Top 10 Violations During Last Week

page 83
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Reporting FFee
e

Details:

• The figure above shows a WAF Report for the Top 10 Violations during the last week. The most
common violation
(URI While List Failure) appears at the top of the chart, and the second most common violation
(Response Headers Filtered), appears in the second position from the top of the chart, and so
on.
• The horizontal axis shows Date Time, and the vertical axis is used to show the Count.
• The blue dots represent the number of times a particular violation occurred during the time
interval. In this example, a blue dot appears every hour.
• You can optionally click the green Show Charts button (at upper right) to toggle between show-
ing and hiding the charts.
7. (Optional) To see where attacks are coming from, you can select Top Attacker from the Report
Type, and click Apply to generate the desired chart.
A window similar to that shown in Figure 30 appears. In this example, the Top 10 Attackers are
shown. However, in this particular example, the attacks are all coming from one hypothetical
source IP address: 172.128.9.154.

FIGURE 30 WAF Report with Top 10 Attackers During Last Day

page 84
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Configure External Logging (recommended)

Configure External Logging (recommended)


Although optional, A10 Networks strongly recommends configuring external logging. It is the only
mechanism supported for accessing WAF log messages.

Logging of WAF events to external logging servers is supported over TCP or UDP, although UDP is typi-
cally used for Syslog.

You can configure logging to a single server or a group of servers. If you use a group of servers, ACOS
balances the log traffic among the servers for optimal efficiency.

Configuration Overview

To configure web logging:

1. Create a server configuration for each log server. On each server, add a UDP port with the port
number on which the log server listens for log messages. (While either TCP or UDP would work,
Syslog typically uses UDP.)
2. Add the log servers to a service group. Make sure to use the round-robin load-balancing method.
(This is the default method.)
3. (Optional) If logging over TCP, configure a TCP-proxy template to customize TCP settings for con-
nections between ACOS and the log servers. For example, you can enable use of keepalive probes
to ensure that the TCP connections with the log servers remain established during idle periods
between logs.
4. Configure a logging template. Add the service group containing the log servers to the logging tem-
plate. If you configure a custom TCP-proxy template, also add that template to the logging tem-
plate.
5. Apply the logging template to the WAF template.

External logging is activated once you bind the WAF template to a virtual port.

Configure Log Servers


1. Hover over ADC on the menu bar, then select SLB.
2. Select the Servers tab.
3. Click the Create button.
A window similar to that shown below appears:

page 85
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Configure External Logging (recommended) FFee
e

FIGURE 31 Create WAF Logging server

4. In the Name field, enter a name for the external log server.
5. In the Type radio button, select the IP version, IPv4, IPv6, or FQDN.
6. In the Host field, enter the server’s IP address or FQDN.
7. In the Port section of the window, configure the protocol port information:
a. Click the Create button.
b. Enter the following:
• Port Number – enter the port number in this field (514, which is the default for Syslog)
• Protocol – click the drop-down and select UDP protocol for this port.
• Range – enter the range of port values
• Health Check – select one of the radio buttons for Default, Disable, Monitor, Follow
Port
• Connection Limit – enter a value ranging from 1-8000000.
• Select the No Logging On/Off button.
• Click Create. The port appears in the list of ports for this server.
8. Click Create again. The server appears in the list of servers.
9. Repeat this process to add additional servers, as needed.

page 86
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Configure External Logging (recommended)

Add Server to Service Group


1. Hover over ADC on the menu bar, then select SLB.
2. Select the Service Groups tab.
3. Click Create.
A window similar to that shown below appears:

FIGURE 32 Create Service Group

4. Enter a name for the service group in the Name field.


5. Click the Protocol drop-down and select UDP from the list. (Optionally, you could select TCP, but
not recommended.)
6. Click the Algorithm drop-down and select the desired load balancing algorithm (e.g., Round Robin,
Least Connection).
7. If desired, select the Health Check Disable On/Off button, or if health checks are desired, then
select one from the Health Monitor drop-down menu.
8. In the Member section, click Create to add the server.
A window similar to that shown below appears:

page 87
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Configure External Logging (recommended) FFee
e

FIGURE 33 Adding a Member to the Service Group

a. For the desired Choose creation type radio button, select Existing Server.
b. Click the Server drop-down list and select the server(s) you just created in
“Configure Log Servers” on page 85.
c. Enter 514 in the Port field, since we are using Syslog. (Use the same number as specified in the
server config.)
d. In the Priority field, enter an appropriate value from 1-16.
Assign a higher priority number to the primary servers, and assign lower numbers for the
servers that will be used as backups. By default, the ACOS device will not use the lower-priority
backup servers unless all of the primary servers are down. The same priority number must be
used for all the primary servers, but keep in mind that assigning the same priority value to the
primary servers will cause the logs to be load balanced across the primary servers, and will NOT
cause duplicate copies of the logs to be sent to multiple primary servers. For a detailed
discussion and background information on how Priority works, please see the “Priority Affinity”
chapter in the Application Delivery Controller Guide.
e. (Optional) Click the Template drop-down and select an HTTP template.
f. Click the State drop-down menu and select Enable or Disable to decide if the server will be
active or not.
g. (Optional) Select Stats Data Disable On/Off button if you wish to disable statistical data
collection for system resources, such as CPU, memory, disk, or interfaces.
h. Click Create button.
i. Repeat these steps for each server to add to this service group.

page 88
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Configure External Logging (recommended)

Configure the Logging Template


1. Hover over ADC on the menu bar, then select Templates.
2. Select the General tab.
3. Click the Create button, and from the drop-down menu that appears, select Logging.
A window similar to that shown below appears:

FIGURE 34 Create Logging Template

4. In the Name field, enter a name for the template.


5. In the Format field, enter the log format. (See “WAF Log Examples” on page 108.)
6. In the Local Logging field, enter the local logging information.
7. Click the Service Group drop-down menu and select the service group that contains the log serv-
ers.
8. For the PCRE Mask radio button, select Enable or Disable. (See “Writing PCRE Expressions” on
page 117 for details.)
9. If you configured a custom TCP-proxy template for logging over TCP, select the template from
the drop-down.
10.Click the OK button.

Apply the Log Template to the WAF Template


1. Hover over Security on the menu bar, then select WAF.
2. Select the WAF Templates tab.

page 89
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Configure External Logging (recommended) FFee
e

3. Click the Edit link next to the desired WAF template name to display the General Settings. (See
Figure 12 on page 60.)
4. Click the Logging Template drop-down menu and select the logging template created.
5. Click the Update button.

page 90
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Required Configuration

Configuring the WAF Using the CLI

The WAF operates on traffic that is addressed to the virtual IP address (VIP) and HTTP/HTTPS virtual port of your
website. To apply WAF protection to the virtual port, basic configuration is required. Additional, advanced config-
uration is optional.

This chapter describes how to configure the WAF using the command-line interface (CLI).

NOTE: For deployment examples, see “WAF Deployment and Logging Examples” on
page 127.

Required Configuration
The minimum required configuration for the WAF consists of the following tasks:

1. Create a WAF template.


2. Bind the WAF template to the HTTP/HTTPS virtual port on the VIP.

NOTE: Configuration of other SLB resources required by the virtual port, such as real serv-
ers and service groups, are not covered here. However, the deployment examples
in the guide include the commands for configuring these resources. (See “WAF
Deployment and Logging Examples” on page 127.)

Create a WAF Template


To create or modify a WAF template, use this command at the global configuration level of the CLI:

waf template template-name

For the template-name option, enter the name of an existing WAF template to modify the template’s configura-
tion, or an unused name to create a new WAF template. This command enters the CLI
configuration level for the template.

If you plan to use all the default settings for the template (including Active Mode operation) no further template
configuration is required. To customize template settings, see “Optional Configuration” on page 94.

page 91
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Required Configuration FFee
e

Bind the WAF Template to the HTTP/HTTPS Virtual Port


The WAF template goes into operation after you bind the template to an HTTP/HTTPS port.

To bind a template to a virtual port, you must access the configuration level for the port.

1. From the global configuration level of the CLI, use the following command to access the configuration level
for the virtual server that will receive HTTP/HTTPS traffic to be secured using the WAF:
slb virtual-server name ipaddr

2. At the configuration level for the virtual server, use the following command to access the configuration level
for the virtual port:
port port-number {http | https}
3. At the configuration level for the virtual port, use the following command to bind the WAF template to the
port:
template waf template-name

OWASP Top 10 Compliance


Content Security Policy (CSP) is a tool used for application security, mitigating the risk of DDOS content injection
vulnerabilities like cross-site scripting; and reducing the run privileges for applications.

CSP protects against cross-site scripting attacks by ensuring that their trusted Content Delivery
Network, is the only origin from which script can load and execute. No plug ins can execute in the page contexts:

Content-Security-Policy: script-src https://cdn.example.com/scripts/; object-src 'none'

The new CSP HTTP response header helps reduce XSS risks on modern browsers by declaring what dynamic
resources are allowed to load through a HTTP Header. Server administrators can reduce or eliminate executable
scripts based errors, by specifying the valid domains that the browser must
consider valid.

CSP allows multiple policies for a resource, including through the CSP header, the CSP-Report-Only header and a
<meta> element. You can use the CSP header more than once.

CLI Configuration
To support OWASP Top 10 Compliance, a new configuration mode, “csp” is added in WAF template:

To configure CSP, got to WAF template configuration mode using waf-template command:

ACOS(config)# waf template xyz

Use csp command as follows in config-waf mode to replace server CSP header if it exists:

page 92
ACOS 5.1.0 Web Application Firewall Guide
Feedback
External Logging Configuration

ACOS(config-waf)# csp csp1 insert-if-not-exist

By default, CSP is disabled. Otherwise use “insert-always” to insert a separate CSP header.

ACOS(config-waf)# csp csp1 insert-always

If no CSP policy is provided, use the default value “script-src 'self'; object-src ‘self’”.

External Logging Configuration


Although optional, A10 Networks strongly recommends external logging. It is the only mechanism
supported for accessing WAF data event messages.

To configure external logging for WAF:

1. Create a server configuration for each log server. Add a TCP or UDP port to each server
configuration, with the port number on which the external log server listens for log messages.
a. Use the following command to add a server and access the configuration level for it:
slb server server-name ipaddr
b. Use the following command to add a TCP or UDP port to the server. Specify the port number on which the
server will listen for log traffic.
port port-num {tcp | udp}

2. Add the log servers to a service group. Make sure to use the round-robin load-balancing method. (This is the
default method.)
a. Use the following command to add the service group and access the configuration level for it:
slb service-group group-name {tcp | udp}
b. Use the following command to add each log server and its TCP or UDP port to the group:
member server-name portnum

page 93
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Optional Configuration FFee
e

3. (TCP only) If logging over TCP, configure a TCP-proxy template to customize TCP settings for connections to
log servers. For example, you can enable use of keepalive probes, to ensure that the TCP connections with
the log servers remain established during idle periods between logs.
a. Use the following command to create the TCP-proxy template and access the configuration level for it:
slb template tcp-proxy template-name

b. Use the following command to set keep-alive probes:


keepalive-probes num

4. Configure a logging template:


a. Use the following command to create the logging template and access its configuration level:
slb template logging template-name

b. Use the following command to add the service group containing the log servers to the logging template:
service-group group-name

c. If you configured a TCP-proxy template, use the following command to add that template to the logging
template:
template tcp-proxy template-name

5. Bind the logging template to the WAF template:


a. Use the following command to access the configuration level for the WAF template:
waf template template-name

b. Use the following command to bind the logging template to the WAF template:
template logging template-name

NOTE: External logging is activated once you bind the WAF template that uses the logging
template to an HTTP/HTTPS virtual port.

NOTE: The following log is generated when external logging is configured using
command form-check {request-non-post | response-non-post}.

• For sensitive data in forms, server requests client to submit with method POST.
If POST form method is not used in HTTP response, a warning message is logged.

Optional Configuration
This section provides syntax for the following WAF configuration options:

• Deployment mode

• Custom policy files (definitions)

page 94
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Optional Configuration

• Request checks

• Deny action (WAF response sent to client when a request is denied by the WAF)

• Response checks

Set Deployment Mode


The default operational mode for WAF is active. To change the operational mode, use the following command at
the configuration level for the WAF template:

deploy-mode {active | passive | learning}

You can deploy WAF in one of the following operational modes:

• active – The WAF enforces the security checks configured on the template and sends events to the exter-
nal log server.
• passive– The WAF sends events to the external log server only and does not enforce any security checks.

• learning – The WAF template “learns” acceptable check parameters based on a stream of legitimate,
secure traffic. In Learning Mode, the WAF continues to send events to the external log server.

For more information, see “WAF Operational Modes” on page 49.

Customize WAF Policy Files

CAUTION: A mis-configured PCRE expression can negatively impact system performance. Do


not apply a PCRE expression to a WAF policy file unless you are completely certain
that the PCRE expression will achieve the desired result.

The WAF is pre-loaded with a set of default policy files which are used for certain security checks. For example, if
you enable bot checking with the WAF template, the default “bots_def” WAF policy file is used for a list of known
bot names. (See “Bot Check” on page 112.)

Optionally, you can customize WAF policy files and apply these files to security checks. For example, you can
copy the default bots policy file, modify and import the copied file, then update the corresponding WAF template
option to use the custom policy file.

For more information, see “WAF Policy Files” on page 111.

page 95
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Optional Configuration FFee
e

Configure Security Checks for Requests


To configure individual WAF security checks for requests, use the following commands:

• allowed-http-methods method-list – Use this command to specify the HTTP methods (GET, POST, and
so on) that are allowed in requests.
• bot-check – Use this command to check the user-agent of incoming requests for known bots. This check
uses the list of defined bots in the “bot_defs” WAF policy file. See “Bot Check” on page 112.
• buf-ovf option – Use this command to configure checks for attempts to cause a buffer overflow on the
web server.
• disable – Disables buffer overflow protection.
• max-cookie-len bytes – Sets the maximum length for cookies allowed in requests.
• max-cookie-name-len bytes – Sets the maximum length for cookie names in requests.
• max-cookie-value-len bytes – Sets the maximum length for cookie values in requests.
• max-cookies-len bytes – Sets the maximum total length for cookies allowed in requests.
• max-data-parse bytes – Sets the maximum data parsed for Web Application Firewall.
• max-hdr-name-len bytes - Sets the maximum header name length allowed in requests.
• max-hdr-value-len bytes - Sets the maximum header value length allowed in requests.
• max-hdrs-len bytes – Sets the maximum header length for headers allowed in requests.
• max-line-len bytes - Sets the maximum line length allowed in requests.
• max-parameter-name-len bytes - Sets the maximum parameter name length allowed in requests.
• max-parameter-total-len bytes - Sets the maximum total number of parameters allowed in requests.
• max-parameter-value-len bytes - Sets the maximum parameter value length allowed in requests.
• max-post-size bytes – Sets the maximum content length allowed in HTTP POST requests.
• max-query-len bytes - Sets the maximum query length allowed in requests.
• max-url-len bytes – Sets the maximum URL length allowed in requests.
• csrf-check – Use this command to tag the fields of a web form with a nonce. This check protects against
cross-site request forgery (CSRF). “XSS Check” on page 112
• deny-action response-type – Use this command to specify the type of response string sent to a client
when WAF denies a request
• http-resp-403 resp-string – Sends a 403 Forbidden response to the client. The default string returns a
generic “Request Denied!” page to the client.
• http-resp-200 resp-string– Sends a 200 OK response to the client with the specified resp-string. The
default string returns a generic “Request Denied!” page to the client.
• http-redirect url-string – Sends a 302 Found redirection address to the client with the URL specified
in the redirect-url.

page 96
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Optional Configuration

• reset-conn – Terminates the client connection.


• deny-non-masked-passwords – Prevents “shoulder surfing” by denying the web server’s attempt to send a
form through the WAF unless the field type for the password field has been set to “password”. See “Deny
Unmasked Passwords” on page 19.
• deny-non-ssl-passwords – Denies user passwords that are sent over a non-encrypted connection. If the
connection between the client and the WAF is secured with SSL/TLS, then the user password is allowed,
but if the client attempts to submit to a form field where “input type=password”, and if the connection is not
encrypted with SSL/TLS, then the WAF blocks the transmission. The feature is disabled by default, mean-
ing that forms not using the SSL/TLS protocol will not be denied. See “Deny Passwords Sent Over an Unen-
crypted Connection” on page 20.
• deny-password-autocomplete – Denies web server attempts to transmit the form if one of the form fields
type is set to “password” and if the “autocomplete=on/off” attribute is set to “on”. Enabling this option
blocks browser “autocomplete” behavior. Although convenient for users, password auto-completion weak-
ens security by allowing browsers to store user passwords in order to later guess the user’s password for
some websites. See “Deny Passwords if Autocomplete is Enabled” on page 20.
• form-consistency-check – Use this command to check that the user input to a form field conforms to the
form field tag. WAF also parses HTTP bodies encoded as multipart/form-data. Extracted form fields are
verified against previously parsed HTML forms.
• form-deny-non-post – Deny request with forms if the method is not POST.

• form-deny-non-ssl – Deny request with forms if the protocol is not SSL.

• form-set-no-cache – Disable caching of form-containing responses.

• http-check – Use this command to check that user requests are compliant with HTTP protocols.

• json-format-check – Checks that incoming requests containing JSON code are in compliance with RFC
4627, and blocks requests if the JSON content is not well- formed.
• json-limit – Enforces parsing limits to protect backend servers against various types of denial-of-service
(DoS) attacks, which are designed to exhaust system memory or CPU resources.
• max-array-value-count num – Limits the maximum number of values within a single array.
• max-depth num – Limits the maximum recursion depth in a JSON value.
• max-object-member-count num – Limits the number of members in a JSON object.
• max-string num – Limits the length of a string in a JSON request for a name or a value.
• log-succ-reqs – Enabling this option logs a debug message on the successful completion of WAF
requests, and not just for errors.
• max-cookies num – Specifies the maximum number of cookies allowed in a request.

• max-entities num – Specifies the maximum number of MIME entities allowed in request.

• max-hdrs num – Specifies the maximum number of headers allowed in a request.

• max-parameters num – Specifies the maximum number of parameters allowed in a request.

page 97
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Optional Configuration FFee
e

• redirect-wlist– Enables protection against unvalidated redirects, which can occur if a hacker uses social
networking to trick unsuspecting users into clicking on a malicious hyperlink. The WAF must be deployed
in Learning Mode when the redirect-wlist CLI command is used for the first time so the list of acceptable
locations can be built up. The WAF pre-learns a white-list of acceptable locations to which users can safely
be redirected. If one of the web servers gets hacked and attempts to redirect a user to a location that does
not appear in the redirect white-list, then the WAF blocks the redirect. See “Open Redirect Mitigation” on
page 21 for details.
• referer-check {enable | only-if-present}
safe-referer-domain safe-redirect-url – Use this command to validate that the referer header in a
request contains web form data from the specified web server, rather than from an outside website. This
check protects against CSRF attacks.
• enable – always validates the referer header. If selected, the request fails the referer check if there is no
referer header or if the referer header is invalid.
• only-if-present – validates the referer header only if a referer header exists. If the check finds an invalid
referer header, the request fails the check. However, the request does not fail the check if there is no ref-
erer header in the request.
• session-check secs – This command creates an ID for a client request and inserts it in a cookie in the
response. Future requests from the same client are validated against the session cookie. If the ID or IP do
not match, then the request will be rejected. The default lifetime for the session ID is 600 seconds. See
“Session Checks” on page 19.
• soap-format-check – Check XML documents for SOAP format compliance and blocks those which are not
well-formed. SOAP format checks are typically done in tandem with XML format checks. See “WAF SOAP
Checks” on page 32 for details.
• sqlia-check {reject | sanitize} – Use this command to check for SQL strings to protect against SQL
injection attacks. This check uses the list of defined SQL commands in the “sqlia_defs” WAF policy file. See
“SQL Injection Attack Check” on page 112.
• reject – denies requests that contain SQL injection attacks.
• sanitize – removes the SQL injection attack and forwards the request to the web server.
• uri-blist-check file-name – Enforces the rules contained within a WAF policy file for the URI Black List.
For more information see, “URI Black List” on page 113.
• uri-wlist-check file-name – Enforces the rules contained within a WAF policy file for the URI White List.
For more information, see “URI White List” on page 114.
• url-check – The URL Check allows users to access web pages only by clicking hyperlinks on your pro-
tected website, as opposed to allowing users to access hidden web pages by typing the full URL in the
browser. Select this option to prevent users from manually typing the URL for content on your website that
you do not want accessible.
The list of approved URL paths is initially generated as a policy file during Learning Mode. After this list is
generated, you can customize the contents of the URL Check policy file. For a deployment example that
includes configuration of the URL Check, see “Generate Allowed URL Paths for the URL Check” on
page 131.
• url-options option – This command is used to normalize requested URLs.

page 98
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Optional Configuration

The url-options command helps shorten URLs, thus preventing buffer overflows from long URLs.
• decode-entities - Decode entities, such as &lt;, in an internal URL.
• decode-escaped-chars - Decode escaped chars, such as \r or \n, in an internal URL.
• decode-hex-chars - Decode hexadecimal characters, such as \%xx and \%u00yy, in an internal URL.
• decode-plus-chars - To be consistent in pattern matching inside WAF module, decode '+' into in a URL.
• remove-comments - Remove comments from an internal URL.
• remove-selfref - Remove self-references, such as /./ and /path/../, from an internal URL.
• remove-spaces - Remove spaces from an internal URL.

NOTE: ACOS 4.0 does not support the ability to decode a plus symbol “+” in the URL if it is
being used to represent a space by the browsers.

• xml-format-check – Check HTTP body for XML format compliance. Incoming requests containing XML
code are checked for compliance with the XML 1.0 specification. (See “XML Format Checks” on page 26 for
details.)
• xml-limit – XML parsing limits. (See “XML Limit Checks” on page 28 for details.)

• max-attr num – Limits the maximum number of attributes/children each individual element is allowed to
have.
Range is 1–256. Default is 256.
• max-attr-name-len num – Limits the maximum length of each attribute name.
Range is 1–2048. Default is 128.
• max-attr-value-len num – Limits the maximum length of each attribute value.
Range is 1–2048. Default is 128.
• max-cdata-len num – Limits the length of the CDATA section for each element.
Range is 1–65535. Default is 65535.
• max-elem num – Limits the maximum number of any one type of element per XML document.
Range is 1–8192. Default is 1024.
• max-elem-child num – Limits the maximum number of children each element is allowed, and includes
other elements, character information, and comments. Range is 1–4096. Default is 1024.
• max-elem-depth depth – Limits the maximum number of nested levels in each element.
Range is 1–4096. Default is 256.
• max-elem-name-len length – Limits the maximum length of name of each element, and includes the XML
path, which is in the following format: http://<site>/<path>/page.xml
Range is 1–65535. Default is 128.
• max-entity-exp num – Limits the number of entity expansions allowed.
Range is 0–1024. Default is 1024.
• max-entity-exp-depth num – Limits the maximum depth of nested entity expansions.
Range is 0–32. Default is 32.
• max-namespace num – Limits the number of namespace declarations in XML document.
Range is 0–256. Default is 16.

page 99
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Optional Configuration FFee
e

• max-namespace-uri-len num – Limits the URL length for each namespace declaration.
Range is 0–1024. Default is 256.
• xml-sqlia-check – Checks XML data against SQLIA policy. Checking for XML SQL Injection attacks means
the WAF examine the headers and bodies of incoming requests for inappropriate SQL special characters or
keywords that might indicate the presence of an SQL Injection Attack (See “XML SQL Injection Checks” on
page 31 for details.)
• xml-validation xml-schema [resp-val] xml-schema-file-name – Checks incoming requests against an
XML schema file to validate the XML content. Used to prevent hackers from using invalid XML messages
that have been specially-constructed to evade application security. (See “XML Validation Checks” on
page 26 for details.)
• xml-xss-check – Checks XML data against XSS policy. The XML cross-site scripting check examines the
headers and bodies of incoming XML requests for Javascript keywords that might indicate possible cross-
site scripting attacks and blocks those requests. (See “XML Cross-Site Scripting Checks” on page 30 for
details.)
• xss-check {reject | sanitize} – Use this command to check for potential HTML XSS scripts to protect
against cross-site scripting attacks. This check uses the list of defined Javascript commands in the
“jscript_defs” WAF policy file. See “XSS Check” on page 112.
• reject – denies requests that contain cross-site scripting.
• sanitize – removes the detected XSS script and forwards the request to the web server.

Configure Security Checks for Responses


To configure individual WAF security checks for responses, use the following commands:

• ccn-mask – Use this command to examine strings of outbound replies from the web server for patterns of
numerical characters that resemble credit card numbers (CCN). If the WAF identifies a credit card number,
the WAF replaces all but the last four digits of credit card numbers with “x” characters.
• cookie-encrypt – Use this command to encrypt specified cookies matching PCRE pattern. Used to pro-
tect against cookie tampering by encrypting cookies before sending the server replies to a client. (See
“Cookie Encryption” on page 137.)
• filter-resp-hdrs – Use this command to removes the web server’s identifying headers in outgoing
responses.
• hide-resp-codes – Cloaks 4xx and 5xx response codes for outbound responses from the web server.

NOTE: Do not enter the secret-encrypted option when configuring this check. This option
is placed into the configuration by the WAF to indicate that the string is the
encrypted form.

page 100
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Optional Configuration

• pcre-mask options pcre-pattern – Use this command to masks patterns in a response that match the
specified PCRE pattern.
• For options you can enter the following:
• keep-end num-length – Specifies the number of unmasked characters at the end of the string. The
default is 0.
• keep-start num-length – Sets the number of unmasked characters at the beginning of the string. The
default is 0.
• mask character – Selects a character to mask the matched pattern of a string. The default is x.
• For pcre-pattern, enter a PCRE expression. (See “Writing PCRE Expressions” on page 117.)

NOTE: You can configure PCRE patterns to match only on a fixed-length string. For this
reason, wildcard characters that can mask excessively long strings (* and +) are
not supported.

If either the asterisk (*) or plus symbol (+) is detected during the syntax check, the
syntax check will automatically fail. To use an expression that matches an actual
“*” or “+” character, use an escape character (\) before the matched symbol. For
example, to search for the actual asterisk (*) or plus character (+), enter “\*” or “\+”

• ssn-mask – Use this command to examine server responses for strings that resemble US Social Security
numbers and masks all but the last four digits of the string with “x” characters in a response.

page 101
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Optional Configuration FFee
e

page 102
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Event Types and Where They Are Logged

WAF Event Logging

This chapter describes where WAF events are logged and the format used for WAF log messages.

There is no external logging by default. To configure external logging, see either of the following sec-
tions:

• Using the GUI – “Configure External Logging (recommended)” on page 85

• Using the CLI – “External Logging Configuration” on page 93

NOTE: After external logging is enabled, WAF messages for configuration


events will be sent to the local log, but messages for data events will be
sent to the external logging servers.

Deny actions are not written to the log. To view the configured response
to denied client requests, check the WAF template currently in use.

WAF Event Types and Where They Are Logged


WAF log messages consist of the following basic event types:

• Configuration events – Indicate that a configuration change has occurred. Typically, this type of
WAF event is generated when you configure WAF settings.
• Data events – Indicate that traffic has matched a WAF template check.

By default, only configuration events are logged to the local logging buffer on ACOS.

Data events are not logged by default. Due to the potentially high volume of data event messages, they
are accessible only by using remote logging servers. You can configure the WAF to use a single logging
server or a group of servers.

After enabling WAF logging to remote logging servers, WAF configuration events also are sent to the
remote servers. In this case, WAF configuration events are no longer sent to the local logging buffer.

Figure 35 shows the WAF logging behavior without external logging. WAF configuration events are
logged locally. WAF data events are not logged.

NOTE: WAF configuration is allowed on “shared” and on “service” partitions.

page 103
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Event Types and Where They Are Logged FFee
e

FIGURE 35 WAF logging without external log server

Figure 36 shows the WAF logging behavior after external logging is configured for the WAF template.
WAF configuration events and WAF data events both are logged to the external log server.

FIGURE 36 WAF logging with external log server

page 104
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Log Format

Log Format
For optimal interoperability, WAF uses the Common Event Format (CEF), an open standard used by
other security appliances and network devices.

WAF log messages can contain the following fields:

Timestamp CEF:version|device-vendor|device-product|
device-version|module|event-type|severity|CEF-extension

Table 2 describes the data fields that can appear in WAF logs

TABLE 2 WAF log data fields


Field Description
Timestamp Date and time that the log was generated, in the following format: Mon Day
hh:mm:ss
CEF version CEF version.
device-vendor Vendor name, “A10”.
device-product A10 Thunder or AX model number.
device-version Advanced Core Operating System (ACOS) version.
module System module that generated the log message. For WAF messages, the mod-
ule is “WAF”.

page 105
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Log Format FFee
e

TABLE 2 WAF log data fields (Continued)


Field Description
event-type WAF feature or policy on which the traffic matched. Examples:

• bot-check

• buf-ovf

• ccn-mask

• cookie-encrypt

• csrf-check

• deny-action

• filter-resp-hdrs

• form-consistency-check

• hide-resp-codes

• http-check

• pcre-mask

• referer-check

• sqlia-check

• ssn-mask

• uri-blist-check

• uri-wlist-check

• url-check

• xss-check

page 106
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Log Format

TABLE 2 WAF log data fields (Continued)


Field Description
severity Severity of the event.

• 1 – Debug

• 2 – Info

• 3 – Notice

• 4 – Warning

• 5 – Error

• 6 – Critical

• 7 – Alert

• 8 – Emergency
CEF-extension Set of any number of key/value pairs, in any order, that further describe the
event that generated the log. The CEF extension for WAF uses the following ele-
ments:

• rt – Device Receipt Time

• src – Source IP of the request or response.

• spt – Source protocol port of the request or response.

• dst – Destination IP of the request or response.

• dpt – Destination protocol port of the request or response.

• dhost – Destination host name.

• request method – Protocol request method used (if applicable).

• request – URL in the request. (The request only contains the URL and is not
enclosed in “” marks.)

• app – Aappliction protocol.

• cs1 – device customString1, which is used for customer-specific options

• cs2 – device customString2, which is used for customer-specific options

• act – Action the WAF took in response to the event:

• deny

• allow

• sanitize

• learn

page 107
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Log Examples FFee
e

WAF Log Examples


The following sections show some examples of WAF log messages.

• Basic Log Message

• Bot Check

• Learning Mode

Basic Log Message


Here is a sample log message:

May 30 12:20:29 CEF: 0|A10|AX3030|2.7.2-P8|WAF|session-id|2|rt=May 30 2016 11:30:10


src=172.17.21.4 spt=57253 dst=172.17.21.2 dpt=80 dhost=172.17.21.2 cs1=waf-csrf-check1
cs2=e133c0360150667e act=learn cs3=active app=HTTP requestMethod=GET request=/foooo/
2.html?B92A9743=B6A273450A38B6C7A4667E829B3DCB65&name=abc&age=10 msg=New session created:
Id=e133c0360150667e

Table 3 labels each field in the message.

TABLE 3 WAF log example


Field Value
Timestamp May 30 12:20:29
CEF version 0
device-vendor A10
device-product AX3030
device-version 2.7.2-P8
module WAF
event-type session-id

page 108
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Log Examples

TABLE 3 WAF log example (Continued)


Field Value
severity 2
CEF-extension src=172.17.21.4

spt=57253

dst=172.17.21.2

dpt=80

dhost= dhost=172.17.21.2

req=”/foooo/2.html?B92A9743=B6A273450A38B6
C7A4667E829B3DCB65&name=abc&age=10”

msg=New session created:


Id=e133c0360150667e

cs1=waf-csrf-check1 cs2=e133c0360150667e

act=learn

app=HTTP
requestMethod=GET
md=learn

NOTE: For more log examples, see “WAF Deployment and Logging Examples”
on page 127.

Bot Check
Here is an example of a WAF log that indicates the detection of a bad bot:

Oct 20 18:16:13 CEF:0|A10|AX3200|2.7.1|WAF|bot-check|6|src=20.20.25.10 spt=30842


dst=20.20.25.130 dpt=80 request="GET /tours/index.html HTTP/1.1" 0 msg="Bad bot detected!
User-Agent " cs1=w2 act=deny md=nrm

Here is the same message, formatted to more clearly show each field:

Oct 20 18:16:13
CEF:0
A10
AX3200
2.7.1
WAF
bot-check
6
src=20.20.25.10
spt=30842

page 109
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Log Examples FFee
e

dst=20.20.25.130
dpt=80
request=”GET /tours/index.html HTTP/1.1” 0
msg=”Bad bot detected! User-Agent drip”
cs1=w2
act=deny
md=nrm

This message indicates that an HTTP GET request from 20.20.25.10:30842 to VIP 20.20.25.130:80
contained a bot whose name matches a name in the bots WAF policy file. The WAF template name is
“w2”. Based on the WAF configuration, the request was denied. The WAF is running in normal mode.

Learning Mode
Below are example log messages for when the WAF is deployed in learning mode:

Oct 19 16:24:43 CEF:0|A10|AX3200|2.7.1|WAF|buf-ovf|2|src=20.20.25.10 spt=1892


dst=20.20.25.130 dpt=80 request="GET /tours/index.html HTTP/1.1" 0 msg="Learning Mode:
Increasing headers length limit from 0 to 172" cs1=w2 act=learn md=lrn

Oct 19 16:25:03 CEF:0|A10|AX3200|2.7.1|WAF|http-check|2|src=20.20.25.10 spt=1892


dst=20.20.25.130 dpt=80 request="GET /tours/index.html HTTP/1.1" 0 msg="Learning Mode:
Increasing max_hdrs from 0 to 3" cs1=w2 act=learn md=lrn

The first message indicates that WAF updated the header-length limit based on traffic observed during
Learning Mode. Likewise, the second message indicates that WAF updated the maximum-headers
limit. The act=learn field indicates that the value was learned. The md=lrn field indicates that Learning
Mode was enabled.

page 110
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Pre-Loaded WAF Policies

WAF Policy Files

WAF Policy Files (also referred to as WAF Definitions) give you the ability to define a set of rules for cus-
tomized security checks. WAF policy files enable you to specify security checks for enhanced
response- and request-side protection to protect against security risks, such as SQL injection attacks
or forceful browsing.

CAUTION: Misconfigured PCRE expressions can negatively impact system perfor-


mance. Do not apply a PCRE expression to a WAF policy file unless you
are certain that the PCRE expression will achieve the desired result.

Pre-Loaded WAF Policies


Default WAF policy files are pre-loaded onto ACOS to allow immediate protection against common
threats. Default WAF policies apply to the following checks:

• XSS Check

• Bot Check

• SQLIA Check

• URI White List

• URI Black List

• Hide Response Codes

If one of these checks is enabled and a WAF policy file is not specified, the default WAF policy file is
applied. These policy files are described in more detail below.

NOTE: You cannot rename, edit, or delete default files. However, you can copy a
default WAF policy file and customize it to fit your specific demands.

page 111
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Pre-Loaded WAF Policies FFee
e

Table 4 lists pre-loaded WAF policy files

TABLE 4 Pre-Loaded WAF Policy Files


Check Policy File Description
Hide Response allowed_resp_codes Defines a list of permitted HTTP response codes.
Codes
Bot Check bot_defs Defines a list of known bots.
XSS Check jscript_defs Defines a set of commonly used javascript commands.
SQLIA Check sqlia_defs Defines common search terms for SQL injection attacks.
URI Black List uri_blist_defs Lists exclusion criteria for the URI Black List.
See Table 5 on page 113.
URI White List uri_wlist_defs Lists inclusion criteria for the URI White List.
See Table 6 on page 114.

Request Protection
The following checks point to WAF policy files for enhanced protection against incoming requests. By
default, these checks refer to the default WAF policy files, as described below. Optionally, you can con-
figure these checks to use customized policy files.

Bot Check
The WAF bot check option uses the “bot_defs” policy file for search definitions of known bot agents. If
bot checking is enabled in the WAF template and a match is found with the “bot_defs” policy file, the
request is denied automatically. You can add or modify the “bot_defs” policy file to include or remove
bot search terms.

XSS Check
The “jscript_defs” WAF policy file defines a list of common Javascript commands. The XSS check
uses this policy file for examining the content of URL, cookies, headers, and POST bodies of client
requests. This type of policy file is useful for websites that use Javascript-based web content.

NOTE: If your website contains embedded Javascript, A10 Networks recom-


mends enabling the XSS check in the WAF template.

SQL Injection Attack Check


The WAF policy file “sqlia_defs” provides a basic collection of SQL special characters and keywords
that are common to SQL injection attacks. The terms in this policy file can trigger commands in the
back-end SQL database and allow unauthorized users to obtain sensitive information. If a request con-
tains a term that matches a search definition in the “sqlia_defs” policy file, you can configure the
WAF to sanitize the request of the SQL command or deny the request entirely.

page 112
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Pre-Loaded WAF Policies

URI Black List


A URI Black List specifies exclusion criteria for incoming requests. If the URI of an incoming request
matches a rule in the URI Black List, the request is automatically blocked.

The URI Black List takes priority over a URI White List. That is, even if a URI matches acceptance crite-
ria within the URI White List, a connection is blocked automatically if it meets a rule in the separate URI
Black List.

Table 5 lists URI Black List criteria in the default “uri_blist_defs” file.

TABLE 5 URI Black List – Default


Description Attack Pattern
Access attacks access,^[^?]*(?:htaccess|access_log)(?:[.][^/
?]*)?(?:[~])?(?:[?].*)?$
Apache possible directory index apache_dir,^[^?]*/[?][SM]=[AD]
disclosure vulnerability
Command injection attack cmd_inj,(?:[ /=]|\t|\n)(?:ls|rm|cat)(?:[
;'\"&].*)?$
CodeRed code_red,^[^?]*/default[.]ida[?]N+
Debug attacks debug,debug[.][^/?]*(?:|[?].*)$
Front Page server extensions buffer fp_srvr_ext_bo1,^[^?]*dvwssr[.]dll
overflow-1
Front Page server extensions buffer fp_srvr_ext_bo2,^[^?]*fp30reg[.]dll
overflow-2
Front Page server extensions path fp_srvr_ext_pb,^[^?]*/_vti_bin/shtml[.]
disclosure vulnerability
HTR source disclosure htr_sd,^[^?]*[+][.]htr
Index server buffer overflow idx_srvr_bo,^[^?]*[.]id[aq]
IIS executable file parsing vulnerabil- iis_exe_fp1,^[^?]*[+]dir
ity-1
IIS executable file parsing vulnerabil- iis_exe_fp2,^[^?]*/georgi[.]asp
ity-2
IIS executable file parsing vulnerabil- iis_exe_fp3,^[^?]*[.](?:bat|ini|exe)(?:|[?].*)$
ity-3
Microsoft IIS UNC mapped virtual iis_unc_mvh,^[^?]*[.]asp/.*
host vulnerability
Microsoft IIS UNC path disclosure iis_unc_pd,^[^?]*[.]htx
vulnerability
Nimbda-3 nimda3,^[^?]*Admin[.]dll
Nimbda-4 nimda4,^[^?]*/winnt/
Netscape enterprise server directory nses_dir_idx,^[^?]*/[?]wp-
indexing vulnerability
Netscape enterprise server web nses_web_pub,^[^?]*/publisher
publishing vulnerability
Printer buffer overflow print_bo,^[^?]*/NULL[.]printer
Password file attacks pwd_file,^[^?]*(?:passwd|passwords?)(?:[.][^/
?]*)?(?:[?].*)?$

page 113
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Pre-Loaded WAF Policies FFee
e

TABLE 5 URI Black List – Default


Description Attack Pattern
Script exploit script,^[^?]*[.](?:cgi|pl|php|bat)(?:[/?].*)?[|]
System command attacks sys_cmd,system(?: |\t|\n)*[(?:]
Unix core file attacks unix_core,/core(?:/.*)?$
Unix file attacks unix_file,[\\/]etc[\\/](?:passwd|group|hosts)
Webhits source disclosure webhits_sd,^[^?]*null[.]htw

URI White List


You can configure the WAF to check the URIs of incoming requests and only accept connection
attempts that meet specified criteria. A URI White List check compares the URI of an incoming request
with the expressions contained in the URI Whitelist policy file. Connection requests are accepted only if
the request matches a criterion in the URI White List.

Table 6 lists URI White List criteria in the default “uri_wlist_defs” file.

TABLE 6 URI White List – Default


Description Expression
URL Path Component root,^/$
Common file types static,^[^?]+[.](?:html?|shtml|js|gif|jpg|jpeg|png|
swf|pif|pdf|css|csv)
Common website scripts dynamic,^[^?]+[.](?:cgi|aspx?|jsp|php|pl)(?:[?].*)?$

Response Protection
This section describes policy-based security checks for outbound responses from the web server.

Allowed HTTP Response Codes


The WAF policy file “allowed_resp_codes” lists acceptable HTTP response codes in outbound replies
from the web server. If the Hide Response Codes option is enabled within the WAF template, then
response codes that do not match a value contained in the “allowed_resp_codes” file are cloaked in
replies.

page 114
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Customize WAF Policy Files

Customize WAF Policy Files


CAUTION: Misconfigured PCRE expressions can negatively impact system perfor-
mance. Do not apply a PCRE expression to a WAF policy file unless you
are certain that the PCRE expression will achieve the desired result.

You cannot remove or edit a pre-loaded WAF policy file. However, you can quickly duplicate an existing
file to an unused name and modify the contents.

The following sections describe writing PCRE patterns for customized WAF policies. ACOS incorpo-
rates aspects of PCRE expressions for writing WAF policies, but does not support full PCRE functional-
ity.

Syntax Check
After the file is created or modified, a syntax check is automatically performed on the file. If you modify
a WAF policy file that is currently bound to a WAF template and the file does not pass the syntax check,
it is automatically restored to the previous version.

Files which do not pass the syntax check cannot be bound to a WAF template. A policy can fail a syntax
check for various reasons, including the following:

• Invalid PCRE syntax

• Duplicate policies (more than one policy file containing the same PCRE expressions)

• Pair of brackets missing the escape character sequence; for example:

(a|b) – Incorrect
instead of
(?:a|b) – Correct

Using the CLI


This section describes procedures to create, edit, or manage WAF policy files in the CLI.

Configure Policy Files


To configure a WAF policy file using the CLI:

1. Enter the following command at the global configuration level:


waf policy edit file-name

page 115
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Customize WAF Policy Files FFee
e

For the file-name option, enter the name of an existing WAF policy file to edit the file, or an unused
name to create a new WAF policy. Do not include the “.waf” extension in the file name, this is auto-
matically applied during creation.
The CLI enters the input mode for the policy file.

NOTE: You cannot modify default files. If you enter the name of a pre-loaded
WAF policy for file-name, the following message will display:

Editing of default WAF policy file not allowed.

2. Type or copy-and-paste a collection of PCRE expressions for the file. If you type the script, press
the Enter key at the end of each line. For information about writing PCRE expressions, see “Writing
PCRE Expressions” on page 117.
3. To save the file and complete the input process, press the Escape key, type “:wq” or “ZZ” and press
Enter. Alternatively, use “:q!” to exit without saving the file.

Syntax Checks
After entering policy text, the CLI performs a syntax check and displays one of the following messages:

• WAF file-name edited; syntax check passed. –

Indicates the syntax is valid for file-name.


• WAF policy syntax error. Line n: –

Indicates a failed syntax check and reports the line (n) with invalid syntax.

Manage Files
The following commands allow you to manage WAF policy files.

Copy Files

Use the following command to copy a WAF policy to a new file name:

waf copy source-name destination-name

For the source-name option, use the name of an existing WAF policy.

For the destination-name option, enter an unused name for the copied file.

Rename Files

Use the following command to rename a WAF policy file:

waf policy rename old-name new-name

page 116
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Customize WAF Policy Files

Delete Files

Enter the following command to delete a WAF policy file:

waf policy delete file-name

You cannot rename, edit, or delete default files. However, you can copy a default WAF policy file and
customize it to fit your specific demands.

Writing PCRE Expressions


The following section provides guidelines for writing WAF policy files which the WAF can use to search
for attack patterns or define policy rules.

General Guidelines
This section summarizes common characters used in PCRE expressions and provides a quick refer-
ence to basic PCRE syntax. To learn more about writing detailed PCRE expressions, consult outside
reference material.

Misconfigured PCRE expressions can negatively impact system performance. Do not apply a PCRE
expression to a WAF policy file unless you are certain the expression will achieve the desired result.

page 117
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Customize WAF Policy Files FFee
e

PCRE Characters

Table 7 describes frequently used characters in PCRE expressions.

TABLE 7 PCRE Characters


Character Purpose
\ Escape character.
^ Start of a subject or line.
$ End of a subject or line.
. Matches with any type of character.
- Character range. Use this symbol within square brackets.
For example, [a-f] will indicate the range a, b, c, d, e, f.
[ Start of a character class definition.
] End of a character class definition.
| Logical “or” operator.
For example, (yellow | red | orange) will return true if either yellow, red, or orange is
found.
( Start of a sub-pattern.
) End of a sub-pattern.
* Quantifier for a value of 0 or more.
+ Quantifier for a value of 1 or more.
{ Start of a minimum or maximum quantifier.
} End of a minimum or maximum quantifier.

Enclose Patterns

You can enclose patterns with any non-alphanumeric character that is not a backslash \ or whitespace.
You can also use special symbols that may otherwise carry an alternative function as long as the same
symbol is used in the beginning and end of the string.

Table 8 displays a few valid examples of enclosed expressions:

TABLE 8 PCRE Syntax – Enclose Patterns


Character Example
+ +positive+
/ /ahoy/
# #numeric#
% %percentages%
! !eep!

Basic Syntax

WAF policy files consist of PCRE expressions and comment lines. Lines with PCRE expressions are
structured as follows:

page 118
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Customize WAF Policy Files

name,PCRE expression

The name is a string which you can use to title the line. Follow the description with a comma “,” before
writing the PCRE expression. As shown below:

FromDefaultBlackList,^[^?]*[.]htx

NOTE: Everything following the comma is included in the PCRE expression. Do


not include whitespace unless this is intended as part of the expression.

Comments

To insert a comment into the policy file enter a pound character ‘#’ before the comment line.

example_expression,^[^?]*/[?]wp-
# comment
...

Alternatively, you can enter a comment in-line as follows:

(# comment)

The comment string is not recognized in pattern matching.

Example Applications
Outlined below are various examples of PCRE expressions.

Attack Patterns

You can create customized WAF policies with search criteria for attack
patterns.

• Use the " | " symbol as a separator in lists of elements. Traffic matches a policy rule if the traffic
matches any of the elements delimited by " | ". For example, "(apples | oranges)" is read as a sin-
gle object that can be triggered when either "apples" or "oranges" is found in traffic.
• Use parentheses to enclose each separate element. For example, the set of elements "(apples)
(oranges)" is read by WAF as two individual objects: an "apples" object and an "oranges" object.

The following example uses a segment of the “bot_defs” file.

(builtbottough|bunnyslippers|capture|cegbfeieh|cherrypicker|cheesebot|chinaclaw|cicc|civa|
clipping|collage|collector|copyrightcheck|cosmos|crescent|custo|cyberalert|deweb|diagem|di
gger|digimarc|diibot|directupdate|disco|dittospyder|download accelerator|download
demon|download wonder)

page 119
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Customize WAF Policy Files FFee
e

To add three additional known bots under the names “brewster”, “nook” and “peanut”, you would modify
the policy file similar to the following. The additions are indicated in bold:

(builtbottough|bunnyslippers|capture|cegbfeieh|cherrypicker|cheesebot|
chinaclaw|cicc|civa|clipping|collage|collector|brewster|nook|
copyrightcheck|cosmos|crescent|custo|cyberalert|deweb|diagem|
digger|digimarc|diibot|directupdate|disco|dittospyder|
download accelerator|download demon|download wonder|peanut)

Policy Rules

You can write WAF policy files to list more complicated policy rules. The following examples illustrate
the various rules that you can create as a PCRE expression.

The following example defines a rule for the URI Black List. The rule denies user requests to access the
image server at img.example.com directly:

^http://img[.]example[.]com$

The following example defines a rule for the URI Black List. The rule denies user requests 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)

The following PCRE expression looks for strings that resemble a California driver’s license ID number.
This policy rule can be used in conjunction with the PCRE mask option to mask strings that match the
expression:

[A-Za-z][0-9]{7,7}

page 120
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Configure an HTTP Policy Template

Overriding a WAF Template

You can configure ACOS to override the WAF settings applied to the HTTP/HTTPS virtual port with
another set of WAF settings, using an HTTP policy template. You can configure rules in the HTTP policy
template to match on URLs, hostnames, or cookie names in traffic.

To configure WAF override:

1. Configure a second WAF template with the alternative settings to use. See either of the following:
• Using the GUI – “Add/Edit a WAF Template” on page 60
• Using the CLI – “Create a WAF Template” on page 91
2. Configure an HTTP policy template. Within the template:
• Configure match rules. You can match on one or more of the following:
• Requested URL
• Requested hostname
• Cookie name within request
• Add (bind) the second WAF template to the HTTP policy template.
3. Bind the HTTP policy template to the virtual port.

NOTE: For the WAF to operate, it is still required to bind a WAF template directly
to the virtual port, to use as the virtual port’s primary WAF template.
HTTP policy templates can be used only to override the primary WAF
template with secondary WAF template, based on the match rules in the
HTTP policy template.

Configure an HTTP Policy Template


Within an HTTP policy template, you can configure rules that match on URLs, hostnames, or cookie
names. Requests that match a rule in the HTTP policy template are handled using the alternative WAF
template that you bind to the HTTP policy template.

Below are the match options:

page 121
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Configure an HTTP Policy Template FFee
e

• Equals string – matches only if the URL, hostname, or cookie name completely matches the
specified string.
• Starts-with string – matches only if the URL, hostname, or cookie name starts with the speci-
fied string.
• Contains string – matches if the specified string appears anywhere within the URL, hostname,
or cookie name.
• Ends-with string – matches only if the URL, hostname, or cookie name ends with the specified
string.

These match options are always applied in the order shown above, regardless of the order in which the
rules appear in the configuration. The WAF template associated with the rule that matches first is used.

If a template has more than one rule with the same match option (equals, starts-with, contains, or
ends-with) and a URL matches on more than one of them, the most-specific match is always used.

In addition to URLs, hostnames and cookies, HTTP policy also supports “geo-location”. Below is an
example of a geo location configuration with the assumption that waf-template-1 has been previously
configured.

ACOS(config)# gslb geo-location America.USA.LSG.LSG


ACOS(config-geo-location:America.USA.LSG.)# ip 100.100.100.1 mask 255.255.255.255
ACOS(config-geo-location:America.USA.LSG.)# exit
ACOS(config)# slb template http-policy waf-http-policy
ACOS(config-http-policy)# geo-location America.USA.LSG.LSG template waf waf-template-1
ACOS(config-http-policy)# exit
ACOS(config)# slb virtual-server vs-geo_location 100.17.3.70
ACOS(config-slb vserver)# port 80 http
ACOS(config-slb vserver-vport)# template http-policy waf-http-policy

Use the GUI to Configure an HTTP Policy Template


To configure a WAF HTTP policy template using the GUI:

1. Hover over Security on the menu bar, then select WAF.


2. Select the HTTP Policy tab.
3. Click Create.
4. Enter a name for the template in the Name field.
5. Configure match rules and other fields as desired; refer to the GUI online help for detailed
information about each field.
6. Click Create.

page 122
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Bind the HTTP Policy Template to the Virtual Port

Use the CLI to Configure an HTTP Policy Template


To configure an HTTP policy template, use the slb template http-policy command at the global con-
figuration level of the CLI. For more information about this command, refer to the Command Line Interface
Reference.

Below is an example of this command and HTTP policy template configuration:

ACOS(config)# slb template http-policy http-pol-temp1


ACOS(config-http-policy)# url contains exampledomain template waf waf-temp1

Bind the HTTP Policy Template to the Virtual Port


The HTTP policy does not take effect until you bind it to the HTTP/HTTPS virtual port.

Use the GUI to Bind the HTTP Policy Template to a Virtual Port
To bind the HTTP policy to an existing virtual port:

1. Hover over Security on the menu bar, then select WAF.


2. Select the Bindings tab.
3. Click Create.
4. Select the virtual server name, IP address, and port and protocol to which you will bind the tem-
plate.
5. In the HTTP Policy field, select the HTTP policy template you want to bind to the specified virtual
port.
6. Click Create.

Use the CLI to Bind the HTTP Policy Template to a Virtual Port
To bind a template to a virtual service port, create the VIP and the port, as well as the service group, and
then enter the template waf command at the configuration level for the port. For example:

ACOS(config)# slb virtual-server vs1 8.8.8.8


ACOS(config-slb vserver)# port 80 http
ACOS(config-slb vserver-vport)# template http-policy http-pol-temp1

For a complete CLI example, see “HTTP Virtual Port Configuration” on page 128.

page 123
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Bind the HTTP Policy Template to the Virtual Port FFee
e

page 124
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Displaying WAF Statistics

WAF Statistics

The sections of this chapter describe GUI and CLI procedures to display WAF statistics.

NOTE: Statistics counters increment from 0 after the most recent reboot or
from when the statistics were most recently cleared.

Displaying WAF Statistics

Use the GUI to View WAF Statistics


You can use the GUI to view global WAF statistics by:

1. Hover over Security in the menu bar, then select WAF.


2. Select the Global Stats tab.

Use the CLI to View WAF Statistics


From the CLI, use the show waf stats command to view statistics for a specific virtual server and vir-
tual port.

See “show waf stats” on page 164 for sample output.

Clearing WAF Statistics

Use the GUI to Clear WAF Statistics


You can use the GUI to clear global WAF statistics by:

1. Hover over Security in the menu bar, then select WAF.


2. Select the Global Stats tab.
3. Click Clear.

page 125
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Clearing WAF Statistics FFee
e

Use the CLI to Clear WAF Statistics


From the CLI:

• use the clear waf command to clear all “show waf” counters.

• use the clear waf stats command to clear statistics for a specific virtual server and virtual port.
See “clear waf stats” on page 175 for more information about this CLI command.

page 126
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Initial Configuration

WAF Deployment and Logging Examples

This chapter provides some examples for WAF deployment. Since logging is a crucial part of WAF con-
figuration and management of the WAF, the examples include applicable log messages.

The following examples are provided:

• “Initial Configuration” on page 127

• “Learning” on page 129

• “Response Header Filtering” on page 134

• “SQLIA Check” on page 136

• “Cross-site Scripting Check” on page 136

• “Cookie Encryption” on page 137

Initial Configuration
The commands in this example configure the following resources:

• Logging configuration

• WAF template

• HTTP virtual port

Logging Configuration
The commands in this section configure the resources required for external logging of WAF events.

To begin, the following commands configure external logging for the WAF. A single log server is used.
Log messages are sent over TCP.

A TCP-proxy template is used to periodically send keepalive probes to the syslog port on the server.
The keepalive probes prevent the TCP session from aging out during periods of inactivity.

The following commands create the server configuration and add it to a TCP service group:

ACOS(config)#slb server waf-log2 10.10.10.22


ACOS(config-real server)#port 514 tcp
ACOS((config-real server-node port)#exit

page 127
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Initial Configuration FFee
e

ACOS(config-real server)#exit
ACOS(config)#slb service-group waf-log tcp
ACOS(config-slb svc group)#member waf-log1 514

The following commands configure the TCP-proxy template, to enable keepalive messages:

ACOS(config)#slb template tcp-proxy logtcp


ACOS(config-tcp proxy)#keepalive-probes 4

The following commands configure the logging template. This includes binding the TCP-proxy tem-
plate to the logging template.

ACOS(config-slb)# slb template logging waf-log


ACOS(config-logging)# service-group waf-log tcp
ACOS(config-logging)# template tcp-proxy log tcp

WAF Template Configuration


The following commands create a WAF template and bind the logging template to the WAF template:

ACOS(config)# waf template waf1


ACOS(config-waf)# template logging waf-log

HTTP Virtual Port Configuration


The following commands configure an HTTP virtual port and bind the WAF template to the port.

To begin, the following commands create server configurations for the web servers to be load balanced
and protected by the WAF:

ACOS(config)# slb server http1 20.20.25.11


ACOS(config-real server)# port 80 tcp
ACOS(config-real server-node port)# exit
ACOS(config-real server)# exit
ACOS(config-waf)# slb server http2 20.20.25.12
ACOS(config-real server)# port 80 tcp
ACOS(config-real server-node port)# exit
ACOS(config-real server)# exit

The following commands add the server configurations to a service group:

ACOS(config)#slb service-group http tcp


ACOS(config-slb svc group)#member http1 80
ACOS(config-slb svc group)#member http2 80

page 128
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Learning

The following commands configure the virtual server and bind it to the service group and WAF
template:

ACOS(config)# slb virtual-server http-vip 20.20.25.130


ACOS(config-slb vserver)# port 80 http
ACOS(config-slb vserver-vport)# service-group http
ACOS(config-slb vserver-vport)# template waf waf1

At this point, the WAF is active.

Log Example

When done configuring, you can use the show log command to display log messages. These log mes-
sages indicate whenever a WAF template is updated, created, or deleted. Hypothetical log messages
are shown below for illustration purposes.

ACOS(config:8)#show log
Log Buffer: 30000
Mar 24 2016 15:37:12 Info [WAF]:CEF:1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:37:11|con-
fig|2|msg="Template waf-check-doc: buf-ovf max-hdr-value-len set to 65535"
Mar 24 2016 15:37:12 Info [VCS]:dcs config seq number increase (45,0,652)
Mar 24 2016 15:37:04 Info [WAF]:CEF:1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:37:03|con-
fig|2|msg="Template waf-check-doc: bot-check ON (policy-file=bot_defs)"
Mar 24 2016 15:37:04 Info [VCS]:dcs config seq number increase (45,0,651)
Mar 24 2016 15:37:02 Info [WAF]:CEF:1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:37:01|con-
fig|2|msg="Template waf-check-doc created"
Mar 24 2016 15:37:02 Info [VCS]:dcs config seq number increase (45,0,650)
Mar 24 2016 15:36:42 Info [WAF]:CEF:1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:36:41|con-
fig|2|msg="Template waf-check-doc deleted"

NOTE: If external logging has not been configured for the WAF, then the log
messages will appear in the local log buffer of the ACOS device.

Learning
The commands in this section use Learning Mode to dynamically set some WAF options based on traf-
fic.

NOTE: This example assumes that the VIP using the WAF template is not yet
receiving live traffic but is instead receiving known, valid traffic sent in
order to preset WAF parameters. The following caution explains why.

page 129
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Learning FFee
e

CAUTION: While Learning or Passive Mode is in operation, the WAF does not block
any traffic. Only Active Mode blocks traffic.

Enable Learning Mode


The following commands access the configuration level for the WAF template, and change the mode to
Learning Mode:

ACOS(config)# waf template waf1


ACOS(config-waf)# deploy-mode learning
Switching to learning mode will reset all WAF template parameters and may expose you to
attacks if done in a production environment.
Are you sure you wish to proceed? (N/Y): y

Generate Traffic
On a client device, the following requests are generated and sent to the HTTP virtual port:

curl -v http://20.20.25.130/tours/index.html
curl -v http://20.20.25.130/batblue.html
curl -v http://20.20.25.130/file_set/dir00000/about.html

View External Log


On the external log server, messages such as the following one indicate that the WAF is setting some
of its parameters based on the traffic:

Dec 22 17:13:03 CEF:0|A10|AX3200|2.7.1|WAF|http-check|2|src=20.20.25.10 spt=32462


dst=20.20.25.130 dpt=80 req="GET /tours/index.html HTTP/1.1" 0 msg="Learning: Updating
allowed HTTP methods" cs1=waf1 act=n md=learn

This message indicates that the GET method was observed in the first request sent to the HTTP virtual
port, and that the Allowed HTTP Methods list was updated with the method.

Here are some more examples:

Dec 22 17:13:03 CEF:0|A10|AX3200|2.7.1|WAF|buf-ovf|2|src=20.20.25.10 spt=32462


dst=20.20.25.130 dpt=80 req="GET /tours/index.html HTTP/1.1" 0 msg="Learning: Increasing
max-url-len from 0 to 17" cs1=waf1 act=n md=learn
Dec 22 17:13:03 CEF:0|A10|AX3200|2.7.1|WAF|buf-ovf|2|src=20.20.25.10 spt=32462
dst=20.20.25.130 dpt=80 req="GET /tours/index.html HTTP/1.1" 0 msg="Learning: Increasing
max-hdrs-len from 0 to 172" cs1=waf1 act=n md=learn
Dec 22 17:13:03 CEF:0|A10|AX3200|2.7.1|WAF|http-check|2|src=20.20.25.10 spt=32462
dst=20.20.25.130 dpt=80 req="GET /tours/index.html HTTP/1.1" 0 msg="Learning: Increasing
max-hdrs from 0 to 3" cs1=waf1 act=n md=learn
...

page 130
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Learning

View WAF Template Settings


The following command displays the current template settings:

ACOS(config-waf)# show default-running-config waf | section waf


waf template waf1
allowed-http-methods "GET POST"
bot-check
buf-ovf max-cookie-len 4096
buf-ovf max-cookie-name-len 64
buf-ovf max-cookie-value-len 4096
buf-ovf max-cookies-len 4096
buf-ovf max-data-parse 65536
buf-ovf max-hdr-name-len 63
buf-ovf max-hdr-value-len 4096
buf-ovf max-hdrs-len 4096
buf-ovf max-line-len 1024
buf-ovf max-parameter-name-len 256
buf-ovf max-parameter-total-len 4096
form-protection
form-check caching
...

NOTE: The HTTP header "Cache-Control: no-cache" cannot be inserted if the


form element is positioned beyond 128KB in the HTML.

Generate Allowed URL Paths for the URL Check


An additional WAF parameter you can set during Learning Mode is the URL Check. The URL Check pre-
vents users from navigating directly to any URL paths other than the ones explicitly defined by the URL
Check policy file.

To configure the URL Check:

1. Set the WAF to Learning Mode.


2. Enable the URL Check within a WAF template.
3. Send secure traffic to the website. This step will generate a WAF policy file containing acceptable
URL paths.
4. After the URL Check policy file has been generated, change the WAF operational mode to Active to
enforce the URL Check on client requests.

page 131
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Learning FFee
e

Configuration Example
The following example outlines steps for customizing the URL Check in learning mode and enforcing
the check for your website.

Create the URL Check Policy File

1. The following commands set the WAF to learning mode and enable the URL Check option in the
WAF template:
ACOS(config)# waf template w1
ACOS(config-waf)# deploy-mode learning
Switching to learning mode will reset all WAF template parameters and may expose you to
attacks if done in a production environment.
Are you sure you wish to proceed? (N/Y): Y
ACOS(config-waf)# url-check

NOTE: In this example, the WAF template “w1” is bound to a virtual server with
the IP address 192.168.25.130.

2. Send secure traffic from a client. In this example, traffic from the client is sent to the following
addresses:
http://192.168.25.130/tours/index.html
http://192.168.25.130/batblue.html
http://192.168.25.130/file_set/dir00000/about.html

3. Check the logs on the external log server. The log should contain a message such as the following,
for each URL path requested:
Mar 24 16:34:40 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:46:12|session-
id|2|src=172.17.3.100 spt=55150 dst=172.17.3.61 dpt=8080 hst="172.17.3.61:8080"
cs1=waf-url-check cs2=90f0c225f82e4cb8 act=learn md=passive svc=http req="GET /foooo/
rest/upload/aaa.txt HTTP/1.1" 0 msg="New session created: Id=90f0c225f82e4cb8"

4. The log will contain similar messages for each URL path clients are allowed to access. The follow-
ing commands verify that the URL Check policy file is created and display the contents of the file:
ACOS(config-waf)# show waf policy
Total WAF policy number: 14
Max WAF policy file size: 32K
Name Syntax Template
------------------------------------------------------------------------
_w1_url_check_ Check Bind
allowed_resp_codes Check Bind
bot_defs Check Bind
jscript_defs Check Bind
...

ACOS(config-waf)# show waf policy _w1_url_check_


Name: _w1_url_check_

page 132
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Learning

Syntax: Check

In WAF Template:
w1 (for url-check)

Content:
Matches Value
--------------------------------------------------------------------------
1 /tours/
1 /batblue.html
1 /file_set/dir00000/

Apply the URL Check

5. Change the WAF deployment mode. (See “Save Template Settings” on page 134.) When you
change the deployment mode from Learning Mode, ACOS writes the observed URL paths into a
policy file. The URL Check will start operating.
ACOS(config-waf)#waf template w1
ACOS(config-waf)#deploy-mode active

NOTE: In Passive Mode, requests for other URL paths still are allowed, but they
are logged. The URL path list is enforced only while the URL Check is
enabled and the WAF template is in Active Mode.

6. Optionally, edit the contents of the URL Check policy file to explicitly define acceptable URI paths.

NOTE: The contents of the URL Check policy file are first generated in Learning
Mode. After which you can remove or define additional URL paths in the
policy file. You cannot create the URL Check policy file without first
deploying a WAF template in Learning Mode with the URL Check
enabled.

Check Form Method on Response


7. Add configuration to check FORM method from Response and also rename current "NON-POST"
to "REQUEST-NON-POST" using the following commands on CLI.
ACOS(config)# waf template waf1
ACOS(config-waf)# form-protection
ACOS(config-waf-form-protection)# form-check request-non-post

page 133
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Response Header Filtering FFee
e

Save Template Settings


To “lock down” WAF template settings configured by Learning Mode, change the mode. The following
command changes to Passive Mode:

ACOS(config-waf)# deploy-mode passive

In Passive Mode, WAF checks are performed but the filter actions are not applied. Requests to the
HTTP virtual port are logged but are sent to the server without being altered. (For more information, see
“WAF Operational Modes” on page 49.)

Response Header Filtering


Header Response Filtering removes the web server’s identifying headers in outgoing responses. This
information can be exploited by hackers to send an attack targeted specifically to your server’s operat-
ing system (OS).

Header That Includes OS-identifying Fields

Here is an example of header fields in the HTTP response from a server. The fields shown in bold pro-
vide information about the server OS.

< HTTP/1.1 200 OK


< Transfer-Encoding: chunked
< Content-Type: text/html
< Server: hpd
< X-Powered-By: Cavisson
< X-AspNet-Version: 1.0
< X-AspNetMvc-Version: 2.0
< Cache-Control: public, max-age=100
< Age: 52
< Via: AX-CACHE-2.7:130
<
...

Header Without OS-identifying Fields

Here is the same excerpt from the server response, with the OS-identifying headers removed:

< HTTP/1.1 200 OK


< Transfer-Encoding: chunked
< Content-Type: text/html
< Cache-Control: public, max-age=100
< Age: 0

page 134
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Response Header Filtering

< Via: AX-CACHE-2.7:130


...

The response received by the client does not contain the OS-identifying headers.

Enable Header Response Filtering


The following commands access the configuration level for the WAF template and enable Header
Response Filtering:

ACOS(config)#waf template waf1


ACOS(config-waf)#filter-resp-hdrs

View External Log


Messages in the external WAF log indicate when header fields are removed by Header Response Filter-
ing:

Mar 24 16:39:12 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:50:44|session-


id|2|src=172.17.3.100 spt=50621 dst=172.17.3.73 dpt=8080 hst="172.17.3.73:8080" cs1=waf-
filter-resp-hdrs cs2=8c59ef7fc665dbb act=learn md=active svc=http req="GET /hello.php
HTTP/1.1" 0 msg="New session created: Id=8c59ef7fc665dbb"
Mar 24 16:39:12 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:50:44|filter-resp-
hdrs|6|src=172.17.3.100 spt=50621 dst=172.17.3.73 dpt=8080 hst="" cs1=waf-filter-resp-hdrs
cs2=8c59ef7fc665dbb act=sanitize md=active svc=http req="GET /hello.php HTTP/1.1" 135
msg="Header Server filtered"
Mar 24 16:39:12 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 15:50:44|filter-resp-
hdrs|6|src=172.17.3.100 spt=50621 dst=172.17.3.73 dpt=8080 hst="" cs1=waf-filter-resp-hdrs
cs2=8c59ef7fc665dbb act=sanitize md=active svc=http req="GET /hello.php HTTP/1.1" 135
msg="Header X-Powered-By filtered"
Mar 24 16:39:12 173.17.3.14 A10
Mar 24 16:39:12 200.0.0.14 A10

page 135
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
SQLIA Check FFee
e

SQLIA Check
The SQLIA Check protects against SQL commands hidden in requests sent to database servers. The
check looks for SQL code in form arguments, URLs, and cookies. In general, these places are not sup-
posed to contain SQL code.

Enable the SQLIA Check


The following commands access the configuration level for the WAF template and enable the SQLIA
Check. In this example, the sanitize option is used. This option removes the SQL and then forwards
the request.

ACOS(config)#waf template waf1


ACOS(config-waf)#sqlia-check sanitize

View External Log


The following log messages indicates that SQL was detected in a request:

Mar 24 17:13:21 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 16:24:52|session-


id|2|src=172.17.3.100 spt=44427 dst=172.17.3.57 dpt=8080 hst="172.17.3.57:8080" cs1=waf-
sql-check-sanitize cs2=61b6f0af51703b87 act=learn md=active svc=http req="GET /
hello.php?aa=bb-- HTTP/1.1" 0 msg="New session created: Id=61b6f0af51703b87"
Mar 24 17:13:21 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 16:24:52|sqlia-
check|6|src=172.17.3.100 spt=44427 dst=172.17.3.57 dpt=8080 hst="172.17.3.57:8080"
cs1=waf-sql-check-sanitize cs2=61b6f0af51703b87 act=sanitize md=active svc=http req="GET /
hello.php?aa=bb-- HTTP/1.1" 0 msg="SQLIA pattern detected! bb-- matches #1 in rule1 sani-
tizing.."
Mar 24 17:13:22 1730::14 A10

Cross-site Scripting Check


The Cross-site Scripting Check (XSS Check) protects against cross-site scripting attacks.

Enable the XSS Check


The following commands access the configuration level for the WAF template and enable the XSS
Check. In this example, the reject option is used. This option logs the XSS attempt and then drops the
request instead of forwarding it to the server.

ACOS(config)#waf template waf1

page 136
ACOS 5.1.0 Web Application Firewall Guide
Feedback
Cookie Encryption

ACOS(config-waf)#xss-check reject

View External Log


The following log message indicates that an XSS attempt was detected and denied:

Mar 24 17:17:03 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 16:28:35|session-


id|2|src=172.17.3.100 spt=58140 dst=172.17.3.54 dpt=81 hst="172.17.3.54:81" cs1=waf-xss-
check cs2=ffde33f6ff0dfa70 act=learn md=active svc=http req="POST /digest.html HTTP/1.1" 9
msg="New session created: Id=ffde33f6ff0dfa70"
Mar 24 17:17:03 CEF: 1|A10|AX3030|4.1.0|WAF|Mar 24 2016 16:28:35|xss-
check|6|src=172.17.3.100 spt=58140 dst=172.17.3.54 dpt=81 hst="172.17.3.54:81" cs1=waf-
xss-check cs2=ffde33f6ff0dfa70 act=deny md=active svc=http req="POST /digest.html HTTP/
1.1" 9 msg="Javascript pattern detected! applet matches #1 in a1"
Mar 24 17:17:04 173.17.3.221 A10

Since the reject option is used in the configuration, a Deny page such as the one in “Deny page” on
page 137 is sent to the client.

FIGURE 37 Deny page

Cookie Encryption
Cookie Encryption protects against cookie tampering by encrypting cookies before sending server
replies to clients.

You can enable encryption based on specific cookie names or for all cookies that match a PCRE
expression. The encryption uses a secret string to decrypt and encrypt cookies that are transferred
between the web server and client.

page 137
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
Cookie Encryption FFee
e

The following commands access the configuration level for WAF template “resetti” and configure
encryption for all cookies containing “hiddencookie” in the name:

ACOS(config)# waf template resetti


ACOS(config-waf)# cookie-encrypt ".*hiddencookie" r0cc0

The secret value “r0cc0” is used for encryption. To view the encrypted value created by the WAF and
used in responses, display the configuration:

ACOS(config-waf)# show default-running-config | section waf


waf template waf1
...
cookie-encrypt ".*hiddencookie" secret-encrypted m3nvbYs/EBg8EIy41dsA5zwQjLjV2wDnPBCMuNX-
bAOc8EIy41dsA5zwQjLjV2wDn
...

NOTE: Do not enter the secret-encrypted option when configuring this check.
This option is placed into the configuration by the WAF to indicate that
the string is the encrypted form.

page 138
ACOS 5.1.0 Web Application Firewall Guide
Feedback

WAF Template Reference

WAF templates allow you to easily enforce the following security filters.

Table 9 lists the parameters you can configure.

NOTE: This manule is a reference. For configuration procedures, see either of


the following:

“Configuring the WAF Using the GUI” on page 57

“Configuring the WAF Using the CLI” on page 91

page 139
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
FFee
e

TABLE 9 WAF Template Options


Parameter Description and Syntax Supported Values
General Fields
Template Name of the WAF template in the ACOS config- String
Name uration.
[no] waf template template-name Default: Not set
GUI:

Security > WAF > WAF Templates >


Create
Deployment Sets the operational mode for the WAF tem- You can select one of the following:
Mode plate.
• Active – Standard operational mode.
[no] deploy-mode You must use Active Mode if you want
{active | passive | learning} the WAF to sanitize or drop traffic
based on the configured WAF policies.

• Passive – Provides passive WAF oper-


GUI: ation. All enabled WAF checks are
applied, but no WAF action is per-
Security > WAF > WAF Templates > formed upon matching traffic. This
Create , and then select the Deploy Mode mode is useful in staging environ-
drop-down. ments to identify false positives for fil-
tering.
(For more information, see “WAF Operational
Modes” on page 49.) • Learning – Provides a way to initially
set the thresholds for certain WAF
checks based on known, valid traffic.

Default: Active Mode


Logging Applies a configured logging template to the Name of a logging template
WAF template. See “WAF Event Logging” on
page 103. Default: None selected

[no] template logging template-name

GUI:

Security > WAF > WAF Templates >


Create , and then select the Logging Tem-
plate drop-down.
Request Checks

page 140
ACOS 5.1.0 Web Application Firewall Guide
Feedback

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
URI White List Enforces the rules contained within a WAF pol- Name of a WAF policy file
icy file for the URI White List. For more informa-
tion about URI White Lists, see “URI White List” Default: uri_wlist_defs
on page 114.

[no] uri-wlist-check file-name

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Requests Check menu, and select the
checkbox for URI White List Check .

URI Black List Enforces the rules contained within a WAF pol- Name of a WAF policy file
icy file for the URI Black List. For more informa-
tion about URI Black Lists, see “URI Black List” Default: uri_blist_defs
on page 113.

[no] uri-blist-check file-name

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Requests Check menu, and select the
checkbox for URI Black List Check .

Deny Action WAF response sent to the client if traffic is One of the following:
denied by the WAF template.
• http-resp-403 – Sends a 403 Forbid-
[no] deny-action options den response to the client. The default
resp-string string returns a generic “Request
Denied!” page to the client.
GUI:
• http-resp-200 – Sends a 200 OK
Security > WAF > WAF Templates > response to the client with the speci-
+Add/Edit WAF Template , and then select fied resp-string. The default string
the HTTP Protocol Checks menu, and returns a generic “Request Denied!”
select the Allowed HTTP Methods page to the client.
multi-selection list and deselect methods not
allowed. • http-redirect – Redirects the client
to the specified URL.

• reset-conn – Sends a TCP RST to


the client to end the connection.

Default: http-resp-403

page 141
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
FFee
e

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
Allowed HTTP Checks requests to ensure they contain only Valid HTTP method names:
Methods the HTTP methods that are allowed by this
option. • GET
[no] allowed-http-methods
method-name • POST

• HEAD
GUI:
• PUT
Security > WAF > WAF Templates > • OPTIONS
+Add/Edit WAF Template , and then select
the Request Checks menu, and in the • DELETE
Allowed HTTP Methods field, click the
desired methods to highlight them. • TRACE

• CONNECT

• PURGE

Default: GET, POST


Bot Check Checks the user-agent of incoming requests for Name of a WAF policy file
known bots. This check uses the list of defined
bots in the specified WAF policy file. See “Bot Default: bot_defs
Check” on page 112.
Default: Disabled
[no] bot-check file-name

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Request Checks menu. Then select the
Bot Check checkbox, and from the drop-
down menu that appears, select the Bot
Check Policy File .

page 142
ACOS 5.1.0 Web Application Firewall Guide
Feedback

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
Disable Buffer Checks for attempts to cause a buffer overflow Enabled or Disabled
Overflow on the web server.
Protection • Max Cookie Length – Sets the maximum The maximum accepted URL length can
length for cookies, cookie names, and/or be set between 0 to 16127. The maxi-
cookie values allowed in a request. mum accepted length for all other limits
can be set between 0 to 65535.
• Max Headers Length – Sets the maximum
header length for headers, header names, Default: Enabled
and/or header values allowed in requests.
If enabled, the following default values
• Max Line Length - Sets the maximum length apply:
for lines.
• Max Cookie Length – 4,096
• Max Parameters Length - Sets the maximum
parameter length allowed for the total param- • Max Cookie Name Length - 64
eters, the parameter names, and/or the
parameter values. • Max Cookie Value Length - 4,096

• Max Post Size – Sets the maximum content • Max Total Cookies Length - 4,096
length allowed in HTTP POST requests.
• Max Data To Parse - 65,536
• Max Query Length - Sets the maximum
length for queries. • Max Header Name Length - 64

• Max URL Length – Sets the maximum URL • Max Header Value Length - 4,096
length allowed in requests.
• Max Header Length – 4,096
[no] buf-ovf
{disable | • Max Line Length - 1,024
max-cookie-len |
max-cookie-name-len | • Max Parameter Name Length - 256
max-cookie-value-len |
max-cookies-len | • Max Parameter Total - 4,096
max-data-parse |
max-hdr-name-len • Max Parameter Value Length - 4,096
max-hdr-value-len |
max-hdrs-len | • Max Query Length - 1,024
max-line-len |
max-parameter-name-len | • Max URL Length – 1,024
max-parameter-total-len |
max-parameter-value-len | • Max POST content size – 20,480
max-post-size |
max-query-len |
max-url-len} [bytes]
[no] max-parameters
GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and select the
Data Leak Prevention menu.

page 143
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
FFee
e

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
Cross-Site Tags fields of a web form to protect against Enabled or Disabled
Forgery (CSRF) cross-site request forgery (CSRF).
Check Default: Disabled
[no] csrf-check

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and select the
Form Protection menu. Then select the
checkbox for CSRF Check .

Form Checks that user input to form fields is consist- Enabled or Disabled
Consistency ent with the intended format.
Check Default: Disabled
[no] form-consistency-check

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and select the
Form Protection menu. Then select the
checkbox for Form Consistency Check .

HTTP Check Checks that user requests are compliant with Enabled or Disabled
HTTP protocols.
Default: Disabled
[no] http-check

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Request Checks menu. Then select the
checkbox for HTTP Check .

Session Check Checks that user requests match a unique ses- 1-1440
sion ID created for them.
Default: 10
[no] session-check [secs]

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Session Checks menu. Then select the
checkbox for Session Check , and from the
Session Check Lifetime field that appears,
enter the session lifetime in minutes.

page 144
ACOS 5.1.0 Web Application Firewall Guide
Feedback

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
Max Cookies Specifies the maximum number of cookies a 0-63
request can contain.
[no] max-cookies num Default: 20
GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Data Leak Protection menu. Then
enter the number in the Max Cookies field.

Max Headers Specifies the maximum number of headers a 0-255


request can contain.
[no] max-hdrs num Default: 20
GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Data Leak Protection menu. Then
enter the number in the Max Request
Headers field.

Max HTML Specifies the maximum number of parameters 0-1024


Parameters a request can contain.
[no] max-parameters num Default: 64
GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Data Leak Protection menu. Then
enter the number in the Max HTML Param-
eters field.

page 145
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
FFee
e

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
Referer Check Validates that the referrer header in a request One of the following:
contains web form data from the specified web
server, rather than from an outside website. • Enabled
This check protects against CSRF attacks.
• Enabled – Always validates the referrer • Disabled
header. If selected, the request fails the check
if there is no referrer header or if the referrer • Only-If-Present
header is invalid.
If this check is activated, you can set the
• Disabled – Configures WAF to not validate following additional options:
requests based on the referrer header.
• Allowed Referer Domains – String
• Only-If-Present – Validates the referer header
only if a referrer header exists. If the check • Safe URL – String
finds an invalid referrer header, the request
fails the check. However, the request does Default: Disabled
not fail the check if there is no referrer header
in the request.

[no] referer-check
{enable | only-if-present}

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Request Checks menu. Then select the
checkbox for Referer Check .

SQL Injection Checks for SQL strings to protect against SQL One of the following:
Attack (SQLIA) injection attacks. This check uses the list of
Check defined SQL commands in the “sqlia_defs” WAF • Reject
policy file. See “SQL Injection Attack Check” on
page 112. • Disabled

[no] sqlia-check • Sanitize


{reject | sanitize}
Definition – Name of a configured WAF
GUI: policy file

Security > WAF > WAF Templates > Default: Disabled


+Add/Edit WAF Template , and then select
the Injection Checks menu. Then select the
Sanitize or Reject radio button.

page 146
ACOS 5.1.0 Web Application Firewall Guide
Feedback

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
Cross-site Checks for potential HTML XSS scripts to pro- One of the following:
Scripting (XSS) tect against cross-site scripting attacks. This
Check check uses the list of defined Javascript com- • Reject
mands in the “jscript_defs” WAF policy file. See
“XSS Check” on page 112. • Disabled

[no] xss-check • Sanitize


{reject | sanitize}
Default: Disabled
GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Form Protection menu. Then select the
checkbox for CSRF Check .

URL Check Select this option to prevent users from access- Enabled or Disabled
ing the URLs of your website directly. The URL
Check allows users to only access web pages Default: Disabled
by clicking a hyperlink on your protected web-
site.
Note: In the current release, the approved URL
path list for the URL Check can be configured
only using Learning Mode. For a deployment
example that includes configuration of the URL
Check, see “Generate Allowed URL Paths for the
URL Check” on page 131.
[no] url-check

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Request Checks menu. Then select the
checkbox for URL Check .

page 147
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
FFee
e

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
URL Options Use this command to normalize request URLs. Enabled or Disabled
This helps shorten the URLs and helps protect
web servers from attacks that hide in the non- Default: Disabled
normalized, recursive encoding of the data.

One example of such an attack is the so-called


directory traversal attack, which exploits non-
sanitized file names in order to gain access to
sensitive directories or unauthorized files.

See “Normalization Enhancements for URL


Options” on page 23.

URL Normalization Options include:

• Decode Entities

• Decode Escaped Characters

• Decode HEX Characters

• Comment Removal

• Remove Self-References

• Remove Spaces

[no] url-options

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Request Checks menu.

Response Checks
CCN Mask Replaces all but the last four digits of credit Enabled or Disabled
card numbers with an “x” character.
Default: Disabled
[no] ccn-mask

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Data Leak Prevention menu, and
select the CCN Mask checkbox.

page 148
ACOS 5.1.0 Web Application Firewall Guide
Feedback

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
SSN Mask Replaces all but the last four digits of US Social Enabled or Disabled
Security numbers with an “x” character.
Default: Disabled
[no] ssn-mask

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Data Leak Prevention menu, and
select the SSN Mask checkbox.

Filter Response Removes the web server’s identifying headers Enabled or Disabled
Headers in responses. By default, this check uses the
“allowed_resp_codes” WAF policy file for a list Default: Disabled
of accepmenule HTTP response codes.

[no] filter-resp-hdrs

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Data Leak Prevention menu, and
select the Filter Response Headers
checkbox.

Hide Response “Cloaks” your web servers by hiding response Enabled or Disabled
Codes codes from them instead of forwarding them to
the client. Default: Disabled

[no] hide-resp-codes Definition – Name of a configured WAF


waf-policy-file-name policy file

GUI: If disabled, the default policy file


is “allowed_resp_codes”
Security > WAF > WAF Templates >
+Add/Edit WAF Template , and then select
the Server Filter Checks menu, and select
the Hide Response Codes checkbox.

page 149
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
FFee
e

TABLE 9 WAF Template Options (Continued)


Parameter Description and Syntax Supported Values
PCRE Mask Cloaks patterns in a response that match the You can specify the following options:
specified PCRE pattern.
• PCRE Pattern – Valid string
• PCRE Pattern – Specifies the pattern to
search for in responses. • Mask – Single character

• Mask – Selects a character to mask the • Keep Start – 0-65535


matched pattern of a string.
• Keep End – 0-65535
• Keep Start – Sets the number of unmasked
characters at the beginning of the string. Default:

• Keep End – Specifies the number of • PCRE Pattern – Not set


unmasked characters at the end of the string.
• Mask – x
[no] pcre-mask pcre-pattern
[keep-end num-length | • Keep Start – 0
keep-start num-length |
mask character ] • Keep End – 0

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Data Leak Prevention menu.

Cookie Encryp- Uses the specified Secret string to encrypt and Cookie Name – String or PCRE expres-
tion Secret decrypt cookies in server to client communica- sion
tion. For Cookie Name, you can enter the name
of a specific cookie as a string, or a PCRE Cookie Encryption Secret – String
expression to encrypt all cookies which match
the expression. Default: Not set

[no] cookie-encrypt
{cookie-name | pcre-pattern}

GUI:

Security > WAF > WAF Templates >


+Add/Edit WAF Template , and then select
the Cookie Security menu.

page 150
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

WAF CLI Command Reference

This chapter lists the CLI commands for WAF. The commands are organized into the following section:

• “WAF Template Commands” on page 151

• “WAF File Management Commands” on page 176

WAF Template Commands


The commands in this section configure WAF template parameters:

• waf template

• show waf stats

• clear waf stats

page 151
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

waf
Description Enable WAF related commands for global, policy, template, WSDL, or XML
schema.

Syntax waf {global | policy | update | wsdl | xml-schema}

Parameter Description
global WAF global statistics sampling.
policy Manage WAF Policy files.
template Manage WAF template configuration.
wsdl Manage Web Services Definition Language files.
xml-schema Manage XML-Schema files.

Default NA

Mode Global Configuration Mode

Usage Various options

waf template
Description Configure a WAF template.

Syntax [no] waf template template-name

Parameter Description
template-name Name of the template.

This command changes the CLI to the configuration level for the specified
WAF template, where the following commands are available.

page 152
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

Command Description
[no] brute-force-pro- Configures protection against brute-force attacks. The sub-options for this
tection command include the following:

• challenge-actions option – Determines if the client is automated.

• cookie – This option determines if the client allows cookies.

• javascript – This options checks if javascript can be added to the


response to test if the client allows javascript.

• challenge-limit num – Specifies the maximum number of triggers that


can occur within the test period. If this limit is breached, then the WAF initi-
ates all of the configured challenge-actions against the client.
Setting this field to zero disables the feature and the challenge is never sent.
Specify a value from 0-65535. The default is 2.

• global – When enabled, this option causes the WAF to maintain a single
counter for all clients, as opposed to having a separate counter for each cli-
ent. When enabled, all clients are locked out for the configured lockout-period
once the lockout-limit is reached. Similarly, all responses include a challenge
once the challenge-limit is reached. This option is disabled by default.

• lockout-limit num – This option sets the maximum number of brute-force


events (or triggers) that can occur within the test period. If the limit exceeds,
the WAF denies all future requests from the client. Specify a value from 0-
65535; default value is 5. If the lockout limit is set to zero, the clients are
never locked out.
The lockout-limit is a learned parameter, so it will be set to the maximum
number of triggers within a test period seen during learning mode.

• lockout-period num – This option sets the number of seconds that a client
should be locked out. Specify a value from 0-1800; default is 600.

• response-codes name – This option triggers a brute-force check based on


the HTTP response code. Specify the name of the WAF policy that will be
used to define which response codes will trigger brute force checking.
Configure the policy file prior to setting this parameter, and it must contain a
set of regular expressions that are matched against the response status-
code.

• response-headers name – This option triggers a brute-force check based


on the HTTP response header names. Specify the name of the WAF policy
that will be used to define which response headers will trigger brute force
checking. Configure the policy file prior to setting this parameter, and it must
contain a set of regular expressions that are matched against the response
header names.

• response-reason-phrase name – This option triggers a brute-force check


based on the HTTP response string. Specify the name of the WAF policy that
will be used to define which response line messages will trigger brute-force
checking. Configure the policy file prior to setting this parameter, and it must
contain a set of regular expressions that will be matched against the
response line messages. This option is disabled by default.

• test-period num – This option sets the number of seconds between clear-
ing of the brute-force counters. The range is 0-600; default is 60.

• enable – This option enables brute force protections.

• disable – This option disables brute force protections. This is the default
option.

page 153
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

Command Description
[no] cookie-security Configures protection to secure cookies. The sub-options for this command
include the following:
• add-http-only – This option adds ‘HttpOnly’ flag to cookies that are not in
the set-cookie-policy list. The option is ‘ON’ by default.

• add-secure – This option adds ‘Secure’ flag to cookies that are not in the
set-cookie-policy list. The option is ‘ON’ by default.

• encrypt secret – This option encrypts the cookies that are not in the set-
cookie-policy list.

• grace-period num – This option allows unrecognized cookies for a period


of time specified after the cookie encryption is applied. The default value is
120 minutes.

• session-cookie-only – Only session cookies are encrypted.

• set-cookie policy name allow [add-http-only] [add-secure]


[encrypt <secret>] – Set the policy for cookies in set-cookie header.
[no] csp option Configures inserting HTTP header Content-Security-Policy, if necessary. The
options for this command include the following:
• name – Enter CSP header value.
• insert-if-not-exist – This option inserts the header when it does not
exist.
• insert-always – This option inserts the header even if header with the
same name exists.
[no] data-leak-preven- Configures prevention of data leak. The options for this command include the
tion following:
• ccn-mask – This option masks credit card numbers.

• pcre-mask – This option masks PCRE pattern.

• ssn-mask – This option scans content for strings that resemble US Social
Security numbers and replaces all but the last four characters of the string
with “x” characters. The feature is disabled by default.
[no] deny-action option Configures the action to be taken when the request is denied. The options for
this command include the following:
• http-redirect – This option sends a 302 Found redirection address to the
client with the URL specified in the url-string.

• http-resp-200 – This option sends a 200 OK response to the client with


the specified resp-string. The default string returns a generic “Request
Denied!” page to the client.

• http-resp-403 – This option sends a 403 Forbidden response to the client.


The default string returns a generic “Request Denied!” page to the client
(default).

• rest-conn – This option resets the client connection.

page 154
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

Command Description
[no] deploy-mode option Configures deployment mode of WAF. The options for this command include
the following:
• active – This option is the standard operational mode. Use active mode if
you want the WAF to sanitize or drop traffic based on the configured WAF
policies. This is the default option.

• passive – This option provides passive WAF operation. All enabled WAF
checks are applied, but no WAF action is performed upon matching traffic.
This mode is useful in staging environments to identify false positives for fil-
tering.

• learning – This option deploys WAF in learning mode. It provides a way to


initially set the thresholds for certain WAF checks based on known, valid traf-
fic.
[no] evasion-check Configures request for HTTP protocol compliance. The sub-options for this
command include the following:
• apache-whitespace – This option checks for whitespace characters in
the URL.

• decode-entities – This option decodes entities in the internal URL.

• decode-escaped-chars – This option decodes escaped characters such


as \r \n \" \xXX \u00YY in the internal URL.

• decode-plus-chars – This option decodes + as space in URL.

• decode-unified-chars – This option checks evasion attempt using %u


encoding of Unicode characters to bypass.

• dir-traversal – This option checks attempts for directory traversal.

• .high-ascii-bytes – This option checks evasion attempt using ASCII


bytes with values.

• invalid-hex-encoding – This option checks for evasion attempt using


invalid hex characters (not in 0-9,a-f).

• multiple-slashes – This option checks evasion attempt using multiple


slashes/backslashes.

• remove-comments – This option removes comments from internal URL.

• remove-spaces – This option removes spaces from internal URL.

page 155
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

Command Description
[no] form-protection Configures web form protection. The sub-options for this command include the
following:

• csrf-check – This option tags the fields of a web form to protect against
Cross-Site Request Forgery (CSRF). By default, it is disabled.

• field-consistency-check – This option verifies that the user input to form


fields is consistent and in the intended format.

• form-check option – This option checks for the entire form.

• caching – This option disables caching for response with forms.


Note: The HTTP header “Cache-Control: no-cache” cannot be inserted if
the form element is positioned beyond 128KB in the html.

• non-ssl– This option checks whether SSL is used for response with
forms.

• request-non-post – This option checks whether POST is used for


request with forms.

• response-non-post – This option checks whether form method POST is


used for response with forms.

• sanitize – This option changes form method GET to POST (A10


recommends to use this option with caution. Ensure that the server
application works after using this option.)

• password-check option – This option checks for the password in the form.

• autocomplete – This option checks protection against server-generated


form which contains password fields that allow autocomplete.

• non-masked – This option checks forms that have a password field with a
textual type resulting in this field being unmasked.

• non-SSL – This option checks forms that has a password field if the form
is not sent over an SSL connection.

page 156
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

Command Description
[no] http-limit-check Configures HTTP limit check. The sub-options for this command include the
following:

• max-content-length num – This option sets the maximum content length


allowed. Default value is 4096.

• max-cookie-header-length num – This option sets the maximum cookie


header length allowed in the request. Default value is 4096.

• max-cookie-name-length num – This option sets the maximum cookie


name length allowed in the request. Default value is 64.

• max-cookie-value-length num – This option sets the maximum cookie


value length allowed in the request. Default value is 4096.

• max-cookies num– This option sets the maximum number of cookies


allowed in the request. Default value is 256.

• max-cookies-length num – This option sets the total length of cookies


allowed in the request. Default value is 4096.

• max-entities num – This option sets the maximum number of MIME enti-
ties allowed in the request. Default value is 10.

• max-header-length num – This option sets the maximum header length


allowed in the request. Default value is 4096.

• max-header-name-length num – This option sets the maximum header


name length allowed in the request. Default value is 64.

• max-header-value-length num – This option sets the maximum header


value length allowed in the request. Default value is 4096.

• max-headers num – This option sets the total number of headers allowed in
the request. Default value is 64.

• max-headers-length num – This option sets the total length of headers


allowed in the request. Default value is 4096.

page 157
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

Command Description
[no] http-limit-check • max-param-name-length num – This option sets the maximum query/ POST
(continued) parameter name length allowed in the request. Default value is 256.

• max-param-value-length num – This option sets the maximum query/


POST parameter value length allowed in the request. Default value is 4096.

• max-params num – This option sets the total number of query/POST allowed
in the request. Default value is 64.

• max-params-length num – This option sets the total length of query/POST


parameters allowed in the request. Default value is 4096.

• max-post-length num – This option sets the maximum content length


allowed in the POST request. Default value is 20480.

• max-query-length num – This option sets the maximum length of query


string allowed. Default value is 4096.

• max-request-length num – This option sets the maximum length of


request. Default value is 20480.

• max-request-line-length num – This option sets the maximum length of


request line. Default value is 4096.

• max-url-length num – This option sets the maximum length of the URL.
Default value is 4096.

page 158
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

Command Description
[no] http-protocol- Configures HTTP protocol check. The sub-options for this command include
check the following:
• allowed-headers name – This option lists the allowed HTTP headers.
Default is "".

• allowed-methods name – This option lists the allowed HTTP methods.


Default is "GET POST".

• allowed-versions option – This option lists the HTTP versions allowed.

• 0.9 – HTTP/0.9

• 1.0 – HTTP/1.0

• 1.1 – HTTP/1.1

• 2 – HTTP/2

• bad-multipart-request – This option checks for bad multipart/form-data


request body.

• get-with-content – This option checks for GET request with content-


length headers in request.

• head-with-content – This option checks for HEAD request with content-


length headers in request.

• host-header-with-ip – This option checks for Host header with IP


address.

• invalid-url-encoding – This option checks for invalid URL encoding in


request.

• malformed-content-length – This option checks for malformed content


length in request.

• malformed-header – This option checks for malformed HTTP header.

• malformed-parameter – This option checks for malformed HTTP query/


POST parameter.

• malformed-request – This option checks for malformed HTTP request.

• malformed-request-line – This option checks for malformed HTTP


request line.

• missing-header-value – This option checks for missing header value in


request.

• missing-host-header – This option checks for missing Host header in


HTTP/1.1 request.

• multiple-content-length – This option checks for multiple content-


length headers in request.

• post-with-0-content – This option checks for POST request with content-


length 0.

• post-without-content – This option checks for POST request without any


content-length or chunk encoding headers in request.

page 159
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

Command Description
[no] json-check Configures check for incoming json requests. The sub-options for this com-
mand include the following:

• format-check – This option examines the format of incoming JSON


requests, checks for compliance with RFC 4627, and blocks requests if the
JSON content is not well-formed.

• max-array-values num – This option limits the maximum number of values


within a single array from 0–4096. The default value is 256.

• max-depth num – This option limits the maximum depth in a JSON value to
a maximum recursion depth ranging from 0–4096. The default value is 16.

• max-object-members num – This option limits the number of members


allowed in a JSON object. Range is 0–4096 and the default value is 256.

• max-string-length num – This option limits the length of a string (in bytes)
in a JSON request for a name or a value. Range is 0–4096 and the default
value is 64.
[no] log-succ-reqs Enabling this option creates a log debug message on the successful comple-
tion of WAF requests, and not just for errors.

page 160
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

Command Description
[no] request-check Configures request check. The sub-options for this command include the fol-
lowing:

• bot-check name– This option checks user-agent of incoming requests for


known bots.

• command-injection-check option – This option checks for protection


against command injection attacks.

• cookies – This option checks for Command Injection in http cookies.

• form-body – This option checks for Command Injection in Form Body.

• headers – This option checks for Command Injection in HTTP headers.

• uri-query – This option checks for Command Injection in uri query argu-
ments.

• redirect-whitelist – This option enables protection against unvalidated


redirects, which can occur if a hacker uses social networking to trick unsus-
pecting users into clicking on a malicious hyperlink. When enabled, the WAF
pre-learns a white-list of acceptable locations to which users can safely be
redirected. If one of the web servers gets hacked and attempts to redirect a
user to a location that does not appear in the redirect whitelist, then the WAF
blocks the redirect.
The WAF must be deployed in Learning Mode when the redirect-whitelist CLI
command is used for the first time so that the list of acceptable locations
can be built up.

• referer-check – This option validates that the referer header in a request


contains web form data from the specified web server, rather than from an
outside website. This check protects against CSRF attacks.

• session-check – This option enables session checking via session cookie.

• sqlia-check – This option checks for protection against SQL injection


attacks.

• url-blacklist – This option specifies the name of the WAF policy list file to
blacklist.

• url-learned-list – This option checks URL against list of previously


learned URLs.

• url-whitelist – This option specifies the name of the WAF policy list file to
whitelist.

• xss-check – This option checks for protection against cross-site scripting


attacks.
[no] response-cloaking Configures response cloaking. The sub-options for this command include the
following:

• filter-headers – This option removes web server’s identifying headers.

• hide-status-codes name – This option hides the response status codes


that are not allowed for the WAF policy list file specified. The default value is
4xx, 5xx.
[no] soap-format-check Configures XML document check for SOAP format compliance.

page 161
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

Command Description
[no] template option The option for this command include the following:
• logging - Applies a configured logging template to the WAF template.
[no] user-tag name Configures the customized tag.
[no] xml-check Configures XML check. The sub-options for this command include the follow-
ing:
• format – This option checks HTTP body for XML format compliance.

• max-attr num – This option checks maximum number of attributes of an


XML element. The default value is 256.

• max-attr-name-len num – This option checks maximum length of an attri-


bute name. The default value is 128.

• max-attr-value-len num – This option checks maximum length of an attri-


bute text value. The default value is 128.

• max-cdata-len num – This option checks maximum length of CDATA sec-


tion of an element. The default value is 65535.

• max-elem num – This option checks maximum number of XML elements.


The default value is 1024.

• max-elem-child num – This option checks maximum number of children of


an XML element. The default value is 1024.

• max-elem-depth num – This option checks maximum recursion level for ele-
ment definition. The default value is 256.

• max-elem-name-len num – This option checks maximum length for an ele-


ment name. The default value is 128.

• max-entity-decl num – This option checks maximum number of entity dec-


laration. The default value is 1024.

• max-entity-depth num - This option checks maximum depth of entities.


The default value is 32.

• max-namespace num – This option checks maximum number of namespace


declarations. The default value is16.

• max-namespace-uri-len num – This option checks maximum length of a


namespace URI. The default value is 256.

• sqlai – This option checks XML data against SQLIA policy.

• xss – This option checks XML data against XSS policy.


[no] xml-content-vali- Configures XML content validation. The options for this command include the
dation option following:

• wsdl – This option specifies a WSDL file for verifying XML body contents.

• xml-schema – This option specifies an XML-schema file for verifying XML


body contents.

page 162
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

csp
Description Insert HTTP header Content-Security-Policy (CSP) if necessary.

Syntax [no] csp <csp_name> [insert-if-not-exist | insert-always]

Parameter Description
<csp_name> CSP header value, for example, "script-src 'none'.
Length of string, has the range, 1 to 255.
[no] csp <csp_name> Disables the CSP.
insert-if-not-exist Only insert the header when it does not exist.
insert-always Always insert the header even when there is a header
with the same name.

Default Disabled

Mode WAF Template Configuration Mode

Usage When it is configured, server CSP header is replaced if it exists;

otherwise use “insert-always” to insert a separate CSP header.

If no CSP policy is provided, use the default value “script-src 'self';


object-src ‘self’”

Example ACOS(config-waf)# csp csp1 insert-if-not-exist

ACOS(config-waf)# csp csp1 insert-always

form-protection
Description Configure form-protection for the WAF template.

Syntax form-protection

Default NA

Mode WAF configuration mode

Usage To define rules and configurations for form protection.


Example ACOS (config-waf)# form-protection

page 163
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

form-check
Description Add configuration checks whether POST method is used for RESPONSE and
REQUEST with forms.

Syntax form-check {request-non-post | response-non-post}

Parameter Description
request-non-post Check whether POST is used for request with forms.
response-non-post Check whether form method POST is used for
response with forms.

Default NA

Mode WAF form-protection


Example ACOS (config-waf-form-protection)# form-check request-non-post

show waf stats


Description Show WAF statistics for a specific virtual port on a specific virtual server.

Syntax show waf stats virtual-server-name portnum

Command Description
virtual-server-name Name of the virtual server.
portnum Virtual port number.

Default N/A

Mode All

page 164
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

Example The following example shows WAF statistics:

ACOS#show waf
Total
---------------------------------------------------------------
Requests 5666
Requests allowed 295630
Requests denied 3995
Responses denied 0
Session Check
- Success 0
- Failed 1
- None 73
Bad Bot Check
- Success 0
- Failed 0
Buffer Overflow Check
- URL too long 57
- Request line too long 18
- Query too long 0
- Cookie too long 0
- Total Cookies too long 0
- Cookie Name too long 0
- Cookie Value too long 0
- Headers too long 117
- Header Name too long 3
- Header Value too long 2460
- POST body too long 256
- Parameter name too long 0
- Parameter value too long 0
- Parameter total too long 0
- Too much data to parse 53
- Too many parameters 0
- Too many cookies 18
- Too many headers 1
- Too many MIME entities 18
Allowed HTTP Methods Check
- Success 299662
- Failed 13
HTTP Protocol Check
- Success 53
- Failed 44
Referer Check
- Success 51

page 165
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

- Failed 17
- No Referer (Redirect) 51
URI Whitelist Check
- Success (Match) 36
- Failed 18
URI Blacklist Check
- Success 35
- Failed (Match) 36
URL Check
- Learned 0
- Success 54
- Failed 126
Form Consistency Check
- Success 0
- Failed 0
Form CSRF Tag Check
- Success 0
- Failed 0
CCN Mask
- Amex 0
- Diners 0
- Visa 0
- MasterCard 0
- Discover 0
- JCB 0
SSN Mask
- US SSN's masked 0
PCRE Mask
- PCRE's masked 0
Cookie Encryption
- Encrypt Success 0
- Encrypt Failed 0
- Encrypt Limit Exceeded 0
- Encrypt Skipped 0
- Decrypt Success 0
- Decrypt Failed 0
SQLIA Check
- URL Success 54
- URL Sanitized 72
- URL Rejected 36
- POST Success 0
- POST Sanitized 0
- POST Rejected 0
- XML Success 72

page 166
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

- XML Failed 36
XSS Check
- Cookie Success 0
- Cookie Sanitized 0
- Cookie Rejected 0
- URL Success 18
- URL Sanitized 0
- URL Rejected 18
- POST Success 36
- POST Sanitized 18
- POST Rejected 18
- XML Success 36
- XML Failed 36
JSON Format Check
- Parse Success 882
- Parse Failure 630
- too many array values 0
- nested too deep 0
- too many object members 0
- string too long 18
XML Format Check
- Parse Success 306
- Parse Failure 252
- too many attributes 0
- attribute name too long 0
- attribute value too long 0
- CDATA field too long 18
- too many elements 0
- too many children 18
- elements nested too deep 0
- element name too long 0
- too many entity expansions 0
- entity expansions nested too deep 36
- too many namespaces 0
- namespace URI too long 0
- XML Schema success 18
- XML Schema failure 0
SOAP Format Check
- Parse Success 0
- Parse Failure 0
- WSDL Success 0
- WSDL Failure 0
Password Security Check
- Non masked passwords Rejected 0

page 167
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

- Non ssl passwords Rejected 0


- Password autocomplete Rejected 0
Redirect Whitelist Check
- Learned 0
- Success 0
- Failed 0
Brute-force Check
- Success 0
- Failed 0
Form non-SSL Rejected 0
Form non-POST Rejected 0
Form no-cache header inserted 0
Resp code hidden 0
Resp hdrs filtered 0
Cookie challenges 0
JavaScript challenges 0
Captcha challenges 0
Learning updates 0

The number at the top of the output (vip1 80 in this example) indicates the name of the virtual server
and port number. Table 10 describes the rest of fields in the command output.

TABLE 10 show waf stats fields


Field Description
Requests Total number of HTTP requests.
Requests allowed Total number of HTTP requests allowed.
Requests denied Total number of HTTP requests denied due to security violations.
Responses denied Total number or HTTP responses denied.
Session Check Session check injects a cookie into the HTTP session and makes sure that subse-
quent requests on this session have this cookie.

• Success – Total number of requests that had a session ID inserted into the
cookie and passed the subsequent validation checks for that same ID.

• Failed – Total number of requests that had a session ID inserted into the cookie,
failed a subsequent check for that same ID, and were denied.

• None – Number of requests that did not contain a session ID.


Bad Bot Check Counters for bot checking:

• Success – Total number of requests that included a bot.

• Failed – Total number of requests that were screened for bots and did not match.

page 168
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

TABLE 10 show waf stats fields (Continued)


Field Description
Buffer Overflow Check Counters for buffer overflow checks:

• URL too long – Total number of requests that included URL headers which
exceeded the configured limit.

• Request line too long - Total number of request lines that exceeded the config-
ured limit.

• Query too long - Total number of request queries that exceeded the configured
limit.

• Cookie too long – Total number of requests that included cookies which
exceeded the configured limit.

• Total Cookies too long - Total number of cookies that exceeded the configured
limit.

• Cookie Name too long - Total number of cookie names that exceeded the config-
ured limit.

• Cookie Value too long - Total number of cookie values that exceeded the config-
ured limit.

• Headers too long – Total number of requests that included headers which
exceeded the configured limit.

• Header Name too long - Total number of header names that exceeded the config-
ured limit.

• Header Value too long - Total number of header values that exceeded the config-
ured limit.

• POST body too long – Total number of POST requests with content length which
exceeded the configured limit.

• Parameter name too long - Total number of parameter names that exceeded the
configured limit.

• Parameter value too long - Total number of parameter values that exceeded the
configured limit.

• Parameter total too long - Total number of requests that exceeded the configured
limit of allowed parameters.

• Too much data to parse - Total number of request that were denied because they
exceeded the configured data limit.

• Too many parameters - Total number of requests that were denied because they
exceeded the configured parameter limit.

• Too many cookies – Total number of requests that were denied because they
exceeded the configured cookie limit.

• Too many headers – Total number of requests that were denied because they
exceeded the configured header limit.

• Too many MIME entities - Total number of requests that were denied because
they contained too many MIME entities.

page 169
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

TABLE 10 show waf stats fields (Continued)


Field Description
Allowed HTTP Meth- Counters for allowed HTTP methods:
ods Check
• Success – Total number of requests that contained only a method that is present
in the Allowed HTTP Methods list.

• Failed – Total number of requests that contained a method that is not in the
Allowed HTTP Methods list.
HTTP Protocol Check Counters for responses that adhere to HTTP protocol:

• Success – Number of requests that followed valid HTTP protocol.

• Failed – Number of requests that did not adhere to HTTP protocol.


Referer Check Counters for referer header validation for incoming requests:

• Success – Number of requests that passed the referer header check.

• Failed – Number of requests that did not pass the referer header check.

• No Referer (Redirect) – Number of requests that did not contain a referer header.
URI White List Check URI White List counters:

• Success (Match) – Number of requests that matched criteria in the URI White
List and were accepted.

• Failed – Number of requests that did not match criteria in the URI White List and
were denied.
URI Black List Check URI Black List counters:

• Success – Number of requests that did not match criteria in the URI Black List
and were accepted.

• Failed (Match) – Number of requests that matched criteria in the URI Black List
and were denied.
URL Check URL Check counters:

• Learned – Number of URL paths learned during Learning Mode and added to the
URL Check list.

• Success – Number of requests that matched the URL Check list and were
accepted.

• Failed – Number of requests that did not match the URL Check list and were
denied.
Form Counters for web form consistency:
Consistency Check
• Success – Number of requests that passed the web form consistency check.

• Failed – Number of requests which did not match the original structure of the
web form and were denied.
Form CSRF Tag Check Counters for the CSRF check on web form field tags in outbound responses:

• Success – Number of requests that passed the check.

• Failed – Number of requests which did not match the nonce for the web form
and denied.

page 170
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

TABLE 10 show waf stats fields (Continued)


Field Description
CCN Mask Counters for credit card numbers masked in requests. This counter is separated
into the following credit card types:

• Amex

• Diners

• Visa

• MasterCard

• Discover

• JCB
SSN Mask Counters for US social security number checks:

• US SSNs masked – Total number of SSN numbers that the WAF discovered and
masked.
PCRE Mask Counters for custom PCRE pattern checks:

• PCREs masked – Total number of custom PCRE string matches the WAF discov-
ered and masked.
Cookie Counters for cookie encryption:
Encryption
• Encrypt Success – Number of times a cookie was successfully encrypted with
the specified secret string.

• Encrypt Failed – Number of times encryption of a cookie failed.

• Encrypt Limit Exceeded – Number of times cookies were not encrypted because
of the a configured limit.

• Encrypt Skipped – Number of cookies that skipped encryption because the


remove-cookies option is enforced in the RAM caching template.

• Decrypt Success – Number of cookies in clients’ requests that were successfully


decrypted with the configured secret string.

• Decrypt Failed – Number of client requests that were rejected because they
could not be decrypted.

page 171
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

TABLE 10 show waf stats fields (Continued)


Field Description
SQLIA Check Counters for the SQL Inject Attack (SQLIA) check:

• URL Success – Number of requests that passed the SQLIA check for the URL.

• URL Sanitized – Total number of requests that the URL component was sani-
tized of an SQL attack pattern and accepted.

• URL Failed – Number of requests that contained an SQLIA in the URL.

• POST Success – Number of requests that passed the SQLIA check for the POST
body.

• POST Sanitized – Total number of requests that the POST body component was
sanitized of an SQL attack pattern and accepted.

• POST Rejected – Total number of requests that were denied because they con-
tained an SQL injection attack in the POST body of a request.

• XML Success – Number of requests that passed the SQLIA check for XML.

• XML Failed – Number of requests that contained an SQLIA in the XML.


XSS Check Counters for cross-site scripting (XSS) attacks:

• Cookie Success – Number of requests that passed the cookie inspection portion
of the XSS check.

• Cookie Sanitized – Number of requests that contained an XSS attack in the


cookie, were sanitized, and accepted.

• Cookie Rejected – Number of requests that contained an XSS attack in the


cookie and were denied.

• URL Success – Number of requests that passed the URL inspection portion of
the XSS check.

• URL Sanitized – Number of requests that contained an XSS attack in the URL,
were sanitized, and accepted.

• URL Rejected – Number of requests that contained an XSS attack in the URL and
were denied.

• POST Success – Number of requests that passed the POST body inspection por-
tion of the XSS check.

• POST Sanitized – Number of requests that contained an XSS attack in the POST
body, were sanitized, and accepted.

• POST Rejected – Number of requests that contained an XSS attack in the POST
body and were denied.

• XML Success – Number of requests that passed the XML inspection portion of
the XSS check.

• XML Rejected – Number of requests that contained an XSS attack in the XML
and were denied.

page 172
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

TABLE 10 show waf stats fields (Continued)


Field Description
JSON Format Check Stats for performing JSON format parsing and validation and making sure the
JSON object is well constructed.

• Parse Success - Number of valid JSON objects.

• Parse Failure - Number of invalid JSON objects.

• too many array values - Number of JSON objects with too many array values.

• nested too deep - Number of JSON objects with invalid nesting.

• too many object members - Number of JSON objects with too many members.

• string too long - Number of JSON objects with invalid string lengths.
XML Format Check Stats for performing XML format parsing and validation and making sure the XML
object is well constructed.

• Parse Success - Number of valid XML objects.

• Parse Failure - Number of XML objects that could not be parsed due to some
error.

• too many attributes - Number of XML objects with too many attributes.

• attribute name too long - Number of XML objects with invalid attribute names.

• attribute value too long - Number of XML objects with invalid attribute values.

• CDATA field too long - Number of XML objects with invalid CDATA fields.

• too many elements - Number of XML objects with too many elements.

• too many children - Number of XML objects with too many children.

• elements nested too deep - Number of XML objects with improper nesting.

• element name too long - Number of XML objects with improper element names.

• too many entity expansions - Number of XML objects with too many entity expan-
sions.

• entity expansions nested too deep - Number of XML objects with improper entity
nesting.

• too many namespaces - Number of XML objects with too many namespaces.

• namespace URI too long - Number of XML objects with improper URI lengths.

• XML Schema success - Number of XML schemas parsed successfully.

• XML Schema failure - Number of XML schemas that could not be parsed.

page 173
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF Template Commands FFee
e

TABLE 10 show waf stats fields (Continued)


Field Description
SOAP Format Check Validates that SOAP messages are properly constructed and also checks the pro-
vided WSDL file to make sure that the fields are aligned with the expected template.

• Parse Success - Number of valid SOAP messages.

• Parse Failure - Number of SOAP messages that could not be processed due to
error.

• WSDL Success - Number of times a SOAP message is validated against the


WSDL file.

• WSDL Failure - Number of times a SOAP message fails validation against the
WSDL file.
Password Security Counters for the Password Security check:
Check
• Non masked passwords Rejected – when a form has an input field for a pass-
word which is not masked (so when you type your password the characters are
not replaced by asterisks)

• Non ssl passwords Rejected – When a form containing a password field is


POSTed over a non-SSL connection

• Password autocomplete Rejected – When the password field of a form has auto-
complete turned on, which means that an unauthorized person with access to
the browser will not need to actually type in the password
Redirect Whitelist Counters for the Redirect Whitelist check:
Check
• Learned – Number of redirect locations (URIs) learned during Learning Mode and
added to the redirect white-list.

• Success – Number of requests that matched a URI entry in the redirect white-list
and were accepted.

• Failed – Number of requests that did not match a URI entry in the redirect white-
list and were blocked.
Form non-SSL Rejected Total number of forms that were rejected due to having been submitted over a non-
SSL connection.
Form non-POST Number of times a form is sent using an HTTP method other than POST.
Rejected
Form no-cache header Number of times WAF inserted a pragma to tell the client not to cache the content.
inserted
Response Code Hidden Number of times WAF masked out an HTTP response code and replaced it with a
generic 200/403.
Response headers fil- Total number of response headers that WAF sanitized and forwarded.
tered
Learning updates Number of additional rules generated from the WAF learning mechanisms when the
WAF is operating in Learning Mode.

page 174
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF Template Commands

clear waf stats


Description Clear WAF statistics for a specific virtual port on a specific virtual server.

Syntax clear waf stats virtual-server-name portnum

Command Description
virtual-server-name Name of the virtual server.
portnum Virtual port number.

Default N/A

Mode Privileged EXEC and all configuration levels

page 175
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF File Management Commands FFee
e

WAF File Management Commands


The commands in this section manage WAF policy files:

• waf policy check

• waf policy copy

• waf policy delete

• waf policy edit

• waf policy max-filesize

• waf policy rename

• waf wsdl check

• waf wsdl copy

• waf wsdl delete

• waf wsdl edit

• waf wsdl max-filesize

• waf wsdl rename

• waf xml-schema check

• waf xml-schema copy

• waf xml-schema delete

• waf xml-schema edit

• waf xml-schema max-filesize

• waf xml-schema rename

• show waf policy

waf policy check


Description Validate a WAF policy file’s syntax.

Syntax waf policy check file-name

Parameter Description
file-name Name of a configured WAF policy file.

Mode Privileged EXEC and all configuration levels

page 176
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF File Management Commands

waf policy copy


Description Copy a WAF policy file to a different file name.

Syntax waf policy copy source-name destination-name

Parameter Description
source-name Name of a configured WAF policy file.
destination-name Name of the new, copied WAF policy file.

Default N/A

Mode Privileged EXEC and all configuration levels

waf policy delete


Description Delete a WAF policy file.

Syntax waf policy delete file-name

Replace file-name with the name of the WAF policy file to be deleted.

Default N/A

Mode Privileged EXEC and all configuration levels

page 177
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF File Management Commands FFee
e

waf policy edit


Description Edit or create a WAF policy file from within the CLI.

Syntax waf policy edit file-name

Replace file-name with the name of the WAF policy file to be modified, or an
un-used name to create a new file.

Default N/A

Mode Privileged EXEC and all configuration levels

Usage Editing the default WAF policy files is not allowed. However, you can copy a
default WAF policy file and customize its contents to fit your specific
demands.

waf policy max-filesize


Description Sets the maximum size of a WAF policy file.

Syntax waf policy max-filesize

Default 32K

Mode Privileged EXEC and all configuration levels

Usage Set a maximum file size in KBytes ranging from 16-10240K.


• The maximum number of learned policy entries is 10240.
• The maximum URL length is 16127 characters, with the new upper limit
representing the concatenated total length of all URL strings.
• These limits are hard-coded and apply across all platforms and models.

waf policy rename


Description Renames a WAF policy file.

Syntax waf policy rename source-name destination-name

Parameter Description
source-name This is the old name of the WAF policy file.
destination-name This is the new name of the WAF policy file.

Default N/A

Mode Privileged EXEC and all configuration levels

page 178
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF File Management Commands

waf wsdl check


Description Validate a WAF WSDL file’s syntax.

Syntax waf wsdl check file-name

Parameter Description
file-name Name of a configured WSDL file.

Mode Privileged EXEC and all configuration levels

waf wsdl copy


Description Copy a WAF WSDL file to a different file name.

Syntax waf wsdl copy source-name destination-name

Parameter Description
source-name Name of a configured WAF WSDL file.
destination-name Name of the new, copied WAF WSDL file.

Default N/A

Mode Privileged EXEC and all configuration levels

waf wsdl delete


Description Delete a WAF WSDL file.

Syntax waf wsdl delete file-name

Replace file-name with the name of the WAF WSDL file to be deleted.

Default N/A

Mode Privileged EXEC and all configuration levels

page 179
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF File Management Commands FFee
e

waf wsdl edit


Description Edit or create a WAF WSDL file from within the CLI.

Syntax waf wsdl edit file-name

Replace file-name with the name of the WAF WSDL file to be modified, or an
un-used name to create a new file.

Default N/A

Mode Privileged EXEC and all configuration levels

waf wsdl max-filesize


Description Sets the maximum size of a WAF WSDL file.

Syntax waf wsdl max-filesize

Default 32K

Mode Privileged EXEC and all configuration levels

Usage Set a maximum file size in KBytes ranging from 16-256K.

waf wsdl rename


Description Renames a WAF WSDL file.

Syntax waf wsdl rename source-name destination-name

Parameter Description
source-name This is the old name of the WAF WSDL file.
destination-name This is the new name of the WAF WSDL file.

Default N/A

Mode Privileged EXEC and all configuration levels

page 180
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF File Management Commands

waf xml-schema check


Description Validate a WAF XML-Schema file’s syntax.

Syntax waf xml-schema check file-name

Parameter Description
file-name Name of a configured WSDL file.

Mode Privileged EXEC and all configuration levels

waf xml-schema copy


Description Copy a WAF XML-Schema file to a different file name.

Syntax waf xml-schema copy source-name destination-name

Parameter Description
source-name Name of a configured WAF XML-Schema file.
destination-name Name of the new, copied WAF XML-Schema file.

Default N/A

Mode Privileged EXEC and all configuration levels

waf xml-schema delete


Description Delete a WAF XML-Schema file.

Syntax waf xml-schema delete file-name

Replace file-name with the name of the WAF XML-Schema file to be deleted.

Default N/A

Mode Privileged EXEC and all configuration levels

page 181
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF File Management Commands FFee
e

waf xml-schema edit


Description Edit or create a WAF XML-Schema file from within the CLI.

Syntax waf xml-schema edit file-name

Replace file-name with the name of the WAF XML-Schema file to be modified,
or an un-used name to create a new file.

Default N/A

Mode Privileged EXEC and all configuration levels

waf xml-schema max-filesize


Description Sets the maximum size of a WAF XML-Schema file.

Syntax waf xml-schema max-filesize

Default 32K

Mode Privileged EXEC and all configuration levels

Usage Set a maximum file size in KBytes ranging from 16-256K.

waf xml-schema rename


Description Renames a WAF XML-Schema file.

Syntax waf xml-schema rename source-name destination-name

Parameter Description
source-name This is the old name of the WAF XML-Schema file.
destination-name This is the new name of the WAF XML-Schema file.

Default N/A

Mode Privileged EXEC and all configuration levels

page 182
ACOS 5.1.0 Web Application Firewall Guide
Feedback
WAF File Management Commands

show waf policy


Description Displays WAF policy files.

Syntax show waf policy [def-file-name]


[all-partitions | partition {shared | partition-name}]

Parameter Description
def-file-name Returns a list of WAF policy files with names that
partially match the specified string.
all-partitions Returns a list of WAF policy files for all partitions.
partition {shared | Returns a list of WAF policy files for the shared
partition-name} partition or the specified private partition.

Default N/A

Mode All

Example The following command lists all WAF policy files, for all partitions:

ACOS(config-waf)# show waf policy all-partitions


Total WAF policy number: 10
Max WAF policy file size: 32K
Name Syntax Template Learning
---------------------------------------------------------------------------------
allowed_resp_codes Check Bind No
bot_defs Check Bind No
jscript_defs Check No No
sqlia_defs Check Bind No
uri_blist_defs Check Bind No
uri_wlist_defs Check Bind No

page 183
ACOS 5.1.0 Web Application Firewall Guide
FeedbackFF
WAF File Management Commands FFee
e

page 184
ACOS 5.1.0 Web Application Firewall Guide

page 185
CONTACT US
1 a10networks.com/contact

ACOS 5.1.0 WEB APPLICATION FIREWALL GUIDE 13 DECEMBER 2019

You might also like