From jyri@sac.sfbay.sun.com Thu Feb  7 20:39:55 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m184dsRS026416
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 7 Feb 2008 20:39:54 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m184dna7023475;
	Fri, 8 Feb 2008 04:39:53 GMT
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JVW00F03KYGHA00@nwk-avmta-2.sfbay.sun.com>; Thu,
 07 Feb 2008 20:39:52 -0800 (PST)
Received: from dm-sfbay-02.sfbay.sun.com ([129.146.11.31])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JVW006L2KYGSW90@nwk-avmta-2.sfbay.sun.com>; Thu,
 07 Feb 2008 20:39:52 -0800 (PST)
Received: from sac.sfbay.sun.com (new-sac.SFBay.Sun.COM [129.146.175.65])
	by dm-sfbay-02.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id m184do5c019508; Thu, 07 Feb 2008 20:39:50 -0800 (PST)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m184Ooqg026312; Thu,
 07 Feb 2008 20:24:50 -0800 (PST)
Received: (from jyri@localhost)	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit)
 id m184Oo56026308; Thu, 07 Feb 2008 20:24:50 -0800 (PST)
Date: Thu, 07 Feb 2008 20:24:50 -0800 (PST)
From: Jyri Virkki <jyri@sac.sfbay.sun.com>
Subject: Additional Apache2 Modules [PSARC/2008/090 FastTrack timeout 2/15/2008]
To: PSARC-ext@sun.com
Cc: Rahul.G.Nair@sun.com, webstack-discuss@opensolaris.org
Message-id: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
Status: RO
Content-Length: 5926


Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 Additional Apache2 Modules
    1.2. Name of Document Author/Supplier:
	 Author:  Rahul Nair
    1.3  Date of This Document:
	07 February, 2008
4. Technical Description

Additional Apache2 Modules

7 February 2008

1.    Summary and motivation

    1.1.    Introduction

    This project delivers Apache modules mod_jk, mod_fcgid,
    mod_security and mod_dtrace to the Apache2 (PSARC/2007/586) in
    OpenSolaris.

    Modules allow Apache to integrate and provide functionality
    during runtime that were not available during compile time.

    This project integrates the most recent stable releases of
    mod_jk[1] tomcat-connectors-1.2.25, mod_fcgid[2] 2.2,
    mod_security[3] 2.1.3 and mod_dtrace[4] 0.3a

    This case seeks Minor Release Binding.

2.    Technical issues

    2.1.    Key objects

    /usr/apache2/2.2/libexec/mod_jk.so
    /usr/apache2/2.2/libexec/mod_fcgid.so
    /usr/apache2/2.2/libexec/mod_security2.so
    /usr/apache2/2.2/libexec/mod_dtrace.so

    /usr/apache2/2.2/libexec/${ISAINFO}/mod_jk.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_fcgid.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_security2.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_dtrace.so

 
    2.2 Versioning

    mod_jk, mod_fcgid, mod_security and mod_dtrace have a single active
    release. (There was a module named mod_jk2 which was deprecated. It
    was not the successor to mod_jk.)

    It is not possible to query the modules to find out their
    versions.  The only way to do that is to look at the package
    description for the package including it.

    2.2 Directory Naming and Structure

    This project delivers the shared libraries of 32 bit and 64 bit
    into /usr/apache2/2.2/libexec and /usr/apache2/2.2/libexec/${ISAINFO}/ 
    directories of apache. This is in keeping with the approach taken
    by the Apache2 integration project for OpenSolaris (PSARC/2007/586).

3. Documentation

    The modules mod_jk, mod_fcgid, mod_security and mod_dtrace do not
    install documentation into apache though they come with some
    documentation in their source. The recommended way to access their
    documentation is to look at their websites (mod_fcgid[5] ,mod_jk[6],
    mod_security[7] and mod_dtrace[8] ). A list of external apache modules
    that has been added and their corresponding sites will be part of the
    release document.

4. Packaging and Delivery

    The modules will be delivered under the cluster SUNWCapch22m. This
    cluster consists of SUNWapch22m-fcgid, SUNWapch22m-jk,
    SUNWapch22m-security and SUNWapch22m-dtrace respectively.

5.  Interfaces

    5.1.    Interface Stability

    The interface stability of most of these modules is Volatile as
    these are controlled by external organisations over which Sun has
    no control. The specific researches regarding stability of each
    module are captured below.

    5.1.1 mod_jk
        The mod_jk developers will try to keep the releases of 1.2.X
    line compatible with each other. But this is not guaranteed in
    case of new features that may need to be retracted due to some
    bugs or vulnerabilities.

    5.1.2 mod_security
       The mod_security developers will keep the compatibility
    between releases of the same major number. (ie 2.y.z with 2 being
    the major number.) But there is no guarantee that meaning of a
    rule set (configuration directive) would be exactly the same
    across any two releases.

    5.1.3 mod_fcgid
       There were no commitments from mod_fcgid developers in this
    regard. (The mod_fcgid does not seem to have broken the
    configuration compatibility with any of its earlier releases
    yet [9] but is in very active development)

    5.1.4 mod_dtrace
        The mod_dtrace has had just two releases (0.2a and 0.3a) and
    is possibly very unstable.
    

    5.2.    Imported Interfaces

    These Apache modules imports interfaces from

    NAME                       STABILITY         NOTES
    ------------------------------------------------------------
    Apache2                    Uncommitted       PSARC/2007/586/   
    LDAP                       Evolving          PSARC/2000/362/
    PCRE                       Uncommitted       PSARC/2007/164/
    SUNWlxml                   Committed         PSARC/2001/175/
    Dtrace                     Uncommitted       PSARC/2001/466/


    5.3.    Exported Interfaces

    NAME                                                STABILITY
    --------------------------------------------------------------- 
    /usr/apache2/2.2/libexec/mod_jk.so                  Volatile
    /usr/apache2/2.2/libexec/mod_fcgid.so               Volatile
    /usr/apache2/2.2/libexec/mod_security.so            Uncommitted
    /usr/apache2/2.2/libexec/mod_dtrace.so              Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_jk.so       Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_fcgid.so    Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_security.so Uncommitted
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_dtrace.so   Volatile


6.    References

   1. http://fastcgi.coremail.cn/
   2. http://tomcat.apache.org/connectors-doc/
   3. http://www.modsecurity.org/projects/modsecurity/apache/index.html
   4. http://prefetch.net/projects/apache_modtrace/index.html
   5. http://fastcgi.coremail.cn/doc.htm
   6. http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
   7. http://www.modsecurity.org/documentation/index.html
   8. http://prefetch.net/projects/apache_modtrace/mod_dtrace.c
   9. http://fastcgi.coremail.cn/download.htm


6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		sfw
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open


From John.Plocher@sun.com Thu Feb  7 20:58:13 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m184wCpq026719
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 7 Feb 2008 20:58:13 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m184w72n029245
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Fri, 8 Feb 2008 04:58:12 GMT
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JVW0080FLSZJA00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Thu, 07 Feb 2008 21:58:11 -0700 (MST)
Received: from sca-es-mail-1.sun.com ([192.18.43.132])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JVW00FN2LSZFT70@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Thu,
 07 Feb 2008 21:58:11 -0700 (MST)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m184wBHR012578	for
 <PSARC-ext@sun.com>; Thu, 07 Feb 2008 20:58:11 -0800 (PST)
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0JVW00401LODU800@fe-sfbay-10.sun.com>
 (original mail from John.Plocher@Sun.COM)
 for PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Thu,
 07 Feb 2008 20:58:11 -0800 (PST)
Received: from [192.168.168.4] ([208.74.177.212])
 by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb
 28 2007)) with ESMTPSA id <0JVW002XELSYYTC0@fe-sfbay-10.sun.com>; Thu,
 07 Feb 2008 20:58:11 -0800 (PST)
Date: Thu, 07 Feb 2008 20:58:10 -0800
From: John Plocher <John.Plocher@sun.com>
Subject: Re: Additional Apache2 Modules [PSARC/2008/090 FastTrack timeout
 2/15/2008]
In-reply-to: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
Sender: John.Plocher@sun.com
To: Jyri Virkki <jyri@sac.sfbay.sun.com>
Cc: PSARC-ext@sun.com, Rahul.G.Nair@sun.com, webstack-discuss@opensolaris.org
Message-id: <47ABE162.1070906@Sun.Com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031)
Status: RO
Content-Length: 633

Jyri Virkki wrote:
> Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI
> This information is Copyright 2008 Sun Microsystems
> 1. Introduction
>     1.1. Project/Component Working Name:
> 	 Additional Apache2 Modules


Other than missing descriptions of what these modules are
used for ("mod_jk is used to connect apache2 to the tomcat
web container/servlet environment..."), this is a very nice
example of the type and level of ARC documentation we need
for projects that bring FOSS stuff into the system.

I particulary like the characterizations of the upstream
community's own stability expectations.

Thanks, Jyri!

   -John

From jyri@buye.red.iplanet.com Thu Feb  7 21:35:40 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m185ZdMk026896
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 7 Feb 2008 21:35:39 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m185ZZW5014193;
	Fri, 8 Feb 2008 05:35:37 GMT
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JVW00I03NJBAZ00@nwk-avmta-2.sfbay.sun.com>; Thu,
 07 Feb 2008 21:35:35 -0800 (PST)
Received: from buye.red.iplanet.com ([192.18.65.224])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JVW0060UNJBSWD0@nwk-avmta-2.sfbay.sun.com>; Thu,
 07 Feb 2008 21:35:35 -0800 (PST)
Received: from buye.red.iplanet.com (localhost [127.0.0.1])
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7) with ESMTP id m185S5PF007765; Thu,
 07 Feb 2008 21:28:05 -0800 (PST)
Received: (from jyri@localhost)
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7/Submit) id m185S5J1007764; Thu,
 07 Feb 2008 21:28:05 -0800 (PST)
Date: Thu, 07 Feb 2008 21:28:05 -0800
From: Jyri Virkki <Jyri.Virkki@sun.com>
Subject: Re: Additional Apache2 Modules [PSARC/2008/090 FastTrack timeout
 2/15/2008]
In-reply-to: <47ABE162.1070906@Sun.Com>
To: John Plocher <John.Plocher@sun.com>
Cc: PSARC-ext@sun.com, webstack-discuss@opensolaris.org
Message-id: <20080208052805.GW6789@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
 <47ABE162.1070906@Sun.Com>
User-Agent: Mutt/1.5.11
Status: RO
Content-Length: 764

John Plocher wrote:
>
> Other than missing descriptions of what these modules are
> used for ("mod_jk is used to connect apache2 to the tomcat
> web container/servlet environment..."), this is a very nice
> example of the type and level of ARC documentation we need
> for projects that bring FOSS stuff into the system.
> 
> I particulary like the characterizations of the upstream
> community's own stability expectations.
> 
> Thanks, Jyri!

I'm sponsoring the case for Rahul (timeout set to 2/15/2008).


This case had a fair amount of pre-review on the webstack community list:

http://www.opensolaris.org/jive/thread.jspa?threadID=47744
http://www.opensolaris.org/jive/thread.jspa?threadID=41624



-- 
Jyri J. Virkki - jyri.virkki@sun.com - Sun Microsystems

From danek.duvall@sun.com Fri Feb  8 09:12:10 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m18HC97F012932
	for <psarc-ext@sac.sfbay.Sun.COM>; Fri, 8 Feb 2008 09:12:09 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m18HBauD014445
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Sat, 9 Feb 2008 01:12:08 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JVX00257JS8YE00@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Fri, 08 Feb 2008 09:12:08 -0800 (PST)
Received: from dm-sfbay-01.sfbay.sun.com ([129.145.155.118])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JVX001AAJS5Y1D0@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Fri,
 08 Feb 2008 09:12:05 -0800 (PST)
Received: from zruty.sfbay.sun.com (zruty.SFBay.Sun.COM [129.146.168.40])
	by dm-sfbay-01.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id m18HC3aG018641; Fri, 08 Feb 2008 09:12:03 -0800 (PST)
Received: from zruty.sfbay.sun.com (localhost [127.0.0.1])
	by zruty.sfbay.sun.com (8.14.2+Sun/8.14.2) with ESMTP id m18HC3GY005555; Fri,
 08 Feb 2008 09:12:03 -0800 (PST)
Received: (from dduvall@localhost)
	by zruty.sfbay.sun.com (8.14.2+Sun/8.14.2/Submit) id m18HC3qt005554; Fri,
 08 Feb 2008 09:12:03 -0800 (PST)
Date: Fri, 08 Feb 2008 09:12:03 -0800
From: Danek Duvall <danek.duvall@sun.com>
Subject: Re: Additional Apache2 Modules [PSARC/2008/090 FastTrack timeout
	2/15/2008]
In-reply-to: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
To: Jyri Virkki <jyri@sac.sfbay.sun.com>
Cc: PSARC-ext@sun.com, Rahul.G.Nair@sun.com, webstack-discuss@opensolaris.org
Message-id: <20080208171203.GQ22027@zruty.sfbay.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
User-Agent: Mutt/1.5.16 (2007-06-27)
Status: RO
Content-Length: 1253

On Thu, Feb 07, 2008 at 08:24:50PM -0800, Jyri Virkki wrote:

>     5.3.    Exported Interfaces
> 
>     NAME                                                STABILITY
>     --------------------------------------------------------------- 
>     /usr/apache2/2.2/libexec/mod_jk.so                  Volatile
>     /usr/apache2/2.2/libexec/mod_fcgid.so               Volatile
>     /usr/apache2/2.2/libexec/mod_security.so            Uncommitted
>     /usr/apache2/2.2/libexec/mod_dtrace.so              Volatile

So what are the interfaces this project is actually exporting?  That is,
for instance, what is Volatile about "/usr/apache2/2.2/libexec/mod_jk.so"?
Is it the pathname?  The pathname seems unlikely to change -- either it
stays the same pretty much forever or we decide to yank it.  Doesn't seem
particularly Volatile.

Is it behavior?

Is it the set of configuration directives it supports?

Something else?

A description of what each actually does would also be nice.  The fact that
it was discussed at length somewhere else is nice, but most of us aren't on
those other lists, so a summary in the proposal of, y'know, what the
project actually *does* would be useful to the majority of ARC members
reviewing the proposal.  :)

Thanks,
Danek

From brectanu@gmail.com Fri Feb  8 09:26:46 2008
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m18HQkHl013202
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 8 Feb 2008 09:26:46 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m18HQkxJ003206
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Fri, 8 Feb 2008 09:26:46 -0800 (PST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JVX00E03KGMBO00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Fri, 08 Feb 2008 09:26:46 -0800 (PST)
Received: from brmea-mail-3.sun.com ([192.18.98.34])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JVX00DERKGLZO10@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Fri,
 08 Feb 2008 09:26:46 -0800 (PST)
Received: from relay42i.sun.com ([192.5.209.72])
	by brmea-mail-3.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m18HMZd0026044	for
 <PSARC-ext@sun.com>; Fri, 08 Feb 2008 17:26:45 +0000 (GMT)
Received: from mms48es.sun.com ([160.41.221.231] [160.41.221.231])
 by relay42i.sun.com with ESMTP id BT-MMP-1044767 for PSARC-ext@sun.com; Fri,
 08 Feb 2008 17:26:45 +0000 (Z)
Received: from relay43i.sun.com (relay43i.sun.com [192.5.209.74])
 by mms48es.sun.com with ESMTP id BT-MMP-1181443 for PSARC-ext@sun.com; Fri,
 08 Feb 2008 17:26:45 +0000 (Z)
Received: from fg-out-1718.google.com ([72.14.220.155] [72.14.220.155])
 by relay4i.sun.com with ESMTP id BT-MMP-19439642 for PSARC-ext@sun.com; Fri,
 08 Feb 2008 17:26:44 +0000 (Z)
Received: by fg-out-1718.google.com with SMTP id e12so2812003fga.6 for
 <PSARC-ext@sun.com>; Fri, 08 Feb 2008 09:26:44 -0800 (PST)
Received: by 10.82.118.2 with SMTP id q2mr23472201buc.23.1202491603668; Fri,
 08 Feb 2008 09:26:43 -0800 (PST)
Received: by 10.82.185.8 with HTTP; Fri, 08 Feb 2008 09:26:43 -0800 (PST)
Date: Fri, 08 Feb 2008 09:26:43 -0800
From: Brian Rectanus <brectanu@gmail.com>
Subject: Re: [webstack-discuss] Additional Apache2 Modules [PSARC/2008/090
 FastTrack timeout 2/15/2008]
In-reply-to: <20080208171203.GQ22027@zruty.sfbay.sun.com>
To: Jyri Virkki <jyri@sac.sfbay.sun.com>
Cc: Danek Duvall <danek.duvall@sun.com>, PSARC-ext@sun.com,
        webstack-discuss@opensolaris.org, Rahul.G.Nair@sun.com
Message-id: <b61a4e530802080926v2931a67p35acdf02f4c9b0cd@mail.gmail.com>
MIME-version: 1.0
Content-type: text/plain; charset=UTF-8
Content-transfer-encoding: 7BIT
Content-disposition: inline
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=gamma;
 h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
 bh=P8WQvP/UMbBklBFpnuhTjMPASFJ0+N68dAxzQaIa5ZU=;
 b=W8MJD6o6XhO85rq5Rzft6cJdGqxa56IuJ5Xiplp15FOqzGl7Ws2d4gskgkj9zM+bnoq/5SXOnQa9ns+V75MhK9SPRIraC2HpaQ6u3dJbnGKKggwdCPaJ51H9nLvpZEyzzqvWVS3GB+hAAIeqho060hDlLQHvgZoi/pFUSCLGsr8=
DomainKey-Signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;
 h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
 b=hnorpQQyVkyCKUPkeV38iv831ApojlOrx4WognfT8K+N1dwVjPb+Uuy5HWcAcgHHXGK34w75H300KncC/d9cZ2Cm4UaNwXrvhH6axqBKNHYNqtzjtyNyCyrhg1931zeeEkzCTdL1L8/uWPES8cL13kmn3YWj67oc7Pj/29gW0DM=
X-PMX-Version: 5.2.0.264296
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=-2.6/5.0, scanned in 0.265sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
 <20080208171203.GQ22027@zruty.sfbay.sun.com>
Status: RO
Content-Length: 2681

On Feb 8, 2008 9:12 AM, Danek Duvall <danek.duvall@sun.com> wrote:
> On Thu, Feb 07, 2008 at 08:24:50PM -0800, Jyri Virkki wrote:
>
> >     5.3.    Exported Interfaces
> >
> >     NAME                                                STABILITY
> >     ---------------------------------------------------------------
> >     /usr/apache2/2.2/libexec/mod_jk.so                  Volatile
> >     /usr/apache2/2.2/libexec/mod_fcgid.so               Volatile
> >     /usr/apache2/2.2/libexec/mod_security.so            Uncommitted
> >     /usr/apache2/2.2/libexec/mod_dtrace.so              Volatile
>
> So what are the interfaces this project is actually exporting?  That is,
> for instance, what is Volatile about "/usr/apache2/2.2/libexec/mod_jk.so"?
> Is it the pathname?  The pathname seems unlikely to change -- either it
> stays the same pretty much forever or we decide to yank it.  Doesn't seem
> particularly Volatile.
>
> Is it behavior?
>
> Is it the set of configuration directives it supports?
>
> Something else?
>
> A description of what each actually does would also be nice.  The fact that
> it was discussed at length somewhere else is nice, but most of us aren't on
> those other lists, so a summary in the proposal of, y'know, what the
> project actually *does* would be useful to the majority of ARC members
> reviewing the proposal.  :)
>
> Thanks,
> Danek

I was curious on this as well.  What does the Uncommited mean for
mod_security?  Also the filename is normally compiled as
mod_security2.so (mod_security.so being the 1.x.y version).

Additionally, "the most recent stable releases of" for mod_security is
no longer 2.1.3.  It is 2.1.5, which fixes a number of issues that you
may want included...

10 Jan 2008 - 2.1.5
-------------------
 * Updated included Core Ruleset to version 1.5.1.
 * Phase 5 rules can now be removed via SecRuleRemoveBy* directives.
 * Fixed issue where only the first phase 5 rule would run when the
   request was intercepted in an earlier phase.
 * Fixed configuration parsing so that disruptive actions, meta actions
   and phases are not allowed in a chained rule (as originally intended).
 * Fixed t:escapeSeqDecode to better follow ANSI C escapes.

27 Nov 2007 - 2.1.4
-------------------
 * Updated included Core Ruleset to version 1.5 and noted in the docs that
   XML support is required to use the rules without modification.
 * Fixed an evasion FP, mistaking a multipart non-boundary for a boundary.
 * Fixed multiple warnings on Solaris and/or 64bit builds.
 * Do not process subrequests in phase 2-4, but do hand off the request data.
 * Fixed a blocking FP in the multipart parser, which affected Safari.

thanks,
-B

From Rahul.G.Nair@sun.com Mon Feb 11 07:09:56 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m1BF9sp5021023
	for <psarc-ext@sac.sfbay.Sun.COM>; Mon, 11 Feb 2008 07:09:54 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m1BF9e7p001101
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Mon, 11 Feb 2008 23:09:51 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JW200405Y4A6X00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Mon, 11 Feb 2008 08:09:46 -0700 (MST)
Received: from sineb-mail-2.sun.com ([192.18.19.7])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JW200LC0Y45UZF0@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Mon,
 11 Feb 2008 08:09:44 -0700 (MST)
Received: from fe-apac-02.sun.com
 (fe-apac-02.sun.com [192.18.19.173] (may be forged))
	by sineb-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m1BF9lVY009897	for
 <PSARC-ext@sun.com>; Mon, 11 Feb 2008 15:09:47 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JW200M01Y3XFO00@mail-apac.sun.com>
 (original mail from Rahul.G.Nair@Sun.COM)
 for PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Mon,
 11 Feb 2008 23:09:40 +0800 (SGT)
Received: from localhost ([129.158.224.78])
 by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr  3
 2006)) with ESMTPSA id <0JW200IP5Y3YP400@mail-apac.sun.com>; Mon,
 11 Feb 2008 23:09:40 +0800 (SGT)
Date: Mon, 11 Feb 2008 20:29:32 +0530
From: rahul <Rahul.G.Nair@sun.com>
Subject: Re: [webstack-discuss] Additional Apache2 Modules [PSARC/2008/090
 FastTrack timeout 2/15/2008]
In-reply-to: <b61a4e530802080926v2931a67p35acdf02f4c9b0cd@mail.gmail.com>
Sender: Rahul.G.Nair@sun.com
To: Brian Rectanus <brectanu@gmail.com>
Cc: Jyri Virkki <jyri@sac.sfbay.sun.com>, PSARC-ext@sun.com,
        webstack-discuss@opensolaris.org, Danek Duvall <Danek.Duvall@sun.com>
Message-id: <20080211145931.GY4494@vayavyam.India.Sun.COM>
MIME-version: 1.0
Content-type: multipart/mixed; boundary="Boundary_(ID_QUUFOcR+f9AyrsyWvio1YQ)"
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
 <20080208171203.GQ22027@zruty.sfbay.sun.com>
 <b61a4e530802080926v2931a67p35acdf02f4c9b0cd@mail.gmail.com>
User-Agent: Mutt/1.5.11
Status: RO
Content-Length: 273099


--Boundary_(ID_QUUFOcR+f9AyrsyWvio1YQ)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline

I would like to update the arc case with the following updates.

1) Include a blurb for each of the modules explaining what they do
2) Add an addendum explaining briefly the interfaces (In this case the configuration directives they support)
3) Provide a complete reference for these configuration directives for each of the modules as supplied by the respective upstream communities.
4) Update mod_security to 2.1.5


                                    rahul


--Boundary_(ID_QUUFOcR+f9AyrsyWvio1YQ)
Content-type: text/plain; NAME=arc.modules; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=arc.modules


Additional Apache Modules

13 December 2007

1.    Summary and motivation

    1.1.    Introduction

    This FastTrack delivers Apache modules mod_jk, mod_fcgid, 
    mod_security and mod_dtrace to the Apache2 in OpenSolaris.

    Modules allow Apache to integrate and provide functionality
    during runtime that were not available during compile time.

    1.1.1 mod_security
    From modsecurity.org[3] "ModSecurity is a web application
    firewall (WAF). With over 70% of all attacks now carried out
    over the web application level, organisations need every help
    they can get in making their systems secure. WAFs are deployed
    to establish an external security layer that increases security,
    detects, and prevents attacks before they reach web applications.
    It provides protection from a range of attacks against web
    applications and allows for HTTP traffic monitoring and real-time
    analysis with little or no changes to existing infrastructure."

    1.1.2 mod_jk
    From tomcat.apache.org "mod_jk is a replacement to the elderly
    mod_jserv. It is a completely new Tomcat-Apache plug-in that
    handles the communication between Tomcat and Apache."

    1.1.3 mod_fcgid
    From fastcgi.coremail.cn "It is a binary compatibility alternative
    to Apache module mod_fastcgi." mod_fcgid is an apache module that
    allows CGIs to be deployed on apache that make use of the FastCGI
    mechanism. From www.fastcgi.com "FastCGI is a language independent,
    scalable, open extension to CGI that provides high performance
    without the limitations of server specific APIs."

    1.1.4 mod_dtrace
    From prefetch.net "The Apache DTrace module (mod_dtrace) utilizes
    the hook framework to add DTrace probes to the Apache web server.
    These probes can be used to observe and correlate web server and
    system behavior, and allow easy access to numerous pieces of
    realtime Apache data.


    This project integrates the most recent stable releases of
    mod_jk[1] tomcat-connectors-1.2.25, mod_fcgid[2] 2.2,
    mod_security[3] 2.1.5 and mod_dtrace[4] 0.3a

    This case seeks Minor Release Binding.

2.    Technical issues

    2.1.    Key objects

    /usr/apache2/2.2/libexec/mod_jk.so
    /usr/apache2/2.2/libexec/mod_fcgid.so
    /usr/apache2/2.2/libexec/mod_security2.so
    /usr/apache2/2.2/libexec/mod_dtrace.so

    /usr/apache2/2.2/libexec/${ISAINFO}/mod_jk.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_fcgid.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_security2.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_dtrace.so

 
    2.2 Versioning

    mod_jk, mod_fcgid, mod_security and mod_dtrace have a single active
    release. (There was a module named mod_jk2 which was deprecated. It
    was not the successor to mod_jk.)

    It is not possible to query the modules to find out their
    versions.  The only way to do that is to look at the package
    description for the package including it.

    2.2 Directory Naming and Structure

    This project delivers the shared libraries of 32 bit and 64 bit
    into /usr/apache2/2.2/libexec and /usr/apache2/2.2/libexec/${ISAINFO}/ 
    directories of apache. This is in keeping with the approach taken
    by the Apache2 integration project for OpenSolaris (PSARC/2007/586).

3. Documentation

    The modules mod_jk, mod_fcgid, mod_security and mod_dtrace do not
    install documentation into apache though they come with some
    documentation in their source. The recommended way to access their
    documentation is to look at their websites (mod_fcgid[5] ,mod_jk[6],
    mod_security[7] and mod_dtrace[8] ). A list of external apache modules
    that has been added and their corresponding sites will be part of the
    release document.

4. Packaging and Delivery

    The modules will be delivered under the cluster SUNWCapch22m. This
    cluster consists of SUNWapch22m-fcgid, SUNWapch22m-jk,
    SUNWapch22m-security and SUNWapch22m-dtrace respectively.

5.  Interfaces

    5.1.    Interface Stability

    The interface stability of each component is described as Volatile
    as these are controled by external organizations over which Sun
    has no control. The specific researches regarding stability of
    each module are captured below.

    5.1.1 mod_jk
        The mod_jk developers will try to keep the releases of 1.2.X
    line compatible with each other. But this is not guaranteed in
    case of new features that may need to be retracted due to some
    bugs or vulnerabilities. The interface of mod_jk (it configuration)
    is presented as Addendum 2. The complete list of directives and
    their explanation as supplied by tomcat.apache.org is available
    as mod_jk_interface.html.

    5.1.2 mod_security
       The mod_security developers will keep the compatibility
    between releases of the same major number. (ie 2.y.z with 2 being
    the major number.) But there is no guarantee that meaning of a
    rule set (configuration directive) would be exactly the same
    across any two releases. The interface of mod_security (its 
    configuration) is presented in Addendum 1. The complete list of
    dirctives and their explanation (as provided by modsecurity.org)
    is available as mod_security_interface.html.

    5.1.3 mod_fcgid
       There were no commitments from mod_fcgid developers in this
    regard. (The mod_fcgid does not seem to have broken the
    configuration compatibility with any of its earlier releases
    yet [9] but is in very active developement). The interface of
    mod_fcgid (its configuration options) is presented as
    Addendum 3. The complete list of directives and their explanation
    as provided by fastcgi.coremail.cn is available as 
    mod_fcgid_interface.html


    5.1.4 mod_dtrace
        The mod_dtrace has had just two releases (0.2a and 0.3a) and
    is possibly very unstable. The interface of dtrace module consists
    of the apache functions it is hooking into. This is provided as 
    Addendum 4.
    

    5.2.    Imported Interfaces

    These Apache modules imports interfaces from

    NAME                      STABILITY        NOTES
    Apache2                    Uncommitted       PSARC/2007/586/   
    LDAP                       Evolving          PSARC/2000/362/
    PCRE                       Uncommitted       PSARC/2007/164/
    SUNWlxml                   Committed         PSARC/2001/175/
    Dtrace                     Uncommitted       PSARC/2001/466/

    5.3.    Exported Interfaces

    NAME                                                STABILITY
 
    /usr/apache2/2.2/libexec/mod_jk.so                  Volatile
    /usr/apache2/2.2/libexec/mod_fcgid.so               Volatile
    /usr/apache2/2.2/libexec/mod_security.so            Uncommitted
    /usr/apache2/2.2/libexec/mod_dtrace.so              Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_jk.so       Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_fcgid.so    Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_security.so Uncommitted
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_dtrace.so   Volatile


6.    References

   1. http://fastcgi.coremail.cn/
   2. http://tomcat.apache.org/connectors-doc/
   3. http://www.modsecurity.org/projects/modsecurity/apache/index.html
   4. http://prefetch.net/projects/apache_modtrace/index.html
   5. http://fastcgi.coremail.cn/doc.htm
   6. http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
   7. http://www.modsecurity.org/documentation/index.html
   8. http://prefetch.net/projects/apache_modtrace/mod_dtrace.c
   9. http://fastcgi.coremail.cn/download.htm


Addendum 1
mod_security interfaces:
    It includes the configuration directives, exposed variables, library
functions (transformation functions), operators and actions to be taken on
the URI

Configuration Directives
    SecAction
    SecArgumentSeparator
    SecAuditEngine
    SecAuditLog
    SecAuditLog2
    SecAuditLogParts
    SecAuditLogRelevantStatus
    SecAuditLogStorageDir
    SecAuditLogType
    SecChrootDir
    SecCookieFormat
    SecDataDir
    SecDebugLog
    SecDebugLogLevel
    SecDefaultAction
    SecGuardianLog
    SecRequestBodyAccess
    SecRequestBodyLimit
    SecRequestBodyInMemoryLimit
    SecResponseBodyLimit
    SecResponseBodyMimeType
    SecResponseBodyMimeTypesClear
    SecResponseBodyAccess
    SecRule
    SecRuleInheritance
    SecRuleEngine
    SecRuleRemoveById
    SecRuleRemoveByMsg
    SecServerSignature
    SecTmpDir
    SecUploadDir
    SecUploadKeepFiles
    SecWebAppId

Variables

    ARGS
    ARGS_COMBINED_SIZE
    ARGS_NAMES
    AUTH_TYPE
    ENV
    FILES
    FILES_COMBINED_SIZE
    FILES_NAMES
    FILES_SIZES
    FILES_TMPNAMES
    HTTP_
    MULTIPART_CRLF_LF_LINES
    MULTIPART_STRICT_ERROR
    MULTIPART_UNMATCHED_BOUNDARY
    PATH_INFO
    QUERY_STRING
    REMOTE_ADDR
    REMOTE_HOST
    REMOTE_PORT
    REMOTE_USER
    REQBODY_PROCESSOR
    REQBODY_PROCESSOR_ERROR
    REQBODY_PROCESSOR_ERROR_MSG
    REQUEST_BASENAME
    REQUEST_BODY
    REQUEST_COOKIES
    REQUEST_COOKIES_NAMES
    REQUEST_FILENAME
    REQUEST_HEADERS
    REQUEST_HEADERS_NAMES
    REQUEST_LINE
    REQUEST_METHOD
    REQUEST_PROTOCOL
    REQUEST_URI
    REQUEST_URI_RAW
    RESPONSE_BODY
    RESPONSE_HEADERS
    RESPONSE_HEADERS_NAMES
    RESPONSE_PROTOCOL
    RESPONSE_STATUS
    RULE
    SCRIPT_BASENAME
    SCRIPT_FILENAME
    SCRIPT_GID
    SCRIPT_GROUPNAME
    SCRIPT_MODE
    SCRIPT_UID
    SCRIPT_USERNAME
    SERVER_ADDR
    SERVER_NAME
    SERVER_PORT
    SESSION
    SESSIONID
    TIME
    TIME_DAY
    TIME_EPOCH
    TIME_HOUR
    TIME_MIN
    TIME_MON
    TIME_SEC
    TIME_WDAY
    TIME_YEAR
    TX
    USERID
    WEBAPPID
    WEBSERVER_ERROR_LOG
    XML

Transformation functions

    base64Decode
    base64Encode
    compressWhitespace
    escapeSeqDecode
    hexDecode
    hexEncode
    htmlEntityDecode
    lowercase
    md5
    none
    normalisePath
    normalisePathWin
    removeNulls
    removeWhitespace
    replaceComments
    replaceNulls
    urlDecode
    urlDecodeUni
    urlEncode
    sha1

Actions

    allow
    auditlog
    capture
    chain
    ctl
    deny
    deprecatevar
    drop
    exec
    expirevar
    id
    initcol
    log
    msg
    multiMatch
    noauditlog
    nolog
    pass
    pause
    phase
    proxy
    redirect
    rev
    sanitiseArg
    sanitiseMatched
    sanitiseRequestHeader
    sanitiseResponseHeader
    severity
    setuid
    setsid
    setenv
    setvar
    skip
    status
    t
    xmlns

Operators

    eq
    ge
    gt
    inspectFile
    le
    lt
    rbl
    rx
    validateByteRange
    validateDTD
    validateSchema
    validateUrlEncoding
    validateUtf8Encoding

Addendum 2:
Apache directives exposed by mod_jk

JkWorkersFile
JkWorkerProperty
JkShmFile
JkShmSize
JkMountFile
JkMountFileReload
JkMount
JkUnMount
JkAutoAlias
JkMountCopy
JkWorkerIndicator
JkLogFile
JkLogLevel
JkLogStampFormat
JkRequestLogFormat
JkExtractSSL
JkHTTPSIndicator
JkCERTSIndicator
JkCIPHERIndicator
JkCERTCHAINPrefix
JkSESSIONIndicator
JkKEYSIZEIndicator
JkOptions
JkEnvVar
JkStripSession

Addendum 3:
Apache directives exposed by mod_fcgid

IdleTimeout
IdleScanInterval
BusyTimeout
BusyScanInterval
ErrorScanInterval
ZombieScanInterval
ProcessLifeTime
SocketPath
SpawnScoreUpLimit
SpawnScore
TerminationScore
MaxProcessCount
DefaultMaxClassProcessCount
DefaultMinClassProcessCount
DefaultInitEnv
IPCConnectTimeout
IPCCommTimeout
OutputBufferSize
PHP_Fix_Pathinfo_Enable

Addendum 4:
Apache methods hooked into by mod_dtrace:

apache_receive_request
apache_log_request
apache_create_child
apache_accept_connection
apache_check_user
apache_check_access
apache_check_authorization
dtrace_register_hooks



--Boundary_(ID_QUUFOcR+f9AyrsyWvio1YQ)
Content-type: text/html; NAME=mod_fcgid_interface.html; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=mod_fcgid_interface.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Server: sf-web24 -->
<!--
  ~ SourceForge.net: Create, Participate, Evaluate
  ~ Copyright (c) 1999-2007 OSTG, Inc. All rights reserved.
  ~ @version $Id: header.html 21857 2008-01-07 16:21:40Z avoigt $
  -->

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<!-- DOCMANAGER DOCUMENT START -->




<p><b>IdleTimeout n (300
seconds)</b><p>An idle fastcgi application will be terminated after IdleTimeout
seconds. <p><b>IdleScanInterval n (120 seconds)</b><p>The scan interval for idle
fastcgi applications. <p><b>BusyTimeout n (300 seconds)</b><p>a fastcgi
application will be terminated if handing a single request longer than busy
timeout.<p><b>BusyScanInterval n (120 seconds)</b><p>The scan interval for busy
timeout fastcgi applications.<p><b>ErrorScanInterval n (3 seconds)</b><p>The
scan interval for exit pending fastcgi applications. fastcgi applications will
be terminated within this scanning.<p><b>ZombieScanInterval n (3 seconds)</b><p>The
scan interval for zombie process.&nbsp;<p><b>ProcessLifeTime n (3600 seconds)</b><p>A
fastcgi application will be terminated if lifetime expired, even no error is
detected.<p><b>SocketPath path (logs/fcgidsock)</b><p>The directory to put the
UNIX domain socket. (UNIX only)<p><b>SpawnScoreUpLimit n (10)</b><p>The
spawn-speed control score up water limit. Score increases while a process is spawned or terminated, and decreases
as time progresses; while the score is higher than <b>SpawnScoreUpLimit</b>, the spawning will be
held for a while. The higher this number is, the higher speed of the spawning
can be.<p><b>SpawnScore n (1)</b><p>The weight of spawning.&nbsp; This weight
will be plused to the spawn-control score on every spawn. The higher this number
is, the lower speed of spawning can be.<p><b>TerminationScore n (2)</b><p>The
weight of termination. This weight will be plused to the score while fastcgi
process terminates. The higher this number is, the lower speed of spawning can
be.<p><b>MaxProcessCount n (1000)</b><p>The max count of total fastcgi process
count.<p><b>DefaultMaxClassProcessCount n (100)</b><p>The maximum number of
fastcgi application instances allowed to run for any one fastcgi application.&nbsp;<p><b>DefaultMinClassProcessCount n
(3)</b><p>The minimum number of
fastcgi application instances for any one fastcgi application.&nbsp;<p><b>DefaultInitEnv&nbsp;
env_name env_value</b><p>The default environment variables before a fastcgi
application is spawned. You can set this configuration more
than once.<p><b>IPCConnectTimeout n (3 seconds)</b><p>The connect timeout to a
fastcgi application.&nbsp;<p><b>IPCCommTimeout n (20 seconds)</b><p>The communication
timeout to a fastcgi application. Please increase this value if your CGI have a
slow initialization or slow respond.<p><b>OutputBufferSize n (64k bytes)</b><p>CGI
output cache buffer size.<p><b>PHP_Fix_Pathinfo_Enable</b><b> n(n=0/1, default 0)</b><p>If
you are using PHP and set cgi.fix_pathinfo=1 in php.ini, set
PHP_Fix_Pathinfo_Enable 1.

