Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.

Commit 7c8727b

Browse files
authored
Merge pull request #890 from lifeforms/merge-v3.0-commits
Merge v3.0/dev commits into v3.1/dev
2 parents ce48026 + 97d5779 commit 7c8727b

File tree

156 files changed

+10839
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+10839
-31
lines changed

.travis.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1+
sudo: required
2+
services:
3+
- docker
14
language: python
25
python:
3-
- "2.7"
4-
install: "pip install -r ./util/integration/requirements.txt"
6+
- 2.7
7+
before_install:
8+
- docker pull owasp/modsecurity-crs
9+
- docker run -ti -e PARANOIA=5 -d --rm -p 80:80 -v /var/log/httpd:/var/log/httpd/ owasp/modsecurity-crs
10+
install:
11+
- pip install -r ./util/integration/requirements.txt
12+
- pip install -r ./util/regression-tests/requirements.txt
513
script:
6-
- py.test -vs ./util/integration/format_tests.py
14+
- py.test -vs ./util/integration/format_tests.py
15+
- py.test -vs util/regression-tests/CRS_Tests.py --rule=util/regression-tests/tests/test.yaml
16+
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-911-METHOD-ENFORCEMENT
17+
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-913-SCANNER-DETECTION
18+
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-921-PROTOCOL-ATTACK
19+
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-930-APPLICATION-ATTACK-LFI
20+
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-941-APPLICATION-ATTACK-XSS
21+
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-942-APPLICATION-ATTACK-SQLI
22+
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION
723
# safelist
824
branches:
925
only:
1026
- v3.0/dev
1127
- v3.0/master
1228
- v3.1/dev
29+
notifications:
30+
irc: "chat.freenode.net#modsecurity"

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
== Version 3.1.0 - 6/5/2017 ==
99

10-
== Version 3.0.2 - 5/FIXME/2017 ==
10+
== Version 3.0.2 - 5/12/2017 ==
1111

1212
* Remove debug rule that popped up in 3.0.1 (Christian Folini)
1313

CONTRIBUTORS

Lines changed: 0 additions & 11 deletions
This file was deleted.

