Skip to content

Commit b76f961

Browse files
hsluoyzvictorhora
authored andcommitted
Reformat the README to Markdown
1 parent a168669 commit b76f961

File tree

3 files changed

+128
-164
lines changed

3 files changed

+128
-164
lines changed

README.TXT

-110
This file was deleted.

README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
ModSecurity for Apache 2.x
2+
======
3+
4+
http://www.modsecurity.org/
5+
6+
Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
7+
8+
You may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
9+
10+
If any of the files related to licensing are missing or if you have any other questions related to licensing please contact Trustwave Holdings, Inc. directly using the email address: [email protected].
11+
12+
13+
## Documentation
14+
15+
Please refer to: [the documentation folder](https://github.com/SpiderLabs/ModSecurity/tree/v2/master/doc) for the reference manual.
16+
17+
## OWASP ModSecurity Core Rule Set (CRS)
18+
19+
Project Site: https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project
20+
21+
Download: https://github.com/SpiderLabs/owasp-modsecurity-crs
22+
23+
ModSecurity™ is a web application firewall engine that provides very little protection on its own. In order to become useful, ModSecurity™ must be configured with rules. In order to enable users to take full advantage of ModSecurity™ out of the box, Trustwave's SpiderLabs is providing a free certified rule set for ModSecurity™ 2.x.
24+
25+
Unlike intrusion detection and prevention systems, which rely on signatures specific to known vulnerabilities, the Core Rules provide generic protection from unknown vulnerabilities often found in web applications, which are in most cases custom coded. The Core Rules are heavily commented to allow it to be used as a step-by-step deployment guide for ModSecurity™.
26+
27+
### Core Rules Content
28+
29+
In order to provide generic web applications protection, the Core Rules use the following techniques:
30+
31+
* **HTTP Protection** - detecting violations of the HTTP protocol and a locally defined usage policy.
32+
* **Real-time Blacklist Lookups** - utilizes 3rd Party IP Reputation
33+
* **Web-based Malware Detection** - identifies malicious web content by check against the Google Safe Browsing API.
34+
* **HTTP Denial of Service Protections** - defense against HTTP Flooding and Slow HTTP DoS Attacks.
35+
* **Common Web Attacks Protection** - detecting common web application security attack.
36+
* **Automation Detection** - Detecting bots, crawlers, scanners and other surface malicious activity.
37+
* **Integration with AV Scanning for File Uploads** - detects malicious files uploaded through the web application.
38+
* **Tracking Sensitive Data** - Tracks Credit Card usage and blocks leakages.
39+
* **Trojan Protection** - Detecting access to Trojans horses.
40+
* **Identification of Application Defects** - alerts on application misconfigurations.
41+
* **Error Detection and Hiding** - Disguising error messages sent by the server.
42+
43+
## ModSecurity Rules from Trustwave SpiderLabs
44+
45+
Project Site: https://www.trustwave.com/modsecurity-rules-support.php
46+
47+
Download: https://ssl.trustwave.com/web-application-firewall
48+
49+
Trustwave now provides a commercial certified rule set for ModSecurity 2.x that protects against known attacks that target vulnerabilities in public software and are based on intelligence gathered from real-world investigations, honeypot data and research.
50+
51+
1. More than 16,000 specific rules, broken out into the following attack categories:
52+
53+
* SQL injection
54+
* Cross-site Scripting (XSS)
55+
* Local File Include
56+
* Remote File Include
57+
58+
2. User option for application specific rules, covering the same vulnerability classes for applications such as:
59+
60+
* WordPress
61+
* cPanel
62+
* osCommerce
63+
* Joomla
64+
* For a complete listing of application coverage, please refer to this link (which is updated daily): https://modsecurity.org/application_coverage.html
65+
66+
3. Complements and integrates with the OWASP Core Rule Set
67+
68+
4. IP Reputation capabilities which provide protection against malicious clients identified by the Trustwave SpiderLabs Distributed Web Honeypots
69+
70+
5. Malware Detection capabilities which prevent your web site from distributing malicious code to clients.
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
=====================================================================
2-
MOD_SECURITY 2.6 Command-line Build notes for Windows 4/2/2011
3-
by Tom Donovam
4-
=====================================================================
51

6-
PREREQUISITES:
2+
## ModSecurity 2.x Command-line build notes for Windows
73

8-
Microsoft Visual Studio C++ tested with Visual Studio 2008 (aka VC9)
4+
by Tom Donovam, 4/2/2011
95

10-
CMake build system from: http://www.cmake.org/ tested with CMake v2.8.0
116

12-
Apache 2.2.x from: http://httpd.apache.org/ tested with Apache 2.2.17
13-
Apache must be built from source using the same Visual Studio compiler as mod_security.
7+
## Prerequisites:
148

15-
PCRE Perl Compatible Regular Expression library from: http://www.pcre.org/ tested with PCRE v8.12
9+
Dependency | Tested with | Note
10+
----|------|----
11+
Microsoft Visual Studio C++ | Visual Studio 2008 (aka VC9) |
12+
[CMake build system](http://www.cmake.org/) | CMake v2.8.0 |
13+
[Apache 2.2.x](http://httpd.apache.org/) | Apache 2.2.17 | Apache must be built from source using the same Visual Studio compiler as mod_security.
14+
[PCRE, Perl Compatible Regular Expression library](http://www.pcre.org/) | PCRE v8.12
15+
[LibXML2](http://xmlsoft.org/) | LibXML2 v2.7.7 | Note that LibXML2 v2.7.8 does not build correctly for Windows
16+
[Lua Scripting Language](http://www.lua.org/) | Lua v5.1.4
17+
[cURL multiprotocol file transfer library](http://curl.haxx.se/) | cURL v7.21.4
1618

17-
LibXML2 from: http://xmlsoft.org/ tested with LibXML2 v2.7.7
18-
Note that LibXML2 v2.7.8 does not build correctly for Windows
1919

20-
Lua Scripting Language from: http://www.lua.org/ tested with Lua v5.1.4
20+
## Before building
2121

22-
cURL multiprotocol file transfer library from: http://curl.haxx.se/ tested with cURL v7.21.4
23-
24-
25-
BEFORE BUILDING
26-
27-
The directory where you build software from source ( C:\work in this exmaple)
22+
The directory where you build software from source ( ``C:\work`` in this exmaple)
2823
must contain the Apache source you used to build the Apache web serverand the mod_security source
2924

3025
Apache source is in C:\work\httpd-2.2.17 in this example.
3126
Apache has been installed to C:\Apache2217 in this example.
3227
Mod_security source is in C:\work\mod_security in this example.
3328

34-
Download and untar the prerequite library sources:
29+
## Download and untar the prerequisite library sources:
3530

3631
Download pcre-8.12.tar.gz from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
3732
untar it into C:\work\ creating C:\work\pcre-8.12
@@ -45,75 +40,87 @@ Download and untar the prerequite library sources:
4540
Download curl-7.21.4.tar.gz from http://curl.haxx.se/download.html
4641
untar it into C:\work\ creating C:\work\curl-7.21.4
4742

48-
Setup your build environment:
43+
## Setup your build environment:
44+
45+
1. The ``PATH`` environment variable must include the Visual Studio variables as set by ``vsvars32.bat``
46+
47+
2. The ``PATH`` environment variable must also include the CMAKE ``bin\`` directory
4948

50-
The PATH environment variable must include the Visual Studio variables as set by vsvars32.bat
51-
The PATH environment variable must also include the CMAKE bin\ directory
49+
3. Set an environment variable to the Apache source code directory:
5250

53-
Set an environment variable to the Apache source code directory:
51+
```
52+
SET HTTPD_BUILD=C:\work\httpd-2.2.17
53+
```
5454

55-
SET HTTPD_BUILD=C:\work\httpd-2.2.17
55+
### Optional:
5656

57-
If OpenSSL and Zlib support were included when you built Apache 2.2, and you want them available to LIBXML2 and CURL
57+
If OpenSSL and zlib support were included when you built Apache 2.2, and you want them available to LibXML2 and cURL
5858

59-
Ensure that cURL and libXML2 can find the OpenSSL and Zlib includes and libraries that Apache was built with.
59+
1. Ensure that cURL and LibXML2 can find the OpenSSL and zlib includes and libraries that Apache was built with.
6060

61-
SET INCLUDE=%INCLUDE%;%HTTPD_BUILD%\srclib\openssl\inc32;%HTTPD_BUILD%\srclib\zlib
62-
SET LIB=%LIB%;%HTTPD_BUILD%\srclib\openssl\out32dll;%HTTPD_BUILD%\srclib\zlib
61+
```
62+
SET INCLUDE=%INCLUDE%;%HTTPD_BUILD%\srclib\openssl\inc32;%HTTPD_BUILD%\srclib\zlib
63+
SET LIB=%LIB%;%HTTPD_BUILD%\srclib\openssl\out32dll;%HTTPD_BUILD%\srclib\zlib
64+
```
6365

64-
Ensure that cURL and libXML2 don't use the static zlib library: zlib.lib.
65-
Force cURL and libXML2 to use zdll.lib instead, requiring zlib1.dll at runtime:
66+
2. Ensure that cURL and libXML2 don't use the static zlib library: ``zlib.lib``. Force cURL and libXML2 to use ``zdll.lib`` instead, requiring ``zlib1.dll`` at runtime:
6667

67-
IF EXIST %HTTPD_BUILD%\srclib\zlib\zlib.lib DEL %HTTPD_BUILD%\srclib\zlib\zlib.lib
68+
```
69+
IF EXIST %HTTPD_BUILD%\srclib\zlib\zlib.lib DEL %HTTPD_BUILD%\srclib\zlib\zlib.lib
70+
```
6871

69-
BUILD PCRE-8.12
72+
## Build
73+
74+
### PCRE-8.12
7075

7176
CD C:\work\pcre-8.12
7277
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
7378
NMAKE
7479

75-
BUILD LIBXML2-2.7.7 (note: the more recent version: 2.7.8 does not build correctly on Windows)
80+
### LibXML2-2.7.7
81+
82+
Note: the more recent version: 2.7.8 does not build correctly on Windows)
7683

7784
CD C:\work\libxml2-2.7.7\win32
7885
CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes
7986
NMAKE -f Makefile.msvc
8087

81-
BUILD LUA-5.1.4
88+
### Lua-5.1.4
8289

8390
CD C:\work\lua-5.1.4\src
8491
CL /Ox /arch:SSE2 /GF /GL /Gy /FD /EHsc /MD /Zi /TC /wd4005 /D "_MBCS" /D "LUA_CORE" /D "LUA_BUILD_AS_DLL" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_WIN32" /D "_WINDLL" /c *.c
8592
DEL lua.obj luac.obj
8693
LINK /DLL /LTCG /DEBUG /OUT:lua5.1.dll *.obj
8794
IF EXIST lua5.1.dll.manifest MT -manifest lua5.1.dll.manifest -outputresource:lua5.1.dll;2
8895

89-
BUILD CURL-7.21.4
96+
### cURL-7.21.4
9097

9198
CD C:\work\curl-7.21.4
9299
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
93100
NMAKE
94101

95-
BUILD MOD_SECURITY-2.6
102+
### ModSecurity-2.6
96103

97104
CD C:\work\mod_security\apache2
98105
NMAKE -f Makefile.win APACHE=C:\Apache2217 PCRE=C:\work\pcre-8.12 LIBXML2=C:\work\libxml2-2.7.7 LUA=C:\work\lua-5.1.4\src
99106

100-
INSTALL MOD_SECURITY AND RUN APACHE
107+
## Install ModSecurity and run Apache
108+
109+
Copy these five files to ``C:\Apache2217\bin``:
101110

102-
Copy these five files to C:\Apache2217\bin:
103111
C:\work\pcre-8.12\pcre.dll C:\Apache2217\bin\
104112
C:\work\lua-5.1.4\src\lua5.1.dll C:\Apache2217\bin\
105113
C:\work\libxml2-2.7.7\win32\bin.msvc\libxml2.dll C:\Apache2217\bin\
106114
C:\work\curl-7.21.4\libcurl.dll C:\Apache2217\bin\
107115
C:\work\mod_security\apache2\mlogc-src\mlogc.exe
108116

109-
Copy this one file to C:\Apache2217\modules:
117+
Copy this one file to ``C:\Apache2217\modules``:
110118

111119
C:\work\mod_security\apache2\mod_security2.so
112120

113-
You may also copy C:\work\curl-7.21.4\curl.exe to C:\Apache2217\bin, if you want to use the cURL command-line program.
121+
You may also copy ``C:\work\curl-7.21.4\curl.exe`` to ``C:\Apache2217\bin``, if you want to use the cURL command-line program.
114122

115-
Download the core rules from http://sourceforge.net/projects/mod-security/files/modsecurity-crs/0-CURRENT/
116-
and unzip them into C:\Apache2217\conf\modsecurity_crs
123+
Download the core rules from http://sourceforge.net/projects/mod-security/files/modsecurity-crs/0-CURRENT/ and unzip them into ``C:\Apache2217\conf\modsecurity_crs``
117124

118125
Add configuration directives to your Apache conf\httpd.conf:
119126

@@ -134,11 +141,9 @@ Add configuration directives to your Apache conf\httpd.conf:
134141
SecAuditLog logs/modsecurity.log
135142
</IfModule>
136143

144+
## Optional: Build and configure the ModSecurity-2.x MLOGC piped-logging program
137145

138-
==============================================================================================
139-
OPTIONAL: BUILD AND CONFIGURE THE MOD_SECURITY-2.6 MLOGC piped-logging program
140-
141-
Edit the top of C:\work\mod_security\apache2\mlogc-src\Makefile.win and set your local paths
146+
Edit the top of ``C:\work\mod_security\apache2\mlogc-src\Makefile.win`` and set your local paths
142147

143148
# Path to Apache httpd installation
144149
BASE = C:\Apache2217
@@ -154,19 +159,19 @@ Edit the top of C:\work\mod_security\apache2\mlogc-src\Makefile.win and set your
154159
$(CURL)\libcurl_imp.lib \
155160
wsock32.lib
156161

157-
Build the mlogc.exe program:
162+
Build the ``mlogc.exe`` program:
158163

159164
CD C:\work\mod_security_trunk\mlogc
160165
NMAKE -f Makefile.win
161166

162-
Copy mlocg.exe to C:\Apache2217\bin\
167+
Copy ``mlocg.exe`` to ``C:\Apache2217\bin\``
163168

164-
Create a new command file C:\Apache2217\bin\mlogc.bat with one line:
169+
Create a new command file ``C:\Apache2217\bin\mlogc.bat`` with one line:
165170

166171
C:\Apache2217\bin\mlogc.exe C:\Apache2217\conf\mlogc.conf
167172

168-
Create a new configuration file C:\Apache2217\conf\mlogc.conf to control the piped-logging program mlogc.exe.
169-
Here is an example conf\mlogc.conf:
173+
Create a new configuration file ``C:\Apache2217\conf\mlogc.conf`` to control the piped-logging program ``mlogc.exe``.
174+
Here is an example ``conf\mlogc.conf``:
170175

171176
CollectorRoot "C:/Apache2217/logs"
172177
ConsoleURI "https://localhost:8888/rpc/auditLogReceiver"
@@ -186,7 +191,6 @@ Here is an example conf\mlogc.conf:
186191
CheckpointInterval 15
187192
ServerErrorTimeout 60
188193

189-
Change the SecAuditLog directive in conf\httpd.conf to pipe the log data to mlogc
190-
instead of writing them to a file:
194+
Change the SecAuditLog directive in ``conf\httpd.conf`` to pipe the log data to mlogc instead of writing them to a file:
191195

192196
SecAuditLog |C:/Apache2217/bin/mlogc.bat

0 commit comments

Comments
 (0)