</td>

</tr>

</table>


<!-- sf.net/safe_html -->
<!-- DOCMANAGER DOCUMENT END -->
</body>
</html>
 	  	 


--Boundary_(ID_QUUFOcR+f9AyrsyWvio1YQ)
Content-type: text/html; NAME=mod_jk_interface.html; charset=us-ascii
Content-transfer-encoding: QUOTED-PRINTABLE
Content-disposition: attachment; filename=mod_jk_interface.html

<html><head><META http-equiv=3D"Content-Type" content=3D"text/html; c=
harset=3Diso-8859-1"><title>The Apache Tomcat Connector - Reference G=
uide - Configuring Apache</title><meta name=3D"author" value=3D"Mlade=
n Turk"><meta name=3D"email" value=3D"mturk@apache.org"><link href=
=3D"../style.css" type=3D"text/css" rel=3D"stylesheet"></head><body b=
gcolor=3D"#ffffff" text=3D"#000000" link=3D"#525D76" alink=3D"#525D76=
" vlink=3D"#525D76"><table border=3D"0" width=3D"100%" cellspacing=
=3D"4"><!--PAGE HEADER--><tr><td colspan=3D"2"><!--TOMCAT LOGO--><a h=
ref=3D"http://tomcat.apache.org/"><img src=3D"../images/tomcat.gif" a=
lign=3D"left" alt=3D"Apache Tomcat" border=3D"0"></a><!--APACHE LOGO-=
-><a href=3D"http://www.apache.org/"><img src=3D"http://www.apache.or=
g/images/asf-logo.gif" align=3D"right" alt=3D"Apache Logo" border=
=3D"0"></a></td></tr><!--HEADER SEPARATOR--><tr><td colspan=3D"2"><hr=
 noshade=3D"noshade" size=3D"1"></td></tr><tr>
                <!--RIGHT SIDE MAIN BODY--><td width=3D"80%" valign=
=3D"top" align=3D"left"><table border=3D"0" width=3D"100%" cellspacin=
g=3D"4"><tr><td align=3D"left" valign=3D"top"><h1>The Apache Tomcat C=
onnector - Reference Guide</h1><h2>Configuring Apache</h2></td><td al=
ign=3D"right" valign=3D"top" nowrap=3D"true"><small><a href=3D"printe=
r/apache.html"><img src=3D"../images/printer.gif" border=3D"0" alt=
=3D"Printer Friendly Version"><br>print-friendly<br>version
                    </a></small></td></tr></table><table border=3D"0"=
 cellspacing=3D"0" cellpadding=3D"2" width=3D"100%"><tr><td bgcolor=
=3D"#525D76"><font color=3D"#ffffff" face=3D"arial,helvetica.sanserif=
"><a name=3D"Configuration Directives"><strong>Configuration Directiv=
es</strong></a></font></td></tr><tr><td><blockquote>
<p>
Most of the directives are allowed once in the global part of the Apa=
che httpd
configuration and once in every &lt;VirtualHost&gt; elements. Excepti=
ons from this rule are
explicitely listed in the table below.
</p>
<p>
Values are inherited from the main server to the virtual hosts.=20
Since version 1.2.20 they can be overwritten in the virtual hosts.
Exceptions from this rule are
again explicitely listed in the table below.
</p>
<p><b>Waring: If Apache httpd and Tomcat are configured to serve cont=
ent from
the same filing system location then care must be taken to ensure tha=
t httpd is
not able to serve inappropriate content such as the contents of the W=
EB-INF
directory or JSP source code.</b> This could occur if the httpd Docum=
entRoot
overlaps with a Tomcat Host's appBase or the docBase of any Context. =
It could
also occur when using the httpd Alias directive with a Tomcat Host's =
appBase or
the docBase of any Context.
</p>
<p>
Here are the all directives supported by Apache:
</p>
<table border=3D"1" cellpadding=3D"5"><tr><th width=3D"20%" bgcolor=
=3D"#023264"><font color=3D"#ffffff">Directive</font></th><th width=
=3D"80%" bgcolor=3D"#023264"><font color=3D"#ffffff">Description</fon=
t></th></tr><tr><td align=3D"left" valign=3D"center"><code>JkWorkersF=
ile</code></td><td align=3D"left" valign=3D"center"><p>
The name of a worker file for the Tomcat servlet containers.
<br>
This directive is only allowed once. It must be put into
 the global part of the configuration.
<br>
If you don't use the JkWorkerProperty directives, then you must
define your workers with a valid JkWorkersFile. There is no default
value.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkWorker=
Property</code></td><td align=3D"left" valign=3D"center"><p>
Enables setting worker properties inside Apache configuration file.
The syntax is the same as in the JkWorkersFile (usually workers.prope=
rties).
Simply prefix each line with "JkWorkerProperty" to put it directly in=
to
the Apache httpd config files.
<br>
This directive is allowed multiple times.
It must be put into the global part of the configuration.
<br>
If you don't use the JkWorkerProperty directives, then you must
define your workers with a valid JkWorkersFile. There is no default
value.
<br>
This directive is available in jk1.2.7 version and later.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkShmFil=
e</code></td><td align=3D"left" valign=3D"center"><p>
Shared memory file name. Used only on unix platforms.
The shm file is used by balancer and status workers.
<br>
This directive is only allowed once. It must be put into
 the global part of the configuration.
<br>
The default value is logs/jk-runtime-status.
It is highly recommended that the shm file be placed on a local
drive and not an NFS share.
</p>
<p>
The shared memory contains configuration and runtime information for =
load balancer
workers and their members. It is need in order that all apache childr=
en
<ul>
<li>share the same status information for load balancing members (OK,=
 ERROR, ...),</li>
<li>share the information about load taken by the individual workers,=
</li>
<li>share the information for the parts of the configuration, which a=
re changeable
during runtime by status workers.</li>
</ul>
</p>
</td></tr><tr><td align=3D"left" valign=3D"center"><code>JkShmSize</c=
ode></td><td align=3D"left" valign=3D"center"><p>
Size of the shared memory file name.
<br>
This directive is only allowed once. It must be put into
 the global part of the configuration.
<br>
The default value depends on the platform. It is usually less than 64=
KB.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkMountF=
ile</code></td><td align=3D"left" valign=3D"center"><p>
File containing multiple mappings from a context to a Tomcat worker.
It is usually called uriworkermap.properties.
<br>
For inheritance rules, see: JkMountCopy.
<br>
There is no default value.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkMountF=
ileReload</code></td><td align=3D"left" valign=3D"center"><p>
This directive configures the reload check interval in seconds.
The JkMountFile is checked periodically for changes.
A changed file gets reloaded automatically. If you set
this directive to "0", reload checking is turned off.
<br>
The default value is 60 seconds.
<br>
This directive has been added in version 1.2.20 of mod_jk.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkMount<=
/code></td><td align=3D"left" valign=3D"center"><p>
A mount point from a context to a Tomcat worker.
<br>
This directive is allowed multiple times.
It is allowed in the global configuration and in VirtualHost.
You can also use it inside Location with a different syntax.
Inside Location, one omits the first argument (path),
which gets inherited from the Location.
For inheritance rules, see: JkMountCopy.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkUnMoun=
t</code></td><td align=3D"left" valign=3D"center"><p>
An exclusion mount point from a context to a Tomcat worker.
All exclusion mounts are checked after mapping a request
to a tomcat worker. If the request maps also to an exclusion,
it will not be forwarded to tomcat, and instead be served locally.
<br>
This directive is allowed multiple times.
It is allowed in the global configuration and in VirtualHost.
You can also use it inside Location with a different syntax.
Inside Location, one omits the first argument (path),
which gets inherited from the Location.
For inheritance rules, see: JkMountCopy.
<br>
This directive is available in jk1.2.7 version and later.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkAutoAl=
ias</code></td><td align=3D"left" valign=3D"center"><p>
Automatically Alias webapp context directories into the Apache
document space.
<br>
Care should be taken to ensure that only static content is served via=
 httpd as a
result of using this directive. Any static content served by httpd wi=
ll bypass any
security constraints defined in the application's web.xml.
<br>
For inheritance rules, see: JkMountCopy.
<br>
There is no default value.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkMountC=
opy</code></td><td align=3D"left" valign=3D"center"><p>
If this directive is set to "On" in some virtual server,
the mounts from the global server will be copied to the
virtual server, more precisely all mounts defined by JkMount
or JkUnMount. The Mounts defined by JkMountFile and JkAutoAlias
will only be inherited, if the VirtualHost does not define
it's own JkMountFile or JkAutoAlias.
<br>
If you want all vhost to inherit mounts from the main server,
you can set JkMountCopy to 'All' in the main server.
<br>
This directive is only allowed inside VirtualHost (with value "On")
and in the global server (with value "All").
<br>
The default is Off.
<br>
Starting with version 1.2.26 you can also set it to "All" in the
global virtual server. This will switch the default to On.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkWorker=
Indicator</code></td><td align=3D"left" valign=3D"center"><p>
Name of the Apache environment variable that can be used to set worke=
r names
in combination with SetHandler jakarta-servlet.
<br>
This directive is only allowed once per virtual server.
It is allowed in the global configuration and in VirtualHost.
<br>
The default value is JK_WORKER_NAME.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkLogFil=
e</code></td><td align=3D"left" valign=3D"center"><p>
Full or server relative path to the Tomcat Connector module log file.
It will also work with pipe, by using a value of the form "| ...".
<br>
The default value is logs/mod_jk.log.
<br>
Pipes are supported for Apache 1.3 only since version 1.2.16.
The default value exists only since version 1.2.20.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkLogLev=
el</code></td><td align=3D"left" valign=3D"center"><p>
The Tomcat Connector module log level, can be debug, info, warn
error or trace.
<br>
The default value is info.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkLogSta=
mpFormat</code></td><td align=3D"left" valign=3D"center"><p>
The Tomcat Connector module <b>date</b> log format, using an
extended strftime syntax.
This format will be used for the time stamps in the JkLogFile.
The maximum length of the format is 63 characters.
<br>
Starting with version 1.2.24 of mod_jk you can also use %Q
for adding milliseconds to the log and %q for microseconds.=20
These conversion specifiers are an extension to strftime.
They will only work on platforms with a gettimeofday() function.
You can use %Q and %q only once in the pattern and also not both
together in the same pattern.
<br>
The default value is "[%a %b %d %H:%M:%S %Y] " and beginning
with version 1.2.24 on platforms with a gettimeofday()
function it is "[%a %b %d %H:%M:%S.%Q %Y] ".
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkReques=
tLogFormat</code></td><td align=3D"left" valign=3D"center"><p>
Request log format string. See detailed description below.
<br>
There is no default value. Without defining a value, the request logg=
ing
is turned off.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkExtrac=
tSSL</code></td><td align=3D"left" valign=3D"center"><p>
Turns on SSL processing and information gathering by mod_jk
<br>
The default value is On.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkHTTPSI=
ndicator</code></td><td align=3D"left" valign=3D"center"><p>
Name of the Apache environment variable that contains SSL indication.
<br>
The default value is "HTTPS".
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkCERTSI=
ndicator</code></td><td align=3D"left" valign=3D"center"><p>
Name of the Apache environment variable that contains SSL client cert=
ificates.
<br>
The default value is "SSL_CLIENT_CERT".
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkCIPHER=
Indicator</code></td><td align=3D"left" valign=3D"center"><p>
Name of the Apache environment variable that contains SSL client ciph=
er.
<br>
The default value is "SSL_CIPHER".
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkCERTCH=
AINPrefix</code></td><td align=3D"left" valign=3D"center"><p>
Name of the Apache environment (prefix) that contains SSL client chai=
n certificates.
<br>
The default value is "SSL_CLIENT_CERT_CHAIN_".
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkSESSIO=
NIndicator</code></td><td align=3D"left" valign=3D"center"><p>
Name of the Apache environment variable that contains SSL session.
<br>
The default value is "SSL_SESSION_ID".
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkKEYSIZ=
EIndicator</code></td><td align=3D"left" valign=3D"center"><p>
Name of the Apache environment variable that contains SSL key size in=
 use.
<br>
The default value is "SSL_CIPHER_USEKEYSIZE".
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkOption=
s</code></td><td align=3D"left" valign=3D"center"><p>
Set one of more options to configure the mod_jk module. See below for
details about this directive.
<br>
This directive can be used multiple times per virtual server.
<br>
The default value is "ForwardURIProxy" since version 1.2.24.
It was "ForwardURICompatUnparsed" in version 1.2.23 and
"ForwardURICompat" until version 1.2.22.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkEnvVar=
</code></td><td align=3D"left" valign=3D"center"><p>
Adds a name and an optional default value of environment variable
that should be sent to servlet-engine as a request attribute.
If the default value is not given explicitely, the variable
will only be send, if it is set during runtime.
<br>
This directive can be used multiple times per virtual server.
<br>
The default is empty, so no additional variables will be sent.
<br>
Empty default values are supported since version 1.2.20.
Not sending variables with empty defaults and empty runtime value
has been introduced in version 1.2.21.
</p></td></tr><tr><td align=3D"left" valign=3D"center"><code>JkStripS=
ession</code></td><td align=3D"left" valign=3D"center"><p>
If this directive is set to On in some virtual server,
the session IDs <b class=3D"code">;jsessionid=3D...</b> will be
removed for non matched URLs.
<br>
This directive is only allowed inside VirtualHost.
<br>
The default is Off.
<br>
This directive has been introduced in version 1.2.21.
</p></td></tr></table>
</blockquote></td></tr></table><table border=3D"0" cellspacing=3D"0" =
cellpadding=3D"2" width=3D"100%"><tr><td bgcolor=3D"#525D76"><font co=
lor=3D"#ffffff" face=3D"arial,helvetica.sanserif"><a name=3D"Configur=
ation Directives Types"><strong>Configuration Directives Types</stron=
g></a></font></td></tr><tr><td><blockquote>
<p>
We'll discuss here the mod_jk directive types.
</p>

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"2" width=3D"100%=
"><tr><td bgcolor=3D"#828DA6"><font color=3D"#ffffff" face=3D"arial,h=
elvetica.sanserif"><a name=3D"Define workers"><strong>Define workers<=
/strong></a></font></td></tr><tr><td><blockquote>
<p>
<b>JkWorkersFile</b> specify the location where mod_jk will find the =
workers definitions.
Take a look at <a href=3D"workers.html">Workers documentation</a> for=
 detailed description.

<div class=3D"example"><pre>
 =20
  JkWorkersFile     /etc/httpd/conf/workers.properties
</pre></div>

<br>
<br>
</p>

</blockquote></td></tr></table>

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"2" width=3D"100%=
"><tr><td bgcolor=3D"#828DA6"><font color=3D"#ffffff" face=3D"arial,h=
elvetica.sanserif"><a name=3D"Logging"><strong>Logging</strong></a></=
font></td></tr><tr><td><blockquote>
<p>
<b>JkLogFile</b> specify the location where mod_jk is going to place =
its log file.
</p>

<div class=3D"example"><pre>
  JkLogFile     /var/log/httpd/mod_jk.log
</pre></div>

<p>
Since JK 1.2.3 for Apache 2.0 and JK 1.2.16 for Apache 1.3 this can a=
lso
be used for piped logging:
</p>

<div class=3D"example"><pre>
  JkLogFile     "|/usr/bin/rotatelogs /var/log/httpd/mod_jk.log 86400=
"
</pre></div>

<p>
<b>JkLogLevel</b>
set the log level between :
</p>

<ul>
<li>
<b>info</b> log will contain standard mod_jk activity (default).
</li>
<li>
<b>warn</b> log will contain non fatal error reports.
</li>
<li>
<b>error</b> log will contain also error reports.
</li>
<li>
<b>debug</b> log will contain all information on mod_jk activity
</li>
<li>
<b>trace</b> log will contain all tracing information on mod_jk activ=
ity
</li>
</ul>

<div class=3D"example"><pre> =20
  JkLogLevel    info
</pre></div>

<p>
<b class=3D"code">info</b> should be your default selection for norma=
l operations.
<br>
<br>
</p>

<p>
<b>JkLogStampFormat</b> will configure the date/time format found on =
mod_jk log file.=20
Using the strftime() format string it's set by<br>
default to <b>"[%a %b %d %H:%M:%S %Y]"</b>
</p>

<div class=3D"example"><pre>
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
</pre></div>

<p>
<br>
<br>
</p>

<p>
<b>JkRequestLogFormat</b> will configure the format of mod_jk individ=
ual request logging.=20
Request logging is configured and enabled on a per virtual host basis=
.=20
To enable request logging for a virtual host just add a JkRequestLogF=
ormat config.=20
The syntax of the format string is similar to the Apache LogFormat co=
mmand,=20
here is a list of the available request log format options:
</p>
                      =20
<p>
<table border=3D"1" cellpadding=3D"5"><tr><th width=3D"20%" bgcolor=
=3D"#023264"><font color=3D"#ffffff">Options</font></th><th width=
=3D"80%" bgcolor=3D"#023264"><font color=3D"#ffffff">Description</fon=
t></th></tr><tr><td align=3D"left" valign=3D"center"><code>%b</code><=
/td><td align=3D"left" valign=3D"center">Bytes sent, excluding HTTP h=
eaders (CLF format)</td></tr><tr><td align=3D"left" valign=3D"center"=
><code>%B</code></td><td align=3D"left" valign=3D"center">Bytes sent,=
 excluding HTTP headers</td></tr><tr><td align=3D"left" valign=3D"cen=
ter"><code>%H</code></td><td align=3D"left" valign=3D"center">The req=
uest protocol</td></tr><tr><td align=3D"left" valign=3D"center"><code=
>%m</code></td><td align=3D"left" valign=3D"center">The request metho=
d</td></tr><tr><td align=3D"left" valign=3D"center"><code>%p</code></=
td><td align=3D"left" valign=3D"center">The canonical Port of the ser=
ver serving the request</td></tr><tr><td align=3D"left" valign=3D"cen=
ter"><code>%q</code></td><td align=3D"left" valign=3D"center">The que=
ry string (prepended with a ? if a query string exists, otherwise an =
empty string)</td></tr><tr><td align=3D"left" valign=3D"center"><code=
>%r</code></td><td align=3D"left" valign=3D"center">First line of req=
uest</td></tr><tr><td align=3D"left" valign=3D"center"><code>%s</code=
></td><td align=3D"left" valign=3D"center">Request HTTP status code</=
td></tr><tr><td align=3D"left" valign=3D"center"><code>%T</code></td>=
<td align=3D"left" valign=3D"center">Request duration, elapsed time t=
o handle request in seconds '.' micro seconds</td></tr><tr><td align=
=3D"left" valign=3D"center"><code>%U</code></td><td align=3D"left" va=
lign=3D"center">The URL path requested, not including any query strin=
g.</td></tr><tr><td align=3D"left" valign=3D"center"><code>%v</code><=
/td><td align=3D"left" valign=3D"center">The canonical ServerName of =
the server serving the request</td></tr><tr><td align=3D"left" valign=
=3D"center"><code>%V</code></td><td align=3D"left" valign=3D"center">=
The server name according to the UseCanonicalName setting</td></tr><t=
r><td align=3D"left" valign=3D"center"><code>%w</code></td><td align=
=3D"left" valign=3D"center">Tomcat worker name</td></tr><tr><td align=
=3D"left" valign=3D"center"><code>%R</code></td><td align=3D"left" va=
lign=3D"center">Real worker name</td></tr></table>

<div class=3D"example"><pre>
  JkRequestLogFormat     "%w %V %T"
</pre></div>

<br>
<br>
</p>

<p>
You can also log mod_jk information using the Apache standard module =
<b>mod_log_config</b>.
The module sets several notes in the Apache httpd notes table.
Most of them are are only useful in combination with a load balancer =
worker.
</p>
                      =20
<p>
<table border=3D"1" cellpadding=3D"5"><tr><th width=3D"20%" bgcolor=
=3D"#023264"><font color=3D"#ffffff">Note</font></th><th width=3D"80%=
" bgcolor=3D"#023264"><font color=3D"#ffffff">Description</font></th>=
</tr><tr><td align=3D"left" valign=3D"center"><code>JK_WORKER_NAME</c=
ode></td><td align=3D"left" valign=3D"center">Name of the worker sele=
cted by the URI mapping</td></tr><tr><td align=3D"left" valign=3D"cen=
ter"><code>JK_WORKER_TYPE</code></td><td align=3D"left" valign=3D"cen=
ter">Type of the worker selected by the URI mapping</td></tr><tr><td =
align=3D"left" valign=3D"center"><code>JK_WORKER_ROUTE</code></td><td=
 align=3D"left" valign=3D"center">Actual worker name selected by the =
URI mapping (usually a member of the load balancer).<br>
                                                         Before versi=
on 1.2.26 only available if JkRequestLogFormat is set.</td></tr><tr><=
td align=3D"left" valign=3D"center"><code>JK_REQUEST_DURATION</code><=
/td><td align=3D"left" valign=3D"center">Request duration in seconds =
and microseconds.<br>
                                                         Before versi=
on 1.2.26 only available if JkRequestLogFormat is set.</td></tr><tr><=
td align=3D"left" valign=3D"center"><code>JK_LB_FIRST_NAME</code></td=
><td align=3D"left" valign=3D"center">Load-Balancer: Name of the firs=
t worker tried</td></tr><tr><td align=3D"left" valign=3D"center"><cod=
e>JK_LB_FIRST_TYPE</code></td><td align=3D"left" valign=3D"center">Lo=
ad-Balancer: Type of the first worker tried</td></tr><tr><td align=
=3D"left" valign=3D"center"><code>JK_LB_FIRST_ACCESSED</code></td><td=
 align=3D"left" valign=3D"center">Load-Balancer: Access count for the=
 first worker tried</td></tr><tr><td align=3D"left" valign=3D"center"=
><code>JK_LB_FIRST_READ</code></td><td align=3D"left" valign=3D"cente=
r">Load-Balancer: Bytes read for the first worker tried</td></tr><tr>=
<td align=3D"left" valign=3D"center"><code>JK_LB_FIRST_TRANSFERRED</c=
ode></td><td align=3D"left" valign=3D"center">Load-Balancer: Bytes tr=
ansferred for the first worker tried</td></tr><tr><td align=3D"left" =
valign=3D"center"><code>JK_LB_FIRST_ERRORS</code></td><td align=3D"le=
ft" valign=3D"center">Load-Balancer: Error count for the first worker=
 tried</td></tr><tr><td align=3D"left" valign=3D"center"><code>JK_LB_=
FIRST_BUSY</code></td><td align=3D"left" valign=3D"center">Load-Balan=
cer: Busy count for the first worker tried</td></tr><tr><td align=
=3D"left" valign=3D"center"><code>JK_LB_FIRST_ACTIVATION</code></td><=
td align=3D"left" valign=3D"center">Load-Balancer: Activation state f=
or the first worker tried</td></tr><tr><td align=3D"left" valign=3D"c=
enter"><code>JK_LB_FIRST_STATE</code></td><td align=3D"left" valign=
=3D"center">Load-Balancer: Error state for the first worker tried</td=
></tr><tr><td align=3D"left" valign=3D"center"><code>JK_LB_LAST_NAME<=
/code></td><td align=3D"left" valign=3D"center">Load-Balancer: Name o=
f the last worker tried</td></tr><tr><td align=3D"left" valign=3D"cen=
ter"><code>JK_LB_LAST_TYPE</code></td><td align=3D"left" valign=3D"ce=
nter">Load-Balancer: Type of the last worker tried</td></tr><tr><td a=
lign=3D"left" valign=3D"center"><code>JK_LB_LAST_ACCESSED</code></td>=
<td align=3D"left" valign=3D"center">Load-Balancer: Access count for =
the last worker tried</td></tr><tr><td align=3D"left" valign=3D"cente=
r"><code>JK_LB_LAST_READ</code></td><td align=3D"left" valign=3D"cent=
er">Load-Balancer: Bytes read for the last worker tried</td></tr><tr>=
<td align=3D"left" valign=3D"center"><code>JK_LB_LAST_TRANSFERRED</co=
de></td><td align=3D"left" valign=3D"center">Load-Balancer: Bytes tra=
nsferred for the last worker tried</td></tr><tr><td align=3D"left" va=
lign=3D"center"><code>JK_LB_LAST_ERRORS</code></td><td align=3D"left"=
 valign=3D"center">Load-Balancer: Error count for the last worker tri=
ed</td></tr><tr><td align=3D"left" valign=3D"center"><code>JK_LB_LAST=
_BUSY</code></td><td align=3D"left" valign=3D"center">Load-Balancer: =
Busy count for the last worker tried</td></tr><tr><td align=3D"left" =
valign=3D"center"><code>JK_LB_LAST_ACTIVATION</code></td><td align=
=3D"left" valign=3D"center">Load-Balancer: Activation state for the l=
ast worker tried</td></tr><tr><td align=3D"left" valign=3D"center"><c=
ode>JK_LB_LAST_STATE</code></td><td align=3D"left" valign=3D"center">=
Load-Balancer: Error state for the last worker tried</td></tr></table=
>

<div class=3D"example"><pre>
  LogFormat     "%h %l %u %t \"%r\" %&gt;s %b %{JK_WORKER_NAME}n %{JK=
_LB_FIRST_NAME}n \
                 %{JK_LB_FIRST_BUSY}n %{JK_LB_LAST_NAME}n %{JK_LB_LAS=
T_BUSY}n" mod_jk_log
  CustomLog     logs/access_log     mod_jk_log
</pre></div>

<br>
<br>
</p>

</blockquote></td></tr></table>

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"2" width=3D"100%=
"><tr><td bgcolor=3D"#828DA6"><font color=3D"#ffffff" face=3D"arial,h=
elvetica.sanserif"><a name=3D"Forwarding"><strong>Forwarding</strong>=
</a></font></td></tr><tr><td><blockquote>
<p>
The directive JkOptions allow you to set many forwarding options whic=
h will enable (+)
or disable (-) following option. Without any leading signs, options w=
ill be enabled.
<br>
<br>
</p>

<p>
The four following options <b>+ForwardURIxxx</b> are mutually exclusi=
ve.
Exactly one of them is required, a negative sign prefix is not allowe=
d with them.
The default value is "ForwardURIProxy" since version 1.2.24.
It was "ForwardURICompatUnparsed" in version 1.2.23 and
"ForwardURICompat" until version 1.2.22.
You can turn the default off by switching on one of the other two opt=
ions.
You should leave this at it's default value, unless you have a very g=
ood
reason to change it.
<br>
<br>
</p>

<p>
All options are inherited from the global server to virtual hosts.
Options that support enabling (plus options) and disabling (minus opt=
ions),
are inherited in the following way:
<br>
<br>
options(vhost) =3D plus_options(global) - minus_options(global) + plu=
s_options(vhost) - minus_options(vhost)
<br>
<br>
</p>

<p>
Using JkOptions <b>ForwardURIProxy</b>, the forwarded URI
will be partially reencoded after processing inside Apache httpd and
before forwarding to Tomcat. This will be compatible with local
URL manipulation by mod_rewrite and with URL encoded session ids.

<div class=3D"example"><pre>
  JkOptions     +ForwardURIProxy
</pre></div>

<br>
<br>
</p>

<p>
Using JkOptions <b>ForwardURICompatUnparsed</b>, the forwarded URI
will be unparsed. It's spec compliant and secure.
It will always forward the original request URI, so rewriting
URIs with mod_rewrite and then forwarding the rewritten URI
will not work.

<div class=3D"example"><pre>
  JkOptions     +ForwardURICompatUnparsed
</pre></div>

<br>
<br>
</p>

<p>
Using JkOptions <b>ForwardURICompat</b>, the forwarded URI will
be decoded by Apache httpd. Encoded characters will be decoded and
explicit path components like ".." will already be resolved.
This is less spec compliant and is <b>not safe</b> if you are using
prefix JkMount. This option will allow to rewrite URIs with
mod_rewrite before forwarding.

<div class=3D"example"><pre>
  JkOptions     +ForwardURICompat
</pre></div>

<br>
<br>
</p>

<p>
Using JkOptions <b>ForwardURIEscaped</b>, the forwarded URI will
be the encoded form of the URI used by ForwardURICompat.
Explicit path components like ".." will already be resolved.
This will not work in combination with URL encoded session IDs,
but it will allow to rewrite URIs with mod_rewrite before forwarding.

<div class=3D"example"><pre>
  JkOptions     +ForwardURIEscaped
</pre></div>

<br>
<br>
</p>

<p>
JkOptions <b>RejectUnsafeURI</b> will block all
URLs, which contain percent signs '%' or backslashes '\'
after decoding.
<br>
<br>
</p>
<p>
Most web apps do not use such URLs. Using the option RejectUnsafeURI,=
 you
can block several well known URL encoding attacks. By default, this o=
ption
is not set.
</p>
<p>
You can also realize such a check with mod_rewrite, which is more pow=
erful
but also slightly more complicated.

<div class=3D"example"><pre> =20
  JkOptions     +RejectUnsafeURI
</pre></div>

<br>
<br>
</p>

<p>
JkOptions <b>ForwardDirectories</b> is used in conjunction with <b>Di=
rectoryIndex</b>
directive of Apache web server. As such mod_dir should be available t=
o Apache,
statically or dynamically (DSO)
<br>
<br>
</p>

<p>
When DirectoryIndex is configured, Apache will create sub-requests fo=
r
each of the local-url's specified in the directive, to determine if t=
here is a
local file that matches (this is done by stat-ing the file).
</p>