CONTRIBUTORS.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Project Lead:
2+
3+
- [Chaim Sanders](https://github.com/csanders-git)
4+
5+
## Core Developers:
6+
7+
- [Christian Folini](https://github.com/dune73)
8+
- [Walter Hop](https://github.com/lifeforms)
9+
10+
## Developers:
11+
12+
- [Franziska Bühler](https://github.com/franbuehler)
13+
- [Christoph Hansen](https://github.com/emphazer)
14+
- [Victor Hora](https://github.com/victorhora)
15+
16+
## Contributors:
17+
18+
- [Zack Allen](https://github.com/zmallen)
19+
- [Ryan Barnett](https://github.com/rcbarnett)
20+
- [Jeremy Brown](https://github.com/jwbrown77)
21+
- [Jonathan Claudius](https://github.com/claudijd)
22+
- [Ashish Dixit](https://github.com/tundal45)
23+
- [FrozenSolid](https://github.com/frozenSolid)
24+
- [Michael Haas](https://github.com/MichaelHaas)
25+
- [jamuse](https://github.com/jamuse)
26+
- [Krzysztof Kotowicz](https://github.com/koto)
27+
- [Evgeny Marmalstein](https://github.com/shimshon70)
28+
- [Christian Mehlmauer](https://github.com/FireFart)
29+
- [Glyn Mooney](https://github.com/skidoosh)
30+
- [Robert Paprocki](https://github.com/p0pr0ck5)
31+
- [Christian Peron](https://github.com/csjperon)
32+
- [Elia Pinto](https://github.com/yersinia)
33+
- [Brian Rectanus](https://github.com/b1v1r)
34+
- [Federico G. Schwindt](https://github.com/fgsch)
35+
- Ofer Shezaf
36+
- Breno Silva
37+
- Marc Stern
38+
- [Ben Williams](https://github.com/benwilliams)
39+
- [Greg Wroblewski](https://github.com/gwroblew)
40+
- [ygrek](https://github.com/ygrek)
41+
- [Zino](https://github.com/zinoe)
42+
- [Felipe Zimmerle](https://github.com/zimmerle)
43+
- Josh Zlatin
44+
- [Zou Guangxian](https://github.com/zouguangxian)
45+
- [4ft35t](https://github.com/4ft35t)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Join the chat at https://gitter.im/owasp-crs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/owasp-crs/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2+
[![OWASP Flagship](https://img.shields.io/badge/owasp-flagship%20project-38a047.svg)](https://www.owasp.org/index.php/OWASP_Project_Inventory#tab=Flagship_Projects)
23

34
# OWASP ModSecurity Core Rule Set (CRS)
45

crs-setup.conf.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ SecDefaultAction "phase:2,log,auditlog,pass"
645645
#
646646
# Blocking based on reputation is permanent in the CRS. Unlike other rules,
647647
# which look at the indvidual request, the blocking of IPs is based on
648-
# a persistent record in the IP collection, which remains active for a
648+
# a persistent record in the IP collection, which remains active for a
649649
# certain amount of time.
650650
#
651651
# There are two ways an individual client can become flagged for blocking:

rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAME
6363
#
6464
# [ PHP Script Uploads ]
6565
#
66-
# Block file uploads with PHP extensions (.php, .php5, .phtml etc).
66+
# Block file uploads with filenames ending in PHP related extensions
67+
# (.php, .phps, .phtml, .php5 etc).
6768
#
6869
# Many application contain Unrestricted File Upload vulnerabilities.
6970
# https://www.owasp.org/index.php/Unrestricted_File_Upload
@@ -588,8 +589,8 @@ SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_F
588589
#
589590
# [ PHP Script Uploads: Superfluous extension ]
590591
#
591-
# Block file uploads with PHP extensions (.php, .php5, .phtml etc)
592-
# anywhere in the name, followed by a dot.
592+
# Block file uploads with PHP related extensions (.php, .phps, .phtml,
593+
# .php5 etc) anywhere in the name, followed by a dot.
593594
#
594595
# Example: index.php.tmp
595596
#

rules/REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAME
5252
setvar:tx.%{rule.id}-OWASP_CRS/WEB_ATTACK/SESSION_FIXATION-%{matched_var_name}=%{tx.0}"
5353

5454

55-
SecRule ARGS_NAMES "@rx ^(jsessionid|aspsessionid|asp.net_sessionid|phpsession|phpsessid|weblogicsession|session_id|session-id|cfid|cftoken|cfsid|jservsession|jwsession)$" \
55+
SecRule ARGS_NAMES "@rx ^(jsessionid|aspsessionid|asp\.net_sessionid|phpsession|phpsessid|weblogicsession|session_id|session-id|cfid|cftoken|cfsid|jservsession|jwsession)$" \
5656
"id:943110,\
5757
phase:2,\
5858
block,\

util/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM owasp/modsecurity:v2_master
2+
MAINTAINER Chaim Sanders [email protected]
3+
4+
ENV PARANOIA=1
5+
6+
RUN dnf -y update
7+
8+
RUN dnf -y install python
9+
10+
RUN cd /opt && \
11+
#wget https://github.com/SpiderLabs/owasp-modsecurity-crs/archive/v3.0.2.tar.gz && \
12+
#tar -xvzf v3.0.2.tar.gz && \
13+
git clone https://github.com/csanders-git/owasp-modsecurity-crs owasp-modsecurity-crs-3.0.2 && \
14+
cp -R /opt/owasp-modsecurity-crs-3.0.2/ /etc/httpd/modsecurity.d/owasp-crs/ && \
15+
mv /etc/httpd/modsecurity.d/owasp-crs/crs-setup.conf.example /etc/httpd/modsecurity.d/owasp-crs/crs-setup.conf && \
16+
cd /etc/httpd/modsecurity.d/owasp-crs/ && \
17+
git checkout v3.0/dev-za && \
18+
cd /etc/httpd/modsecurity.d && \
19+
printf "include modsecurity.d/owasp-crs/crs-setup.conf\ninclude modsecurity.d/owasp-crs/rules/*.conf" > include.conf && \
20+
sed -i -e 's/SecRuleEngine DetectionOnly/SecRuleEngine On/g' /etc/httpd/modsecurity.d/modsecurity.conf
21+
22+
COPY docker-entrypoint.sh /
23+
24+
EXPOSE 80
25+
26+
ENTRYPOINT ["/docker-entrypoint.sh"]
27+
CMD ["httpd", "-k", "start", "-D", "FOREGROUND"]

util/README

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
The util directory contains many supporting tools/scripts that may be used with
22
the OWASP ModSecurity CRS files.
3+
4+
Docker Support
5+
==============
6+
You can optionally specify
7+
the paranoia level
8+
of the resulting CRS image,
9+
using the PARANOIA build arg,
10+
as follows:
11+
```docker build -t owasp/modsecurity-crs .```
12+
```docker run -p 80:80 -ti -e PARANOIA=5 --rm owasp/modsecurity-crs```
13+
14+
Regression Tests
15+
================
16+
The regression tests
17+
are in the
18+
util/regression-tests
19+
folder.

0 commit comments

Comments
 (0)