request-match

Use the request-match entry to define which requests should be processed by the ModSecurity engine.

Syntax

request-match = [phases]<request-line>

Description

The request-match configuration entry is used to define the pattern to be matched against the HTTP request line, which includes method, URI, and protocol. If a match is successful, then the web application firewall rules engine processing is triggered.

Multiple entries can be specified if needed.

Options

phases
An optional list of ModSecurity phases for which the web application firewall rules engine processing will be triggered. Phases can be provided as a comma separated list or hyphenated range of numbers. The supported phases include:
Table 1. ModSecurity phases
Phase
1 Request Headers
2 Request Body
3 Response Headers
4 Response Body
5 Logging

If a list of phases is not supplied, the WAF processing will be triggered for every phase.

request-line

Contains the request line to be matched against. The pattern matching is case-sensitive. Wildcard characters # and ? can be used.

Usage

This stanza entry is optional.

Default value

None

Example

request-match = GET /index.html HTTP/1.1
request-match = GET /jct/*
request-match = [1-2,5]GET /login/*