<p>
If ForwardDirectories is set to false (default) and Apache doesn't fi=
nd any
files that match, Apache will serve the content of the directory (if =
directive
Options specifies Indexes for that directory) or a <b class=3D"code">=
403 Forbidden</b> response (if
directive Options doesn't specify Indexes for that directory).
</p>

<p>
If ForwardDirectories is set to true and Apache doesn't find any file=
s that
match, the request will be forwarded to Tomcat for resolution. This i=
s used in
cases when Apache cannot see the index files on the file system for v=
arious
reasons: Tomcat is running on a different machine, the JSP file has b=
een
precompiled etc.=20
</p>

<p>Note that locally visible files will take precedence over the
ones visible only to Tomcat (i.e. if Apache can see the file, that's =
the one
that's going to get served). This is important if there is more then =
one type of
file that Tomcat normally serves - for instance Velocity pages and JS=
P pages.

<div class=3D"example"><pre> =20
  JkOptions     +ForwardDirectories
</pre></div>
<br>
<br>
</p>

<p>
JkOptions <b>ForwardLocalAddress</b>, you ask mod_jk to send the loca=
l address,
of the Apache web server instead remote client address. This can be u=
sed by
Tomcat remote address valve for allowing connections only from regist=
ered Apache
web servers.

<div class=3D"example"><pre> =20
  JkOptions     +ForwardLocalAddress
</pre></div>

<br>
<br>
</p>

<p>
JkOptions <b>FlushPackets</b>, you ask mod_jk to flush Apache's conne=
ction
buffer after each AJP packet chunk received from Tomcat. This option =
can have
a strong performance penalty for Apache and Tomcat as writes are perf=
ormed
more often than would normally be required (ie: at the end of each
response).

<div class=3D"example"><pre> =20
  JkOptions     +FlushPackets
</pre></div>

<br>
<br>
</p>

<p>
JkOptions <b>FlushHeader</b>, you ask mod_jk to flush Apache's connec=
tion
buffer after the response headers have been  received from Tomcat.

<div class=3D"example"><pre> =20
  JkOptions     +FlushHeader
</pre></div>

<br>
<br>
</p>

<p>
JkOptions <b>DisableReuse</b>, you ask mod_jk to close connections im=
mediately
after their use. Normally mod_jk uses persistent connections and pool=
s idle
connections to reuse them, when new requests have to be sent to Tomca=
t.
</p>

<p>
Using this option will have a strong performance penalty for Apache a=
nd Tomcat.
Use this only as a last resort in case of unfixable network problems.
If a firewall between Apache and Tomcat silently kills idle connectio=
ns,
try to use the worker attribute socket_keepalive in combination with =
an appropriate
TCP keepalive value in your OS.

<div class=3D"example"><pre> =20
  JkOptions     +DisableReuse
</pre></div>

<br>
<br>
</p>

<p>
JkOptions <b>ForwardKeySize</b>,  you ask mod_jk, when using ajp13, t=
o forward also the SSL Key Size  as=20
required by Servlet API 2.3.
This flag shouldn't be set when servlet engine is Tomcat 3.2.x (on by=
 default).

<div class=3D"example"><pre> =20
  JkOptions     +ForwardKeySize
</pre></div>

<br>
<br>
</p>

<p>
JkOptions <b>ForwardSSLCertChain</b>,  you ask mod_jk, when using ajp=
13,
to forward SSL certificate chain (off by default).
Mod_jk only passes the <b class=3D"code">SSL_CLIENT_CERT</b> to the A=
JP connector. This is not a
problem with self-signed certificates or certificates directly signed=
 by the
root CA certificate. However, there's a large number of certificates =
signed by
an intermediate CA certificate, where this is a significant problem: =
A servlet
will not have the possibility to validate the client certificate on i=
ts own. The
bug would be fixed by passing on the <b class=3D"code">SSL_CLIENT_CER=
T_CHAIN</b> to Tomcat via the AJP connector.
<br>
This directive exists only since version 1.2.22.
<div class=3D"example"><pre> =20
  JkOptions     +ForwardSSLCertChain
</pre></div>

<br>
<br>
</p>

<p>
The directive <b>JkEnvVar</b> allows you to forward environment varia=
bles from Apache server to Tomcat engine.
The variables can be retrieved on the Tomcat side as request attribut=
es.
You can add a default value as a second parameter to the directive.
If the default value is not given explicitely, the variable
will only be send, if it is set during runtime.
<br>
<br>
The variables are inherited from the global server to virtual hosts.

<div class=3D"example"><pre> =20
  JkEnvVar     SSL_CLIENT_V_START     undefined
</pre></div>
<br>
<br>
</p>

</blockquote></td></tr></table>

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"2" width=3D"100%=
"><tr><td bgcolor=3D"#828DA6"><font color=3D"#ffffff" face=3D"arial,h=
elvetica.sanserif"><a name=3D"Assigning URLs to Tomcat"><strong>Assig=
ning URLs to Tomcat</strong></a></font></td></tr><tr><td><blockquote>
<p>
If you have created a custom or local version of mod_jk.conf-local as=
 noted above,=20
you can change settings such as the workers or URL prefix.
</p>
<p>
<b>JkMount</b> directive assign specific URLs to Tomcat.=20
In general the structure of a JkMount directive is:
</p>

<div class=3D"example"><pre> =20
  JkMount [URL prefix] [Worker name]
</pre></div>

<div class=3D"example"><pre>
  # send all requests ending in .jsp to worker1
  JkMount /*.jsp worker1
  # send all requests ending /servlet to worker1
  JkMount /*/servlet/ worker1
  # send all requests jsp requests to files located in /otherworker w=
ill go worker2
  JkMount /otherworker/*.jsp worker2
</pre></div>

<p>
You can use the JkMount directive at the top level or inside &lt;Virt=
ualHost&gt;
sections of your httpd.conf file.
</p>
<p><b>JkUnMount</b> directive acts as an opposite to JkMount and bloc=
ks access
to a particular URL. The purpose is to be able to filter out the part=
icular content
types from mounted context. The following example mounts /servlet/*
context, but all .gif files that belongs to that context are not serv=
ed.
</p>
<div class=3D"example"><pre>
  # send all requests ending with /servlet to worker1
  JkMount /servlet/* worker1
  # do not send requests ending with .gif to worker1
  JkUnMount /servlet/*.gif worker1
</pre></div>
<p>
JkUnMount takes precedence over JkMount directives, meaning that the =
JK
will first try to mount and then checks, if there is an exclusiond de=
fined by a
JkUnMount. A JkUnMount overrides a JkMount only, if the worker names =
in the
JkMount and in the JkUnMount are the same.
</p>
<p>
The following example will block all .gif files although there is a J=
kMount for them:
</p>
<div class=3D"example"><pre>
  # do not send requests ending with .gif to worker1
  JkUnMount /*.gif worker1
  # The .gif files will not be mounted cause JkUnMount takes
  # precedence over JkMount directive
  JkMount /servlet/*.gif worker1
</pre></div>
<p>
Starting with version 1.2.26 of JK you can apply a JkUnMount to any w=
orker,
by using the star character '*' as the worker name in the JkUnMount.
More complex patterns in JkUnMount worker names are not allowed.
</p>
<div class=3D"example"><pre>
  # Mapping the webapps myapp1 and myapp2:
  /myapp1/*=3Dworker1
  /myapp2/*=3Dworker2
  # Exclude the all subdirectories static for all workers:
  !/*/static/*=3D*
  # Exclude some suffixes for all workers:
  !*.html=3D*
</pre></div>
<p>
<b>JkAutoAlias</b> directive automatically <b>Alias</b> webapp contex=
t directories into
the Apache document space. It enables Apache to serve a static contex=
t while Tomcat
serving dynamic context. This directive is used for convenience so th=
at you don't
have to put an apache Alias directive for each application directory =
inside Tomcat's
webapp directory. For security reasons is is strongly recommended tha=
t JkMount
is used to pass all requests to Tomcat by default and JkUnMount is us=
ed to
explicitly exclude static content to be served by httpd. It should al=
so be noted
that content served by httpd will bypass any security constraints def=
ined in the
application's web.xml.
</p>
<div class=3D"example"><pre>
  # enter the full path to the tomcat webapps directory
  JkAutoAlias /opt/tomtact/webapps
</pre></div>
<p>The following example shows how to serve a dynamic context by
Tomcat and static using Apache. The webapps directory has to
be accessible by apache.</p>

<div class=3D"example"><pre>
  # enter the full path to the tomcat webapps directory
  JkAutoAlias /opt/tomtact/webapps

  # Mount 'servlets-examples' directory. It's physical location
  # is assumed to be in the /opt/tomtact/webapps/servlets-examples
  # ajp13w is a worker defined in the workers.properties
  JkMount /servlets-examples/* ajp13w

  # Unmount desired static content from servlets-examples webapp.
  # This content will be served by the httpd directly.
  JkUnMount /servlets-examples/*.gif ajp13w
  JkUnMount /servlets-examples/*.jpg ajp13w
</pre></div>
<p>Note that you can have a single JkAutoAlias directive per virtual
host inside your httpd.conf
</p>
<p>
<b>JkWorkerProperty</b> is a new directive available from JK 1.2.7
version. It is a convenient method for setting directives that are
usually set inside <b>workers.propeties</b> file. The parameter for
that directive is raw line from workers.properties file.
</p>
<div class=3D"example"><pre>
  # Just like workers.properties but exact line is prefixed
  # with JkWorkerProperty

  # Minimal jk configuration
  JkWorkerProperty worker.list=3Dajp13w
  JkWorkerProperty worker.ajp13w.type=3Dajp13
  JkWorkerProperty worker.ajp13w.host=3Dlocalhost
  JkWorkerProperty worker.ajp13w.port=3D8009  =20
</pre></div>
<p>
<b>JkMountFile</b> is a new directive available from JK 1.2.9
version. It is used for dynamic updates of mount points at runtime.
When the mount file is changed, JK will reload it's content.
</p>
<div class=3D"example"><pre>
  # Load mount points

  JkMountFile conf/uriworkermap.properties
</pre></div>
<p>If the mount point uri starts with an exclamation mark '!'
it defines an exclusion in the same way JkUnMount does.
If the mount point uri starts with minus sign '-'
the mount point will only be disabled. A disabled mount can be reenab=
led
by deleting the minus sign and waiting for the JkMountFile to reload.
An exclusion can be disabled by prefixing it with a mninus sign.
</p>
<div class=3D"example"><pre>
  # Sample uriworkermap.properties file

  /servlets-examples/*=3Dajp13w
  # Do not map .jpeg files
  !/servlets-examples/*.jpeg=3Dajp13w
  # Make jsp examples initially disabled =20
  -/jsp-examples/*=3Dajp13w
</pre></div>
<p>At run time you can change the content of this file. For example
removing minus signs will enable the previously disabled uri mappings=
.
You can add any number of new entries at runtime that reflects the ne=
wly deployed
applications. Apache will reload the file and update the mount
points within 60 second interval.
</p>
<p>
There is no way to delete entries by dynamic reloading, but you can d=
isable or
exclude mappings.
<br>
<br>
</p>

</blockquote></td></tr></table>

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"2" width=3D"100%=
"><tr><td bgcolor=3D"#828DA6"><font color=3D"#ffffff" face=3D"arial,h=
elvetica.sanserif"><a name=3D"Using SetHandler and Environment Variab=
les"><strong>Using SetHandler and Environment Variables</strong></a><=
/font></td></tr><tr><td><blockquote>
<p>
Alternatively to the mod_jk specific directives, you can also use
SetHandler and environment variables to control, which requests
are being forwarded via which worker. This gives you more flexibility=
,
but the results might be more difficult to understand. If you mix bot=
h
ways of defining the forwards, in general to mod_jk directives will w=
in.
</p>
<p>
<b>SetHandler jakarta-servlet</b> forces requests to be handled by mo=
d_jk.
If you neither specify any workers via JkMount and the related direct=
ives,
not via the environment variable described below,
the first worker in the list of all worker will be chosen. You can us=
e SetHandler
for example in Location blocks or with Apache 2.2 also in RewriteRule=
.
</p>
<p>
In order to control the worker using <b>SetEnvIf</b> or <b>RewriteRul=
e</b>
for more complex rules, you can set the environment variable <b>JK_WO=
RKER_NAME</b>
to the name of your chosen target worker. This enables you to decide =
on
the chosen worker in a more flexible way, including dependencies on c=
ookie values.
This feature has been added in version 1.2.19 of mod_jk.
</p>
<p>
In order to use another variable than <b>JK_WORKER_NAME</b>, you can =
set the name
of this variable via the <b>JkWorkerIndicator</b> directive.
</p>
<p>
Finally you can define exclusions from mod_jk forwards by setting the=
 environment
variable <b>no-jk</b>.
</p>
<div class=3D"example"><pre>
  # Automatically map all encoded urls
  &lt;Location *;jsessionid=3D&gt;
    SetHandler jakarta-servlet
    SetEnv JK_WORKER_NAME my_worker
  &lt;/Location&gt;

  # Map all subdirs to workers via naming rule
  # and exclude static content.
  &lt;Location /apps/&gt;
    SetHandler jakarta-servlet
    SetEnvIf REQUEST_URI ^/apps/([^/]*)/ JK_WORKER_NAME=3D$1
    SetEnvIf REQUEST_URI ^/apps/([^/]*)/static no-jk
  &lt;/Location&gt;
</pre></div>

</blockquote></td></tr></table>
 </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr>=
<td colspan=3D"2"><hr noshade=3D"noshade" size=3D"1"></td></tr><!--PA=
GE FOOTER--><tr><td colspan=3D"2"><div align=3D"center"><font color=
=3D"#525D76" size=3D"-1"><em>
        Copyright &copy; 1999-2005, Apache Software Foundation
        </em></font></div></td></tr></table></body></html>

--Boundary_(ID_QUUFOcR+f9AyrsyWvio1YQ)
Content-type: text/html; NAME=mod_security2_interface.html; charset=us-ascii
Content-transfer-encoding: QUOTED-PRINTABLE
Content-disposition: attachment; filename=mod_security2_interface.html

<html><head><META http-equiv=3D"Content-Type" content=3D"text/html; c=
harset=3DISO-8859-1"><title>ModSecurity Reference Manual</title><link=
 href=3D"modsecurity-reference.css" rel=3D"stylesheet" type=3D"text/c=
ss"><meta content=3D"DocBook XSL Stylesheets V1.69.1" name=3D"generat=
or"><link rel=3D"start" href=3D"#N10001" title=3D"ModSecurity Referen=
ce Manual"><link rel=3D"next" href=3D"#01-introduction" title=3D"Intr=
oduction"></head><body bgcolor=3D"white" text=3D"black" link=3D"#0000=
FF" vlink=3D"#840084" alink=3D"#0000FF"><div style=3D"background:#F5F=
5F5;width:100%;border-top:1px solid #DDDDDD;border-bottom:1px solid #=
DDDDDD"><table width=3D"100%" cellspacing=3D"0" cellpadding=3D"0"><tr=
><td><a href=3D"http://www.modsecurity.org"><img style=3D"margin:4px"=
 src=3D"modsecurity.gif" width=3D"120" height=3D"36" alt=3D"ModSecuri=
ty" border=3D"0"></a></td><td align=3D"right"><a href=3D"http://www.b=
reach.com"><img style=3D"margin:6px" src=3D"breach-logo-small.gif" he=
ight=3D"36" width=3D"100" border=3D"0"></a></td></tr></table></div><d=
iv class=3D"article" lang=3D"en"><div class=3D"titlepage"><div><div><=
h2 class=3D"title"><a name=3D"N10001"></a>ModSecurity Reference Manua=
l</h2></div><div><p class=3D"releaseinfo">Version 2.1.5 / (Jan 10, 20=
08)</p></div><div><p class=3D"copyright">Copyright &copy; 2004-2008 B=
reach Security, Inc. (<a href=3D"http://www.breach.com" target=3D"_to=
p">http://www.breach.com</a>)</p></div></div><div></div><hr size=3D"1=
"></div><div class=3D"toc"><p><b>Table of Contents</b></p><dl><dt><sp=
an class=3D"section"><a href=3D"#01-introduction">Introduction</a></s=
pan></dt><dd><dl><dt><span class=3D"section"><a href=3D"#N1001D">HTTP=
 Traffic Logging</a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10022">Real-Time Monitoring and Attack Detection</a></span></dt=
><dt><span class=3D"section"><a href=3D"#N10027">Attack Prevention an=
d Just-in-time Patching</a></span></dt><dt><span class=3D"section"><a=
 href=3D"#N10038">Flexible Rule Engine</a></span></dt><dt><span class=
=3D"section"><a href=3D"#N1003D">Embedded-mode Deployment</a></span><=
/dt><dt><span class=3D"section"><a href=3D"#N10058">Network-based Dep=
loyment</a></span></dt><dt><span class=3D"section"><a href=3D"#03-lic=
ensing">Licensing</a></span></dt></dl></dd><dt><span class=3D"section=
"><a href=3D"#N10066">ModSecurity Core Rules</a></span></dt><dd><dl><=
dt><span class=3D"section"><a href=3D"#N10069">Overview</a></span></d=
t><dt><span class=3D"section"><a href=3D"#N10072">Core Rules Structur=
e</a></span></dt><dt><span class=3D"section"><a href=3D"#N1008A">Core=
 Rules Content</a></span></dt></dl></dd><dt><span class=3D"section"><=
a href=3D"#02-installation">Installation</a></span></dt><dt><span cla=
ss=3D"section"><a href=3D"#03-configuration-directives">Configuration=
 Directives</a></span></dt><dd><dl><dt><span class=3D"section"><a hre=
f=3D"#N1011F"><code class=3D"literal">SecAction</code></a></span></dt=
><dt><span class=3D"section"><a href=3D"#N1014D"><code class=3D"liter=
al">SecArgumentSeparator</code></a></span></dt><dt><span class=3D"sec=
tion"><a href=3D"#N10187"><code class=3D"literal">SecAuditEngine</cod=
e></a></span></dt><dt><span class=3D"section"><a href=3D"#N101D3"><co=
de class=3D"literal">SecAuditLog</code></a></span></dt><dt><span clas=
s=3D"section"><a href=3D"#N10204"><code class=3D"literal">SecAuditLog=
2</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N1023=
8"><code class=3D"literal">SecAuditLogParts</code></a></span></dt><dt=
><span class=3D"section"><a href=3D"#N102C6"><code class=3D"literal">=
SecAuditLogRelevantStatus</code></a></span></dt><dt><span class=3D"se=
ction"><a href=3D"#N102F0"><code class=3D"literal">SecAuditLogStorage=
Dir</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10=
31A"><code class=3D"literal">SecAuditLogType</code></a></span></dt><d=
t><span class=3D"section"><a href=3D"#N10353"><code class=3D"literal"=
>SecChrootDir</code></a></span></dt><dt><span class=3D"section"><a hr=
ef=3D"#N1037B"><code class=3D"literal">SecCookieFormat</code></a></sp=
an></dt><dt><span class=3D"section"><a href=3D"#N103B2"><code class=
=3D"literal">SecDataDir</code></a></span></dt><dt><span class=3D"sect=
ion"><a href=3D"#N103DE"><code class=3D"literal">SecDebugLog</code></=
a></span></dt><dt><span class=3D"section"><a href=3D"#N10406"><code c=
lass=3D"literal">SecDebugLogLevel</code></a></span></dt><dt><span cla=
ss=3D"section"><a href=3D"#N10467"><code class=3D"literal">SecDefault=
Action</code></a></span></dt><dt><span class=3D"section"><a href=3D"#=
N1049A"><code class=3D"literal">SecGuardianLog</code></a></span></dt>=
<dt><span class=3D"section"><a href=3D"#N104CE"><code class=3D"litera=
l">SecRequestBodyAccess</code></a></span></dt><dt><span class=3D"sect=
ion"><a href=3D"#N10505"><code class=3D"literal">SecRequestBodyLimit<=
/code></a></span></dt><dt><span class=3D"section"><a href=3D"#N1052D"=
><code class=3D"literal">SecRequestBodyInMemoryLimit</code></a></span=
></dt><dt><span class=3D"section"><a href=3D"#N1055A"><code class=
=3D"literal">SecResponseBodyLimit</code></a></span></dt><dt><span cla=
ss=3D"section"><a href=3D"#N10587"><code class=3D"literal">SecRespons=
eBodyMimeType</code></a></span></dt><dt><span class=3D"section"><a hr=
ef=3D"#N105C4"><code class=3D"literal">SecResponseBodyMimeTypesClear<=
/code></a></span></dt><dt><span class=3D"section"><a href=3D"#N105F0"=
><code class=3D"literal">SecResponseBodyAccess</code></a></span></dt>=
<dt><span class=3D"section"><a href=3D"#N10627"><code class=3D"litera=
l">SecRule</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N1069E"><code class=3D"literal">SecRuleInheritance</code></a></s=
pan></dt><dt><span class=3D"section"><a href=3D"#N106ED"><code class=
=3D"literal">SecRuleEngine</code></a></span></dt><dt><span class=3D"s=
ection"><a href=3D"#N1072A"><code class=3D"literal">SecRuleRemoveById=
</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10755=
"><code class=3D"literal">SecRuleRemoveByMsg</code></a></span></dt><d=
t><span class=3D"section"><a href=3D"#N10781"><code class=3D"literal"=
>SecServerSignature</code></a></span></dt><dt><span class=3D"section"=
><a href=3D"#N107A9"><code class=3D"literal">SecTmpDir</code></a></sp=
an></dt><dt><span class=3D"section"><a href=3D"#N107D1"><code class=
=3D"literal">SecUploadDir</code></a></span></dt><dt><span class=3D"se=
ction"><a href=3D"#N10800"><code class=3D"literal">SecUploadKeepFiles=
</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10841=
"><code class=3D"literal">SecWebAppId</code></a></span></dt></dl></dd=
><dt><span class=3D"section"><a href=3D"#04-processing-phases">Proces=
sing Phases</a></span></dt><dd><dl><dt><span class=3D"section"><a hre=
f=3D"#N108C5">Phase Request Headers</a></span></dt><dt><span class=
=3D"section"><a href=3D"#N108D0">Phase Request Body</a></span></dt><d=
t><span class=3D"section"><a href=3D"#N108E7">Phase Response Headers<=
/a></span></dt><dt><span class=3D"section"><a href=3D"#N108EC">Phase =
Response Body</a></span></dt><dt><span class=3D"section"><a href=3D"#=
N108F1">Phase Logging</a></span></dt></dl></dd><dt><span class=3D"sec=
tion"><a href=3D"#05-variables">Variables</a></span></dt><dd><dl><dt>=
<span class=3D"section"><a href=3D"#N108FC"><code class=3D"literal">A=
RGS</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10=
93D"><code class=3D"literal">ARGS_COMBINED_SIZE</code></a></span></dt=
><dt><span class=3D"section"><a href=3D"#N1094B"><code class=3D"liter=
al">ARGS_NAMES</code></a></span></dt><dt><span class=3D"section"><a h=
ref=3D"#N10959"><code class=3D"literal">AUTH_TYPE</code></a></span></=
dt><dt><span class=3D"section"><a href=3D"#N10970"><code class=3D"lit=
eral">ENV</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10982"><code class=3D"literal">FILES</code></a></span></dt><dt>=
<span class=3D"section"><a href=3D"#N10990"><code class=3D"literal">F=
ILES_COMBINED_SIZE</code></a></span></dt><dt><span class=3D"section">=
<a href=3D"#N1099E"><code class=3D"literal">FILES_NAMES</code></a></s=
pan></dt><dt><span class=3D"section"><a href=3D"#N109AC"><code class=
=3D"literal">FILES_SIZES</code></a></span></dt><dt><span class=3D"sec=
tion"><a href=3D"#N109BA"><code class=3D"literal">FILES_TMPNAMES</cod=
e></a></span></dt><dt><span class=3D"section"><a href=3D"#N109CC"><co=
de class=3D"literal">HTTP_</code></a></span></dt><dt><span class=3D"s=
ection"><a href=3D"#N109E3"><code class=3D"literal">MULTIPART_CRLF_LF=
_LINES</code></a></span></dt><dt><span class=3D"section"><a href=3D"#=
N10A04"><code class=3D"literal">MULTIPART_STRICT_ERROR</code></a></sp=
an></dt><dt><span class=3D"section"><a href=3D"#N10A3C"><code class=
=3D"literal">MULTIPART_UNMATCHED_BOUNDARY</code></a></span></dt><dt><=
span class=3D"section"><a href=3D"#N10A4E"><code class=3D"literal">PA=
TH_INFO</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10A5C"><code class=3D"literal">QUERY_STRING</code></a></span></=
dt><dt><span class=3D"section"><a href=3D"#N10A6A"><code class=3D"lit=
eral">REMOTE_ADDR</code></a></span></dt><dt><span class=3D"section"><=
a href=3D"#N10A78"><code class=3D"literal">REMOTE_HOST</code></a></sp=
an></dt><dt><span class=3D"section"><a href=3D"#N10A86"><code class=
=3D"literal">REMOTE_PORT</code></a></span></dt><dt><span class=3D"sec=
tion"><a href=3D"#N10A97"><code class=3D"literal">REMOTE_USER</code><=
/a></span></dt><dt><span class=3D"section"><a href=3D"#N10AAB"><code =
class=3D"literal">REQBODY_PROCESSOR</code></a></span></dt><dt><span c=
lass=3D"section"><a href=3D"#N10AC5"><code class=3D"literal">REQBODY_=
PROCESSOR_ERROR</code></a></span></dt><dt><span class=3D"section"><a =
href=3D"#N10ADE"><code class=3D"literal">REQBODY_PROCESSOR_ERROR_MSG<=
/code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10AEC"=
><code class=3D"literal">REQUEST_BASENAME</code></a></span></dt><dt><=
span class=3D"section"><a href=3D"#N10AFD"><code class=3D"literal">RE=
QUEST_BODY</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10B11"><code class=3D"literal">REQUEST_COOKIES</code></a></span=
></dt><dt><span class=3D"section"><a href=3D"#N10B1F"><code class=
=3D"literal">REQUEST_COOKIES_NAMES</code></a></span></dt><dt><span cl=
ass=3D"section"><a href=3D"#N10B2D"><code class=3D"literal">REQUEST_F=
ILENAME</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10B3B"><code class=3D"literal">REQUEST_HEADERS</code></a></span=
></dt><dt><span class=3D"section"><a href=3D"#N10B55"><code class=
=3D"literal">REQUEST_HEADERS_NAMES</code></a></span></dt><dt><span cl=
ass=3D"section"><a href=3D"#N10B63"><code class=3D"literal">REQUEST_L=
INE</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10=
B77"><code class=3D"literal">REQUEST_METHOD</code></a></span></dt><dt=
><span class=3D"section"><a href=3D"#N10B8B"><code class=3D"literal">=
REQUEST_PROTOCOL</code></a></span></dt><dt><span class=3D"section"><a=
 href=3D"#N10B9F"><code class=3D"literal">REQUEST_URI</code></a></spa=
n></dt><dt><span class=3D"section"><a href=3D"#N10BAD"><code class=
=3D"literal">REQUEST_URI_RAW</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N10BBB"><code class=3D"literal">RESPONSE_BOD=
Y</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10BC=
9"><code class=3D"literal">RESPONSE_HEADERS</code></a></span></dt><dt=
><span class=3D"section"><a href=3D"#N10BE0"><code class=3D"literal">=
RESPONSE_HEADERS_NAMES</code></a></span></dt><dt><span class=3D"secti=
on"><a href=3D"#N10BF4"><code class=3D"literal">RESPONSE_PROTOCOL</co=
de></a></span></dt><dt><span class=3D"section"><a href=3D"#N10C02"><c=
ode class=3D"literal">RESPONSE_STATUS</code></a></span></dt><dt><span=
 class=3D"section"><a href=3D"#N10C16"><code class=3D"literal">RULE</=
code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10C38">=
<code class=3D"literal">SCRIPT_BASENAME</code></a></span></dt><dt><sp=
an class=3D"section"><a href=3D"#N10C4C"><code class=3D"literal">SCRI=
PT_FILENAME</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10C60"><code class=3D"literal">SCRIPT_GID</code></a></span></dt=
><dt><span class=3D"section"><a href=3D"#N10C74"><code class=3D"liter=
al">SCRIPT_GROUPNAME</code></a></span></dt><dt><span class=3D"section=
"><a href=3D"#N10C88"><code class=3D"literal">SCRIPT_MODE</code></a><=
/span></dt><dt><span class=3D"section"><a href=3D"#N10C9C"><code clas=
s=3D"literal">SCRIPT_UID</code></a></span></dt><dt><span class=3D"sec=
tion"><a href=3D"#N10CB0"><code class=3D"literal">SCRIPT_USERNAME</co=
de></a></span></dt><dt><span class=3D"section"><a href=3D"#N10CC4"><c=
ode class=3D"literal">SERVER_ADDR</code></a></span></dt><dt><span cla=
ss=3D"section"><a href=3D"#N10CD2"><code class=3D"literal">SERVER_NAM=
E</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10CE=
6"><code class=3D"literal">SERVER_PORT</code></a></span></dt><dt><spa=
n class=3D"section"><a href=3D"#N10CF4"><code class=3D"literal">SESSI=
ON</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10D=
12"><code class=3D"literal">SESSIONID</code></a></span></dt><dt><span=
 class=3D"section"><a href=3D"#N10D24"><code class=3D"literal">TIME</=
code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10D32">=
<code class=3D"literal">TIME_DAY</code></a></span></dt><dt><span clas=
s=3D"section"><a href=3D"#N10D40"><code class=3D"literal">TIME_EPOCH<=
/code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10D4E"=
><code class=3D"literal">TIME_HOUR</code></a></span></dt><dt><span cl=
ass=3D"section"><a href=3D"#N10D5C"><code class=3D"literal">TIME_MIN<=
/code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10D6A"=
><code class=3D"literal">TIME_MON</code></a></span></dt><dt><span cla=
ss=3D"section"><a href=3D"#N10D78"><code class=3D"literal">TIME_SEC</=
code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10D86">=
<code class=3D"literal">TIME_WDAY</code></a></span></dt><dt><span cla=
ss=3D"section"><a href=3D"#N10D94"><code class=3D"literal">TIME_YEAR<=
/code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10DA2"=
><code class=3D"literal">TX</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N10DB4"><code class=3D"literal">USERID</code=
></a></span></dt><dt><span class=3D"section"><a href=3D"#N10DC6"><cod=
e class=3D"literal">WEBAPPID</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N10DD8"><code class=3D"literal">WEBSERVER_ER=
ROR_LOG</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10DE6"><code class=3D"literal">XML</code></a></span></dt></dl><=
/dd><dt><span class=3D"section"><a href=3D"#06-transformation-functio=
ns">Transformation functions</a></span></dt><dd><dl><dt><span class=
=3D"section"><a href=3D"#N10E3F"><code class=3D"literal">base64Decode=
</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10E45=
"><code class=3D"literal">base64Encode</code></a></span></dt><dt><spa=
n class=3D"section"><a href=3D"#N10E4B"><code class=3D"literal">compr=
essWhitespace</code></a></span></dt><dt><span class=3D"section"><a hr=
ef=3D"#N10E51"><code class=3D"literal">escapeSeqDecode</code></a></sp=
an></dt><dt><span class=3D"section"><a href=3D"#N10E8B"><code class=
=3D"literal">hexDecode</code></a></span></dt><dt><span class=3D"secti=
on"><a href=3D"#N10E91"><code class=3D"literal">hexEncode</code></a><=
/span></dt><dt><span class=3D"section"><a href=3D"#N10E97"><code clas=
s=3D"literal">htmlEntityDecode</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N10ED6"><code class=3D"literal">lowercase</c=
ode></a></span></dt><dt><span class=3D"section"><a href=3D"#N10EDC"><=
code class=3D"literal">md5</code></a></span></dt><dt><span class=3D"s=
ection"><a href=3D"#N10EE2"><code class=3D"literal"><code class=3D"li=
teral">none</code></code></a></span></dt><dt><span class=3D"section">=
<a href=3D"#N10EE9"><code class=3D"literal">normalisePath</code></a><=
/span></dt><dt><span class=3D"section"><a href=3D"#N10EEF"><code clas=
s=3D"literal">normalisePathWin</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N10EF5"><code class=3D"literal">removeNulls<=
/code></a></span></dt><dt><span class=3D"section"><a href=3D"#N10EFB"=
><code class=3D"literal">removeWhitespace</code></a></span></dt><dt><=
span class=3D"section"><a href=3D"#N10F01"><code class=3D"literal">re=
placeComments</code></a></span></dt><dt><span class=3D"section"><a hr=
ef=3D"#N10F0F"><code class=3D"literal">replaceNulls</code></a></span>=
</dt><dt><span class=3D"section"><a href=3D"#N10F15"><code class=3D"l=
iteral">urlDecode</code></a></span></dt><dt><span class=3D"section"><=
a href=3D"#N10F1F"><code class=3D"literal">urlDecodeUni</code></a></s=
pan></dt><dt><span class=3D"section"><a href=3D"#N10F2D"><code class=
=3D"literal">urlEncode</code></a></span></dt><dt><span class=3D"secti=
on"><a href=3D"#N10F33"><code class=3D"literal">sha1</code></a></span=
></dt></dl></dd><dt><span class=3D"section"><a href=3D"#07-actions">A=
ctions</a></span></dt><dd><dl><dt><span class=3D"section"><a href=
=3D"#N10F6B"><code class=3D"literal">allow</code></a></span></dt><dt>=
<span class=3D"section"><a href=3D"#N10F8B"><code class=3D"literal">a=
uditlog</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N10FA8"><code class=3D"literal">capture</code></a></span></dt><d=
t><span class=3D"section"><a href=3D"#N10FC5"><code class=3D"literal"=
>chain</code></a></span></dt><dt><span class=3D"section"><a href=3D"#=
N10FE5"><code class=3D"literal">ctl</code></a></span></dt><dt><span c=
lass=3D"section"><a href=3D"#N1105B"><code class=3D"literal">deny</co=
de></a></span></dt><dt><span class=3D"section"><a href=3D"#N11072"><c=
ode class=3D"literal">deprecatevar</code></a></span></dt><dt><span cl=
ass=3D"section"><a href=3D"#N1108B"><code class=3D"literal">drop</cod=
e></a></span></dt><dt><span class=3D"section"><a href=3D"#N110A8"><co=
de class=3D"literal">exec</code></a></span></dt><dt><span class=3D"se=
ction"><a href=3D"#N110C5"><code class=3D"literal">expirevar</code></=
a></span></dt><dt><span class=3D"section"><a href=3D"#N110E2"><code c=
lass=3D"literal">id</code></a></span></dt><dt><span class=3D"section"=
><a href=3D"#N11124"><code class=3D"literal">initcol</code></a></span=
></dt><dt><span class=3D"section"><a href=3D"#N1118F"><code class=
=3D"literal">log</code></a></span></dt><dt><span class=3D"section"><a=
 href=3D"#N111AB"><code class=3D"literal">msg</code></a></span></dt><=
dt><span class=3D"section"><a href=3D"#N111CB"><code class=3D"literal=
">multiMatch</code></a></span></dt><dt><span class=3D"section"><a hre=
f=3D"#N111E7"><code class=3D"literal">noauditlog</code></a></span></d=
t><dt><span class=3D"section"><a href=3D"#N11207"><code class=3D"lite=
ral">nolog</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N11223"><code class=3D"literal">pass</code></a></span></dt><dt><=
span class=3D"section"><a href=3D"#N1123F"><code class=3D"literal">pa=
use</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N11=
25B"><code class=3D"literal">phase</code></a></span></dt><dt><span cl=
ass=3D"section"><a href=3D"#N11278"><code class=3D"literal">proxy</co=
de></a></span></dt><dt><span class=3D"section"><a href=3D"#N11294"><c=
ode class=3D"literal">redirect</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N112B4"><code class=3D"literal">rev</code></=
a></span></dt><dt><span class=3D"section"><a href=3D"#N112D5"><code c=
lass=3D"literal">sanitiseArg</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N112F1"><code class=3D"literal">sanitiseMatc=
hed</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N11=
310"><code class=3D"literal">sanitiseRequestHeader</code></a></span><=
/dt><dt><span class=3D"section"><a href=3D"#N1132C"><code class=3D"li=
teral">sanitiseResponseHeader</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N11348"><code class=3D"literal">severity</co=
de></a></span></dt><dt><span class=3D"section"><a href=3D"#N1137E"><c=
ode class=3D"literal">setuid</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N113A3"><code class=3D"literal">setsid</code=
></a></span></dt><dt><span class=3D"section"><a href=3D"#N113CB"><cod=
e class=3D"literal">setenv</code></a></span></dt><dt><span class=3D"s=
ection"><a href=3D"#N113EF"><code class=3D"literal">setvar</code></a>=
</span></dt><dt><span class=3D"section"><a href=3D"#N11416"><code cla=
ss=3D"literal">skip</code></a></span></dt><dt><span class=3D"section"=
><a href=3D"#N11434"><code class=3D"literal">status</code></a></span>=
</dt><dt><span class=3D"section"><a href=3D"#N11459"><code class=3D"l=
iteral">t</code></a></span></dt><dt><span class=3D"section"><a href=
=3D"#N11475"><code class=3D"literal">xmlns</code></a></span></dt></dl=
></dd><dt><span class=3D"section"><a href=3D"#08-operators">Operators=
</a></span></dt><dd><dl><dt><span class=3D"section"><a href=3D"#N1149=
2"><code class=3D"literal">eq</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N114A4"><code class=3D"literal">ge</code></a=
></span></dt><dt><span class=3D"section"><a href=3D"#N114B6"><code cl=
ass=3D"literal">gt</code></a></span></dt><dt><span class=3D"section">=
<a href=3D"#N114C8"><code class=3D"literal">inspectFile</code></a></s=
pan></dt><dt><span class=3D"section"><a href=3D"#N114DA"><code class=
=3D"literal">le</code></a></span></dt><dt><span class=3D"section"><a =
href=3D"#N114EC"><code class=3D"literal">lt</code></a></span></dt><dt=
><span class=3D"section"><a href=3D"#N114FE"><code class=3D"literal">=
rbl</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N11=
510"><code class=3D"literal">rx</code></a></span></dt><dt><span class=
=3D"section"><a href=3D"#N1154C"><code class=3D"literal">validateByte=
Range</code></a></span></dt><dt><span class=3D"section"><a href=3D"#N=
11573"><code class=3D"literal">validateDTD</code></a></span></dt><dt>=
<span class=3D"section"><a href=3D"#N11585"><code class=3D"literal">v=
alidateSchema</code></a></span></dt><dt><span class=3D"section"><a hr=
ef=3D"#N11599"><code class=3D"literal">validateUrlEncoding</code></a>=
</span></dt><dt><span class=3D"section"><a href=3D"#N115B4"><code cla=
ss=3D"literal">validateUtf8Encoding</code></a></span></dt></dl></dd><=
dt><span class=3D"section"><a href=3D"#N115D8">Miscellaneous Topics</=
a></span></dt><dd><dl><dt><span class=3D"section"><a href=3D"#N115DC"=
>Impedance Mismatch</a></span></dt></dl></dd></dl></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h2 class=
=3D"title" style=3D"clear: both"><a name=3D"01-introduction"></a>Intr=
oduction</h2></div></div><div></div></div><p><span class=3D"trademark=
">ModSecurity</span>&trade; is a web
    application firewall (WAF). With over 70% of all attacks now carr=
ied out
    over the web application level, organisations need every help the=
y can get
    in making their systems secure. WAFs are deployed to establish an=
 external
    security layer that increases security, detects, and prevents att=
acks
    before they reach web applications. It provides protection from a=
 range of
    attacks against web applications and allows for HTTP traffic moni=
toring
    and real-time analysis with little or no changes to existing
    infrastructure.</p><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1001D"></a>H=
TTP Traffic Logging</h3></div></div><div></div></div><p>Web servers a=
re typically well-equipped to log traffic in a form
      useful for marketing analyses, but fall short when it comes to =
logging
      of traffic to web applications. In particular, most are not cap=
able of
      logging the request bodies. Your adversaries know this, and tha=
t is why
      most attacks are now carried out via POST requests, rendering y=
our
      systems blind. ModSecurity makes full HTTP transaction logging =
possible,
      allowing complete requests and responses to be logged. Its logg=
ing
      facilities also allow fine-grained decisions to be made about e=
xactly
      what is logged and when, ensure only the relevant data is
      recorded.</p></div><div class=3D"section" lang=3D"en"><div clas=
s=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10022"></a>=
Real-Time Monitoring and Attack Detection</h3></div></div><div></div>=
</div><p>In addition to providing logging facilities, ModSecurity can
      monitor the HTTP traffic in real time in order to detect attack=
s. In
      this case ModSecurity operates as a web intrusion detection too=
l,
      allowing you to react to suspicious events that take place at y=
our web
      systems.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10027"></a>A=
ttack Prevention and Just-in-time Patching</h3></div></div><div></div=
></div><p>ModSecurity can also act immediately to prevent attacks fro=
m
      reaching your web applications. There are three commonly used
      approaches:</p><div class=3D"orderedlist"><ol type=3D"1"><li><p=
>Negative security model. Negative security model monitors
          requests for anomalies, unusual behaviour, and common web
          application attacks. It keeps anomaly scores for each reque=
st, IP
          addresses, application sessions, and user accounts. Request=
s with
          high anomaly scores are either logged or rejected altogethe=
r.</p></li><li><p>Positive security model. When positive security mod=
el is
          deployed, only requests that are known to be valid are acce=
pted,
          with everything else rejected. This approach works best wit=
h
          applications that are heavily used but rarely updated.</p><=
/li><li><p>Known weaknesses and vulnerabilities. Its rule language ma=
kes
          ModSecurity an ideal external patching tool. External patch=
ing is
          all about reducing the window of opportunity. Time needed t=
o patch
          application vulnerabilities often runs to weeks in many
          organisations. With ModSecurity, applications can be patche=
d from
          the outside, without touching the application source code (=
and even
          without any access to it), making your systems secure until=
 a proper
          patch is produced.</p></li></ol></div></div><div class=3D"s=
ection" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"t=
itle"><a name=3D"N10038"></a>Flexible Rule Engine</h3></div></div><di=
v></div></div><p>A flexible rule engine sits in the heart of ModSecur=
ity. It
      implements the ModSecurity Rule Language, which is a specialise=
d
      programming language designed to work with HTTP transaction dat=
a. The
      ModSecurity Rule Language was designed to be easy to use, yet f=
lexible:
      common operations are simple while complex operations are possi=
ble.
      Certified ModSecurity Rules, included with subscription to ModS=
ecurity,
      contain a comprehensive set of rules that implement general-pur=
pose
      hardening, common web application security issues. Heavily comm=
ented,
      these rules can be used as a learning tool.</p></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N1003D"></a>Embedded-mode Deployment</h3></div>=
</div><div></div></div><p>ModSecurity is an embeddable web applicatio=
n firewall, which means
      it can be deployed as part of your existing web server infrastr=
ucture
      provided your web servers are Apache-based. This deployment met=
hod has
      certain advantages:</p><div class=3D"orderedlist"><ol type=3D"1=
"><li><p>No changes to existing network. It only takes a few minutes =
to
          add ModSecurity to your existing web servers. And because i=
t was
          designed to be completely passive by default, you are free =
to deploy
          it incrementally and only use the features you need. It is =
equally
          easy to remove or deactivate it should decide you don't wan=
t it any
          more.</p></li><li><p>No single point of failure. Unlike wit=
h network-based
          deployments, you will not be introducing a new point of fai=
lure to
          your system.</p></li><li><p>Implicit load balancing and sca=
ling. Because it works embedded
          in web servers, ModSecurity will automatically take advanta=
ge of the
          additional load balancing and scalability features. You wil=
l not
          need to think of load balancing and scaling unless your exi=
sting
          system needs them.</p></li><li><p>Minimal overhead. Because=
 it works from inside the web server
          process there is no overhead for network communication and =
minimal
          overhead in parsing and data exchange.</p></li><li><p>No pr=
oblem with encrypted or compressed content. Many IDS
          systems have difficulties analysing SSL traffic. This is no=
t a
          problem for ModSecurity because it is positioned to work wh=
en the
          traffic is decrypted and decompressed.</p></li></ol></div><=
p>ModSecurity is known to work well on a wide range of operating
      systems. Our customers are successfully running it on Linux, Wi=
ndows,
      Solaris, FreeBSD, OpenBSD, NetBSD, AIX, Mac OS X, and HP-UX.<sp=
an class=3D"bold"><strong></strong></span></p></div><div class=3D"sec=
tion" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"tit=
le"><a name=3D"N10058"></a>Network-based Deployment</h3></div></div><=
div></div></div><p>ModSecurity works equally well when deployed as pa=
rt of an
      Apache-based reverse proxy server, and many of our customers ch=
oose to
      do so. In this scenario, one installation of ModSecurity can pr=
otect any
      number of web servers (even the non-Apache ones).</p></div><div=
 class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3=
 class=3D"title"><a name=3D"03-licensing"></a>Licensing</h3></div></d=
iv><div></div></div><p>ModSecurity is available under two licenses. U=
sers can choose to
      use the software under the terms of the GNU General Public Lice=
nse
      version 2 (licence text is included with the distribution), as =
an Open
      Source / Free Software product. A range of commercial licenses =
is also
      available, together with a range of commercial support contract=
s. For
      more information on commercial licensing please contact Breach
      Security.</p><div class=3D"note" style=3D"margin-left: 0.5in; m=
argin-right: 0.5in;"><h3 class=3D"title">Note</h3><p>ModSecurity, mod=
_security, and ModSecurity Pro are trademarks or
        registered trademarks of Breach Security, Inc.</p></div></div=
></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><d=
iv><div><h2 class=3D"title" style=3D"clear: both"><a name=3D"N10066">=
</a>ModSecurity Core Rules</h2></div></div><div></div></div><div clas=
s=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 clas=
s=3D"title"><a name=3D"N10069"></a>Overview</h3></div></div><div></di=
v></div><p>ModSecurity is a web application firewall engine that prov=
ides
      very little protection on its own. In order to become useful,
      ModSecurity must be configured with rules. In order to enable u=
sers to
      take full advantage of ModSecurity out of the box, Breach Secur=
ity Inc.
      is providing a free certified rule set for ModSecurity 2.0. Unl=
ike
      intrusion detection and prevention systems, which rely on signa=
ture
      specific to known vulnerabilities, the Core Rules provide gener=
ic
      protection from unknown vulnerabilities often found in web appl=
ications,
      which are in most cases custom coded. The Core Rules are heavil=
y
      commented to allow it to be used as a step-by-step deployment g=
uide for
      ModSecurity. The latest Core Rules can be found at the ModSecur=
ity
      website - <a href=3D"http://www.modsecurity.org/projects/rules/=
" target=3D"_top">http://www.modsecurity.org/projects/rules/</a>.</p>=
</div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><di=
v><div><h3 class=3D"title"><a name=3D"N10072"></a>Core Rules Structur=
e</h3></div></div><div></div></div><p>If you expect a single pack of =
Apache configuration files, you are
      right, and wrong. A ModSecurity rule set includes information a=
bout
      different areas:</p><div class=3D"itemizedlist"><ul type=3D"dis=
c"><li><p>The logic required to detect attacks.</p></li><li><p>A poli=
cy setting the actions to perform if an attack is
          detected.</p></li><li><p>Information regarding attacks.</p>=
</li></ul></div><p>In order to allow separate management of the diffe=
rent parts, the
      Core Rules are based on templates that are generated into a run=
-time
      rule set by inserting policy, patterns and event information. T=
he Core
      Rules package includes these templates, the generation script (=
written
      in Perl) and data files required to generate a useful rule set.=
 It also
      includes a bunch of pre-generated rule sets for different polic=
ies. The
      generation script also allows two optimizations:</p><div class=
=3D"itemizedlist"><ul type=3D"disc"><li><p>Optimal use of regular exp=
ressions. Since regular expressions
          are much more efficient if assembled into a single expressi=
on and
          optimized, the generation script takes the list of patterns=
 that are
          required for a rule and optimize them into a most efficient=
 regular
          expression.</p></li><li><p>Removal of rules that are not ut=
ilized by a specific
          policy.</p></li></ul></div></div><div class=3D"section" lan=
g=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a na=
me=3D"N1008A"></a>Core Rules Content</h3></div></div><div></div></div=
><p>In order to provide generic web applications protection, the Core
      Rules use the following techniques:</p><div class=3D"itemizedli=
st"><ul type=3D"disc"><li><p>HTTP protection - detecting violations o=
f the HTTP protocol
          and a locally defined usage policy.</p></li><li><p>Common W=
eb Attacks Protection - detecting common web
          application security attack.</p></li><li><p>Automation dete=
ction - Detecting bots, crawlers, scanners and
          other surface malicious activity.</p></li><li><p>Trojan Pro=
tection - Detecting access to Trojans horses.</p></li><li><p>Error Hi=
ding - Disguising error messages sent by the
          server.</p></li></ul></div></div></div><div class=3D"sectio=
n" lang=3D"en"><div class=3D"titlepage"><div><div><h2 class=3D"title"=
 style=3D"clear: both"><a name=3D"02-installation"></a>Installation</=
h2></div></div><div></div></div><p>ModSecurity installation consists =
of the following steps:</p><div class=3D"orderedlist"><ol type=3D"1">=
<li><p>ModSecurity 2.x works with Apache 2.0.x or better.</p></li><li=
><p>Make sure you have <code class=3D"literal">mod_unique_id</code> i=
nstalled.</p></li><li><p>Install the latest version of libxml2, if it=
 isn't already
        installed on the server.</p></li><li><p>Unpack the ModSecurit=
y archive</p></li><li><p>Edit Makefile to configure the path to the A=
pache ServerRoot
        directory. You can check this by identifying the ServerRoot d=
irective
        setting in your httpd.conf file. This is the path that was sp=
ecified
        with the "--install-path=3D" configuration flag during compil=
ation (for
        example, in Fedora Core4: <code class=3D"literal">top_dir =
=3D
        /etc/httpd</code>).</p></li><li><p>Edit Makefile to configure=
 the correct include path for libxml
        (for example: <code class=3D"literal">INCLUDES=3D-I/usr/inclu=
de/libxml2</code>)</p></li><li><p>Compile with <code class=3D"literal=
">make</code></p></li><li><p>Stop Apache</p></li><li><p>Install with<=
code class=3D"literal"> make
        install</code></p></li><li><p>Add one line to your configurat=
ion to load libxml2:</p><p><code class=3D"literal">LoadFile
        /usr/lib/libxml2.so</code></p></li><li><p>Add one line to you=
r configuration to load ModSecurity:</p><p><code class=3D"literal">Lo=
adModule security2_module
        modules/mod_security2.so</code></p></li><li><p>Configure ModS=
ecurity</p></li><li><p>Start Apache</p></li><li><p>You now have ModSe=
curity 2.x up and running.</p></li></ol></div><div class=3D"note" sty=
le=3D"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=3D"title">N=
ote</h3><p>If you have compiled Apache yourself or are compiling for =
a
      distribution, please read the following notes.</p><p>The ModSec=
urity Core rules may assume XML support is
      available (compiled with -DWITH_LIBXML2).  You may have to manu=
ally
      remove any XML references in the Core rules if you choose not t=
o
      include XML support.  In future versions of ModSecurity XML sup=
port
      will be required.  For these reasons, please consider XML suppo=
rt
      required.</p><p>You might experience problems
      compiling ModSecurity against PCRE. This is because Apache bund=
les PCRE
      but this library is also typically provided by the operating sy=
stem. I
      would expect most (all) vendor-packaged Apache distributions to=
 be
      configured to use an external PCRE library (so this should not =
be a
      problem).</p><p>You want to avoid Apache using the bundled PCRE=
 library and
      ModSecurity linking against the one provided by the operating s=
ystem.
      The easiest way to do this is to compile Apache against the PCR=
E library
      provided by the operating system (or you can compile it against=
 the
      latest PCRE version you downloaded from the main PCRE distribut=
ion
      site). You can do this at configure time using the<code class=
=3D"literal"> --with-pcre</code> switch. If you are not in a
      position to recompile Apache then, to compile ModSecurity succe=
ssfully,
      you'd still need to have access to the bundled PCRE headers (th=
ey are
      available only in the Apache source code) and change the includ=
e path
      for ModSecurity (as you did in step 7 above) to point to them.<=
/p><p>If your Apache is using an external PCRE library you
      can compile ModSecurity with <code class=3D"literal">WITH_PCRE_=
STUDY</code> defined,which would possibly
      give you a slight performance edge in regular expression
      processing.</p></div></div><div class=3D"section" lang=3D"en"><=
div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear:=
 both"><a name=3D"03-configuration-directives"></a>Configuration Dire=
ctives</h2></div></div><div></div></div><p>The following section outl=
ines all of the ModSecurity directives.
    Most of the ModSecurity directives can be used inside the various=
 Apache
    Scope Directives such as <code class=3D"literal">VirtualHost</cod=
e>,
    <code class=3D"literal">Location</code>, <code class=3D"literal">=
LocationMatch</code>,
    <code class=3D"literal">Directory</code>, etc... There are others=
, however, that can
    only be used once in the main configuration file. This informatio=
n is
    specified in the Scope sections below.</p><p>These rules, along w=
ith the Core rules files, should be contained is
    files outside of the httpd.conf file and called up with Apache "I=
nclude"
    directives. This allows for easier updating/migration of the rule=
s. If you
    create your own custom rules that you would like to use with the =
Core
    rules, you should create a file called -
    <code class=3D"filename">modsecurity_crs_15_customrules.conf</cod=
e> and place it in
    the same directory as the Core rules files. By using this file na=
me, your
    custom rules will be called up after the standard ModSecurity Cor=
e rules
    configuration file but before the other Core rules. This allows y=
our rules
    to be evaluate first which can be useful if you need to implement=
 specific
    "allow" rules or to correct any false positives in the Core rules=
 as they
    are applied to your site.</p><p><span class=3D"bold"><strong>Note=
</strong></span></p><p>It is highly encouraged that you do not edit t=
he Core rules files
    themselves but rather place all changes (such as
    <code class=3D"literal">SecRuleRemoveByID</code>, etc...) in your=
 custom rules file.
    This will allow for easier upgrading as newer Core rules are rele=
ased by
    Breach Security on the ModSecurity website.</p><div class=3D"sect=
ion" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"titl=
e"><a name=3D"N1011F"></a><code class=3D"literal">SecAction</code></h=
3></div></div><div></div></div><p><span class=3D"bold"><strong>Descri=
ption:</strong></span> Unconditionally
      processes the action list it receives as the first and only par=
ameter.
      It accepts one parameter, the syntax of which is identical to t=
he third
      parameter of<code class=3D"literal"> SecRule</code>.</p><p><spa=
n class=3D"bold"><strong>Syntax:</strong></span> <code class=3D"liter=
al">SecAction action1,action2,action2</code></p><p><span class=3D"bol=
d"><strong>Example Usage:</strong></span> <code class=3D"literal">Sec=
Action
      nolog,redirect:http://www.hostname.com</code></p><p><span class=
=3D"bold"><strong>ProcessingPhase:</strong></span> Any</p><p><span cl=
ass=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> None</p><p>SecA=
ction is best used when you uncondiationally execute an
      action. This is explicit triggering whereas the normal Actions =
are
      conditional based on data inspection of the request/response. T=
his is a
      useful directive when you want to run certian actions such as i=
nitcol to
      initialize collections.</p></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N1014D"></a><code class=3D"literal">SecArgumentSeparator</code><=
/h3></div></div><div></div></div><p><span class=3D"bold"><strong>Desc=
ription:</strong></span> Specifies which
      character to use as separator for<code class=3D"literal">
      application/x-www-form-urlencoded</code> content. Defaults to
      <code class=3D"literal">&amp;</code>. Applications are sometime=
s
      (very rarely) written to use a semicolon (<code class=3D"litera=
l">;</code>).</p><p><span class=3D"bold"><strong>Syntax:</strong></sp=
an> <code class=3D"literal">SecArgumentSeparator character</code></p>=
<p><span class=3D"bold"><strong>Example Usage:</strong></span> <code =
class=3D"literal">SecArgumentSeparator ;</code></p><p><span class=
=3D"bold"><strong>Processing Phase:</strong></span> Any</p><p><span c=
lass=3D"bold"><strong> <span class=3D"bold"><strong>Scope:</strong></=
span>
      </strong></span> Main</p><p><span class=3D"bold"><strong>Depend=
encies/Notes:</strong></span> None</p><p>This directive is needed if =
a backend web appliaction is using a
      non-standard argument separator. If this directive is not set p=
roperly
      for each web app, then ModSecurity will not be able to parse th=
e
      arguements appropriately and the effectiveness of the rule matc=
hing will
      be significantly decreased.</p></div><div class=3D"section" lan=
g=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a na=
me=3D"N10187"></a><code class=3D"literal">SecAuditEngine</code></h3><=
/div></div><div></div></div><p><span class=3D"bold"><strong>Descripti=
on:</strong></span> Configures the audit
      logging engine.</p><p><span class=3D"bold"><strong>Syntax:</str=
ong></span> <code class=3D"literal">SecAuditEngine On|Off|RelevantOnl=
y</code></p><p><span class=3D"bold"><strong>Example Usage:</strong></=
span> <code class=3D"literal">SecAuditEngine On</code></p><p><span cl=
ass=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><spa=
n class=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> Can be
      set/changed with the "ctl" action for the current transaction.<=
/p><p>Example: The following example shows the various audit directiv=
es
      used together.</p><pre class=3D"programlisting"><span class=
=3D"bold"><strong>SecAuditEngine RelevantOnly</strong></span>=20
SecAuditLog logs/audit/audit.log
SecAuditLogParts ABCFHZ
SecAuditLogType concurrent
SecAuditLogStorageDir logs/audit
<span class=3D"bold"><strong>SecAuditLogRelevantStatus ^[45]</strong>=
</span></pre><p>Possible values are:</p><div class=3D"itemizedlist"><=
ul type=3D"disc"><li><p><code class=3D"literal">On</code> - log all t=
ransactions
          by default.</p></li><li><p><code class=3D"literal">Off</cod=
e> - do not log
          transactions by default.</p></li><li><p><code class=3D"lite=
ral">RelevantOnly</code> - by default
          only log transactions that have triggered a warning or an e=
rror, or
          have a status code that is considered to be relevant (see<c=
ode class=3D"literal"> SecAuditLogRelevantStatus</code>).</p></li></u=
l></div></div><div class=3D"section" lang=3D"en"><div class=3D"titlep=
age"><div><div><h3 class=3D"title"><a name=3D"N101D3"></a><code class=
=3D"literal">SecAuditLog</code></h3></div></div><div></div></div><p><=
span class=3D"bold"><strong>Description:</strong></span> Defines the =
path to
      the main audit log file.</p><p><span class=3D"bold"><strong>Syn=
tax:</strong></span> <code class=3D"literal">SecAuditLog /path/to/aud=
itlog</code></p><p><span class=3D"bold"><strong>Example Usage:</stron=
g></span> <code class=3D"literal">SecAuditLog
      /usr/local/apache/logs/audit.log</code></p><p><span class=3D"bo=
ld"><strong>Processing Phase:</strong></span> N/A</p><p><span class=
=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=3D"bol=
d"><strong>Dependencies/Notes:</strong></span> This file is
      open on startup when the server typically still runs as<span cl=
ass=3D"emphasis"><em>
      root</em></span>. You should not allow non-root users to have w=
rite
      privileges for this file or for the directory it is stored in..=
</p><p>This file will be used to store the audit log entries if seria=
l
      audit logging format is used. If concurrent audit logging forma=
t is used
      this file will be used as an index, and contain a record of all=
 audit
      log files created. If you are planning to use Concurrent audit =
logging
      and sending your audit log data off to a remote Console host, t=
hen you
      will need to use the modsec-auditlog-collector.pl script and us=
e the
      following format:</p><p><pre class=3D"programlisting">SecAuditL=
og \
  "|/path/modsec-auditlog-collector.pl /path/SecAuditLogDataDir /path=
/SecAuditLog"</pre></p></div><div class=3D"section" lang=3D"en"><div =
class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10204">=
</a><code class=3D"literal">SecAuditLog2</code></h3></div></div><div>=
</div></div><p><span class=3D"bold"><strong>Description:</strong></sp=
an> Defines the path to
      the secondary audit log index file when concurrent logging is e=
nabled.
      See <code class=3D"literal">SecAuditLog2</code> for more
      details.</p><p><span class=3D"bold"><strong>Syntax:</strong></s=
pan> <code class=3D"literal">SecAuditLog2 /path/to/auditlog2</code></=
p><p><span class=3D"bold"><strong>Example Usage:</strong></span> <cod=
e class=3D"literal">SecAuditLog2
      /usr/local/apache/logs/audit2.log</code></p><p><span class=3D"b=
old"><strong>Processing Phase:</strong></span> N/A</p><p><span class=
=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=3D"bol=
d"><strong>Dependencies/Notes:</strong></span> A main audit
      log must be defined via <code class=3D"literal">SecAuditLog</co=
de>
      before this directive may be used. Additionally, this log is on=
ly used
      for replicating the main audit log index file when concurrent a=
udit
      logging is used. It will <span class=3D"bold"><strong>not</stro=
ng></span> be used
      for non-concurrent audit logging.</p></div><div class=3D"sectio=
n" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"=
><a name=3D"N10238"></a><code class=3D"literal">SecAuditLogParts</cod=
e></h3></div></div><div></div></div><p><span class=3D"bold"><strong>D=
escription:</strong></span> Defines the path to
      the main audit log file.</p><p><span class=3D"bold"><strong>Syn=
tax:</strong></span> <code class=3D"literal">SecAuditLogParts PARTS</=
code></p><p><span class=3D"bold"><strong>Example Usage:</strong></spa=
n> <code class=3D"literal">SecAuditLogParts ABCFHZ</code></p><p><span=
 class=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><=
span class=3D"bold"><strong> <span class=3D"bold"><strong>Scope:</str=
ong></span>
      </strong></span> Any</p><p><span class=3D"bold"><strong>Depende=
ncies/Notes:</strong></span> At this time
      ModSecurity does not log response bodies of stock Apache respon=
ses (e.g.
      <code class=3D"literal">404</code>), or the <code class=3D"lite=
ral">Server</code> and <code class=3D"literal">Date</code> response h=
eaders.</p><p>Default:<code class=3D"literal"> ABCFHZ</code>.</p><p>A=
vailable audit log parts:</p><div class=3D"itemizedlist"><ul type=
=3D"disc"><li><p><code class=3D"literal">A</code> - audit log header
          (mandatory)</p></li><li><p><code class=3D"literal">B</code>=
 - request headers</p></li><li><p><code class=3D"literal">C</code> - =
request body (present
          only if the request body exists and ModSecurity is configur=
ed to
          intercept it)</p></li><li><p><code class=3D"literal">D</cod=
e> - RESERVED for
          intermediary response headers, not implemented yet.</p></li=
><li><p><code class=3D"literal">E</code> - intermediary response
          body (present only if ModSecurity is configured to intercep=
t
          response bodies, and if the audit log engine is configured =
to record
          it). Intermediary response body is the same as the actual r=
esponse
          body unless ModSecurity intercepts the intermediary respons=
e body,
          in which case the actual response body will contain the err=
or
          message (either the Apache default error message, or the
          ErrorDocument page).</p></li><li><p><code class=3D"literal"=
>F</code> - final response headers
          (excluding the Date and Server headers, which are always ad=
ded by
          Apache in the late stage of content delivery).</p></li><li>=
<p><code class=3D"literal">G</code> - RESERVED for the actual
          response body, not implemented yet.</p></li><li><p><code cl=
ass=3D"literal">H</code> - audit log
          trailer</p></li><li><p><code class=3D"literal">I</code> - T=
his part is a
          replacement for part C. It will log the same data as C in a=
ll cases
          except when <code class=3D"literal">multipart/form-data</co=
de>
          encoding in used. In this case it will log a fake <code cla=
ss=3D"literal">application/x-www-form-urlencoded</code> body
          that contains the information about parameters but not abou=
t the
          files. This is handy if you don't want to have (often large=
) files
          stored in your audit logs.</p></li><li><p><code class=3D"li=
teral">J</code> - RESERVED. This part,
          when implemented, will contain information about the files =
uploaded
          using <code class=3D"literal">multipart/form-data</code> en=
coding.</p></li><li><p><code class=3D"literal">Z</code> - final bound=
ary,
          signifies the end of the entry (mandatory)</p></li></ul></d=
iv></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage">=
<div><div><h3 class=3D"title"><a name=3D"N102C6"></a><code class=3D"l=
iteral">SecAuditLogRelevantStatus</code></h3></div></div><div></div><=
/div><p><span class=3D"bold"><strong>Description:</strong></span> Con=
figures which
      response status code is to be considered relevant for the purpo=
se of
      audit logging.</p><p><span class=3D"bold"><strong>Syntax:</stro=
ng></span> <code class=3D"literal">SecAuditLogRelevantStatus REGEX</c=
ode></p><p><span class=3D"bold"><strong>Example Usage:</strong></span=
> <code class=3D"literal">SecAuditLogRelevantStatus ^[45]</code></p><=
p><span class=3D"bold"><strong>Processing Phase:</strong></span> N/A<=
/p><p><span class=3D"bold"><strong>Scope:</strong></span> Any</p><p><=
span class=3D"bold"><strong>Dependencies/Notes:</strong></span> Must =
have the
      SecAuditEngine set to RelevantOnly. The parameter is a regular
      expression.</p><p>The main purpose of this directive is to allo=
w you to configure
      audit logging for only transactions that generate the specified=
 HTTP
      Response Status Code. This directive is often used to the decre=
ase the
      total size of the audit log file. Keep in mind that if this par=
ameter is
      used, then successful attacks that result in a 200 OK status co=
de will
      not be logged.</p></div><div class=3D"section" lang=3D"en"><div=
 class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N102F0"=
></a><code class=3D"literal">SecAuditLogStorageDir</code></h3></div><=
/div><div></div></div><p><span class=3D"bold"><strong>Description:</s=
trong></span> Configures the
      storage directory where concurrent audit log entries are to be
      stored.</p><p><span class=3D"bold"><strong>Syntax:</strong></sp=
an> <code class=3D"literal">SecAuditLogStorageDir
      /path/to/storage/dir</code></p><p><span class=3D"bold"><strong>=
Example Usage:</strong></span> <code class=3D"literal">SecAuditLogSto=
rageDir
      /usr/local/apache/logs/audit</code></p><p><span class=3D"bold">=
<strong>Processing Phase:</strong></span> N/A</p><p><span class=3D"bo=
ld"><strong>Scope:</strong></span> Any</p><p><span class=3D"bold"><st=
rong>Dependencies/Notes:</strong></span>
      SecAuditLogType must be set to Concurrent. The directory must a=
lready be
      created before starting Apache and it must be writable by the w=
eb server
      user as new files are generated at runtime.</p><p>As with all l=
ogging mechanisms, ensure that you specify a file
      system location that has adequate disk space and is not on the =
root
      partition.</p></div><div class=3D"section" lang=3D"en"><div cla=
ss=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1031A"></a=
><code class=3D"literal">SecAuditLogType</code></h3></div></div><div>=
</div></div><p><span class=3D"bold"><strong>Description:</strong></sp=
an> Configures the type
      of audit logging mechanism to be used.</p><p><span class=3D"bol=
d"><strong>Syntax:</strong></span> <code class=3D"literal">SecAuditLo=
gType Serial|Concurrent</code></p><p><span class=3D"bold"><strong>Exa=
mple Usage:</strong></span> <code class=3D"literal">SecAuditLogType S=
erial</code></p><p><span class=3D"bold"><strong>Processing Phase:</st=
rong></span> N/A</p><p><span class=3D"bold"><strong>Scope:</strong></=
span> Any</p><p><span class=3D"bold"><strong>Dependencies/Notes:</str=
ong></span> Must specify
      SecAuditLogStorageDir if you use concurrent logging.</p><p>Poss=
ible values are:</p><div class=3D"orderedlist"><ol type=3D"1"><li><p>=
<code class=3D"literal">Serial</code> - all audit log
          entries will be stored in the main audit logging file. This=
 is more
          convenient for casual use but it is slower as only one audi=
t log
          entry can be written to the file at any one file.</p></li><=
li><p><code class=3D"literal">Concurrent</code> - audit log
          entries will be stored in separate files, one for each tran=
saction.
          Concurrent logging is the mode to use if you are going to s=
end the
          audit log data off to a remote ModSecurity Console host.</p=
></li></ol></div></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10353"></a><=
code class=3D"literal">SecChrootDir</code></h3></div></div><div></div=
></div><p><span class=3D"bold"><strong>Description:</strong></span> C=
onfigures the
      directory path that will be used to jail the web server process=
.</p><p><span class=3D"bold"><strong>Syntax:</strong></span> <code cl=
ass=3D"literal">SecChrootDir /path/to/chroot/dir</code></p><p><span c=
lass=3D"bold"><strong>Example Usage:</strong></span> <code class=3D"l=
iteral">SecChrootDir /chroot</code></p><p><span class=3D"bold"><stron=
g>Processing Phase:</strong></span> N/A</p><p><span class=3D"bold"><s=
trong>Scope:</strong></span> Main</p><p><span class=3D"bold"><strong>=
Dependencies/Notes:</strong></span> The internal
      chroot functionality provided by ModSecurity works great for si=
mple
      setups. One example of a simple setup is Apache serving static =
files
      only, or running scripts using modules. For more complex setups=
 you
      should consider building a jail the old-fashioned way. The inte=
rnal
      chroot feature should be treated as somewhat experimental. Due =
to the
      large number of default and third-party modules available for t=
he Apache
      web server, it is not possible to verify the internal chroot wo=
rks
      reliably with all of them. You are advised to think about your =
option
      and make your own decision. In particular, if you are using any=
 of the
      modules that fork in the module initialisation phase (e.g. mod_=
fastcgi,
      mod_fcgid, mod_cgid), you are advised to examine each Apache pr=
ocess and
      observe its current working directory, process root, and the li=
st of
      open files.</p></div><div class=3D"section" lang=3D"en"><div cl=
ass=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1037B"></=
a><code class=3D"literal">SecCookieFormat</code></h3></div></div><div=
></div></div><p><span class=3D"bold"><strong>Description:</strong></s=
pan> Selects the cookie
      format that will be used in the current configuration context.<=
/p><p><span class=3D"bold"><strong>Syntax:</strong></span> <code clas=
s=3D"literal">SecCookieFormat 0|1</code></p><p><span class=3D"bold"><=
strong>Example Usage:</strong></span> <code class=3D"literal">SecCook=
ieFormat 0</code></p><p><span class=3D"bold"><strong>Processing Phase=
:</strong></span> N/A</p><p><span class=3D"bold"><strong>Scope:</stro=
ng></span> Any</p><p><span class=3D"bold"><strong>Dependencies/Notes:=
</strong></span> None</p><p>Possible values are:</p><div class=3D"ite=
mizedlist"><ul type=3D"disc"><li><p><code class=3D"literal">0</code> =
- use version 0
          (Netscape) cookies. This is what most applications use. It =
is the
          default value.</p></li><li><p><code class=3D"literal">1</co=
de> - use version 1
          cookies.</p></li></ul></div></div><div class=3D"section" la=
ng=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a n=
ame=3D"N103B2"></a><code class=3D"literal">SecDataDir</code></h3></di=
v></div><div></div></div><p><span class=3D"bold"><strong>Description:=
</strong></span> Path where
      persistent data (e.g. IP address data, session data, etc) is to=
 be
      stored.</p><p><span class=3D"bold"><strong>Syntax:</strong></sp=
an> <code class=3D"literal">SecDataDir /path/to/dir</code></p><p><spa=
n class=3D"bold"><strong>Example Usage:</strong></span> <code class=
=3D"literal">SecDataDir /usr/local/apache/logs/data</code></p><p><spa=
n class=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p>=
<span class=3D"bold"><strong> <span class=3D"bold"><strong>Scope:</st=
rong></span>
      </strong></span> Main</p><p><span class=3D"bold"><strong>Depend=
encies/Notes: </strong></span> This
      directive is needed when initcol, setsid an setuid are used. Mu=
st be
      writable by the web server user.</p></div><div class=3D"section=
" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title">=
<a name=3D"N103DE"></a><code class=3D"literal">SecDebugLog</code></h3=
></div></div><div></div></div><p><span class=3D"bold"><strong>Descrip=
tion:</strong></span> Path to the
      ModSecurity debug log file.</p><p><span class=3D"bold"><strong>=
Syntax:</strong></span> <code class=3D"literal">SecDebugLog /path/to/=
modsec-debug.log</code></p><p><span class=3D"bold"><strong>Example Us=
age:</strong></span> <code class=3D"literal">SecDebugLog
      /usr/local/apache/logs/modsec-debug.log</code></p><p><span clas=
s=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><span =
class=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> None</p></div><=
div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div>=
<h3 class=3D"title"><a name=3D"N10406"></a><code class=3D"literal">Se=
cDebugLogLevel</code></h3></div></div><div></div></div><p><span class=
=3D"bold"><strong>Description:</strong></span> Configures the
      verboseness of the debug log data.</p><p><span class=3D"bold"><=
strong>Syntax:</strong></span> <code class=3D"literal">SecDebugLogLev=
el 0|1|2|3|4|5|6|7|8|9</code></p><p><span class=3D"bold"><strong>Exam=
ple Usage:</strong></span> <code class=3D"literal">SecDebugLogLevel 4=
</code></p><p><span class=3D"bold"><strong>Processing Phase:</strong>=
</span> N/A</p><p><span class=3D"bold"><strong>Scope:</strong></span>=
 Any</p><p><span class=3D"bold"><strong>Dependencies/Notes:</strong><=
/span> Levels
      <code class=3D"literal">1 - 3</code> are always sent to the Apa=
che
      error log. Therefore you can always use level <code class=3D"li=
teral">0</code> as the default logging level in production.
      Level <code class=3D"literal">5</code> is useful when debugging=
. It
      is not advisable to use higher logging levels in production as =
excessive
      logging can slow down server significantly.</p><p>Possible valu=
es are:</p><div class=3D"itemizedlist"><ul type=3D"disc"><li><p><code=
 class=3D"literal">0</code> - no logging.</p></li><li><p><code class=
=3D"literal">1</code> - errors (intercepted
          requests) only.</p></li><li><p><code class=3D"literal">2</c=
ode> - warnings.</p></li><li><p><code class=3D"literal">3</code> - no=
tices.</p></li><li><p><code class=3D"literal">4</code> - details of h=
ow
          transactions are handled.</p></li><li><p><code class=3D"lit=
eral">5</code> - as above, but including
          information about each piece of information handled.</p></l=
i><li><p><code class=3D"literal">9</code> - log everything,
          including very detailed debugging information.</p></li></ul=
></div></div><div class=3D"section" lang=3D"en"><div class=3D"titlepa=
ge"><div><div><h3 class=3D"title"><a name=3D"N10467"></a><code class=
=3D"literal">SecDefaultAction</code></h3></div></div><div></div></div=
><p><span class=3D"bold"><strong>Description:</strong></span> Defines=
 the default
      action to take on a rule match.</p><p><span class=3D"bold"><str=
ong>Syntax:</strong></span> <code class=3D"literal">SecDefaultAction
      action1,action2,action3</code></p><p><span class=3D"bold"><stro=
ng>Example Usage:</strong></span> <code class=3D"literal">SecDefaultA=
ction
      log,auditlog,deny,status:403,phase:2,t:lowercase</code></p><p><=
span class=3D"bold"><strong>Processing Phase:</strong></span> Any</p>=
<p><span class=3D"bold"><strong>Scope:</strong></span> Any</p><p><spa=
n class=3D"bold"><strong>Dependencies/Notes:</strong></span> Rules
      following a SecDefaultAction directive will inherit this settin=
g unless
      a specific action is specified for an indivdual rule or until a=
nother
      SecDefaultAction is specified.</p><p>The default value is:</p><=
pre class=3D"programlisting">SecDefaultAction log,auditlog,deny,statu=
s:403,phase:2,t:lowercase,t:replaceNulls,t:compressWhitespace</pre><p=
><span class=3D"bold"><strong>Note</strong></span></p><p>SecDefaultAc=
tion must specify a disruptive action and a processing
      phase.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1049A"></a><=
code class=3D"literal">SecGuardianLog</code></h3></div></div><div></d=
iv></div><p><span class=3D"bold"><strong>Description:</strong></span>=
 Configuration
      directive to use the httpd-guardian script to monitor for Denia=
l of
      Service (DoS) attacks.</p><p><span class=3D"bold"><strong>Synta=
x:</strong></span> <code class=3D"literal">SecGuardianLog |/path/to/h=
ttpd-guardian</code></p><p><span class=3D"bold"><strong>Example Usage=
:</strong></span> <code class=3D"literal">SecGuardianLog
      |/usr/local/apache/bin/httpd-guardian</code></p><p><span class=
=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><span c=
lass=3D"bold"><strong>Scope:</strong></span> Main</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> By default
      httpd-guardian will defend against clients that send more 120 r=
equests
      in a minute, or more than 360 requests in five minutes.</p><p>S=
ince 1.9, ModSecurity supports a new directive, SecGuardianLog,
      that is designed to send all access data to another program usi=
ng the
      piped logging feature. Since Apache is typically deployed in a
      multi-process fashion, making information sharing difficult, th=
e idea is
      to deploy a single external process to observe all requests in =
a
      stateful manner, providing additional protection.</p><p>Develop=
ment of a state of the art external protection tool will be
      a focus of subsequent ModSecurity releases. However, a fully fu=
nctional
      tool is already available as part of the <a href=3D"http://www.=
apachesecurity.net/tools/" target=3D"_top">Apache httpd tools
      project</a>. The tool is called httpd-guardian and can be used =
to
      defend against Denial of Service attacks. It uses the blacklist=
 tool
      (from the same project) to interact with an iptables-based (Lin=
ux) or
      pf-based (*BSD) firewall, dynamically blacklisting the offendin=
g IP
      addresses. It can also interact with SnortSam (http://www.snort=
sam.net).
      Assuming httpd-guardian is already configured (look into the so=
urce code
      for the detailed instructions) you only need to add one line to=
 your
      Apache configuration to deploy it:</p><pre class=3D"programlist=
ing">SecGuardianLog |/path/to/httpd-guardian</pre></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N104CE"></a><code class=3D"literal">SecRequestB=
odyAccess</code></h3></div></div><div></div></div><p><span class=3D"b=
old"><strong>Description:</strong></span> Configures whether
      request bodies will be buffered and processed by ModSecurity by
      default.</p><p><span class=3D"bold"><strong>Syntax:</strong></s=
pan> <code class=3D"literal">SecRequestBodyAccess On|Off</code></p><p=
><span class=3D"bold"><strong>Example Usage:</strong></span> <code cl=
ass=3D"literal">SecRequestBodyAccess On</code></p><p><span class=3D"b=
old"><strong>Processing Phase:</strong></span> N/A</p><p><span class=
=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=3D"bol=
d"><strong>Dependencies/Notes:</strong></span> This
      directive is required if you plan to inspect POST_PAYLOADS of r=
equests.
      This directive must be used along with the "phase:2" processing=
 phase
      action and REQUEST_BODY variable/location. If any of these 3 pa=
rts are
      not configured, you will not be able to inspect the request
      bodies.</p><p>Possible values are:</p><div class=3D"itemizedlis=
t"><ul type=3D"disc"><li><p><code class=3D"literal">On</code> - acces=
s request
          bodies.</p></li><li><p><code class=3D"literal">Off</code> -=
 do not attempt to
          access request bodies.</p></li></ul></div></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10505"></a><code class=3D"literal">SecRequestB=
odyLimit</code></h3></div></div><div></div></div><p><span class=3D"bo=
ld"><strong>Description:</strong></span> Configures the
      maximum request body size ModSecurity will accept for buffering=
.</p><p><span class=3D"bold"><strong>Syntax:</strong></span> <code cl=
ass=3D"literal">SecRequestBodyLimit NUMBER_IN_BYTES</code></p><p><spa=
n class=3D"bold"><strong>Example Usage:</strong></span> <code class=
=3D"literal">SecRequestBodyLimit 134217728</code></p><p><span class=
=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><span c=
lass=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> 131072 KB
      (134217728 bytes) is the default setting. Anything over this li=
mit will
      be rejected with status code 413 Request Entity Too Large. Ther=
e is a
      hard limit of 1 GB.</p></div><div class=3D"section" lang=3D"en"=
><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1=
052D"></a><code class=3D"literal">SecRequestBodyInMemoryLimit</code><=
/h3></div></div><div></div></div><p><span class=3D"bold"><strong>Desc=
ription:</strong></span> Configures the
      maximum request body size ModSecurity will store in memory.</p>=
<p><span class=3D"bold"><strong>Syntax:</strong></span> <code class=
=3D"literal">SecRequestBodyInMemoryLimit
      NUMBER_IN_BYTES</code></p><p><span class=3D"bold"><strong>Examp=
le Usage:</strong></span> <code class=3D"literal">SecRequestBodyInMem=
oryLimit 131072</code></p><p><span class=3D"bold"><strong>Processing =
Phase:</strong></span> N/A</p><p><span class=3D"bold"><strong>Scope:<=
/strong></span> Any</p><p><span class=3D"bold"><strong>Dependencies/N=
otes:</strong></span> None</p><p>By default the limit is 128 KB:</p><=
pre class=3D"programlisting"># Store up to 128 KB in memory
SecRequestBodyInMemoryLimit 131072</pre></div><div class=3D"section" =
lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a=
 name=3D"N1055A"></a><code class=3D"literal">SecResponseBodyLimit</co=
de></h3></div></div><div></div></div><p><span class=3D"bold"><strong>=
Description:</strong></span> Configures the
      maximum response body size that will be accepted for buffering.=
</p><p><span class=3D"bold"><strong>Syntax:</strong></span> <code cla=
ss=3D"literal">SecResponseBodyLimit NUMBER_IN_BYTES</code></p><p><spa=
n class=3D"bold"><strong>Example Usage:</strong></span> <code class=
=3D"literal">SecResponseBodyLimit 524228</code></p><p><span class=
=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><span c=
lass=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> Anything over
      this limit will be rejected with status code 500 Internal Serve=
r Error.
      This setting will not affect the responses with MIME types that=
 are not
      marked for buffering. There is a hard limit of 1 GB.</p><p>By d=
efault this limit is configured to 512 KB:</p><pre class=3D"programli=
sting"># Buffer response bodies of up to 512 KB in length=20
SecResponseBodyLimit 524288</pre></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N10587"></a><code class=3D"literal">SecResponseBodyMimeType</cod=
e></h3></div></div><div></div></div><p><span class=3D"bold"><strong>D=
escription:</strong></span> Configures
      which<code class=3D"literal"> MIME</code> types are to be consi=
dered
      for response body buffering.</p><p><span class=3D"bold"><strong=
>Syntax:</strong></span> <code class=3D"literal">SecResponseBodyMimeT=
ype mime/type</code></p><p><span class=3D"bold"><strong>Example Usage=
:</strong></span> <code class=3D"literal">SecResponseBodyMimeType tex=
t/plain
      text/html</code></p><p><span class=3D"bold"><strong>Processing =
Phase:</strong></span> N/A</p><p><span class=3D"bold"><strong>Scope:<=
/strong></span> Any</p><p><span class=3D"bold"><strong>Dependencies/N=
otes:</strong></span>
      Multiple<code class=3D"literal"> SecResponseBodyMimeType</code>
      directives can be used to add<code class=3D"literal"> MIME</cod=
e>
      types.</p><p>The default value is <code class=3D"literal">text/=
plaintext/html</code>:</p><pre class=3D"programlisting">SecResponseBo=
dyMimeType text/plain text/html</pre></div><div class=3D"section" lan=
g=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a na=
me=3D"N105C4"></a><code class=3D"literal">SecResponseBodyMimeTypesCle=
ar</code></h3></div></div><div></div></div><p><span class=3D"bold"><s=
trong>Description:</strong></span> Clears the list of
      <code class=3D"literal">MIME</code> types considered for respon=
se
      body buffering, allowing you to start populating the list from
      scratch.</p><p><span class=3D"bold"><strong>Syntax:</strong></s=
pan> <code class=3D"literal">SecResponseBodyMimeTypesClear</code></p>=
<p><span class=3D"bold"><strong>Example Usage:</strong></span> <code =
class=3D"literal">SecResponseBodyMimeTypesClear</code></p><p><span cl=
ass=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><spa=
n class=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> None</p></div><=
div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div>=
<h3 class=3D"title"><a name=3D"N105F0"></a><code class=3D"literal">Se=
cResponseBodyAccess</code></h3></div></div><div></div></div><p><span =
class=3D"bold"><strong>Description:</strong></span> Configures whethe=
r
      response bodies are to be buffer and analysed or not.</p><p><sp=
an class=3D"bold"><strong>Syntax:</strong></span> <code class=3D"lite=
ral">SecResponseBodyAccess On|Off</code></p><p><span class=3D"bold"><=
strong>Example Usage:</strong></span> <code class=3D"literal">SecResp=
onseBodyAccess On</code></p><p><span class=3D"bold"><strong>Processin=
g Phase:</strong></span> N/A</p><p><span class=3D"bold"><strong>Scope=
:</strong></span> Any</p><p><span class=3D"bold"><strong>Dependencies=
/Notes:</strong></span> This
      directive is required if you plan to inspect html responses. Th=
is
      directive must be used along with the "phase:4" processing phas=
e action
      and RESPONSE_BODY variable/location. If any of these 3 parts ar=
e not
      configured, you will not be able to inspect the response bodies=
.</p><p>Possible values are:</p><div class=3D"itemizedlist"><ul type=
=3D"disc"><li><p><code class=3D"literal">On</code> - access response =
bodies
          (but only if the MIME type matches, see above).</p></li><li=
><p><code class=3D"literal">Off</code> - do not attempt to
          access response bodies.</p></li></ul></div></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10627"></a><code class=3D"literal">SecRule</co=
de></h3></div></div><div></div></div><p><span class=3D"bold"><strong>=
Description:</strong></span> <code class=3D"literal">SecRule</code> i=
s the main ModSecurity directive. It
      is used to analyse data and perform actions based on the result=
s.</p><p><span class=3D"bold"><strong>Syntax:</strong></span> <code c=
lass=3D"literal">SecRule VARIABLES OPERATOR [ACTIONS]</code></p><p><s=
pan class=3D"bold"><strong>Example Usage:</strong></span> <code class=
=3D"literal">SecRule REQUEST_URI "attack"</code></p><p><span class=
=3D"bold"><strong>Processing Phase:</strong></span> Any</p><p><span c=
lass=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Dependencies/Notes:</strong></span> None</p><p>In g=
eneral, the format of this rule is as follows:</p><pre class=3D"progr=
amlisting">SecRule VARIABLES OPERATOR [ACTIONS]</pre><p>The second pa=
rt, <code class=3D"literal">OPERATOR</code>,
      specifies how they are going to be checked. The third (optional=
) part,
      <code class=3D"literal">ACTIONS</code>, specifies what to do
      whenever the operator used performs a successful match against =
a
      variable.</p><div class=3D"section" lang=3D"en"><div class=3D"t=
itlepage"><div><div><h4 class=3D"title"><a name=3D"N10662"></a>Variab=
les in rules</h4></div></div><div></div></div><p>The first part,<code=
 class=3D"literal"> VARIABLES</code>,
        specifies which variables are to be checked. For example, the
        following rule will reject a transaction that has the word<sp=
an class=3D"emphasis"><em>
        dirty</em></span> in the URI:</p><pre class=3D"programlisting=
">SecRule REQUEST_URI dirty</pre><p>Each rule can specify one or more=
 variables:</p><pre class=3D"programlisting">SecRule REQUEST_URI|QUER=
Y_STRING dirty</pre><p>There is a third format supported by the selec=
tion operator -
        XPath expression. XPath expressions can only used against the=
 special
        variable XML, which is available only of the request body was
        processed as XML.</p><pre class=3D"programlisting">SecRule XM=
L:/xPath/Expression dirty</pre><div class=3D"note" style=3D"margin-le=
ft: 0.5in; margin-right: 0.5in;"><h3 class=3D"title">Note</h3><p>As y=
ou have just seen, not all collections support all
          selection operator format types. You should refer to the
          documentation of each collection to determine what is and i=
sn't
          supported.</p></div></div><div class=3D"section" lang=3D"en=
"><div class=3D"titlepage"><div><div><h4 class=3D"title"><a name=3D"N=
1067E"></a>Operators in rules</h4></div></div><div></div></div><p>In =
the simplest possible case you will use a regular expression
        pattern as the second rule parameter. This is what we've done=
 in the
        examples above. If you do this ModSecurity assumes you want t=
o use the
        <code class=3D"literal">rx</code> operator. You can explicitl=
y
        specify the operator you want to use by using <code class=
=3D"literal">@</code> as the first character in the second rule
        parameter:</p><pre class=3D"programlisting">SecRule REQUEST_U=
RI "@rx dirty"</pre><p>Note how we had to use double quotes to delimi=
t the second rule
        parameter. This is because the second parameter now has a whi=
tespace
        in it. Any number of whitespace characters can follow the nam=
e of the
        operator. If there are any non-whitespace characters there, t=
hey will
        all be treated as a special parameter to the operator. In the=
 case of
        the regular expression operator the special parameter is the =
pattern
        that will be used for comparison.</p><p>The @ can be the seco=
nd character if you are using negation to
        negate the result returned by the operator:</p><pre class=
=3D"programlisting">SecRule &amp;ARGS "!@rx ^0$"</pre></div><div clas=
s=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h4 clas=
s=3D"title"><a name=3D"N10695"></a>Actions in rules</h4></div></div><=
div></div></div><p>The third parameter, <code class=3D"literal">ACTIO=
NS</code>,
        can be omitted only because there is a helper feature that sp=
ecifies
        the default action list. If the parameter isn't omitted the a=
ctions
        specified in the parameter will be merged with the default ac=
tion list
        to create the actual list of actions that will be processed o=
n a rule
        match.</p></div></div><div class=3D"section" lang=3D"en"><div=
 class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1069E"=
></a><code class=3D"literal">SecRuleInheritance</code></h3></div></di=
v><div></div></div><p><span class=3D"bold"><strong>Description:</stro=
ng></span> Configures whether
      the current context will inherit rules from the parent context
      (configuration options are inherited in most cases - you should=
 look up
      the documentation for every directive to determine if it is inh=
erited or
      not).</p><p><span class=3D"bold"><strong>Syntax:</strong></span=
> <code class=3D"literal">SecRuleInheritance On|Off</code></p><p><spa=
n class=3D"bold"><strong>Example Usage:</strong></span> <code class=
=3D"literal">SecRuleInheritance Off</code></p><p><span class=3D"bold"=
><strong>Processing Phase:</strong></span> Any</p><p><span class=3D"b=
old"><strong>Scope:</strong></span> Any</p><p><span class=3D"bold"><s=
trong>Dependencies/Notes:</strong></span>
      Resource-specific contexts (e.g.<code class=3D"literal">
      Location</code>, <code class=3D"literal">Directory</code>, etc)
      cannot override <span class=3D"emphasis"><em>phase1</em></span>=
 rules configured in the main
      server or in the virtual server. This is because phase 1 is run=
 early in
      the request processing process, before Apache maps request to r=
esource.
      Virtual host context can override phase 1 rules configured in t=
he main
      server.</p><p>Example: The following example shows where ModSec=
urity may be
      enabled in the main Apache configuration scope, however you mig=
ht want
      to configure your VirtualHosts differently. In the first exampl=
e, the
      first virtualhost is not inheriting the ModSecurity main config
      directives and in the second one it is.</p><pre class=3D"progra=
mlisting">SecRuleEnine On
SecDefaultAction log,pass,phase:2
=2E.. =20

&lt;VirtualHost *:80&gt;
ServerName app1.com=20
ServerAlias www.app1.com<span class=3D"bold"><strong>
SecRuleInheritance Off</strong></span>
SecDefaultAction log,deny,phase:1,redirect:http://www.site2.com=20
=2E..=20
&lt;/VirtualHost&gt; =20

&lt;VirtualHost *:80&gt;=20
ServerName app2.com=20
ServerAlias www.app2.com
<span class=3D"bold"><strong>SecRuleInheritance On</strong></span> Se=
cRule ARGS "attack"=20
=2E..=20
&lt;/VirtualHost&gt;</pre><p>Possible values are:</p><div class=3D"it=
emizedlist"><ul type=3D"disc"><li><p><code class=3D"literal">On</code=
> - inherit rules from the
          parent context.</p></li><li><p><code class=3D"literal">Off<=
/code> - do not inherit rules
          from the parent context.</p></li></ul></div></div><div clas=
s=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 clas=
s=3D"title"><a name=3D"N106ED"></a><code class=3D"literal">SecRuleEng=
ine</code></h3></div></div><div></div></div><p><span class=3D"bold"><=
strong>Description:</strong></span> Configures the rules
      engine.</p><p><span class=3D"bold"><strong>Syntax:</strong></sp=
an> <code class=3D"literal">SecRuleEngine On|Off|DetectionOnly</code>=
</p><p><span class=3D"bold"><strong>Example Usage:</strong></span> <c=
ode class=3D"literal">SecRuleEngine On</code></p><p><span class=3D"bo=
ld"><strong>Processing Phase:</strong></span> Any</p><p><span class=
=3D"bold"><strong>Scope:</strong></span> Any</p><p><span class=3D"bol=
d"><strong>Dependencies/Notes:</strong></span> Thisdirective
      can also be controled by the ctl action (ctl:ruleEngine=3Doff) =
for per
      rule processing.</p><p>Possible values are:</p><div class=3D"it=
emizedlist"><ul type=3D"disc"><li><p><code class=3D"literal">On</code=
> - process rules.</p></li><li><p><code class=3D"literal">Off</code> =
- do not process
          rules.</p></li><li><p><code class=3D"literal">DetectionOnly=
</code> - process
          rules but never intercept transactions, even when rules are
          configured to do so.</p></li></ul></div></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N1072A"></a><code class=3D"literal">SecRuleRemo=
veById</code></h3></div></div><div></div></div><p><span class=3D"bold=
"><strong>Description:</strong></span> Removes matching
      rules from the parent contexts.</p><p><span class=3D"bold"><str=
ong>Syntax:</strong></span> <code class=3D"literal">SecRuleRemoveById=
 RULEID</code></p><p><span class=3D"bold"><strong>Example Usage:</str=
ong></span> <code class=3D"literal">SecRuleRemoveByID 1 2 "9000-9010"=
</code></p><p><span class=3D"bold"><strong>Processing Phase:</strong>=
</span> Any</p><p><span class=3D"bold"><strong>Scope:</strong></span>=
 Any</p><p><span class=3D"bold"><strong>Dependencies/Notes:</strong><=
/span> This
      directive supports multiple parameters, where each parameter ca=
n either
      be a rule ID, or a range. Parameters that contain spaces must b=
e
      delimited using double quotes.</p><pre class=3D"programlisting"=
>SecRuleRemoveById 1 2 5 10-20 "400-556" 673</pre></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10755"></a><code class=3D"literal">SecRuleRemo=
veByMsg</code></h3></div></div><div></div></div><p><span class=3D"bol=
d"><strong>Description:</strong></span> Removes matching
      rules from the parent contexts.</p><p><span class=3D"bold"><str=
ong>Syntax:</strong></span> <code class=3D"literal">SecRuleRemoveByMs=
g REGEX</code></p><p><span class=3D"bold"><strong>Example Usage:</str=
ong></span> <code class=3D"literal">SecRuleRemoveByMsg "FAIL"</code><=
/p><p><span class=3D"bold"><strong>Processing Phase:</strong></span> =
Any</p><p><span class=3D"bold"><strong>Scope:</strong></span> Any</p>=
<p><span class=3D"bold"><strong>Dependencies/Notes:</strong></span> T=
his
      directive supports multiple parameters. Each parameter is a reg=
ular
      expression that will be applied to the message (specified using=
 the
      <code class=3D"literal">msg</code> action).</p></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10781"></a><code class=3D"literal">SecServerSi=
gnature</code></h3></div></div><div></div></div><p><span class=3D"bol=
d"><strong>Description:</strong></span> Instructs
      ModSecurity to change the data presented in the "Server:" respo=
nse
      header token.</p><p><span class=3D"bold"><strong>Syntax:</stron=
g></span> <code class=3D"literal">SecServerSignature "WEB SERVER
      SOFTWARE"</code></p><p><span class=3D"bold"><strong>Example Usa=
ge:</strong></span> <code class=3D"literal">SecServerSignature
      "Netscape-Enterprise/6.0"</code></p><p><span class=3D"bold"><st=
rong>Processing Phase:</strong></span> N/A</p><p><span class=3D"bold"=
><strong>Scope:</strong></span> Main</p><p><span class=3D"bold"><stro=
ng>Dependencies/Notes:</strong></span> In order for
      this directive to work, you must set the Apache ServerTokens di=
rective
      to Full. ModSecurity will overwrite the server signature data h=
eld in
      this memory space with the data set in this directive. If Serve=
rTokens
      is not set to Full, then the memory space is most likely not la=
rge
      enough to hold the new data we are looking to insert.</p></div>=
<div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div=
><h3 class=3D"title"><a name=3D"N107A9"></a><code class=3D"literal">S=
ecTmpDir</code></h3></div></div><div></div></div><p><span class=3D"bo=
ld"><strong>Description:</strong></span> Configures the
      directory where temporary files will be created.</p><p><span cl=
ass=3D"bold"><strong>Syntax:</strong></span> <code class=3D"literal">=
SecTmpDir /path/to/dir</code></p><p><span class=3D"bold"><strong>Exam=
ple Usage:</strong></span> <code class=3D"literal">SecTmpDir /tmp</co=
de></p><p><span class=3D"bold"><strong>Processing Phase:</strong></sp=
an> N/A</p><p><span class=3D"bold"><strong>Scope:</strong></span> Any=
</p><p><span class=3D"bold"><strong>Dependencies/Notes:</strong></spa=
n> Needs to be
      writable by the Apache user process. This is the directory loca=
tion
      where Apache will swap data to disk if it runs out of memory (m=
ore data
      than what was specified in the SecRequestBodyInMemoryLimit dire=
ctive)
      during inspection.</p></div><div class=3D"section" lang=3D"en">=
<div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10=
7D1"></a><code class=3D"literal">SecUploadDir</code></h3></div></div>=
<div></div></div><p><span class=3D"bold"><strong>Description:</strong=
></span> Configures the
      directory where intercepted files will be stored.</p><p><span c=
lass=3D"bold"><strong>Syntax:</strong></span> <code class=3D"literal"=
>SecUploadDir /path/to/dir</code></p><p><span class=3D"bold"><strong>=
Example Usage:</strong></span> <code class=3D"literal">SecUploadDir /=
tmp</code></p><p><span class=3D"bold"><strong>Processing Phase:</stro=
ng></span> N/A</p><p><span class=3D"bold"><strong>Scope:</strong></sp=
an> Any</p><p><span class=3D"bold"><strong>Dependencies/Notes:</stron=
g></span> This
      directory must be on the same filesystem as the temporary direc=
tory
      defined with <code class=3D"literal">SecTmpDir</code>. This
      directive is used with <code class=3D"literal">SecUploadKeepFil=
es</code>.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10800"></a><=
code class=3D"literal">SecUploadKeepFiles</code></h3></div></div><div=
></div></div><p><span class=3D"bold"><strong>Description:</strong></s=
pan> Configures whether
      or not the intercepted files will be kept after transaction is
      processed.</p><p><span class=3D"bold"><strong>Syntax:</strong><=
/span> <code class=3D"literal">SecUploadKeepFiles On|Off|RelevantOnly=
</code></p><p><span class=3D"bold"><strong>Example Usage:</strong></s=
pan> <code class=3D"literal">SecUploadKeepFiles On</code></p><p><span=
 class=3D"bold"><strong>Processing Phase:</strong></span> N/A</p><p><=
span class=3D"bold"><strong>Scope:</strong></span> Any</p><p><span cl=
ass=3D"bold"><strong>Dependencies/Notes:</strong></span> This
      directive requires the storage directory to be defined (using <=
code class=3D"literal">SecUploadDir</code>).</p><p>Possible values ar=
e:</p><div class=3D"itemizedlist"><ul type=3D"disc"><li><p><code clas=
s=3D"literal">On</code> - Keep uploaded
          files.</p></li><li><p><code class=3D"literal">Off</code> - =
Do not keep uploaded
          files.</p></li><li><p><code class=3D"literal">RelevantOnly<=
/code> - This will
          keep only those files that belong to requests that are deem=
ed
          relevant.</p></li></ul></div></div><div class=3D"section" l=
ang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a =
name=3D"N10841"></a><code class=3D"literal">SecWebAppId</code></h3></=
div></div><div></div></div><p><span class=3D"bold"><strong>Descriptio=
n:</strong></span> Creates a partition
      on the server that belongs to one web application.</p><p><span =
class=3D"bold"><strong>Syntax:</strong></span> <code class=3D"literal=
">SecWebAppId "NAME"</code></p><p><span class=3D"bold"><strong>Exampl=
e Usage:</strong></span> <code class=3D"literal">SecWebAppId "WebApp1=
"</code></p><p><span class=3D"bold"><strong>Processing Phase:</strong=
></span> N/A</p><p><span class=3D"bold"><strong>Scope:</strong></span=
> Any</p><p><span class=3D"bold"><strong>Dependencies/Notes:</strong>=
</span> Partitions
      are used to avoid collisions between session IDs and user IDs. =
This
      directive must be used if there are multiple applications deplo=
yed on
      the same server. If it isn't used, a collision between session =
IDs might
      occur. The default value is<code class=3D"literal"> default</co=
de>.
      Example:</p><pre class=3D"programlisting">&lt;VirtualHost *:80&=
gt;=20
ServerName app1.com=20
ServerAlias www.app1.com
<span class=3D"bold"><strong>SecWebAppId "App1"</strong></span>
SecRule REQUEST_COOKIES:PHPSESSID !^$ chain,nolog,pass=20
SecAction setsid:%{REQUEST_COOKIES.PHPSESSID}=20
=2E..=20
&lt;/VirtualHost&gt; =20

&lt;VirtualHost *:80&gt;=20
ServerName app2.com=20
ServerAlias www.app2.com<span class=3D"bold"><strong>
SecWebAppId "App2"</strong></span>
SecRule REQUEST_COOKIES:PHPSESSID !^$ chain,nolog,pass=20
SecAction setsid:%{REQUEST_COOKIES.PHPSESSID}=20
=2E..=20
&lt;/VirtualHost&gt;</pre><p>In the two examples configurations shown=
, SecWebAppId is being
      used in conjuction with the Apache VirtualHost directives. What=
 this
      achieves is to create more unique collection names when being h=
osted on
      one server. Normally, when setsid is used, ModSecurity will cre=
ate a
      collection with the name "SESSION" and it will hold the value s=
pecified.
      With using SecWebAppId as shown in the examples, however, the n=
ame of
      the collection would become "App1_SESSION" and "App2_SESSION".<=
/p><p>SecWebAppId is relevant in two cases:</p><div class=3D"orderedl=
ist"><ol type=3D"1"><li><p>You are logging transactions/alerts to the=
 ModSecurity Console
          and you want to use the web application ID to search only t=
he
          transactions belonging to that application.</p></li><li><p>=
You are using the data persistence facility (collections
          SESSION and USER) and you need to avoid collisions between =
sessions
          and users belonging to different applications.</p></li></ol=
></div></div></div><div class=3D"section" lang=3D"en"><div class=3D"t=
itlepage"><div><div><h2 class=3D"title" style=3D"clear: both"><a name=
=3D"04-processing-phases"></a>Processing Phases</h2></div></div><div>=
</div></div><p>ModSecurity 2.x allows rules to be placed in one of th=
e following
    five phases:</p><div class=3D"orderedlist"><ol type=3D"1"><li><p>=
Request headers</p></li><li><p>Request body</p></li><li><p>Response h=
eaders</p></li><li><p>Response body</p></li><li><p>Logging</p></li></=
ol></div><p><span class=3D"bold"><strong>ModSecurity Processing Phase=
s
    Diagram</strong></span></p><p><span class=3D"emphasis"><em> <span=
 class=3D"emphasis"><em>Below is a diagram of the standard Apache
    Request Cycle. In the diagram, the 5 ModSecurity processing phase=
s are
    shown.</em></span> </em></span></p><p><div><img src=3D"apache_req=
uest_cycle-modsecurity.jpg" width=3D"810"></div></p><p>In order to se=
lect the phase a rule executes during, use the phase
    action either directly in the rule or in using the
    <code class=3D"literal">SecDefaultAction</code> directive:</p><pr=
e class=3D"programlisting">SecDefaultAction "log,pass,<span class=
=3D"bold"><strong>phase:2</strong></span>"
SecRule REQUEST_HEADERS:Host "!^$" "deny,<span class=3D"bold"><strong=
>phase:1</strong></span>"</pre><p><span class=3D"bold"><strong>Note o=
n Rule and Phases</strong></span></p><p>Keep in mind that rules are e=
xecuted according to phases, so even if
    two rules are adjacent in a configuration file, but are set to ex=
ecute in
    different phases, they would not happen one after the other. The =
order of
    rules in the configuration file is important only within the rule=
s of each
    phase. This is especially important when using the <code class=
=3D"literal">skip</code>
    action.</p><div class=3D"section" lang=3D"en"><div class=3D"title=
page"><div><div><h3 class=3D"title"><a name=3D"N108C5"></a>Phase Requ=
est Headers</h3></div></div><div></div></div><p>Rules in this phase a=
re processed immediately after Apache
      completes reading the request headers (post-read-request phase)=
. At this
      point the request body has not been read yet, meaning not all r=
equest
      arguments are available. Rules should be placed in this phase i=
f you
      need to have them run early (before Apache does something with =
the
      request), to do something before the request body has been read=
,
      determine whether or not the request body should be buffered, o=
r decide
      how you want the request body to be processed (e.g. whether to =
parse it
      as XML or not).</p><p><span class=3D"bold"><strong>Note</strong=
></span></p><p>Rules in this phase can not leverage Apache scope dire=
ctives
      (Directory, Location, LocationMatch, etc...) as the post-read-r=
equest
      hook does not have this information yet. The exception here is =
the
      VirtualHost directive. If you want to use ModSecurity rules ins=
ide
      Apache locations, then they should run in Phase 2. Refer to the=
 Apache
      Request Cycle/ModSecurity Processing Phases diagram.</p></div><=
div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div>=
<h3 class=3D"title"><a name=3D"N108D0"></a>Phase Request Body</h3></d=
iv></div><div></div></div><p>This is the general-purpose input analys=
is phase. Most of the
      application-oriented rules should go here. In this phase you ar=
e
      guaranteed to have received the request argument (provided the =
request
      body has been read). ModSecurity supports three encoding types =
for the
      request body phase:</p><div class=3D"itemizedlist"><ul type=
=3D"disc"><li><p><code class=3D"literal">application/x-www-form-urlen=
coded</code> - used to
          transfer form data</p></li><li><p><code class=3D"literal">m=
ultipart/form-data</code> - used for file
          transfers</p></li><li><p><code class=3D"literal">text/xml</=
code> - used for passing XML data</p></li></ul></div><p>Other encodin=
gs are not used by most web applications.</p></div><div class=3D"sect=
ion" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"titl=
e"><a name=3D"N108E7"></a>Phase Response Headers</h3></div></div><div=
></div></div><p>This phase takes place just before response headers a=
re sent back
      to the client. Run here if you want to observe the response bef=
ore that
      happens, and if you want to use the response headers to determi=
ne if you
      want to buffer the response body. Note that some response statu=
s codes
      (such as 404) are handled earlier in the request cycle by Apach=
e and my
      not be able to be triggered as expected. Additionally, there ar=
e some
      response headers that are added by Apache at a later hook (such=
 as Date,
      Server and Connection) that we would not be able to trigger on =
or
      sanitize. This should work appropirately in a proxy setup or wi=
thin
      phase:5 (logging).</p></div><div class=3D"section" lang=3D"en">=
<div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10=
8EC"></a>Phase Response Body</h3></div></div><div></div></div><p>This=
 is the general-purpose output analysis phase. At this point
      you can run rules against the response body (provided it was bu=
ffered,
      of course). This is the phase where you would want to inspect t=
he
      outbound html for information discloure, error messages or fail=
ed
      authentication text.</p></div><div class=3D"section" lang=3D"en=
"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N=
108F1"></a>Phase Logging</h3></div></div><div></div></div><p>This pha=
se is run just before logging takes place. The rules
      placed into this phase can only affect how the logging is perfo=
rmed.
      This phase can be used to inspect the error messages logged by =
Apache.
      You can not deny/block connections in this phase as it is too l=
ate. This
      phase also allows for inspection of other response headers that=
 weren't
      available during phase:3 or phase:4.</p></div></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h2 class=
=3D"title" style=3D"clear: both"><a name=3D"05-variables"></a>Variabl=
es</h2></div></div><div></div></div><p>The following variables are su=
pported in ModSecurity 2.x:</p><div class=3D"section" lang=3D"en"><di=
v class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N108FC=
"></a><code class=3D"literal">ARGS</code></h3></div></div><div></div>=
</div><p><code class=3D"literal">ARGS</code> is a collection and can =
be used on its own
      (means all arguments including the POST Payload), with a static
      parameter (matches arguments with that name), or with a regular
      expression (matches all arguments with name that matches the re=
gular
      expression). Note: <code class=3D"literal">ARGS:p</code> will n=
ot result in any
      invocations against the operator if argument p does not exist. =
Some
      variables are actually collections, which are expanded into mor=
e
      variables at runtime. The following example will examine all re=
quest
      arguments:<pre class=3D"programlisting">SecRule ARGS dirty</pre=
>
      Sometimes, however, you will want to look only at parts of a co=
llection.
      This can be achieved with the help of the <span class=3D"emphas=
is"><em>selection
      operator</em></span>(colon). The following example will only lo=
ok at the
      arguments named<code class=3D"literal"> p</code> (do note that,=
 in
      general, requests can contain multiple arguments with the same =
name):
      <pre class=3D"programlisting">SecRule ARGS:p dirty</pre>
      It is also possible to specify exclusions. The following will e=
xamine
      all request arguments for the word<span class=3D"emphasis"><em>=
 dirty</em></span>, except
      the ones named <code class=3D"literal">z</code> (again, there c=
an be
      zero or more arguments named<code class=3D"literal"> z</code>):
      <pre class=3D"programlisting">SecRule ARGS|!ARGS:z dirty</pre>
      There is a special operator that allows you to count how many v=
ariables
      there are in a collection. The following rule will trigger if t=
here is
      more than zero arguments in the request (ignore the second para=
meter for
      the time being): <pre class=3D"programlisting">SecRule &amp;ARG=
S !^0$</pre>
      And sometimes you need to look at an array of parameters, each =
with a
      slightly different name. In this case you can specify a regular
      expression in the selection operator itself. The following rule=
 will
      look into all arguments whose names begin with <code class=3D"l=
iteral">id_</code>: <pre class=3D"programlisting">SecRule ARGS:/^id_/=
 dirty</pre></p><div class=3D"note" style=3D"margin-left: 0.5in; marg=
in-right: 0.5in;"><h3 class=3D"title">Note</h3><p>In ModSecurity 1.X,=
 the <code class=3D"literal">ARGS</code> variable stood
        for <code class=3D"literal">QUERY_STRING</code> + <code class=
=3D"literal">POST_PAYLOAD</code>,
        whereas now it expands to to individual variables.</p></div><=
/div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div=
><div><h3 class=3D"title"><a name=3D"N1093D"></a><code class=3D"liter=
al">ARGS_COMBINED_SIZE</code></h3></div></div><div></div></div><p>Thi=
s variable allows you to set more targeted evaluations on the
      total size of the Arguments as compared with normal Apache Limi=
tRequest
      directives. For example, you could create a rule to ensure that=
 the
      total size of the argument data is below a certain threshold (t=
o help
      prevent buffer overflow issues). Example: Block request if the =
size of
      the arguments is above 25 characters.</p><pre class=3D"programl=
isting">SecRule REQUEST_FILENAME "^/cgi-bin/login\.php$" "chain,log,d=
eny,phase:2"
SecRule <span class=3D"bold"><strong>ARGS_COMBINED_SIZE</strong></spa=
n> "@gt 25"</pre></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1094B"></a><=
code class=3D"literal">ARGS_NAMES</code></h3></div></div><div></div><=
/div><p>Is a collection of the argument names. You can search for spe=
cific
      argument names that you want to block. In a positive policy sce=
nario,
      you can also whitelist (using an inverted rule with the ! chara=
cter)
      only authorized argument names. Example: This example rule will=
 only
      allow 2 argument names - p and a. If any other argument names a=
re
      injected, it will be blocked.</p><pre class=3D"programlisting">=
SecRule REQUEST_FILENAME "/index.php" "chain,log,deny,status:403,phas=
e:2"
SecRule<span class=3D"bold"><strong> ARGS_NAMES</strong></span> "!^(p=
|a)$"</pre></div><div class=3D"section" lang=3D"en"><div class=3D"tit=
lepage"><div><div><h3 class=3D"title"><a name=3D"N10959"></a><code cl=
ass=3D"literal">AUTH_TYPE</code></h3></div></div><div></div></div><p>=
This variable holds the authentication method used to validate a
      user. Example:</p><pre class=3D"programlisting">SecRule <span c=
lass=3D"bold"><strong>AUTH_TYPE</strong></span> "basic" log,deny,stat=
us:403,phase:1,t:lowercase</pre><p><span class=3D"bold"><strong>Note<=
/strong></span></p><p>This data will not be available in a proxy-mode=
 deployment as the
      authentication is not local. In a proxy-mode deployment, you wo=
uld need
      to inpect the <code class=3D"literal">REQUEST_HEADERS:Authoriza=
tion</code>
      header.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10970"></a><=
code class=3D"literal">ENV</code></h3></div></div><div></div></div><p=
>Collection, requires a single parameter (after a colon character).
      The ENV variable is set with setenv and does not give access to=
 the CGI
      environment variables. Example:</p><pre class=3D"programlisting=
">SecRule REQUEST_FILENAME "printenv" pass,<span class=3D"bold"><stro=
ng>setenv:tag=3Dsuspicious</strong></span>
SecRule <span class=3D"bold"><strong>ENV:tag</strong></span> "suspici=
ous"</pre></div><div class=3D"section" lang=3D"en"><div class=3D"titl=
epage"><div><div><h3 class=3D"title"><a name=3D"N10982"></a><code cla=
ss=3D"literal">FILES</code></h3></div></div><div></div></div><p>Colle=
ction. Contains a collection of original file names (as they
      were called on the remote user's file system). Note: only avail=
able if
      files were extracted from the request body. Example:</p><pre cl=
ass=3D"programlisting">SecRule<span class=3D"bold"><strong> FILES</st=
rong></span> "\.conf$" log,deny,status:403,phase:2</pre></div><div cl=
ass=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 cl=
ass=3D"title"><a name=3D"N10990"></a><code class=3D"literal">FILES_CO=
MBINED_SIZE</code></h3></div></div><div></div></div><p>Single value. =
Total size of the uploaded files. Note: only
      available if files were extracted from the request body. Exampl=
e:</p><pre class=3D"programlisting">SecRule <span class=3D"bold"><str=
ong>FILES_COMBINED_SIZE</strong></span> "@gt 1000" log,deny,status:40=
3,phase:2</pre></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1099E"></a><=
code class=3D"literal">FILES_NAMES</code></h3></div></div><div></div>=
</div><p>Collection w/o parameter. Contains a list of form fields tha=
t were
      used for file upload. Note: only available if files were extrac=
ted from
      the request body. Example:</p><pre class=3D"programlisting">Sec=
Rule<span class=3D"bold"><strong> FILES_NAMES</strong></span> "^upfil=
e$" log,deny,status:403,phase:2</pre></div><div class=3D"section" lan=
g=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a na=
me=3D"N109AC"></a><code class=3D"literal">FILES_SIZES</code></h3></di=
v></div><div></div></div><p>Collection. Contains a list of file sizes=
. Useful for implementing
      a size limitation on individual uploaded files. Note: only avai=
lable if
      files were extracted from the request body. Example:</p><pre cl=
ass=3D"programlisting">SecRule <span class=3D"bold"><strong>FILES_SIZ=
ES</strong></span> "@gt 100" log,deny,status:403,phase:2</pre></div><=
div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div>=
<h3 class=3D"title"><a name=3D"N109BA"></a><code class=3D"literal">FI=
LES_TMPNAMES</code></h3></div></div><div></div></div><p>Collection. C=
ontains a collection of temporary files' names on the
      disk. Useful when used together with <code class=3D"literal">@i=
nspectFile.</code> Note: only available if files
      were extracted from the request body. Example:</p><pre class=
=3D"programlisting">SecRule <span class=3D"bold"><strong>FILES_TMPNAM=
ES</strong></span> "@inspectFile /path/to/inspect_script.pl"</pre></d=
iv><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><=
div><h3 class=3D"title"><a name=3D"N109CC"></a><code class=3D"literal=
">HTTP_</code></h3></div></div><div></div></div><p>This variable is a=
 special prefix that is followed by a header
      name and can be used to access any request header. Example:</p>=
<pre class=3D"programlisting">SecRule<span class=3D"bold"><strong> HT=
TP_REFERER</strong></span> "www\.badsite\.com"</pre><p><span class=
=3D"bold"><strong>Note</strong></span></p><p>This variable is for bac=
kward-compatibilty with ModSecurity 1.X
      rules. It has been superceded by the REQUEST_HEADERS variable
      (REQUEST_HEADERS:<span class=3D"emphasis"><em>Headername</em></=
span>)</p></div><div class=3D"section" lang=3D"en"><div class=3D"titl=
epage"><div><div><h3 class=3D"title"><a name=3D"N109E3"></a><code cla=
ss=3D"literal">MULTIPART_CRLF_LF_LINES</code></h3></div></div><div></=
div></div><p>This flag variable will be set to <code class=3D"literal=
">1</code> whenever a
      multipart request uses mixed line terminators. The
      <code class=3D"literal">multipart/form-data</code> RFC requires
      <code class=3D"literal">CRLF</code> sequence to be used to term=
inate lines. Since
      some client implementations use only <code class=3D"literal">LF=
</code> to terminate
      lines you might want to allow them to proceed under certain
      circumstances (if you want to do this you will need to stop usi=
ng
      <code class=3D"literal">MULTIPART_STRICT_ERROR</code> and check=
 each multipart flag
      variable individually, avoding <code class=3D"literal">MULTIPAR=
T_LF_LINE</code>).
      However, mixing <code class=3D"literal">CRLF</code> and <code c=
lass=3D"literal">LF</code> line
      terminators is dangerous as it can allow for evasion. Therefore=
, in such
      cases, you will have to add a check for
      <code class=3D"literal">MULTIPART_CRLF_LF_LINES</code>.</p></di=
v><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><d=
iv><h3 class=3D"title"><a name=3D"N10A04"></a><code class=3D"literal"=
>MULTIPART_STRICT_ERROR</code></h3></div></div><div></div></div><p><c=
ode class=3D"literal">MULTIPART_STRICT_ERROR</code> will be set to
      <code class=3D"literal">1</code> when any of the following vari=
ables is also set to
      <code class=3D"literal">1</code>: <code class=3D"literal">REQBO=
DY_PROCESSOR_ERROR</code>,
      <code class=3D"literal">MULTIPART_BOUNDARY_QUOTED</code>,
      <code class=3D"literal">MULTIPART_BOUNDARY_WHITESPACE</code>,
      <code class=3D"literal">MULTIPART_DATA_BEFORE</code>,
      <code class=3D"literal">MULTIPART_DATA_AFTER</code>,
      <code class=3D"literal">MULTIPART_HEADER_FOLDING</code>,
      <code class=3D"literal">MULTIPART_LF_LINE</code>,
      <code class=3D"literal">MULTIPART_SEMICOLON_MISSING</code>. Eac=
h of these variables
      covers one unusual (although sometimes legal) aspect of the req=
uest body
      in <code class=3D"literal">multipart/form-data format</code>. Y=
our policies should
      <span class=3D"emphasis"><em>always</em></span> contain a rule =
to check either this variable
      (easier) or one or more individual variables (if you know exact=
ly what
      you want to accomplish). Depending on the rate of false positiv=
es and
      your default policy you should decide whether to block or just =
warn when
      the rule is triggered.</p><p>The best way to use this variable =
is as in the example
      below:</p><pre class=3D"programlisting">SecRule MULTIPART_STRIC=
T_ERROR "!@eq 0" \
"phase:2,t:none,log,deny,msg:'Multipart request body \
failed strict validation: \
PE %{REQBODY_PROCESSOR_ERROR}, \
BQ %{MULTIPART_BOUNDARY_QUOTED}, \
BW %{MULTIPART_BOUNDARY_WHITESPACE}, \
DB %{MULTIPART_DATA_BEFORE}, \
DA %{MULTIPART_DATA_AFTER}, \
HF %{MULTIPART_HEADER_FOLDING}, \
LF %{MULTIPART_LF_LINE}, \
SM %{MULTIPART_SEMICOLON_MISSING}'"</pre><p>The <code class=3D"litera=
l">multipart/form-data</code> parser has been
      upgraded in ModSecurity v2.1.3 to actively look for signs of ev=
asion.
      Many variables (as listed above) were added to expose various f=
acts
      discovered during the parsing process. The
      <code class=3D"literal">MULTIPART_STRICT_ERROR</code> variable =
is handy to check on
      all abnormalities at once. The individual variables allow detec=
tion to
      be fine-tuned according to your circumstances in order to reduc=
e the
      number of false positives. Detailed analysis of various evasion
      techniques covered will be released as a separated document at =
a later
      date.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10A3C"></a><=
code class=3D"literal">MULTIPART_UNMATCHED_BOUNDARY</code></h3></div>=
</div><div></div></div><p>Set to <code class=3D"literal">1</code> whe=
n, during the parsing phase of a
      <code class=3D"literal">multipart/request-body</code>, ModSecur=
ity encounters what
      feels like a boundary but it is not. Such an event may occur wh=
en
      evasion of ModSecurity is attempted.</p><p>The best wasy to use=
 this variable is as in the example
      below:</p><pre class=3D"programlisting">SecRule MULTIPART_UNMAT=
CHED_BOUNDARY "!@eq 0" \
"phase:2,t:none,log,deny,msg:'Multipart parser detected a possible un=
matched boundary.'"</pre><p>Change the rule from blocking to logging-=
only if many false
      positives are encountered.</p></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N10A4E"></a><code class=3D"literal">PATH_INFO</code></h3></div><=
/div><div></div></div><p>Besides passing query information to a scrip=
t/handler, you can
      also pass additional data, known as extra path information, as =
part of
      the URL. Example:</p><pre class=3D"programlisting">SecRule<span=
 class=3D"bold"><strong> PATH_INFO</strong></span> "^/(bin|etc|sbin|o=
pt|usr)"</pre></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10A5C"></a><=
code class=3D"literal">QUERY_STRING</code></h3></div></div><div></div=
></div><p>This variable holds form data passed to the script/handler =
by
      appending data after a question mark. Warning: Not URL-decoded.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>QUERY_STRING</strong></span> "attack"</pre></div><d=
iv class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><=
h3 class=3D"title"><a name=3D"N10A6A"></a><code class=3D"literal">REM=
OTE_ADDR</code></h3></div></div><div></div></div><p>This variable hol=
ds the IP address of the remote client.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>REMOTE_ADDR</strong></span> "^192\.168\.1\.101$"</p=
re></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage">=
<div><div><h3 class=3D"title"><a name=3D"N10A78"></a><code class=3D"l=
iteral">REMOTE_HOST</code></h3></div></div><div></div></div><p>If Hos=
tnameLookUps are set to On, then this variable will hold the
      DNS resolved remote host name. If it is set to Off, then it wil=
l hold
      the remote IP address. Possible uses for this variable would be=
 to deny
      known bad client hosts or network blocks, or conversely, to all=
ow in
      authorized hosts. Example:</p><pre class=3D"programlisting">Sec=
Rule <span class=3D"bold"><strong>REMOTE_HOST</strong></span> "\.evil=
\.network\org$"</pre></div><div class=3D"section" lang=3D"en"><div cl=
ass=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10A86"></=
a><code class=3D"literal">REMOTE_PORT</code></h3></div></div><div></d=
iv></div><p>This variable holds information on the source port that t=
he client
      used when initiating the connection to our web server. Example:=
 in this
      example, we are evaluating to see if the <code class=3D"literal=
">REMOTE_PORT</code>
      is less than 1024, which would indicate that the user is a priv=
ileged
      user (root).</p><pre class=3D"programlisting">SecRule <span cla=
ss=3D"bold"><strong>REMOTE_PORT</strong></span> "@lt 1024" phase:1,lo=
g,pass,setenv:remote_port=3Dprivileged</pre></div><div class=3D"secti=
on" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title=
"><a name=3D"N10A97"></a><code class=3D"literal">REMOTE_USER</code></=
h3></div></div><div></div></div><p>This variable holds the username o=
f the authenticated user. If
      there are no password (basic|digest) access controls in place, =
then this
      variable will be empty. Example:</p><pre class=3D"programlistin=
g">SecRule <span class=3D"bold"><strong>REMOTE_USER</strong></span> "=
admin"</pre><p><span class=3D"bold"><strong>Note</strong></span></p><=
p>This data will not be available in a proxy-mode deployment as the
      authentication is not local.</p></div><div class=3D"section" la=
ng=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a n=
ame=3D"N10AAB"></a><code class=3D"literal">REQBODY_PROCESSOR</code></=
h3></div></div><div></div></div><p>Built-in processors are <code clas=
s=3D"literal">URLENCODED</code>,<code class=3D"literal">
      MULTIPART</code>, and <code class=3D"literal">XML</code>.
      Example:</p><pre class=3D"programlisting">SecRule<span class=
=3D"bold"><strong> REQBODY_PROCESSOR</strong></span> "^XML$ chain
SecRule XML "@validateDTD /opt/apache-frontend/conf/xml.dtd"</pre></d=
iv><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><=
div><h3 class=3D"title"><a name=3D"N10AC5"></a><code class=3D"literal=
">REQBODY_PROCESSOR_ERROR</code></h3></div></div><div></div></div><p>=
Possible values are 0 (no error) or 1 (error). This variable will
      be set by request body processors (typically the
      <code class=3D"classname">multipart/request-data</code> parser =
or the XML parser)
      when they fail to properly parse a request payload.</p><p>Examp=
le:</p><pre class=3D"programlisting">SecRule<span class=3D"bold"><str=
ong> REQBODY_PROCESSOR_ERROR</strong></span> "@eq 1" deny,phase:2</pr=
e><div class=3D"note" style=3D"margin-left: 0.5in; margin-right: 0.5i=
n;"><h3 class=3D"title">Note</h3><p>Your policies <span class=3D"emph=
asis"><em>must</em></span> have a rule to check
        REQBODY_PROCESSOR_ERROR at the beginning of phase 2. Failure =
to do so
        will leave the door open for impedance mismatch attacks. It i=
s
        possible, for example, that a payload that cannot be parsed b=
y
        ModSecurity can be successfully parsed by more tolerant parse=
r
        operating in the application. If your policy dictates blockin=
g then
        you should reject the request if error is detected. When oper=
ating in
        detection-only mode your rule should alert with high severity=
 when
        request body processing fails.</p></div></div><div class=3D"s=
ection" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"t=
itle"><a name=3D"N10ADE"></a><code class=3D"literal">REQBODY_PROCESSO=
R_ERROR_MSG</code></h3></div></div><div></div></div><p>Empty, or cont=
ains the error message from the processor.
      Example:</p><pre class=3D"programlisting">SecRule<span class=
=3D"bold"><strong> REQBODY_PROCESSOR_ERROR_MSG</strong></span> "faile=
d to parse" t:lowercase</pre></div><div class=3D"section" lang=3D"en"=
><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1=
0AEC"></a><code class=3D"literal">REQUEST_BASENAME</code></h3></div><=
/div><div></div></div><p>This variable holds just the filename part o=
f
      <code class=3D"literal">REQUEST_FILENAME</code> (e.g. index.php=
). Warning: not
      urlDecoded. Example:</p><pre class=3D"programlisting">SecRule <=
span class=3D"bold"><strong>REQUEST_BASENAME</strong></span> "^login\=
.php$"</pre></div><div class=3D"section" lang=3D"en"><div class=3D"ti=
tlepage"><div><div><h3 class=3D"title"><a name=3D"N10AFD"></a><code c=
lass=3D"literal">REQUEST_BODY</code></h3></div></div><div></div></div=
><p>This variable holds the data in the request body (including
      POST_PAYLOAD data). REQUEST_BODY should be used if the original=
 order of
      the arguements is important (ARGS should be used in all other c=
ases).
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>REQUEST_BODY</strong></span> "^username=3D\w{25,}\&=
amp;password=3D\w{25,}\&amp;Submit\=3Dlogin$"</pre><p><span class=
=3D"bold"><strong>Note</strong></span></p><p>This variable is only av=
ailable if the content type is
      application/x-www-form-urlencoded.</p></div><div class=3D"secti=
on" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title=
"><a name=3D"N10B11"></a><code class=3D"literal">REQUEST_COOKIES</cod=
e></h3></div></div><div></div></div><p>This variable is a collection =
of all of the cookie data. Example:
      the following example is using the Ampersand special operator t=
o count
      how many variables are in the collection. In this rule, it woul=
d trigger
      if the request does not include any Cookie headers.</p><pre cla=
ss=3D"programlisting">SecRule<span class=3D"bold"><strong> &amp;REQUE=
ST_COOKIES</strong></span> "@eq 0"</pre></div><div class=3D"section" =
lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a=
 name=3D"N10B1F"></a><code class=3D"literal">REQUEST_COOKIES_NAMES</c=
ode></h3></div></div><div></div></div><p>This variable is a collectio=
n of the cookie names in the request
      headers. Example: the following rule will trigger if the JSESSI=
ONID
      cookie is not present.</p><pre class=3D"programlisting">SecRule=
<span class=3D"bold"><strong> &amp;REQUEST_COOKIES_NAMES:JSESSIONID</=
strong></span> "@eq 0"</pre></div><div class=3D"section" lang=3D"en">=
<div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10=
B2D"></a><code class=3D"literal">REQUEST_FILENAME</code></h3></div></=
div><div></div></div><p>This variable holds the relative REQUEST_URI =
minus the
      QUERY_STRING part (e.g. /index.php). Example:</p><pre class=
=3D"programlisting">SecRule <span class=3D"bold"><strong>REQUEST_FILE=
NAME</strong></span> "^/cgi-bin/login\.php$"</pre></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10B3B"></a><code class=3D"literal">REQUEST_HEA=
DERS</code></h3></div></div><div></div></div><p>This variable can be =
used as either a collection of all of the
      Request Headers or can be used to specify indivudual headers (b=
y using
      REQUEST_HEADERS<span class=3D"emphasis"><em>:Header-Name</em></=
span>). Example: the first
      example uses REQUEST_HEADERS as a collection and is applying th=
e
      validateUrlEncoding operator against all headers.</p><pre class=
=3D"programlisting">SecRule <span class=3D"bold"><strong>REQUEST_HEAD=
ERS</strong></span> "@validateUrlEncoding"</pre><p>Example: the secon=
d example is targeting only the Host
      header.</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>REQUEST_HEADERS:Host</strong></span> "^[\d\.]+$" \
    "deny,log,status:400,msg:'Host header is a numeric IP address'"</=
pre></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"=
><div><div><h3 class=3D"title"><a name=3D"N10B55"></a><code class=
=3D"literal">REQUEST_HEADERS_NAMES</code></h3></div></div><div></div>=
</div><p>This variable is a collection of the names of all of the Req=
uest
      Headers. Example:</p><pre class=3D"programlisting">SecRule <spa=
n class=3D"bold"><strong>REQUEST_HEADERS_NAMES</strong></span> "^x-fo=
rwarded-for" \
    "log,deny,status:403,t:lowercase,msg:'Proxy Server Used'"</pre></=
div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div>=
<div><h3 class=3D"title"><a name=3D"N10B63"></a><code class=3D"litera=
l">REQUEST_LINE</code></h3></div></div><div></div></div><p>This varia=
ble holds the complete request line sent to the server
      (including the REQUEST_METHOD and HTTP version data). Example: =
this
      example rule will trigger if the request method is something ot=
her than
      GET, HEAD, POST or if the HTTP is something other than HTTP/0.9=
, 1.0 or
      1.1.</p><pre class=3D"programlisting">SecRule <span class=3D"bo=
ld"><strong>REQUEST_LINE</strong></span> "!(^((?:(?:pos|ge)t|head))|h=
ttp/(0\.9|1\.0|1\.1)$)"</pre><p><span class=3D"bold"><strong>Note</st=
rong></span></p><p>Due to the default action transformation function =
lowercase, the
      regex strings should be in lowercase as well unless the t:none
      transformation function is specified for this particular rule.<=
/p></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage">=
<div><div><h3 class=3D"title"><a name=3D"N10B77"></a><code class=3D"l=
iteral">REQUEST_METHOD</code></h3></div></div><div></div></div><p>Thi=
s variable holds the Request Method used by the client.
      Example: the following example will trigger if the Request Meth=
od is
      either CONNECT or TRACE.</p><pre class=3D"programlisting">SecRu=
le <span class=3D"bold"><strong>REQUEST_METHOD</strong></span> "^((?:=
connect|trace))$"</pre><p><span class=3D"bold"><strong>Note</strong><=
/span></p><p>Due to the default action transformation function lowerc=
ase, the
      regex strings should be in lowercase as well unless the t:none
      transformation function is specified for this particular rule.<=
/p></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage">=
<div><div><h3 class=3D"title"><a name=3D"N10B8B"></a><code class=3D"l=
iteral">REQUEST_PROTOCOL</code></h3></div></div><div></div></div><p>T=
his variable holds the Request Protocol Version information.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>REQUEST_PROTOCOL</strong></span> "!^http/(0\.9|1\.0=
|1\.1)$"</pre><p><span class=3D"bold"><strong>Note</strong></span></p=
><p>Due to the default action transformation function lowercase, the
      regex strings should be in lowercase as well unless the t:none
      transformation function is specified for this particular rule.<=
/p></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage">=
<div><div><h3 class=3D"title"><a name=3D"N10B9F"></a><code class=3D"l=
iteral">REQUEST_URI</code></h3></div></div><div></div></div><p>This v=
ariable holds the full URL including the QUERY_STRING data
      (e.g. /index.php?p=3DX), however it will never contain a domain=
 name, even
      if it was provided on the request line. Warning: not urlDecoded=
. It also
      does not include either the REQUEST_METHOD or the HTTP version =
info.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>REQUEST_URI</strong></span> "attack"</pre></div><di=
v class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h=
3 class=3D"title"><a name=3D"N10BAD"></a><code class=3D"literal">REQU=
EST_URI_RAW</code></h3></div></div><div></div></div><p>Same as REQUES=
T_URI but will contain the domain name if it was
      provided on the request line (e.g.
      http://www.example.com/index.php?p=3DX). Warning: not urlDecode=
d.
      Example:</p><pre class=3D"programlisting">SecRule<span class=
=3D"bold"><strong> REQUEST_URI_RAW</strong></span> "http:/"</pre></di=
v><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><d=
iv><h3 class=3D"title"><a name=3D"N10BBB"></a><code class=3D"literal"=
>RESPONSE_BODY</code></h3></div></div><div></div></div><p>This variab=
le holds the data for the response payload.
      Example:</p><pre class=3D"programlisting">SecRule<span class=
=3D"bold"><strong> RESPONSE_BODY</strong></span> "ODBC Error Code"</p=
re></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage">=
<div><div><h3 class=3D"title"><a name=3D"N10BC9"></a><code class=3D"l=
iteral">RESPONSE_HEADERS</code></h3></div></div><div></div></div><p>T=
his variable is similar to the REQUEST_HEADERS variable and can
      be used in the same manner. Example:</p><pre class=3D"programli=
sting">SecRule<span class=3D"bold"><strong> RESPONSE_HEADERS</strong>=
</span><span class=3D"bold"><strong>:X-Cache</strong></span> "MISS"</=
pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>This v=
ariable may not have access to some headers when running in
      embedded-mode. Headers such as Server, Date, Connection and Con=
tent-Type
      are added during a later Apache hook just prior to sending the =
data to
      the client. This data should be available, however, either duri=
ng
      ModSecurity phase:5 (logging) or when running in proxy-mode.</p=
></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><d=
iv><div><h3 class=3D"title"><a name=3D"N10BE0"></a><code class=3D"lit=
eral">RESPONSE_HEADERS_NAMES</code></h3></div></div><div></div></div>=
<p>This variable is a collection of the response header names.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>RESPONSE_HEADERS_NAMES</strong></span> "Set-Cookie"=
</pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>Same=
 limitations as RESPONSE_HEADERS with regards to access to
      some headers in embedded-mode.</p></div><div class=3D"section" =
lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a=
 name=3D"N10BF4"></a><code class=3D"literal">RESPONSE_PROTOCOL</code>=
</h3></div></div><div></div></div><p>This variable holds the HTTP Res=
ponse Protocol information.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>RESPONSE_PROTOCOL</strong></span> "^HTTP\/0\.9"</pr=
e></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><=
div><div><h3 class=3D"title"><a name=3D"N10C02"></a><code class=3D"li=
teral">RESPONSE_STATUS</code></h3></div></div><div></div></div><p>Thi=
s variable holds the HTTP Response Status Code generated by
      Apache. Example:</p><pre class=3D"programlisting">SecRule <span=
 class=3D"bold"><strong>RESPONSE_STATUS</strong></span> "^[45]"</pre>=
<p><span class=3D"bold"><strong>Note</strong></span></p><p>This direc=
tive may not work as expected in embedded-mode as Apache
      handles many of the stock response codes (404, 401, etc...) ear=
lier in
      Phase 2. This variable should work as expected in a proxy-mode
      deployment.</p></div><div class=3D"section" lang=3D"en"><div cl=
ass=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10C16"></=
a><code class=3D"literal">RULE</code></h3></div></div><div></div></di=
v><p>This variable provides access to the <code class=3D"literal">id<=
/code>,<code class=3D"literal">rev</code>,<code class=3D"literal">sev=
erity</code>, and <code class=3D"literal">msg</code> fields of the ru=
le that triggered the
      action. Only available for expansion in action strings (e.g.<co=
de class=3D"literal">setvar:tx.varname=3D%{rule.id}</code>). Example:=
</p><pre class=3D"programlisting">SecRule &amp;REQUEST_HEADERS:Host "=
@eq 0" "log,deny,setvar:tx.varname=3D<span class=3D"bold"><strong>%{r=
ule.id}</strong></span>"</pre></div><div class=3D"section" lang=3D"en=
"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N=
10C38"></a><code class=3D"literal">SCRIPT_BASENAME</code></h3></div><=
/div><div></div></div><p>This variable holds just the local filename =
part of
      SCRIPT_FILENAME. Example:</p><pre class=3D"programlisting">SecR=
ule <span class=3D"bold"><strong>SCRIPT_BASENAME</strong></span> "^lo=
gin\.php$"</pre><p><span class=3D"bold"><strong>Note</strong></span><=
/p><p>This variable is not available in proxy mode.</p></div><div cla=
ss=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 cla=
ss=3D"title"><a name=3D"N10C4C"></a><code class=3D"literal">SCRIPT_FI=
LENAME</code></h3></div></div><div></div></div><p>This variable holds=
 the full path on the server to the requested
      script. (e.g. SCRIPT_NAME plus the server path). Example:</p><p=
re class=3D"programlisting">SecRule <span class=3D"bold"><strong>SCRI=
PT_FILENAME</strong></span> "^/usr/local/apache/cgi-bin/login\.php$"<=
/pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>This =
variable is not available in proxy mode.</p></div><div class=3D"secti=
on" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title=
"><a name=3D"N10C60"></a><code class=3D"literal">SCRIPT_GID</code></h=
3></div></div><div></div></div><p>This variable holds the groupid (nu=
merical value) of the group
      owner of the script. Example:</p><pre class=3D"programlisting">=
SecRule <span class=3D"bold"><strong>SCRIPT_GID</strong></span> "!^46=
$"</pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>Th=
is variable is not available in proxy mode.</p></div><div class=3D"se=
ction" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"ti=
tle"><a name=3D"N10C74"></a><code class=3D"literal">SCRIPT_GROUPNAME<=
/code></h3></div></div><div></div></div><p>This variable holds the gr=
oup name of the group owner of the
      script. Example:</p><pre class=3D"programlisting">SecRule<span =
class=3D"bold"><strong> SCRIPT_GROUPNAME</strong></span> "!^apache$"<=
/pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>This =
variable is not available in proxy mode.</p></div><div class=3D"secti=
on" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title=
"><a name=3D"N10C88"></a><code class=3D"literal">SCRIPT_MODE</code></=
h3></div></div><div></div></div><p>This variable holds the script's p=
ermissions mode data (numerical
      - 1=3Dexecute, 2=3Dwrite, 4=3Dread and 7=3Dread/write/execute).=
 Example: will
      trigger if the script has the WRITE permissions set.</p><pre cl=
ass=3D"programlisting">SecRule <span class=3D"bold"><strong>SCRIPT_MO=
DE</strong></span> "^(2|3|6|7)$"</pre><p><span class=3D"bold"><strong=
>Note</strong></span></p><p>This variable is not available in proxy m=
ode.</p></div><div class=3D"section" lang=3D"en"><div class=3D"titlep=
age"><div><div><h3 class=3D"title"><a name=3D"N10C9C"></a><code class=
=3D"literal">SCRIPT_UID</code></h3></div></div><div></div></div><p>Th=
is variable holds the userid (numerical value) of the owner of
      the script. Example: the example rule below will trigger if the=
 UID is
      not 46 (the Apache user).</p><pre class=3D"programlisting">SecR=
ule<span class=3D"bold"><strong> SCRIPT_UID</strong></span> "!^46$"</=
pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>This v=
ariable is not available in proxy mode.</p></div><div class=3D"sectio=
n" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"=
><a name=3D"N10CB0"></a><code class=3D"literal">SCRIPT_USERNAME</code=
></h3></div></div><div></div></div><p>This variable holds the usernam=
e of the owner of the script.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>SCRIPT_USERNAME</strong></span> "!^apache$"</pre><p=
><span class=3D"bold"><strong>Note</strong></span></p><p>This variabl=
e is not available in proxy mode.</p></div><div class=3D"section" lan=
g=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a na=
me=3D"N10CC4"></a><code class=3D"literal">SERVER_ADDR</code></h3></di=
v></div><div></div></div><p>This variable contains the IP address of =
the server.
      Example:</p><pre class=3D"programlisting">SecRule<span class=
=3D"bold"><strong> SERVER_ADDR</strong></span> "^192\.168\.1\.100$"</=
pre></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"=
><div><div><h3 class=3D"title"><a name=3D"N10CD2"></a><code class=
=3D"literal">SERVER_NAME</code></h3></div></div><div></div></div><p>T=
his variable contains the server's hostname or IP address.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>SERVER_NAME</strong></span> "hostname\.com$"</pre><=
p><span class=3D"bold"><strong>Note</strong></span></p><p>This data i=
s taken from the Host header submitted in the client
      request.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10CE6"></a><=
code class=3D"literal">SERVER_PORT</code></h3></div></div><div></div>=
</div><p>This variable contains the local port that the web server is
      listening on. Example:</p><pre class=3D"programlisting">SecRule=
 <span class=3D"bold"><strong>SERVER_PORT</strong></span> "^80$"</pre=
></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><d=
iv><div><h3 class=3D"title"><a name=3D"N10CF4"></a><code class=3D"lit=
eral">SESSION</code></h3></div></div><div></div></div><p>This variabl=
e is a collection, available only after <code class=3D"literal">setsi=
d</code> is executed. Example: the following
      example shows how to initialize a SESSION collection with setsi=
d, how to
      use setvar to increase the session.score values, how to set the
      session.blocked variable and finally how to deny the connection=
 based on
      the session:blocked value.</p><pre class=3D"programlisting">Sec=
Rule REQUEST_COOKIES:PHPSESSID !^$ chain,nolog,pass
SecAction setsid:%{REQUEST_COOKIES.PHPSESSID}
SecRule REQUEST_URI "^/cgi-bin/finger$" "pass,log,setvar:<span class=
=3D"bold"><strong>session.score</strong></span>=3D+10"
SecRule<span class=3D"bold"><strong> SESSION:SCORE</strong></span> "@=
gt 50" "pass,log,setvar:<span class=3D"bold"><strong>session.blocked<=
/strong></span>=3D1"
SecRule<span class=3D"bold"><strong> SESSION:BLOCKED</strong></span> =
"@eq 1" "log,deny,status:403"</pre></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N10D12"></a><code class=3D"literal">SESSIONID</code></h3></div><=
/div><div></div></div><p>This variable is the value set with <code cl=
ass=3D"literal">setsid</code>. Example:</p><pre class=3D"programlisti=
ng">SecRule <span class=3D"bold"><strong>SESSIONID</strong></span> !^=
$ chain,nolog,pass
SecRule REQUEST_COOKIES:PHPSESSID !^$
SecAction setsid:%{REQUEST_COOKIES.PHPSESSID}</pre></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10D24"></a><code class=3D"literal">TIME</code>=
</h3></div></div><div></div></div><p>This variable holds a formatted =
string representing the time
      (hour:minute:second). Example:</p><pre class=3D"programlisting"=
>SecRule<span class=3D"bold"><strong> TIME</strong></span> "^(([1](8|=
9))|([2](0|1|2|3))):\d{2}:\d{2}$"</pre></div><div class=3D"section" l=
ang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a =
name=3D"N10D32"></a><code class=3D"literal">TIME_DAY</code></h3></div=
></div><div></div></div><p>This variable holds the current date (1-31=
). Example: this rule
      would trigger anytime between the 10th and 20th days of the
      month.</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>TIME_DAY</strong></span> "^(([1](0|1|2|3|4|5|6|7|8|=
9))|20)$"</pre></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10D40"></a><=
code class=3D"literal">TIME_EPOCH</code></h3></div></div><div></div><=
/div><p>This variable holds the time in seconds since 1970.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>TIME_EPOCH</strong></span> "@gt 1000"</pre></div><d=
iv class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><=
h3 class=3D"title"><a name=3D"N10D4E"></a><code class=3D"literal">TIM=
E_HOUR</code></h3></div></div><div></div></div><p>This variable holds=
 the current hour (0-23). Example: this rule
      would trigger during "off hours".</p><pre class=3D"programlisti=
ng">SecRule<span class=3D"bold"><strong> TIME_HOUR</strong></span> "^=
(0|1|2|3|4|5|6|[1](8|9)|[2](0|1|2|3))$"</pre></div><div class=3D"sect=
ion" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"titl=
e"><a name=3D"N10D5C"></a><code class=3D"literal">TIME_MIN</code></h3=
></div></div><div></div></div><p>This variable holds the current minu=
te (0-59). Example: this rule
      would trigger during the last half hour of every hour.</p><pre =
class=3D"programlisting">SecRule <span class=3D"bold"><strong>TIME_MI=
N</strong></span> "^(3|4|5)"</pre></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N10D6A"></a><code class=3D"literal">TIME_MON</code></h3></div></=
div><div></div></div><p>This variable holds the current month (0-11).=
 Example: this rule
      would match if the month was either November (10) or December
      (11).</p><pre class=3D"programlisting">SecRule<span class=3D"bo=
ld"><strong> TIME_MON</strong></span> "^1"</pre></div><div class=3D"s=
ection" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"t=
itle"><a name=3D"N10D78"></a><code class=3D"literal">TIME_SEC</code><=
/h3></div></div><div></div></div><p>This variable holds the current s=
econd count (0-59).
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>TIME_SEC</strong></span> "@gt 30"</pre></div><div c=
lass=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 c=
lass=3D"title"><a name=3D"N10D86"></a><code class=3D"literal">TIME_WD=
AY</code></h3></div></div><div></div></div><p>This variable holds the=
 current weekday (0-6). Example: this rule
      would trigger only on week-ends (Saturday and Sunday).</p><pre =
class=3D"programlisting">SecRule <span class=3D"bold"><strong>TIME_WD=
AY</strong></span> "^(0|6)$"</pre></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N10D94"></a><code class=3D"literal">TIME_YEAR</code></h3></div><=
/div><div></div></div><p>This variable holds the current four-digit y=
ear data.
      Example:</p><pre class=3D"programlisting">SecRule <span class=
=3D"bold"><strong>TIME_YEAR</strong></span> "^2006$"</pre></div><div =
class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 =
class=3D"title"><a name=3D"N10DA2"></a><code class=3D"literal">TX</co=
de></h3></div></div><div></div></div><p>Transaction Collection. This =
is used to store pieces of data,
      create a transaction anomaly score, and so on. Transaction vari=
ables are
      set for 1 request/response cycle. The scoring and evaluation wi=
ll not
      last past the current request/response process. Example: In thi=
s
      example, we are using setvar to increase the tx.score value by =
5 points.
      We then have a follow-up run that will evaluate the transaction=
al score
      this this request and then it will decided whether or not to al=
low/deny
      the request through.</p><pre class=3D"programlisting">SecRule W=
EBSERVER_ERROR_LOG "does not exist" "phase:5,pass,<span class=3D"bold=
"><strong>setvar:tx.score=3D+5</strong></span>"
SecRule<span class=3D"bold"><strong> TX:SCORE</strong></span> "@gt 20=
" deny,log</pre></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10DB4"></a><=
code class=3D"literal">USERID</code></h3></div></div><div></div></div=
><p>This variable is the value set with <code class=3D"literal">setui=
d</code>. Example:</p><pre class=3D"programlisting">SecAction setuid:=
%{REMOTE_USER},nolog
SecRule<span class=3D"bold"><strong> USERID</strong></span> "Admin"</=
pre></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"=
><div><div><h3 class=3D"title"><a name=3D"N10DC6"></a><code class=
=3D"literal">WEBAPPID</code></h3></div></div><div></div></div><p>This=
 variable is the value set with <code class=3D"literal">SecWebAppId</=
code>. Example:</p><pre class=3D"programlisting">SecWebAppId "WebApp1=
"
SecRule<span class=3D"bold"><strong> WEBAPPID</strong></span> "WebApp=
1" "chain,log,deny,status:403"
SecRule REQUEST_HEADERS:Transfer-Encoding "!^$"</pre></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10DD8"></a><code class=3D"literal">WEBSERVER_E=
RROR_LOG</code></h3></div></div><div></div></div><p>Contains zero or =
more error messages produced by the web server.
      Access to this variable is in phase:5 (logging). Example:</p><p=
re class=3D"programlisting">SecRule<span class=3D"bold"><strong> WEBS=
ERVER_ERROR_LOG</strong></span> "File does not exist" "phase:5,setvar=
:tx.score=3D+5"</pre></div><div class=3D"section" lang=3D"en"><div cl=
ass=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10DE6"></=
a><code class=3D"literal">XML</code></h3></div></div><div></div></div=
><p>Can be used standalone (as a target for validateDTD and
      validateSchema) or with an XPath expression parameter (which ma=
kes it a
      valid target for any function that accepts plain text). Example=
 using
      XPath:</p><pre class=3D"programlisting">SecDefaultAction log,de=
ny,status:403,phase:2
SecRule REQUEST_HEADERS:Content-Type ^text/xml$ \
    phase:1,t:lowercase,nolog,pass,ctl:requestBodyProcessor=3D<span c=
lass=3D"bold"><strong>XML</strong></span>
SecRule REQBODY_PROCESSOR "<span class=3D"bold"><strong>!^XML$</stron=
g></span>" skip:2
SecRule <span class=3D"bold"><strong>XML:/employees/employee/name/tex=
t()</strong></span> Fred
SecRule <span class=3D"bold"><strong>XML:/xq:employees/employee/name/=
text()</strong></span> Fred \
    xmlns:xq=3Dhttp://www.example.com/employees</pre><p>The first XPa=
th expression does not use namespaces. It would match
      against payload such as this one:</p><pre class=3D"programlisti=
ng">&lt;employees&gt;
    &lt;employee&gt;
        &lt;name&gt;Fred Jones&lt;/name&gt;
        &lt;address location=3D"home"&gt;
            &lt;street&gt;900 Aurora Ave.&lt;/street&gt;
            &lt;city&gt;Seattle&lt;/city&gt;
            &lt;state&gt;WA&lt;/state&gt;
            &lt;zip&gt;98115&lt;/zip&gt;
        &lt;/address&gt;
        &lt;address location=3D"work"&gt;
            &lt;street&gt;2011 152nd Avenue NE&lt;/street&gt;
            &lt;city&gt;Redmond&lt;/city&gt;
            &lt;state&gt;WA&lt;/state&gt;
            &lt;zip&gt;98052&lt;/zip&gt;
        &lt;/address&gt;
        &lt;phone location=3D"work"&gt;(425)555-5665&lt;/phone&gt;
        &lt;phone location=3D"home"&gt;(206)555-5555&lt;/phone&gt;
        &lt;phone location=3D"mobile"&gt;(206)555-4321&lt;/phone&gt;
    &lt;/employee&gt;
&lt;/employees&gt;</pre><p>The second XPath expression does use names=
paces. It would match
      the following payload:</p><pre class=3D"programlisting">&lt;xq:=
employees xmlns:xq=3D"http://www.example.com/employees"&gt;
    &lt;employee&gt;
        &lt;name&gt;Fred Jones&lt;/name&gt;
        &lt;address location=3D"home"&gt;
            &lt;street&gt;900 Aurora Ave.&lt;/street&gt;
            &lt;city&gt;Seattle&lt;/city&gt;
            &lt;state&gt;WA&lt;/state&gt;
            &lt;zip&gt;98115&lt;/zip&gt;
        &lt;/address&gt;
        &lt;address location=3D"work"&gt;
            &lt;street&gt;2011 152nd Avenue NE&lt;/street&gt;
            &lt;city&gt;Redmond&lt;/city&gt;
            &lt;state&gt;WA&lt;/state&gt;
            &lt;zip&gt;98052&lt;/zip&gt;
        &lt;/address&gt;
        &lt;phone location=3D"work"&gt;(425)555-5665&lt;/phone&gt;
        &lt;phone location=3D"home"&gt;(206)555-5555&lt;/phone&gt;
        &lt;phone location=3D"mobile"&gt;(206)555-4321&lt;/phone&gt;
    &lt;/employee&gt;
&lt;/xq:employees&gt;</pre><p>Note the different namespace used in th=
e second example.</p><p>To learn more about XPath we suggest the foll=
owing
      resources:</p><div class=3D"orderedlist"><ol type=3D"1"><li><p>=
<a href=3D"http://www.w3.org/TR/xpath" target=3D"_top">XPath
          Standard</a></p></li><li><p><a href=3D"http://www.zvon.org/=
xxl/XPathTutorial/General/examples.html" target=3D"_top">XPath
          Tutorial</a></p></li></ol></div></div></div><div class=3D"s=
ection" lang=3D"en"><div class=3D"titlepage"><div><div><h2 class=3D"t=
itle" style=3D"clear: both"><a name=3D"06-transformation-functions"><=
/a>Transformation functions</h2></div></div><div></div></div><p>When =
ModSecurity receives request or response information, it makes
    a copy of this data and places it into memory. It is on this data=
 in
    memory that transformation functions are applied. The raw request=
/response
    data is never altered. Transformation functions are used to trans=
form a
    variable before testing it in a rule.</p><p><span class=3D"bold">=
<strong>Note</strong></span></p><p>The default transformation functio=
n setting is - lowercase,
    replaceNulls and compressWhitespace (in this order).</p><p>The fo=
llowing rule will ensure that an attacker does not use mixed
    case in order to evade the ModSecurity rule:</p><p><pre class=
=3D"programlisting">SecRule ARG:p "xp_cmdshell" <span class=3D"bold">=
<strong>"t:lowercase"</strong></span></pre> multiple
    tranformation actions can be used in the same rule, for example t=
he
    following rule also ensures that an attacker does not use URL enc=
oding
    (%xx encoding) for evasion. Note the order of the transformation
    functions, which ensures that a URL encoded letter is first decod=
ed and
    than translated to lower case.</p><p><pre class=3D"programlisting=
">SecRule ARG:p "xp_cmdshell" <span class=3D"bold"><strong>"t:urlDeco=
de,t:lowercase"</strong></span></pre></p><p>One can use the SetDefaul=
tAction command to ensure the translation
    occurs for every rule until the next. Note that translation actio=
ns are
    additive, so if a rule explicitly list actions, the translation a=
ctions
    set by SetDefaultAction are still performed.</p><p><pre class=
=3D"programlisting">SecDefaultAction <span class=3D"bold"><strong>t:u=
rlDecode,t:lowercase</strong></span></pre></p><p>The following transf=
ormation functions are supported:</p><div class=3D"section" lang=3D"e=
n"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=
=3D"N10E3F"></a><code class=3D"literal">base64Decode</code></h3></div=
></div><div></div></div><p>This function decoes a base64-encoded stri=
ng.</p></div><div class=3D"section" lang=3D"en"><div class=3D"titlepa=
ge"><div><div><h3 class=3D"title"><a name=3D"N10E45"></a><code class=
=3D"literal">base64Encode</code></h3></div></div><div></div></div><p>=
This function encodes input string using base64 encoding.</p></div><d=
iv class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><=
h3 class=3D"title"><a name=3D"N10E4B"></a><code class=3D"literal">com=
pressWhitespace</code></h3></div></div><div></div></div><p>This funct=
ion is enabled by default. It converts whitespace
      characters (32, \f, \t, \n, \r, \v, 160) to spaces (ASCII 32) a=
nd then
      compresses multiple space characters into only one.</p></div><d=
iv class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><=
h3 class=3D"title"><a name=3D"N10E51"></a><code class=3D"literal">esc=
apeSeqDecode</code></h3></div></div><div></div></div><p>This function=
 decode ANSI C escape sequences:<code class=3D"literal"> \a</code>,<c=
ode class=3D"literal"> \b</code>,
      <code class=3D"literal">\f</code>, <code class=3D"literal">\n</=
code>, <code class=3D"literal">\r</code>,
      <code class=3D"literal">\t</code>, <code class=3D"literal">\v</=
code>, <code class=3D"literal">\\</code>,
      <code class=3D"literal">\?</code>, <code class=3D"literal">\'</=
code>, <code class=3D"literal">\"</code>,
      <code class=3D"literal">\xHH</code> (hexadecimal), <code class=
=3D"literal">\0OOO</code> (octal). Invalid encodings are left in
      the output.</p></div><div class=3D"section" lang=3D"en"><div cl=
ass=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10E8B"></=
a><code class=3D"literal">hexDecode</code></h3></div></div><div></div=
></div><p>This function decodes a hex-encoded string.</p></div><div c=
lass=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 c=
lass=3D"title"><a name=3D"N10E91"></a><code class=3D"literal">hexEnco=
de</code></h3></div></div><div></div></div><p>This function encodes i=
nput as hex-encoded string.</p></div><div class=3D"section" lang=3D"e=
n"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=
=3D"N10E97"></a><code class=3D"literal">htmlEntityDecode</code></h3><=
/div></div><div></div></div><p>This function decodes HTML entities pr=
esent in input. The
      following variants are supported:</p><div class=3D"itemizedlist=
"><ul type=3D"disc"><li><p><code class=3D"literal">&amp;#xHH</code> a=
nd <code class=3D"literal">&amp;#xHH;</code> (where H is any hexadeci=
mal
          number)</p></li><li><p><code class=3D"literal">&amp;#DDD</c=
ode> and <code class=3D"literal">&amp;#DDD;</code> (where D is any de=
cimal
          number)</p></li><li><p><code class=3D"literal">&amp;quot</c=
ode> and <code class=3D"literal">&amp;quot;</code></p></li><li><p><co=
de class=3D"literal">&amp;nbsp</code> and <code class=3D"literal">&am=
p;nbsp;</code></p></li><li><p><code class=3D"literal">&amp;lt</code> =
and <code class=3D"literal">&amp;lt;</code></p></li><li><p><code clas=
s=3D"literal">&amp;gt</code> and <code class=3D"literal">&amp;gt;</co=
de></p></li></ul></div></div><div class=3D"section" lang=3D"en"><div =
class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10ED6">=
</a><code class=3D"literal">lowercase</code></h3></div></div><div></d=
iv></div><p>This function is enabled by default. It converts all char=
actes to
      lowercase using the current C locale.</p></div><div class=3D"se=
ction" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"ti=
tle"><a name=3D"N10EDC"></a><code class=3D"literal">md5</code></h3></=
div></div><div></div></div><p>This function calculates an MD5 hash fr=
om input.</p></div><div class=3D"section" lang=3D"en"><div class=3D"t=
itlepage"><div><div><h3 class=3D"title"><a name=3D"N10EE2"></a><code =
class=3D"literal"><code class=3D"literal">none</code></code></h3></di=
v></div><div></div></div><p>This not an actual transformation functio=
n but an instruction to
      ModSecurity to remove all transformation functions associated w=
ith the
      current rule and start from scratch.</p></div><div class=3D"sec=
tion" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"tit=
le"><a name=3D"N10EE9"></a><code class=3D"literal">normalisePath</cod=
e></h3></div></div><div></div></div><p>This function will remove mult=
iple slashes, self-references and
      directory back-references (except when they are at the beginnin=
g of the
      path).</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10EEF"></a><=
code class=3D"literal">normalisePathWin</code></h3></div></div><div><=
/div></div><p>Same as normalisePath, but will first convert backslash=
 characters
      to forward slashes.</p></div><div class=3D"section" lang=3D"en"=
><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1=
0EF5"></a><code class=3D"literal">removeNulls</code></h3></div></div>=
<div></div></div><p>This function removes NULL bytes from input.</p><=
/div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div=
><div><h3 class=3D"title"><a name=3D"N10EFB"></a><code class=3D"liter=
al">removeWhitespace</code></h3></div></div><div></div></div><p>This =
function removes all whitespace characters.</p></div><div class=3D"se=
ction" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"ti=
tle"><a name=3D"N10F01"></a><code class=3D"literal">replaceComments</=
code></h3></div></div><div></div></div><p>This function replaces each=
 occurence of a C-style comments
      (<code class=3D"literal">/* ... */</code>) with a single space
      (multiple consecutive occurences of a space will not be compres=
sed).
      Unterminated comments will too be replaced with a space (ASCII =
32).
      However, a standalone termination of a comment (<code class=
=3D"literal">*/</code>) will not be acted upon.</p></div><div class=
=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=
=3D"title"><a name=3D"N10F0F"></a><code class=3D"literal">replaceNull=
s</code></h3></div></div><div></div></div><p>This function is enabled=
 by default. It replaces NULL bytes in
      input with spaces (ASCII 32).</p></div><div class=3D"section" l=
ang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a =
name=3D"N10F15"></a><code class=3D"literal">urlDecode</code></h3></di=
v></div><div></div></div><p>This function decodes an URL-encoded inpu=
t string. Invalid
      encodings (i.e. the ones that use non-hexadecimal characters, o=
r the
      ones that are at the end of string and have one or two characte=
rs
      missing) will not be converted. If you want to detect invalid e=
ncodings
      use the <code class=3D"literal">@validateUrlEncoding</code>
      operator. The transformational function should not be used agai=
nst
      variables that have already been URL-decoded unless it is your =
intention
      to perform URL decoding twice!</p></div><div class=3D"section" =
lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a=
 name=3D"N10F1F"></a><code class=3D"literal">urlDecodeUni</code></h3>=
</div></div><div></div></div><p>In addition to decoding %xx like <cod=
e class=3D"literal">urlDecode, urlDecodeUni</code> also decodes <code=
 class=3D"literal">%uXXXX</code> encoding. If the code is in the rang=
e
      of FF01-FF5E (the full width ASCII codes), then the higher byte=
 is used
      to detect and adjust the lower byte. Otherwise, only the lower =
byte will
      be used and the higher byte zeroed.</p></div><div class=3D"sect=
ion" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"titl=
e"><a name=3D"N10F2D"></a><code class=3D"literal">urlEncode</code></h=
3></div></div><div></div></div><p>This function encodes input using U=
RL encoding.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10F33"></a><=
code class=3D"literal">sha1</code></h3></div></div><div></div></div><=
p>This function calculates a SHA1 hash from input.</p></div></div><di=
v class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h=
2 class=3D"title" style=3D"clear: both"><a name=3D"07-actions"></a>Ac=
tions</h2></div></div><div></div></div><p>Each action belongs to one =
of five groups:</p><div class=3D"orderedlist"><ol type=3D"1"><li><p><=
span class=3D"emphasis"><em>Disruptive actions</em></span> - are thos=
e actions
        where ModSecurity will intercept the data. They can only appe=
ar in the
        first rule in a chain.</p></li><li><p><span class=3D"emphasis=
"><em>Non-disruptive actions</em></span> - can appear
        anywhere.</p></li><li><p><span class=3D"emphasis"><em>Flow ac=
tions</em></span> - can appear only in the first
        rule in a chain.</p></li><li><p><span class=3D"emphasis"><em>=
Meta-data actions</em></span>(<code class=3D"literal">id</code>,<code=
 class=3D"literal">
        rev</code>,<code class=3D"literal"> severity</code>,<code cla=
ss=3D"literal"> msg</code>) - can only appear in the first rule in
        a chain.</p></li><li><p><span class=3D"emphasis"><em>Data act=
ions</em></span> - can appear anywhere; these
        actions are completely passive and only serve to carry data u=
sed by
        other actions.</p></li></ol></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N10F6B"></a><code class=3D"literal">allow</code></h3></div></div=
><div></div></div><p><span class=3D"bold"><strong>Description:</stron=
g></span> Stops processing on
      a successful match and allows transaction to proceed.</p><p><sp=
an class=3D"bold"><strong>Action Group:</strong></span> Disruptive</p=
><p>Example:</p><pre class=3D"programlisting">SecRule REMOTE_ADDR "^1=
92\.168\.1\.100$" nolog,phase:1,<span class=3D"bold"><strong>allow</s=
trong></span></pre><p><span class=3D"bold"><strong>Note</strong></spa=
n></p><p>The allow action only applies to the current processing phas=
e. If
      your intent is to explicitly allow a request, then you should u=
se the
      "ctl" action to turn the ruleEngine off -<code class=3D"literal=
">
      ctl:ruleEngine=3DOff</code>.</p></div><div class=3D"section" la=
ng=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a n=
ame=3D"N10F8B"></a><code class=3D"literal">auditlog</code></h3></div>=
</div><div></div></div><p><span class=3D"bold"><strong>Description:</=
strong></span> Marks the
      transaction for logging in the audit log.</p><p><span class=
=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REMOTE_ADDR "^192\.168\.1\.100$" <span class=3D"bold"><strong=
>auditlog</strong></span>,phase:1,allow</pre><p><span class=3D"bold">=
<strong>Note</strong></span></p><p>The auditlog action is now explici=
t if log is already
      specified.</p></div><div class=3D"section" lang=3D"en"><div cla=
ss=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10FA8"></a=
><code class=3D"literal">capture</code></h3></div></div><div></div></=
div><p><span class=3D"bold"><strong>Description:</strong></span> When=
 used together
      with the regular expression operator, capture action will creat=
e copies
      of regular expression captures and place them into the transact=
ion
      variable collection. Up to ten captures will be copied on a suc=
cessful
      pattern match, each with a name consisting of a digit from 0 to
      9.</p><p><span class=3D"bold"><strong>Action Group:</strong></s=
pan>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REQUEST_BODY "^username=3D(\w{25,})" phase:2,<span class=3D"b=
old"><strong>capture</strong></span>,t:none,chain
SecRule TX:1 "(?:(?:a(dmin|nonymous)))"</pre><p><span class=3D"bold">=
<strong>Note</strong></span></p><p>The 0 data captures the entire REG=
EX match and 1 captures the data
      in the first parantheses, etc...</p></div><div class=3D"section=
" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title">=
<a name=3D"N10FC5"></a><code class=3D"literal">chain</code></h3></div=
></div><div></div></div><p><span class=3D"bold"><strong>Description:<=
/strong></span> Chains the rule
      where the action is placed with the rule that immediately follo=
ws it.
      The result is called a<span class=3D"emphasis"><em> rule chain<=
/em></span>. Chained rules
      allow for more complex rule matches where you want to use a num=
ber of
      different VARIABLES to create a better rule and to help prevent=
 false
      positives.</p><p><span class=3D"bold"><strong>Action Group:</st=
rong></span> Flow</p><p>Example:</p><pre class=3D"programlisting"># R=
efuse to accept POST requests that do
# not specify request body length=20
SecRule REQUEST_METHOD ^POST$<span class=3D"bold"><strong> chain</str=
ong></span>
SecRule REQUEST_HEADER:Content-Length ^$</pre><p><span class=3D"bold"=
><strong>Note</strong></span></p><p>In programming language concepts,=
 think of chained rules somewhat
      similar to AND conditional statements. The actions specified in=
 the
      first portion of the chained rule will only be triggered if all=
 of the
      variable checks return positive hits. If one aspect of the chai=
ned rule
      is negative, then the entire rule chain is negative. Also note =
that
      disruptive actions, execution phases, metadata actions (id, rev=
, msg)
      and skip actions can only be specified on by the chain starter
      rule.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N10FE5"></a><=
code class=3D"literal">ctl</code></h3></div></div><div></div></div><p=
><span class=3D"bold"><strong>Description:</strong></span> The ctl ac=
tion
      allows configuration options to be updated for the transaction.=
</p><p><span class=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
# Parse requests with Content-Type "text/xml" as XML=20
SecRule REQUEST_CONTENT_TYPE ^text/xml nolog,pass,<span class=3D"bold=
"><strong>ctl:requestBodyProcessor=3DXML</strong></span></pre><p><spa=
n class=3D"bold"><strong>Note</strong></span></p><p>The following con=
figuration options are supported:</p><div class=3D"orderedlist"><ol t=
ype=3D"1"><li><p><code class=3D"literal">auditEngine</code></p></li><=
li><p><code class=3D"literal">auditLogParts</code></p></li><li><p><co=
de class=3D"literal">debugLogLevel</code></p></li><li><p><code class=
=3D"literal">requestBodyAccess</code></p></li><li><p><code class=3D"l=
iteral">requestBodyLimit</code></p></li><li><p><code class=3D"literal=
">requestBodyProcessor</code></p></li><li><p><code class=3D"literal">=
responseBodyAccess</code></p></li><li><p><code class=3D"literal">resp=
onseBodyLimit</code></p></li><li><p><code class=3D"literal">ruleEngin=
e</code></p></li></ol></div><p>With the exception of<code class=3D"li=
teral">
      requestBodyProcessor</code>, each configuration option correspo=
nds to
      one configuration directive and the usage is identical.</p><p>T=
he requestBodyProcessor option allows you to configure the
      request body processor. By default ModSecurity will use the <co=
de class=3D"literal">URLENCODED</code> and<code class=3D"literal">
      MULTIPART</code> processors to process an <code class=3D"litera=
l">application/x-www-form-urlencoded</code> and a
      <code class=3D"literal">multipart/form-data</code> body,
      respectively. A third processor, XML, is also supported, but it=
 is never
      used implicitly. Instead you must tell ModSecurity to use it by=
 placing
      a few rules in the<code class=3D"literal"> REQUEST_HEADERS</cod=
e>
      processing phase. After the request body was processed as XML y=
ou will
      be able to use the XML-related features to inspect it.</p><p>Re=
quest body processors will not interrupt a transaction if an
      error occurs during parsing. Instead they will set variables<co=
de class=3D"literal"> REQBODY_PROCESSOR_ERROR</code> and<code class=
=3D"literal"> REQBODY_PROCESSOR_ERROR_MSG</code>. These variables
      should be inspected in the <code class=3D"literal">REQUEST_BODY=
</code> phase and an appropriate action
      taken.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1105B"></a><=
code class=3D"literal">deny</code></h3></div></div><div></div></div><=
p><span class=3D"bold"><strong>Description:</strong></span> Stops rul=
e
      processing and intercepts transaction.</p><p><span class=3D"bol=
d"><strong>Action Group:</strong></span> Disruptive</p><p>Example:</p=
><pre class=3D"programlisting">SecRule REQUEST_HEADERS:User-Agent "ni=
kto" "log,<span class=3D"bold"><strong>deny</strong></span>,msg:'Nikt=
o Scanners Identified'"</pre></div><div class=3D"section" lang=3D"en"=
><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1=
1072"></a><code class=3D"literal">deprecatevar</code></h3></div></div=
><div></div></div><p><span class=3D"bold"><strong>Description:</stron=
g></span> Decrement counter
      based on its age.</p><p><span class=3D"bold"><strong>Action Gro=
up:</strong></span>
      Non-Disruptive</p><p>Example: The following example will decrem=
ent the counter by 60
      every 300 seconds.</p><pre class=3D"programlisting">SecAction d=
eprecatevar:session.score=3D60/300</pre><p><span class=3D"bold"><stro=
ng>Note</strong></span></p><p>Counter values are always positive, mea=
ning the value will never
      go below zero.</p></div><div class=3D"section" lang=3D"en"><div=
 class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1108B"=
></a><code class=3D"literal">drop</code></h3></div></div><div></div><=
/div><p><span class=3D"bold"><strong>Description:</strong></span> Imm=
ediately initiate
      a "connection close" action to tear down the TCP connection by =
sending a
      FIN packet.</p><p><span class=3D"bold"><strong>Action Group:</s=
trong></span> Disruptive</p><p>Example: The following example initiat=
es an IP collection for
      tracking Basic Authentication attempts. If the client goes over=
 the
      threshold of more than 25 attempts in 2 minutes, it will DROP s=
ubsequent
      connections.</p><pre class=3D"programlisting">SecAction initcol=
:ip=3D%{REMOTE_ADDR},nolog
SecRule ARGS:login "!^$" \
    nolog,phase:1,setvar:ip.auth_attempt=3D+1,deprecatevar:ip.auth_at=
tempt=3D20/120
SecRule IP:AUTH_ATTEMPT "@gt 25" \
    log,<span class=3D"bold"><strong>drop</strong></span>,phase:1,msg=
:'Possible Brute Force Attack"</pre><p><span class=3D"bold"><strong>N=
ote</strong></span></p><p>This action is extremely useful when respon=
ding to both Brute
      Force and Denial of Service attacks in that, in both cases, you=
 want to
      minimize both the network bandwidth and the data returned to th=
e client.
      This action causes error message to appear in the log "(9)Bad f=
ile
      descriptor: core_output_filter: writing data to the network"</p=
></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><d=
iv><div><h3 class=3D"title"><a name=3D"N110A8"></a><code class=3D"lit=
eral">exec</code></h3></div></div><div></div></div><p><span class=
=3D"bold"><strong>Description:</strong></span> Executes an external
      script/binary supplied as parameter.</p><p><span class=3D"bold"=
><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REQUEST_URI "^/cgi-bin/script\.pl" \
    "log,<span class=3D"bold"><strong>exec:/usr/local/apache/bin/test=
.sh</strong></span>,phase:1"</pre><p><span class=3D"bold"><strong>Not=
e</strong></span></p><p>This directive does not effect a primary acti=
on if it exists. This
      action will always call script with no parameters, but providin=
g all
      information in the environment. All the usual CGI environment v=
ariables
      will be there. You can have one binary executed per filter matc=
h.
      Execution will add the header mod_security-executed to the list=
 of
      request headers. You should be aware that forking a threaded pr=
ocess
      results in all threads being replicated in the new process. For=
king can
      therefore incur larger overhead in multithreaded operation. The=
 script
      you execute must write something (anything) to stdout. If it do=
esn't
      ModSecurity will assume execution didn't work.</p></div><div cl=
ass=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 cl=
ass=3D"title"><a name=3D"N110C5"></a><code class=3D"literal">expireva=
r</code></h3></div></div><div></div></div><p><span class=3D"bold"><st=
rong>Description:</strong></span> Configurescollection
      variable to expire after the given time in seconds.</p><p><span=
 class=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REQUEST_COOKIES:JSESSIONID "!^$" nolog,phase:1,pass,chain
SecAction setsid:%{REQUEST_COOKIES:JSESSIONID}
SecRule REQUEST_URI "^/cgi-bin/script\.pl" \
    "log,allow,setvar:session.suspicious=3D1,<span class=3D"bold"><st=
rong>expirevar:session.suspicious=3D3600</strong></span>,phase:1"</pr=
e><p><span class=3D"bold"><strong>Note</strong></span></p><p>You shou=
ld use expirevar actions at the same time that you use
      setvar actions in order to keep the indended expiration time. I=
f they
      are used on their own (perhaps in a SecAction directive) the ex=
pire time
      could get re-set. When variables are removed from collections, =
and there
      are no other changes, collections are not written to disk at th=
e end of
      request. This is because the variables can always be expired ag=
ain when
      the collection is read again on a subsequent request.</p></div>=
<div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div=
><h3 class=3D"title"><a name=3D"N110E2"></a><code class=3D"literal">i=
d</code></h3></div></div><div></div></div><p><span class=3D"bold"><st=
rong>Description:</strong></span> Assigns a unique ID
      to the rule or chain.</p><p><span class=3D"bold"><strong>Action=
 Group:</strong></span> Metadata</p><p>Example:</p><pre class=3D"prog=
ramlisting">SecRule &amp;REQUEST_HEADERS:Host "@eq 0" \
    "log,<span class=3D"bold"><strong>id:60008</strong></span>,severi=
ty:2,msg:'Request Missing a Host Header'"</pre><p><span class=3D"bold=
"><strong>Note</strong></span></p><p>These are the reserved ranges:</=
p><div class=3D"itemizedlist"><ul type=3D"disc"><li><p>1-99,999; rese=
rved for local (internal) use. Use as you see
          fit but do not use this range for rules that are distribute=
d to
          others.</p></li><li><p>100,000-199,999; reserved for intern=
al use of the engine, to
          assign to rules that do not have explicit IDs.</p></li><li>=
<p>200,000-299,999; reserved for rules published at
          modsecurity.org.</p></li><li><p>300,000-399,999; reserved f=
or rules published at
          gotroot.com.</p></li><li><p>400,000-419,999; unused (availa=
ble for reservation).</p></li><li><p>420,000-429,999; reserved for <a=
 href=3D"http://projects.otaku42.de/wiki/ScallyWhack" target=3D"_top"=
>ScallyWhack</a>.</p></li><li><p>430,000-899,999; unused (available f=
or reservation).</p></li><li><p>900,000-999,999; reserved for the <a =
href=3D"http://www.modsecurity.org/projects/rules/" target=3D"_top">C=
ore Rules</a>
          project.</p></li><li><p>1,000,000 and above; unused (availa=
ble for
          reservation).</p></li></ul></div></div><div class=3D"sectio=
n" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"=
><a name=3D"N11124"></a><code class=3D"literal">initcol</code></h3></=
div></div><div></div></div><p><span class=3D"bold"><strong>Descriptio=
n:</strong></span> Initialises a named
      persistent collection, either by loading data from storage or b=
y
      creating a new collection in memory.</p><p><span class=3D"bold"=
><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example: The following example initiates I=
P address
      tracking.</p><pre class=3D"programlisting">SecAction<span class=
=3D"bold"><strong> initcol:ip=3D%{REMOTE_ADDR}</strong></span>,nolog<=
/pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>Every=
 collection contains several built-in variables that are
      read-only:</p><div class=3D"orderedlist"><ol type=3D"1"><li><p>=
<code class=3D"literal">CREATE_TIME</code> - date/time of
          the creation of the collection.</p></li><li><p><code class=
=3D"literal">KEY</code> - the value of the
          initcol variable (the client's IP address in the example).<=
/p></li><li><p><code class=3D"literal">LAST_UPDATE_TIME</code> -
          date/time of the last update to the collection.</p></li><li=
><p><code class=3D"literal">TIMEOUT</code> - date/time in
          seconds when the collection will be updated on disk from me=
mory (if
          no other updates occur).</p></li><li><p><code class=3D"lite=
ral">UPDATE_COUNTER</code> - how many
          times the collection has been updated since creation.</p></=
li><li><p><code class=3D"literal">UPDATE_RATE</code> - is the
          average rate updates per minute since creation.</p></li></o=
l></div><p>Collections are loaded into memory when the initcol action=
 is
      encountered. The collection in storage will be updated (and the
      appropriate counters increased) <span class=3D"emphasis"><em>on=
ly</em></span> if it was
      changed during transaction processing.</p><div class=3D"note" s=
tyle=3D"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=3D"title"=
>Note</h3><p>To create a collection to hold session variables (<code =
class=3D"literal">SESSION</code>) use action <code class=3D"literal">=
setsid</code>. To create a collection to hold user
        variables (<code class=3D"literal">USER</code>) use action
        <code class=3D"literal">setuid</code>.</p></div><div class=
=3D"note" style=3D"margin-left: 0.5in; margin-right: 0.5in;"><h3 clas=
s=3D"title">Note</h3><p>At this time it is only possible to have thre=
e
        collections:<code class=3D"literal"> IP</code>,<code class=
=3D"literal"> SESSION</code>, and <code class=3D"literal">USER</code>=
.</p></div></div><div class=3D"section" lang=3D"en"><div class=3D"tit=
lepage"><div><div><h3 class=3D"title"><a name=3D"N1118F"></a><code cl=
ass=3D"literal">log</code></h3></div></div><div></div></div><p><span =
class=3D"bold"><strong>Description:</strong></span> Indicates that a
      successful match of the rule needs to be logged.</p><p><span cl=
ass=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecAction initcol:ip=3D%{REMOTE_ADDR},<span class=3D"bold"><strong>lo=
g</strong></span></pre><p><span class=3D"bold"><strong>Note</strong><=
/span></p><p>This action will log matches to the Apache error log fil=
e and the
      ModSecurity audit log.</p></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N111AB"></a><code class=3D"literal">msg</code></h3></div></div><=
div></div></div><p><span class=3D"bold"><strong>Description:</strong>=
</span> Assigns a custom
      message to the rule or chain.</p><p><span class=3D"bold"><stron=
g>Action Group:</strong></span> Metadata</p><p>Example:</p><pre class=
=3D"programlisting">SecRule &amp;REQUEST_HEADERS:Host "@eq 0" \
    "log,id:60008<span class=3D"bold"><strong>,</strong></span>severi=
ty:2,<span class=3D"bold"><strong>msg:'Request Missing a Host Header'=
"</strong></span></pre><p><span class=3D"bold"><strong>Note</strong><=
/span></p><p>The msg information appears in the error and/or audit lo=
g files
      and is not sent back to the client in response headers.</p></di=
v><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><d=
iv><h3 class=3D"title"><a name=3D"N111CB"></a><code class=3D"literal"=
>multiMatch</code></h3></div></div><div></div></div><p><span class=
=3D"bold"><strong>Description:</strong></span> If enabled
      ModSecurity will perform multiple operator invocations for ever=
y target,
      before and after every anti-evasion transformation is performed=
.</p><p><span class=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecDefaultAction log,deny,phase:1,t:removeNulls,t:lowercase
SecRule ARGS "attack" <span class=3D"bold"><strong>multiMatch</strong=
></span></pre><p><span class=3D"bold"><strong>Note</strong></span></p=
><p>Normally, variables are evaluated once, only after all
      transformation functions have completed. With multiMatch, varia=
bles are
      checked against the operator before and after every transformat=
ion
      function that changes the input.</p></div><div class=3D"section=
" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title">=
<a name=3D"N111E7"></a><code class=3D"literal">noauditlog</code></h3>=
</div></div><div></div></div><p><span class=3D"bold"><strong>Descript=
ion:</strong></span> Indicates that a
      successful match of the rule should not be used as criteria whe=
ther the
      transaction should be logged to the audit log.</p><p><span clas=
s=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REQUEST_HEADERS:User-Agent "Test" allow,<span class=3D"bold">=
<strong>noauditlog</strong></span></pre><p><span class=3D"bold"><stro=
ng>Note</strong></span></p><p>If the SecAuditEngine is set to On, all=
 of the transactions will
      be logged. If it is set to RelevantOnly, then you can control i=
t with
      the noauditlog action. Even if the noauditlog action is applied=
 to a
      specific rule and a rule either before or after triggered an au=
dit
      event, then the tranaction will be logged to the audit log. The=
 correct
      way to disable audit logging for the entire transaction is to u=
se
      "<code class=3D"literal">ctl:auditEngine=3DOff</code>"</p></div=
><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><di=
v><h3 class=3D"title"><a name=3D"N11207"></a><code class=3D"literal">=
nolog</code></h3></div></div><div></div></div><p><span class=3D"bold"=
><strong>Description:</strong></span> Prevents rule
      matches from appearing in both the error and audit logs.</p><p>=
<span class=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REQUEST_HEADERS:User-Agent "Test" allow,<span class=3D"bold">=
<strong>nolog</strong></span></pre><p><span class=3D"bold"><strong>No=
te</strong></span></p><p>The nolog action also implies noauditlog.</p=
></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><d=
iv><div><h3 class=3D"title"><a name=3D"N11223"></a><code class=3D"lit=
eral">pass</code></h3></div></div><div></div></div><p><span class=
=3D"bold"><strong>Description:</strong></span> Continues processing
      with the next rule in spite of a successful match.</p><p><span =
class=3D"bold"><strong>Action Group:</strong></span> Disruptive</p><p=
>Example:</p><pre class=3D"programlisting">SecRule REQUEST_HEADERS:Us=
er-Agent "Test" log,<span class=3D"bold"><strong>pass</strong></span>=
</pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>Tran=
saction will not be interrupted but it will be logged (unless
      logging has been suppressed).</p></div><div class=3D"section" l=
ang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a =
name=3D"N1123F"></a><code class=3D"literal">pause</code></h3></div></=
div><div></div></div><p><span class=3D"bold"><strong>Description:</st=
rong></span> Pauses transaction
      processing for the specified number of milliseconds.</p><p><spa=
n class=3D"bold"><strong>Action Group:</strong></span> Disruptive</p>=
<p>Example:</p><pre class=3D"programlisting">SecRule REQUEST_HEADERS:=
User-Agent "Test" log,deny,status:403,<span class=3D"bold"><strong>pa=
use:5000</strong></span></pre><p><span class=3D"bold"><strong>Note</s=
trong></span></p><p>This feature can be of limited benefit for slowin=
g down Brute
      Force Scanners, however use with care. If you are under a Denia=
l of
      Service type of attack, the pause feature may make matters wors=
e as this
      feature will cause child processes to sit idle until the pause =
is
      completed.</p></div><div class=3D"section" lang=3D"en"><div cla=
ss=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1125B"></a=
><code class=3D"literal">phase</code></h3></div></div><div></div></di=
v><p><span class=3D"bold"><strong>Description:</strong></span> Places=
 the rule (or
      the rule chain) into one of five available processing phases.</=
p><p><span class=3D"bold"><strong>Action Group:</strong></span> Disru=
ptive</p><p>Example:</p><pre class=3D"programlisting">SecDefaultActio=
n log,deny,<span class=3D"bold"><strong>phase:1</strong></span>,t:rem=
oveNulls,t:lowercase
SecRule REQUEST_HEADERS:User-Agent "Test" log,deny,status:403</pre><p=
><span class=3D"bold"><strong>Note</strong></span></p><p>Keep in mind=
 that is you specify the incorrect phase, the target
      variable that you specify may be empty. This could lead to a fa=
lse
      negative situation where your variable and operator (RegEx) may=
 be
      correct, but it misses malicious data because you specified the=
 wrong
      phase.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N11278"></a><=
code class=3D"literal">proxy</code></h3></div></div><div></div></div>=
<p><span class=3D"bold"><strong>Description:</strong></span> Intercep=
ts
      transaction by forwarding request to another web server using t=
he proxy
      backend.</p><p><span class=3D"bold"><strong>Action Group:</stro=
ng></span> Disruptive</p><p>Example:</p><pre class=3D"programlisting"=
>SecRule REQUEST_HEADERS:User-Agent "Test" log,<span class=3D"bold"><=
strong>proxy:http://www.honeypothost.com/</strong></span></pre><p><sp=
an class=3D"bold"><strong>Note</strong></span></p><p>For this action =
to work, mod_proxy must also be installed. This
      action is useful if you would like to proxy matching requests o=
nto a
      honeypot webserver.</p></div><div class=3D"section" lang=3D"en"=
><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1=
1294"></a><code class=3D"literal">redirect</code></h3></div></div><di=
v></div></div><p><span class=3D"bold"><strong>Description:</strong></=
span> Intercepts
      transaction by issuing a redirect to the given location.</p><p>=
<span class=3D"bold"><strong>Action Group:</strong></span> Disruptive=
</p><p>Example:</p><pre class=3D"programlisting">SecRule REQUEST_HEAD=
ERS:User-Agent "Test" \
    log,<span class=3D"bold"><strong>redirect:http://www.hostname.com=
/failed.html</strong></span></pre><p><span class=3D"bold"><strong>Not=
e</strong></span></p><p>If the <code class=3D"literal">status</code> =
action is present
      and its value is acceptable (301, 302, 303, or 307) it will be =
used for
      the redirection. Otherwise status code 302 will be used.</p></d=
iv><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><=
div><h3 class=3D"title"><a name=3D"N112B4"></a><code class=3D"literal=
">rev</code></h3></div></div><div></div></div><p><span class=3D"bold"=
><strong>Description:</strong></span> Specifies rule
      revision.</p><p><span class=3D"bold"><strong>Action Group:</str=
ong></span> Metadata</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REQUEST_METHOD "^PUT$" "id:340002,<span class=3D"bold"><stron=
g>rev:1</strong></span>,severity:2,msg:'Restricted HTTP function'"</p=
re><p><span class=3D"bold"><strong>Note</strong></span></p><p>This ac=
tion is used in combination with the <code class=3D"literal">id</code=
> action to allow the same rule ID to be used
      after changes take place but to still provide some indication t=
he rule
      changed.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N112D5"></a><=
code class=3D"literal">sanitiseArg</code></h3></div></div><div></div>=
</div><p><span class=3D"bold"><strong>Description:</strong></span> Sa=
nitises (replaces
      each byte with an asterisk) a named request argument prior to a=
udit
      logging.</p><p><span class=3D"bold"><strong>Action Group:</stro=
ng></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecAction nolog,phase:2,<span class=3D"bold"><strong>sanitiseArg:pass=
word</strong></span></pre><p><span class=3D"bold"><strong>Note</stron=
g></span></p><p>The sanitize actions do not sanitize any data within =
the actual
      raw requests but only on the copy of data within memory that is=
 set to
      log to the audit log. It will not sanitize the data in the
      modsec_debug.log file (if the log level is set high enough to c=
apture
      this data).</p></div><div class=3D"section" lang=3D"en"><div cl=
ass=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N112F1"></=
a><code class=3D"literal">sanitiseMatched</code></h3></div></div><div=
></div></div><p><span class=3D"bold"><strong>Description:</strong></s=
pan> Sanitises the
      variable (request argument, request header, or response header)=
 that
      caused a rule match.</p><p><span class=3D"bold"><strong>Action =
Group:</strong></span>
      Non-Disruptive</p><p>Example: This action can be used to saniti=
se arbitrary transaction
      elements when they match a condition. For example, the example =
below
      will sanitise any argument that contains the word<span class=
=3D"emphasis"><em>
      password</em></span> in the name.</p><pre class=3D"programlisti=
ng">SecRule ARGS_NAMES password nolog,pass,<span class=3D"bold"><stro=
ng>sanitiseMatched</strong></span></pre><p><span class=3D"bold"><stro=
ng>Note</strong></span></p><p>Same note as sanitiseArg.</p></div><div=
 class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3=
 class=3D"title"><a name=3D"N11310"></a><code class=3D"literal">sanit=
iseRequestHeader</code></h3></div></div><div></div></div><p><span cla=
ss=3D"bold"><strong>Description:</strong></span> Sanitises a named
      request header.</p><p><span class=3D"bold"><strong>Action Group=
:</strong></span>
      Non-Disruptive</p><p>Example: This will sanitise the data in th=
e Authorization
      header.</p><pre class=3D"programlisting">SecAction log,phase:1,=
<span class=3D"bold"><strong>sanitiseRequestHeader:Authorization</str=
ong></span></pre><p><span class=3D"bold"><strong>Note</strong></span>=
</p><p>Same note as sanitiseArg.</p></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N1132C"></a><code class=3D"literal">sanitiseResponseHeader</code=
></h3></div></div><div></div></div><p><span class=3D"bold"><strong>De=
scription:</strong></span> Sanitises a named
      response header.</p><p><span class=3D"bold"><strong>Action Grou=
p:</strong></span>
      Non-Disruptive</p><p>Example: This will sanitise the Set-Cookie=
 data sent to the
      client.</p><pre class=3D"programlisting">SecAction log,phase:3,=
<span class=3D"bold"><strong>sanitiseResponseHeader:Set-Cookie</stron=
g></span></pre><p><span class=3D"bold"><strong>Note</strong></span></=
p><p>Same note as sanitiseArg.</p></div><div class=3D"section" lang=
=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a nam=
e=3D"N11348"></a><code class=3D"literal">severity</code></h3></div></=
div><div></div></div><p><span class=3D"bold"><strong>Description:</st=
rong></span> Assigns severity to
      the rule it is placed with.</p><p><span class=3D"bold"><strong>=
Action Group:</strong></span> Metadata</p><p>Example:</p><pre class=
=3D"programlisting">SecRule REQUEST_METHOD "^PUT$" "id:340002,rev:1,<=
span class=3D"bold"><strong>severity:2</strong></span>,msg:'Restricte=
d HTTP function'"</pre><p><span class=3D"bold"><strong>Note</strong><=
/span></p><p>The severity numbers follow the Syslog convention:</p><d=
iv class=3D"itemizedlist"><ul type=3D"disc"><li><p>0 =3D EMERGENCY</p=
></li><li><p>1 =3D ALERT</p></li><li><p>2 =3D CRITICAL</p></li><li><p=
>3 =3D ERROR</p></li><li><p>4 =3D WARNING</p></li><li><p>5 =3D NOTICE=
</p></li><li><p>6 =3D INFO</p></li><li><p>7 =3D DEBUG</p></li></ul></=
div></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"=
><div><div><h3 class=3D"title"><a name=3D"N1137E"></a><code class=
=3D"literal">setuid</code></h3></div></div><div></div></div><p><span =
class=3D"bold"><strong>Description:</strong></span> Special-purpose
      action that initialises the <code class=3D"literal">USER</code>
      collection.</p><p><span class=3D"bold"><strong>Action Group:</s=
trong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecAction <span class=3D"bold"><strong>setuid:%{REMOTE_USER}</strong>=
</span>,nolog</pre><p><span class=3D"bold"><strong>Note</strong></spa=
n></p><p>After initialisation takes place the variable <code class=
=3D"literal">USERID</code> will be available for use in the
      subsequent rules.</p></div><div class=3D"section" lang=3D"en"><=
div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N113=
A3"></a><code class=3D"literal">setsid</code></h3></div></div><div></=
div></div><p><span class=3D"bold"><strong>Description:</strong></span=
>
      Special-purposeaction that initialises the <code class=3D"liter=
al">SESSION</code> collection.</p><p><span class=3D"bold"><strong>Act=
ion Group:
      </strong></span>Non-Disruptive</p><p>Example:</p><pre class=
=3D"programlisting"># Initialise session variables using the session =
cookie value=20
SecRule REQUEST_COOKIES:PHPSESSID !^$ chain,nolog,pass
SecAction <span class=3D"bold"><strong>setsid:%{REQUEST_COOKIES.PHPSE=
SSID}</strong></span></pre><p><span class=3D"bold"><strong>Note</stro=
ng></span></p><p>On first invocation of this action the collection wi=
ll be empty
      (not taking the pre-defined variables into account - see <code =
class=3D"literal">initcol</code> for more information). On subsequent
      invocations the contents of the collection (session, in this ca=
se) will
      be retrieved from storage. After initialisation takes place the
      variable<code class=3D"literal"> SESSIONID</code> will be avail=
able
      for use in the subsequent rules.This action understands each ap=
plication
      maintains its own set of sessions. It will utilise the current =
web
      application ID to create a session namespace.</p></div><div cla=
ss=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 cla=
ss=3D"title"><a name=3D"N113CB"></a><code class=3D"literal">setenv</c=
ode></h3></div></div><div></div></div><p><span class=3D"bold"><strong=
>Description:</strong></span> Creates, removes, or
      updates an environment variable.</p><p><span class=3D"bold"><st=
rong>Action Group:</strong></span>
      Non-Disruptive</p><p>Examples:</p><p>To create a new variable (=
if you omit the value <code class=3D"literal">1</code> will be used):=
</p><pre class=3D"programlisting">setenv:name=3Dvalue</pre><p>To remo=
ve a variable:</p><pre class=3D"programlisting">setenv:!name</pre><p>=
<span class=3D"bold"><strong>Note</strong></span></p><p>This action c=
an be used to establish communication with other
      Apache modules.</p></div><div class=3D"section" lang=3D"en"><di=
v class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N113EF=
"></a><code class=3D"literal">setvar</code></h3></div></div><div></di=
v></div><p><span class=3D"bold"><strong>Description:</strong></span> =
Creates, removes, or
      updates a variable in the specified collection.</p><p><span cla=
ss=3D"bold"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Examples:</p><p>To create a new variable:<=
/p><pre class=3D"programlisting">setvar:tx.score=3D10</pre><p>To remo=
ve a variable prefix the name with exclamation mark:</p><pre class=
=3D"programlisting">setvar:!tx.score</pre><p>To increase or decrease =
variable value use <code class=3D"literal">+</code> and <code class=
=3D"literal">-</code>
      characters in front of a numerical value:</p><pre class=3D"prog=
ramlisting">setvar:tx.score=3D+5</pre></div><div class=3D"section" la=
ng=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a n=
ame=3D"N11416"></a><code class=3D"literal">skip</code></h3></div></di=
v><div></div></div><p><span class=3D"bold"><strong>Description:</stro=
ng></span> Skips one or more
      rules (or chains) on successful match.</p><p><span class=3D"bol=
d"><strong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><p><pre class=3D"programlistin=
g">SecRule REQUEST_URI "^/$" "chain,<span class=3D"bold"><strong>skip=
:2</strong></span>"
SecRule REMOTE_ADDR "^127\.0\.0\.1$" "chain"
SecRule REQUEST_HEADERS:User-Agent "^Apache \(internal dummy connecti=
on\)$" "t:none" =20
SecRule &amp;REQUEST_HEADERS:Host "@eq 0" \
    "deny,log,status:400,id:960008,severity:4,msg:'Request Missing a =
Host Header'"
SecRule &amp;REQUEST_HEADERS:Accept "@eq 0" \
    "log,deny,log,status:400,id:960015,msg:'Request Missing an Accept=
 Header'"</pre></p><p><span class=3D"bold"><strong>Note</strong></spa=
n></p><p>Skip only applies to the current processing phase and not
      necessarily the order in which the rules appear in the configur=
ation
      file. If you group rules by processing phases, then skip should=
 work as
      expected. This action can not be used to skip rules within one =
chain.
      Accepts a single paramater denoting the number of rules (or cha=
ins) to
      skip.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N11434"></a><=
code class=3D"literal">status</code></h3></div></div><div></div></div=
><p><span class=3D"bold"><strong>Description:</strong></span> Specifi=
es the
      response status code to use with actions<code class=3D"literal"=
>
      deny</code> and<code class=3D"literal"> redirect</code>.</p><p>=
<span class=3D"bold"><strong>Action Group:</strong></span> Disruptive=
</p><p>Example:</p><pre class=3D"programlisting">SecDefaultAction log=
,deny,<span class=3D"bold"><strong>status:403</strong></span>,phase:1=
</pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>Stau=
s actions defined in Apache scope locations (such as
      Directory, Location, etc...) may be superceded by phase:1 actio=
n
      settings. The Apache ErrorDocument directive will be triggered =
if
      present in the configuration. Therefore if you have previously =
defined a
      custom error page for a given status then it will be executed a=
nd its
      output presented to the user.</p></div><div class=3D"section" l=
ang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a =
name=3D"N11459"></a><code class=3D"literal">t</code></h3></div></div>=
<div></div></div><p><span class=3D"bold"><strong>Description:</strong=
></span> This action can be
      used which transformation function should be used against the s=
pecified
      variables before they (or the results, rather) are run against =
the
      operator specified in the rule.</p><p><span class=3D"bold"><str=
ong>Action Group:</strong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecDefaultAction log,deny,phase:1,t:removeNulls,t:lowercase=20
SecRule REQUEST_COOKIES:SESSIONID "47414e81cbbef3cf8366e84eeacba091" =
\
    log,deny,status:403,<span class=3D"bold"><strong>t:md5</strong></=
span></pre><p><span class=3D"bold"><strong>Note</strong></span></p><p=
>Any transformation functions that you specify in a SecRule will be
      in addtion to previous ones specified in SecDefaultAction. Use =
of
      "t:none" will remove all transformation functions for the speci=
fied
      rule.</p></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N11475"></a><=
code class=3D"literal">xmlns</code></h3></div></div><div></div></div>=
<p><span class=3D"bold"><strong>Description:</strong></span> This act=
ion should
      be used together with an XPath expression to register a
      namespace.</p><p><span class=3D"bold"><strong>Action Group:</st=
rong></span>
      Non-Disruptive</p><p>Example:</p><pre class=3D"programlisting">=
SecRule REQUEST_HEADERS:Content-Type "text/xml" \
    phase:1,pass,ctl:requestBodyProcessor=3DXML,ctl:requestBodyAccess=
=3DOn,<span class=3D"bold"><strong>xmlns:xsd=3D"http://www.w3.org/200=
1/XMLSchema"</strong></span>
SecRule XML:/soap:Envelope/soap:Body/q1:getInput/id() "123" phase:2,d=
eny</pre></div></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: both"><a=
 name=3D"08-operators"></a>Operators</h2></div></div><div></div></div=
><p>A number of operators can be used in rules, as documented below. =
The
    operator syntax used the "@" symbol followed by the specific oper=
ator
    name.</p><div class=3D"section" lang=3D"en"><div class=3D"titlepa=
ge"><div><div><h3 class=3D"title"><a name=3D"N11492"></a><code class=
=3D"literal">eq</code></h3></div></div><div></div></div><p><span clas=
s=3D"bold"><strong>Description:</strong></span> This operator is a
      numerical comparison and stands for "equal to."</p><p>Example:<=
/p><pre class=3D"programlisting">SecRule &amp;REQUEST_HEADERS_NAMES "=
<span class=3D"bold"><strong>@eq</strong></span> 15"</pre></div><div =
class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 =
class=3D"title"><a name=3D"N114A4"></a><code class=3D"literal">ge</co=
de></h3></div></div><div></div></div><p><span class=3D"bold"><strong>=
Description:</strong></span> This operator is a
      numerical comparison and stands for "greater than or equal to."=
</p><p>Example:</p><pre class=3D"programlisting">SecRule &amp;REQUEST=
_HEADERS_NAMES "<span class=3D"bold"><strong>@ge</strong></span> 15"<=
/pre></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage=
"><div><div><h3 class=3D"title"><a name=3D"N114B6"></a><code class=
=3D"literal">gt</code></h3></div></div><div></div></div><p><span clas=
s=3D"bold"><strong>Description:</strong></span> This operator is a
      numerical comparison and stands for "greater than."</p><p>Examp=
le:</p><pre class=3D"programlisting">SecRule &amp;REQUEST_HEADERS_NAM=
ES "<span class=3D"bold"><strong>@gt</strong></span> 15"</pre></div><=
div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div>=
<h3 class=3D"title"><a name=3D"N114C8"></a><code class=3D"literal">in=
spectFile</code></h3></div></div><div></div></div><p><span class=3D"b=
old"><strong>Description:</strong></span> Executes the
      external script/binary given as parameter to the operator again=
st every
      file extracted from the request.</p><p>Example:</p><pre class=
=3D"programlisting">SecRule FILES_TMPNAMES "<span class=3D"bold"><str=
ong>@inspectFile</strong></span> /opt/apache/bin/inspect_script.pl"</=
pre></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"=
><div><div><h3 class=3D"title"><a name=3D"N114DA"></a><code class=
=3D"literal">le</code></h3></div></div><div></div></div><p><span clas=
s=3D"bold"><strong>Description:</strong></span> This operator is a
      numerical comparison and stands for "less than or equal to."</p=
><p>Example:</p><pre class=3D"programlisting">SecRule &amp;REQUEST_HE=
ADERS_NAMES "<span class=3D"bold"><strong>@le</strong></span> 15"</pr=
e></div><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><=
div><div><h3 class=3D"title"><a name=3D"N114EC"></a><code class=3D"li=
teral">lt</code></h3></div></div><div></div></div><p><span class=3D"b=
old"><strong>Description:</strong></span> This operator is a
      numerical comparison and stands for "less than."</p><p>Example:=
</p><pre class=3D"programlisting">SecRule &amp;REQUEST_HEADERS_NAMES =
"<span class=3D"bold"><strong>@lt </strong></span>15"</pre></div><div=
 class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3=
 class=3D"title"><a name=3D"N114FE"></a><code class=3D"literal">rbl</=
code></h3></div></div><div></div></div><p><span class=3D"bold"><stron=
g>Description:</strong></span> Look up the
      parameter in the RBL given as parameter. Parameter can be an IP=
v4
      address, or a hostname.</p><p>Example:</p><pre class=3D"program=
listing">SecRule REMOTE_ADDR "<span class=3D"bold"><strong>@rbl</stro=
ng></span> sc.surbl.org"</pre></div><div class=3D"section" lang=3D"en=
"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N=
11510"></a><code class=3D"literal">rx</code></h3></div></div><div></d=
iv></div><p><span class=3D"bold"><strong>Description:</strong></span>=
 Regular expression
      operator. This is the default operator, so if the "@" operator =
is not
      defined, it is assumed to be rx.</p><p>Example:</p><pre class=
=3D"programlisting">SecRule REQUEST_HEADERS:User-Agent "<span class=
=3D"bold"><strong>@rx</strong></span> nikto"</pre><p><span class=3D"b=
old"><strong>Note</strong></span></p><p>Regular expressions are handl=
ed by the PCRE library (<a href=3D"http://www.pcre.org" target=3D"_to=
p">http://www.pcre.org</a>). ModSecurity
      compiles its regular expressions with the following settings:</=
p><div class=3D"orderedlist"><ol type=3D"1"><li><p>The entire input i=
s treated as a single line, even when there
          are newline characters present.</p></li><li><p>All matches =
are case-sensitive. If you do not care about case
          sensitivity you either need to implement the <code class=
=3D"literal">lowercase</code> transformational function, or
          use the per-pattern<code class=3D"literal">(?i)</code>modif=
icator, as allowed by
          PCRE.</p></li><li><p>The <code class=3D"literal">PCRE_DOTAL=
L</code> and
          <code class=3D"literal">PCRE_DOLLAR_ENDONLY</code> flags ar=
e set
          during compilation, meaning a single dot will match any cha=
racter,
          including the newlines and a <code class=3D"literal">$</cod=
e>
          end anchor will not match a trailing newline charater.</p><=
/li></ol></div></div><div class=3D"section" lang=3D"en"><div class=
=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N1154C"></a><=
code class=3D"literal">validateByteRange</code></h3></div></div><div>=
</div></div><p><span class=3D"bold"><strong>Description:</strong></sp=
an> Validates the byte
      range used in the variable falls into the specified range.</p><=
p>Example:</p><pre class=3D"programlisting">SecRule ARG:text "<span c=
lass=3D"bold"><strong>@validateByteRange</strong></span> 10, 13, 32-1=
26"</pre><p><span class=3D"bold"><strong>Note</strong></span></p><p>Y=
ou can force requests to consist only of bytes from a certain
      byte range. This can be useful to avoid stack overflow attacks =
(since
      they usually contain "random" binary content). Default range va=
lues are
      0 and 255, i.e. all byte values are allowed. This directive doe=
s not
      check byte range in a POST payload when
      <code class=3D"literal">multipart/form-data</code> encoding (fi=
le upload) is used.
      Doing so would prevent binary files from being uploaded. Howeve=
r, after
      the parameters are extracted from such request they are checked=
 for a
      valid range.</p><p>validateByteRange is similar to the ModSecur=
ity 1.X
      SecFilterForceByteRange Directive however since it works in a r=
ule
      context, it has the following differences:</p><div class=3D"ite=
mizedlist"><ul type=3D"disc"><li><p>You can specify a different range=
 for different
          variables.</p></li><li><p>It has an "event" context (id, ms=
g....)</p></li><li><p>It is executed in the flow of rules rather than=
 being a built
          in pre-check.</p></li></ul></div></div><div class=3D"sectio=
n" lang=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"=
><a name=3D"N11573"></a><code class=3D"literal">validateDTD</code></h=
3></div></div><div></div></div><p><span class=3D"bold"><strong>Descri=
ption:</strong></span> This operator
      requires the request body to be processed as XML.</p><p>Example=
:</p><pre class=3D"programlisting">SecDefaultAction log,deny,status:4=
03,phase:2
SecRule REQUEST_HEADERS:Content-Type ^text/xml$ \
    phase:1,t:lowercase,nolog,pass,ctl:requestBodyProcessor=3DXML
SecRule REQBODY_PROCESSOR "!^XML$" nolog,pass,skip:1
SecRule XML "<span class=3D"bold"><strong>@validateDTD /path/to/apach=
e2/conf/xml.dtd</strong></span>"</pre></div><div class=3D"section" la=
ng=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a n=
ame=3D"N11585"></a><code class=3D"literal">validateSchema</code></h3>=
</div></div><div></div></div><p><span class=3D"bold"><strong>Descript=
ion:</strong></span> This operator
      requires the request body to be processed as XML.</p><p>Example=
:</p><pre class=3D"programlisting">SecDefaultAction log,deny,status:4=
03,phase:2
SecRule REQUEST_HEADERS:Content-Type ^text/xml$ \
    phase:1,t:lowercase,nolog,pass,ctl:requestBodyProcessor=3DXML
SecRule REQBODY_PROCESSOR "!^XML$" nolog,pass,skip:1
SecRule XML "<span class=3D"bold"><strong>@validateSchema /path/to/ap=
ache2/conf/xml.xsd</strong></span>"</pre><p>This operator requires re=
quest body to be processed as XML.</p></div><div class=3D"section" la=
ng=3D"en"><div class=3D"titlepage"><div><div><h3 class=3D"title"><a n=
ame=3D"N11599"></a><code class=3D"literal">validateUrlEncoding</code>=
</h3></div></div><div></div></div><p><span class=3D"bold"><strong>Des=
cription:</strong></span> Verifies the
      encodings used in the variable (if any) are valid.</p><p>Exampl=
e:</p><pre class=3D"programlisting">SecRule ARGS "<span class=3D"bold=
"><strong>@validateUrlEncoding</strong></span>"</pre><p><span class=
=3D"bold"><strong>Note</strong></span></p><p>URL encoding is an HTTP =
standard for encoding byte values within a
      URL. The byte is escaped with a % followed by two hexadecimal v=
alues
      (0-F). This directive does not check encoding in a POST payload=
 when the
      <code class=3D"literal">multipart/form-data</code> encoding (fi=
le upload) is used.
      It is not necessary to do so because URL encoding is not used f=
or this
      encoding.</p></div><div class=3D"section" lang=3D"en"><div clas=
s=3D"titlepage"><div><div><h3 class=3D"title"><a name=3D"N115B4"></a>=
<code class=3D"literal">validateUtf8Encoding</code></h3></div></div><=
div></div></div><p><span class=3D"bold"><strong>Description:</strong>=
</span> Verifies the
      variable is a valid UTF-8 encoded string.</p><p>Example:</p><pr=
e class=3D"programlisting">SecRule ARGS "<span class=3D"bold"><strong=
>@validateUtf8Encoding</strong></span>"</pre><p><span class=3D"bold">=
<strong>Note</strong></span></p><p>UTF-8 encoding is valid on most we=
b servers. Integer values
      between 0-65535 are encoded in a UTF-8 byte sequence that is es=
caped by
      percents. The short form is two bytes in length.</p><p>check fo=
r three types of errors:</p><div class=3D"itemizedlist"><ul type=3D"d=
isc"><li><p>Not enough bytes. UTF-8 supports two, three, four, five, =
and
          six byte encodings. ModSecurity will locate cases when a by=
te or
          more is missing.</p></li><li><p>Invalid encoding. The two m=
ost significant bits in most
          characters are supposed to be fixed to 0x80. Attackers can =
use this
          to subvert Unicode decoders.</p></li><li><p>Overlong charac=
ters. ASCII characters are mapped directly into
          the Unicode space and are thus represented with a single by=
te.
          However, most ASCII characters can also be encoded with two=
, three,
          four, five, and six characters thus tricking the decoder in=
to
          thinking that the character is something else (and, presuma=
bly,
          avoiding the security check).</p></li></ul></div></div></di=
v><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div><d=
iv><h2 class=3D"title" style=3D"clear: both"><a name=3D"N115D8"></a>M=
iscellaneous Topics</h2></div></div><div></div></div><p></p><div clas=
s=3D"section" lang=3D"en"><div class=3D"titlepage"><div><div><h3 clas=
s=3D"title"><a name=3D"N115DC"></a>Impedance Mismatch</h3></div></div=
><div></div></div><p>Web application firewalls have a difficult job t=
rying to make
      sense of data that passes by, without any knowledge of the appl=
ication
      and its business logic. The protection they provide comes from =
having an
      independent layer of security on the outside. Because data vali=
dation is
      done twice, security can be increased without having to touch t=
he
      application. In some cases, however, the fact that everything i=
s done
      twice brings problems. Problems can arise in the areas where th=
e
      communication protocols are not well specified, or where either=
 the
      device or the application do things that are not in the specifi=
cation.
      In such cases it may be possible to design payload that will be
      interpreted in one way by one device and in another by the othe=
r device.
      This problem is better known as Impedance Mismatch. It can be e=
xploited
      to evade the security devices.</p><p>While we will continue to =
enhance ModSecurity to deal with various
      evasion techniques the problem can only be minimized, but never=
 solved.
      With so many different application backends chances are some wi=
ll always
      do something completely unexpected. The only solution is to be =
aware of
      the technologies in the backend when writing rules, adapting th=
e rules
      to remove the mismatch. See the next section for some examples.=
</p><div class=3D"section" lang=3D"en"><div class=3D"titlepage"><div>=
<div><h4 class=3D"title"><a name=3D"N115E3"></a>PHP Peculiarities for=
 ModSecurity Users</h4></div></div><div></div></div><p>When writing r=
ules to protect PHP applications you need to pay
        attention to the following facts:</p><div class=3D"orderedlis=
t"><ol type=3D"1"><li><p>When "register_globals" is set to "On" reque=
st parameters
            are automatically converted to script variables. In some =
PHP
            versions it is even possible to override the $GLOBALS
            array.</p></li><li><p>Whitespace at the beginning of para=
meter names is ignored.
            (This is very dangerous if you are writing rules to targe=
t
            specific named variables.)</p></li><li><p>The remaining w=
hitespace (in parameter names) is converted
            to underscores. The same applies to dots and to a "[" if =
the
            variable name does not contain a matching closing bracket=
.
            (Meaning that if you want to exploit a script through a v=
ariable
            that contains an underscore in the name you can send a pa=
rameter
            with a whitespace or a dot instead.)</p></li><li><p>Cooki=
es can be treated as request parameters.</p></li><li><p>The discussio=
n about variable names applies equally to the
            cookie names.</p></li><li><p>The order in which parameter=
s are taken from the request and
            the environment is EGPCS (environment, GET, POST, Cookies=
,
            built-in variables). This means that a POST parameter wil=
l
            overwrite the parameters transported on the request line =
(in
            QUERY_STRING).</p></li><li><p>When "magic_quotes_gpc" is =
set to "On" PHP will use
            backslash to escape the following characters: single quot=
e, double
            quote, backslash, and the nul byte.</p></li><li><p>If "ma=
gic_quotes_sybase" is set to "On" only the single
            quote will be escaped using another single quote. In this=
 case the
            "magic_quotes_gpc" setting becomes irrelevant. The
            "magic_quotes_sybase" setting completely overrides the
            "magic_quotes_gpc" behaviour but "magic_quotes_gpc" still=
 must be
            set to "On" for the Sybase-specific quoting to be work.</=
p></li><li><p>PHP will also automatically create nested arrays for yo=
u.
            For example "p[x][y]=3D1" results in a total of three
            variables.</p></li></ol></div></div></div></div></div><di=
v align=3D"center" class=3D"copyright">Copyright (C) 2004-2008 <a hre=
f=3D"http://www.breach.com">Breach Security</a></div></body></html>

--Boundary_(ID_QUUFOcR+f9AyrsyWvio1YQ)--

From jyri@buye.red.iplanet.com Mon Feb 11 14:31:25 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m1BMVO1h008838
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 11 Feb 2008 14:31:25 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m1BMVKAW000881;
	Mon, 11 Feb 2008 22:31:21 GMT
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JW300G0DIK7JV00@nwk-avmta-2.sfbay.sun.com>; Mon,
 11 Feb 2008 14:31:19 -0800 (PST)
Received: from buye.red.iplanet.com ([192.18.65.224])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JW300BLYIK6O470@nwk-avmta-2.sfbay.sun.com>; Mon,
 11 Feb 2008 14:31:18 -0800 (PST)
Received: from buye.red.iplanet.com (localhost [127.0.0.1])
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7) with ESMTP id m1BMNmlB010998; Mon,
 11 Feb 2008 14:23:48 -0800 (PST)
Received: (from jyri@localhost)
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7/Submit) id m1BMNmKk010997; Mon,
 11 Feb 2008 14:23:48 -0800 (PST)
Date: Mon, 11 Feb 2008 14:23:48 -0800
From: Jyri Virkki <Jyri.Virkki@sun.com>
Subject: Re: [webstack-discuss] Additional Apache2 Modules [PSARC/2008/090
 FastTrack timeout 2/15/2008]
In-reply-to: <20080211145931.GY4494@vayavyam.India.Sun.COM>
To: rahul <Rahul.G.Nair@sun.com>
Cc: PSARC-ext@sun.com, webstack-discuss@opensolaris.org
Message-id: <20080211222348.GB10961@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
 <20080208171203.GQ22027@zruty.sfbay.sun.com>
 <b61a4e530802080926v2931a67p35acdf02f4c9b0cd@mail.gmail.com>
 <20080211145931.GY4494@vayavyam.India.Sun.COM>
User-Agent: Mutt/1.5.11
Status: RO
Content-Length: 304

rahul wrote:
>
> I would like to update the arc case with the following updates.

I've updated the docs in the case materials accordingly.

http://opensolaris.org/os/community/arc/caselog/2008/090/


(updates take a bit to show up on the site)
-- 
Jyri J. Virkki - jyri.virkki@sun.com - Sun Microsystems

From jyri@buye.red.iplanet.com Tue Feb 12 23:16:19 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m1D7GIAb016675
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 12 Feb 2008 23:16:19 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m1D7G5Jh003267;
	Wed, 13 Feb 2008 07:16:14 GMT
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JW600E011J01R00@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 12 Feb 2008 23:16:12 -0800 (PST)
Received: from buye.red.iplanet.com ([192.18.65.224])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JW600CQG1J0DO00@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 12 Feb 2008 23:16:12 -0800 (PST)
Received: from buye.red.iplanet.com (localhost [127.0.0.1])
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7) with ESMTP id m1D6rhUE013563; Tue,
 12 Feb 2008 22:53:43 -0800 (PST)
Received: (from jyri@localhost)
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7/Submit) id m1D6rho4013562; Tue,
 12 Feb 2008 22:53:43 -0800 (PST)
Date: Tue, 12 Feb 2008 22:53:43 -0800
From: Jyri Virkki <Jyri.Virkki@sun.com>
Subject: Re: [webstack-discuss] Additional Apache2 Modules [PSARC/2008/090
 FastTrack timeout 2/15/2008]
In-reply-to: <20080211145931.GY4494@vayavyam.India.Sun.COM>
To: rahul <Rahul.G.Nair@sun.com>
Cc: Brian Rectanus <brectanu@gmail.com>, PSARC-ext@sun.com,
        webstack-discuss@opensolaris.org, Danek Duvall <Danek.Duvall@sun.com>
Message-id: <20080213065343.GO12197@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
 <20080208171203.GQ22027@zruty.sfbay.sun.com>
 <b61a4e530802080926v2931a67p35acdf02f4c9b0cd@mail.gmail.com>
 <20080211145931.GY4494@vayavyam.India.Sun.COM>
User-Agent: Mutt/1.5.11
Status: RO
Content-Length: 913

rahul wrote:
>
> 
>     5.1.4 mod_dtrace
>         The mod_dtrace has had just two releases (0.2a and 0.3a) and
>     is possibly very unstable. The interface of dtrace module consists
>     of the apache functions it is hooking into. This is provided as 
>     Addendum 4.
> 
> Addendum 4:
> Apache methods hooked into by mod_dtrace:
> 
> apache_receive_request
> apache_log_request
> apache_create_child
> apache_accept_connection
> apache_check_user
> apache_check_access
> apache_check_authorization
> dtrace_register_hooks

The above seems a bit confusing.. Isn't the public interface the
provider and probe names being exported?

Looking at
http://prefetch.net/projects/apache_modtrace/apache.d
the probe names seem to be

 receive-request
 log-request
 create-child
 accept-connection
 check-user-credentials
 check-access
 check-authorization


-- 
Jyri J. Virkki - jyri.virkki@sun.com - Sun Microsystems

From Rahul.G.Nair@sun.com Wed Feb 13 01:50:12 2008
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m1D9oCTd020217
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 13 Feb 2008 01:50:12 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m1D9oAZ5004144
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 13 Feb 2008 01:50:11 -0800 (PST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JW60020R8NNDF00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Wed, 13 Feb 2008 02:50:11 -0700 (MST)
Received: from sineb-mail-1.sun.com ([192.18.19.6])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JW600BXD8NJPRE0@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Wed,
 13 Feb 2008 02:50:10 -0700 (MST)
Received: from fe-apac-05.sun.com
 (fe-apac-05.sun.com [192.18.19.176] (may be forged))
	by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m1D9oANm026094	for
 <PSARC-ext@sun.com>; Wed, 13 Feb 2008 09:50:10 +0000 (GMT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JW600E018MFNE00@mail-apac.sun.com>
 (original mail from Rahul.G.Nair@Sun.COM)
 for PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Wed,
 13 Feb 2008 17:50:06 +0800 (SGT)
Received: from localhost ([129.158.224.78])
 by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr  3
 2006)) with ESMTPSA id <0JW60032O8NCMWTY@mail-apac.sun.com>; Wed,
 13 Feb 2008 17:50:01 +0800 (SGT)
Date: Wed, 13 Feb 2008 15:09:56 +0530
From: rahul <Rahul.G.Nair@sun.com>
Subject: Re: [webstack-discuss] Additional Apache2 Modules [PSARC/2008/090
 FastTrack timeout 2/15/2008]
In-reply-to: <20080213065343.GO12197@sun.com>
Sender: Rahul.G.Nair@sun.com
To: Jyri Virkki <Jyri.Virkki@sun.com>
Cc: PSARC-ext@sun.com, webstack-discuss@opensolaris.org,
        Danek Duvall <Danek.Duvall@sun.com>
Message-id: <20080213093955.GF4494@vayavyam.India.Sun.COM>
MIME-version: 1.0
Content-type: multipart/mixed; boundary="Boundary_(ID_W/F6ABLY1olOe5NEZWS5GA)"
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
 <20080208171203.GQ22027@zruty.sfbay.sun.com>
 <b61a4e530802080926v2931a67p35acdf02f4c9b0cd@mail.gmail.com>
 <20080211145931.GY4494@vayavyam.India.Sun.COM> <20080213065343.GO12197@sun.com>
User-Agent: Mutt/1.5.11
Status: RO
Content-Length: 13055


--Boundary_(ID_W/F6ABLY1olOe5NEZWS5GA)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline

Hi,
    Updated arc draft attached, the changes are:
change these
| > apache_receive_request
| > apache_log_request
| > apache_create_child
| > apache_accept_connection
| > apache_check_user
| > apache_check_access
| > apache_check_authorization
| > dtrace_register_hooks

 to the provider names as suggested by jyri.

|  receive-request
|  log-request
|  create-child
|  accept-connection
|  check-user-credentials
|  check-access
|  check-authorization
                                    rahul
--
1. e4 _


--Boundary_(ID_W/F6ABLY1olOe5NEZWS5GA)
Content-type: text/plain; NAME=arc.modules; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=arc.modules


Additional Apache2 Modules

11 February 2008

1.    Summary and motivation

    1.1.    Introduction

    This project delivers Apache modules mod_jk, mod_fcgid,
    mod_security and mod_dtrace to the Apache2 (PSARC/2007/586) in
    OpenSolaris.

    Modules allow Apache to integrate and provide functionality
    during runtime that were not available during compile time.

    1.1.1 mod_security
    From modsecurity.org[3] "ModSecurity is a web application
    firewall (WAF). With over 70% of all attacks now carried out
    over the web application level, organisations need every help
    they can get in making their systems secure. WAFs are deployed
    to establish an external security layer that increases security,
    detects, and prevents attacks before they reach web applications.
    It provides protection from a range of attacks against web
    applications and allows for HTTP traffic monitoring and real-time
    analysis with little or no changes to existing infrastructure."

    1.1.2 mod_jk
    From tomcat.apache.org "mod_jk is a replacement to the elderly
    mod_jserv. It is a completely new Tomcat-Apache plug-in that
    handles the communication between Tomcat and Apache."

    1.1.3 mod_fcgid
    From fastcgi.coremail.cn "It is a binary compatibility alternative
    to Apache module mod_fastcgi." mod_fcgid is an apache module that
    allows CGIs to be deployed on apache that make use of the FastCGI
    mechanism. From www.fastcgi.com "FastCGI is a language independent,
    scalable, open extension to CGI that provides high performance
    without the limitations of server specific APIs."

    1.1.4 mod_dtrace
    From prefetch.net "The Apache DTrace module (mod_dtrace) utilizes
    the hook framework to add DTrace probes to the Apache web server.
    These probes can be used to observe and correlate web server and
    system behavior, and allow easy access to numerous pieces of
    realtime Apache data.


    This project integrates the most recent stable releases of
    mod_jk[1] tomcat-connectors-1.2.25, mod_fcgid[2] 2.2,
    mod_security[3] 2.1.5 and mod_dtrace[4] 0.3a

    This case seeks Minor Release Binding.

2.    Technical issues

    2.1.    Key objects

    /usr/apache2/2.2/libexec/mod_jk.so
    /usr/apache2/2.2/libexec/mod_fcgid.so
    /usr/apache2/2.2/libexec/mod_security2.so
    /usr/apache2/2.2/libexec/mod_dtrace.so

    /usr/apache2/2.2/libexec/${ISAINFO}/mod_jk.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_fcgid.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_security2.so
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_dtrace.so

 
    2.2 Versioning

    mod_jk, mod_fcgid, mod_security and mod_dtrace have a single active
    release. (There was a module named mod_jk2 which was deprecated. It
    was not the successor to mod_jk.)

    It is not possible to query the modules to find out their
    versions.  The only way to do that is to look at the package
    description for the package including it.

    2.2 Directory Naming and Structure

    This project delivers the shared libraries of 32 bit and 64 bit
    into /usr/apache2/2.2/libexec and /usr/apache2/2.2/libexec/${ISAINFO}/ 
    directories of apache. This is in keeping with the approach taken
    by the Apache2 integration project for OpenSolaris (PSARC/2007/586).

3. Documentation

    The modules mod_jk, mod_fcgid, mod_security and mod_dtrace do not
    install documentation into apache though they come with some
    documentation in their source. The recommended way to access their
    documentation is to look at their websites (mod_fcgid[5] ,mod_jk[6],
    mod_security[7] and mod_dtrace[8] ). A list of external apache modules
    that has been added and their corresponding sites will be part of the
    release document.

4. Packaging and Delivery

    The modules will be delivered under the cluster SUNWCapch22m. This
    cluster consists of SUNWapch22m-fcgid, SUNWapch22m-jk,
    SUNWapch22m-security and SUNWapch22m-dtrace respectively.

5.  Interfaces

    5.1.    Interface Stability

    The interface stability of most of these modules is Volatile as
    these are controlled by external organisations over which Sun has
    no control. The specific researches regarding stability of each
    module are captured below.

    5.1.1 mod_jk
        The mod_jk developers will try to keep the releases of 1.2.X
    line compatible with each other. But this is not guaranteed in
    case of new features that may need to be retracted due to some
    bugs or vulnerabilities. The interface of mod_jk (its configuration)
    is presented as Addendum 2. The complete list of directives and
    their explanation as supplied by tomcat.apache.org is available
    as mod_jk_interface.html.

    5.1.2 mod_security
       The mod_security developers will keep the compatibility
    between releases of the same major number. (ie 2.y.z with 2 being
    the major number.) But there is no guarantee that meaning of a
    rule set (configuration directive) would be exactly the same
    across any two releases. The interface of mod_security (its
    configuration) is presented in Addendum 1. The complete list of
    directives and their explanation (as provided by modsecurity.org)
    is available as mod_security_interface.html.

    5.1.3 mod_fcgid
       There were no commitments from mod_fcgid developers in this
    regard. (The mod_fcgid does not seem to have broken the
    configuration compatibility with any of its earlier releases
    yet [9] but is in very active development). The interface of
    mod_fcgid (its configuration options) is presented as
    Addendum 3. The complete list of directives and their explanation
    as provided by fastcgi.coremail.cn is available as 
    mod_fcgid_interface.html


    5.1.4 mod_dtrace
        The mod_dtrace has had just two releases (0.2a and 0.3a) and
    is possibly very unstable. The interface of dtrace module consists
    of the apache functions it is hooking into. This is provided as 
    Addendum 4.
    

    5.2.    Imported Interfaces

    These Apache modules imports interfaces from

    NAME                       STABILITY         NOTES
    ------------------------------------------------------------
    Apache2                    Uncommitted       PSARC/2007/586/   
    LDAP                       Evolving          PSARC/2000/362/
    PCRE                       Uncommitted       PSARC/2007/164/
    SUNWlxml                   Committed         PSARC/2001/175/
    Dtrace                     Uncommitted       PSARC/2001/466/


    5.3.    Exported Interfaces

    NAME                                                STABILITY
    --------------------------------------------------------------- 
    /usr/apache2/2.2/libexec/mod_jk.so                  Volatile
    /usr/apache2/2.2/libexec/mod_fcgid.so               Volatile
    /usr/apache2/2.2/libexec/mod_security.so            Uncommitted
    /usr/apache2/2.2/libexec/mod_dtrace.so              Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_jk.so       Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_fcgid.so    Volatile
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_security.so Uncommitted
    /usr/apache2/2.2/libexec/${ISAINFO}/mod_dtrace.so   Volatile


6.    References

   1. http://fastcgi.coremail.cn/
   2. http://tomcat.apache.org/connectors-doc/
   3. http://www.modsecurity.org/projects/modsecurity/apache/index.html
   4. http://prefetch.net/projects/apache_modtrace/index.html
   5. http://fastcgi.coremail.cn/doc.htm
   6. http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
   7. http://www.modsecurity.org/documentation/index.html
   8. http://prefetch.net/projects/apache_modtrace/mod_dtrace.c
   9. http://fastcgi.coremail.cn/download.htm


==============================================================================

Addendum 1
----------
mod_security interfaces:
    It includes the configuration directives, exposed variables, library
functions (transformation functions), operators and actions to be taken on
the URI

Configuration Directives
    SecAction
    SecArgumentSeparator
    SecAuditEngine
    SecAuditLog
    SecAuditLog2
    SecAuditLogParts
    SecAuditLogRelevantStatus
    SecAuditLogStorageDir
    SecAuditLogType
    SecChrootDir
    SecCookieFormat
    SecDataDir
    SecDebugLog
    SecDebugLogLevel
    SecDefaultAction
    SecGuardianLog
    SecRequestBodyAccess
    SecRequestBodyLimit
    SecRequestBodyInMemoryLimit
    SecResponseBodyLimit
    SecResponseBodyMimeType
    SecResponseBodyMimeTypesClear
    SecResponseBodyAccess
    SecRule
    SecRuleInheritance
    SecRuleEngine
    SecRuleRemoveById
    SecRuleRemoveByMsg
    SecServerSignature
    SecTmpDir
    SecUploadDir
    SecUploadKeepFiles
    SecWebAppId

Variables

    ARGS
    ARGS_COMBINED_SIZE
    ARGS_NAMES
    AUTH_TYPE
    ENV
    FILES
    FILES_COMBINED_SIZE
    FILES_NAMES
    FILES_SIZES
    FILES_TMPNAMES
    HTTP_
    MULTIPART_CRLF_LF_LINES
    MULTIPART_STRICT_ERROR
    MULTIPART_UNMATCHED_BOUNDARY
    PATH_INFO
    QUERY_STRING
    REMOTE_ADDR
    REMOTE_HOST
    REMOTE_PORT
    REMOTE_USER
    REQBODY_PROCESSOR
    REQBODY_PROCESSOR_ERROR
    REQBODY_PROCESSOR_ERROR_MSG
    REQUEST_BASENAME
    REQUEST_BODY
    REQUEST_COOKIES
    REQUEST_COOKIES_NAMES
    REQUEST_FILENAME
    REQUEST_HEADERS
    REQUEST_HEADERS_NAMES
    REQUEST_LINE
    REQUEST_METHOD
    REQUEST_PROTOCOL
    REQUEST_URI
    REQUEST_URI_RAW
    RESPONSE_BODY
    RESPONSE_HEADERS
    RESPONSE_HEADERS_NAMES
    RESPONSE_PROTOCOL
    RESPONSE_STATUS
    RULE
    SCRIPT_BASENAME
    SCRIPT_FILENAME
    SCRIPT_GID
    SCRIPT_GROUPNAME
    SCRIPT_MODE
    SCRIPT_UID
    SCRIPT_USERNAME
    SERVER_ADDR
    SERVER_NAME
    SERVER_PORT
    SESSION
    SESSIONID
    TIME
    TIME_DAY
    TIME_EPOCH
    TIME_HOUR
    TIME_MIN
    TIME_MON
    TIME_SEC
    TIME_WDAY
    TIME_YEAR
    TX
    USERID
    WEBAPPID
    WEBSERVER_ERROR_LOG
    XML

Transformation functions

    base64Decode
    base64Encode
    compressWhitespace
    escapeSeqDecode
    hexDecode
    hexEncode
    htmlEntityDecode
    lowercase
    md5
    none
    normalisePath
    normalisePathWin
    removeNulls
    removeWhitespace
    replaceComments
    replaceNulls
    urlDecode
    urlDecodeUni
    urlEncode
    sha1

Actions

    allow
    auditlog
    capture
    chain
    ctl
    deny
    deprecatevar
    drop
    exec
    expirevar
    id
    initcol
    log
    msg
    multiMatch
    noauditlog
    nolog
    pass
    pause
    phase
    proxy
    redirect
    rev
    sanitiseArg
    sanitiseMatched
    sanitiseRequestHeader
    sanitiseResponseHeader
    severity
    setuid
    setsid
    setenv
    setvar
    skip
    status
    t
    xmlns

Operators

    eq
    ge
    gt
    inspectFile
    le
    lt
    rbl
    rx
    validateByteRange
    validateDTD
    validateSchema
    validateUrlEncoding
    validateUtf8Encoding

==============================================================================

Addendum 2:
-----------
Apache directives exposed by mod_jk

JkWorkersFile
JkWorkerProperty
JkShmFile
JkShmSize
JkMountFile
JkMountFileReload
JkMount
JkUnMount
JkAutoAlias
JkMountCopy
JkWorkerIndicator
JkLogFile
JkLogLevel
JkLogStampFormat
JkRequestLogFormat
JkExtractSSL
JkHTTPSIndicator
JkCERTSIndicator
JkCIPHERIndicator
JkCERTCHAINPrefix
JkSESSIONIndicator
JkKEYSIZEIndicator
JkOptions
JkEnvVar
JkStripSession

==============================================================================

Addendum 3:
-----------
Apache directives exposed by mod_fcgid

IdleTimeout
IdleScanInterval
BusyTimeout
BusyScanInterval
ErrorScanInterval
ZombieScanInterval
ProcessLifeTime
SocketPath
SpawnScoreUpLimit
SpawnScore
TerminationScore
MaxProcessCount
DefaultMaxClassProcessCount
DefaultMinClassProcessCount
DefaultInitEnv
IPCConnectTimeout
IPCCommTimeout
OutputBufferSize
PHP_Fix_Pathinfo_Enable

==============================================================================

Addendum 4:
-----------
Probe names exported by mod_dtrace

receive-request
log-request
create-child
accept-connection
check-user-credentials
check-access
check-authorization


--Boundary_(ID_W/F6ABLY1olOe5NEZWS5GA)--

From jyri@buye.red.iplanet.com Fri Feb 15 16:10:18 2008
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m1G0AIUv026574
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 15 Feb 2008 16:10:18 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m1G0ADsD004846;
	Fri, 15 Feb 2008 17:10:16 -0700 (MST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JWB00M671T2UL00@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 15 Feb 2008 16:10:14 -0800 (PST)
Received: from buye.red.iplanet.com ([192.18.65.224])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JWB004GR1O3YJ80@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 15 Feb 2008 16:07:16 -0800 (PST)
Received: from buye.red.iplanet.com (localhost [127.0.0.1])
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7) with ESMTP id m1FNxkks025336; Fri,
 15 Feb 2008 15:59:46 -0800 (PST)
Received: (from jyri@localhost)
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7/Submit) id m1FNxkGd025335; Fri,
 15 Feb 2008 15:59:46 -0800 (PST)
Date: Fri, 15 Feb 2008 15:59:45 -0800
From: Jyri Virkki <Jyri.Virkki@sun.com>
Subject: Re: [webstack-discuss] Additional Apache2 Modules [PSARC/2008/090
 FastTrack timeout 2/15/2008]
In-reply-to: <20080213093955.GF4494@vayavyam.India.Sun.COM>
To: rahul <Rahul.G.Nair@sun.com>
Cc: PSARC-ext@sun.com, webstack-discuss@opensolaris.org
Message-id: <20080215235945.GO13839@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
 <20080208171203.GQ22027@zruty.sfbay.sun.com>
 <b61a4e530802080926v2931a67p35acdf02f4c9b0cd@mail.gmail.com>
 <20080211145931.GY4494@vayavyam.India.Sun.COM>
 <20080213065343.GO12197@sun.com> <20080213093955.GF4494@vayavyam.India.Sun.COM>
User-Agent: Mutt/1.5.11
Status: RO
Content-Length: 620

rahul wrote:
>
> Hi,
>     Updated arc draft attached, the changes are:
> change these
> | > apache_receive_request
> | > apache_log_request
> | > apache_create_child
> | > apache_accept_connection
> | > apache_check_user
> | > apache_check_access
> | > apache_check_authorization
> | > dtrace_register_hooks
> 
>  to the provider names as suggested by jyri.
> 
> |  receive-request
> |  log-request
> |  create-child
> |  accept-connection
> |  check-user-credentials
> |  check-access
> |  check-authorization

I've updated the copy in the case materials.


-- 
Jyri J. Virkki - jyri.virkki@sun.com - Sun Microsystems

From jyri@buye.red.iplanet.com Tue Feb 19 13:59:45 2008
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m1JLxj9w002165
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 19 Feb 2008 13:59:45 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m1JLxbw2018641;
	Tue, 19 Feb 2008 13:59:42 -0800 (PST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JWI0070FAFGKX00@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 19 Feb 2008 13:59:40 -0800 (PST)
Received: from buye.red.iplanet.com ([192.18.65.224])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JWI00JEVAFG2NA0@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 19 Feb 2008 13:59:40 -0800 (PST)
Received: from buye.red.iplanet.com (localhost [127.0.0.1])
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7) with ESMTP id m1JLqAwC011640; Tue,
 19 Feb 2008 13:52:10 -0800 (PST)
Received: (from jyri@localhost)
	by buye.red.iplanet.com (8.13.7+Sun/8.13.7/Submit) id m1JLqAWd011639; Tue,
 19 Feb 2008 13:52:10 -0800 (PST)
Date: Tue, 19 Feb 2008 13:52:10 -0800
From: Jyri Virkki <Jyri.Virkki@sun.com>
Subject: Re: Additional Apache2 Modules [PSARC/2008/090 FastTrack timeout
 2/15/2008]
In-reply-to: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
To: PSARC-ext@sun.com
Cc: Rahul.G.Nair@sun.com, webstack-discuss@opensolaris.org
Message-id: <20080219215210.GA11633@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.2.0.264296
References: <200802080424.m184Oo56026308@sac.sfbay.sun.com>
User-Agent: Mutt/1.5.11
Status: RO
Content-Length: 230


Discussion has died down and the materials have been updated with the
changes in this thread; I've now marked this case closed approved after
it timed out last Friday.

-- 
Jyri J. Virkki - jyri.virkki@sun.com - Sun Microsystems

