Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
376 commits
Select commit Hold shift + click to select a range
1d26417
Added rev,ver,severity and expirevar
fzipi Oct 5, 2017
bb13a87
Merge branch 'v3.1/dev-contributing' of github.com:fzipi/owasp-modsec…
fzipi Oct 5, 2017
9522dba
split rule 942410 into 942410, 942470, 942480 and small correction in…
franbuehler Oct 9, 2017
6346194
remove trailing slash in 942410, 942470 and 942480
franbuehler Oct 9, 2017
0191e81
remove another trailing whitespace in 942410
franbuehler Oct 9, 2017
846b57c
added source regexp-942400.data and newly optimized rule 942400
franbuehler Oct 9, 2017
64f5d9b
Fix broken links in references
gpasztor87 Oct 13, 2017
30bc65e
Merge pull request #887 from fzipi/v3.1/dev-issue882
dune73 Oct 14, 2017
dede1d1
Merge pull request #879 from fzipi/v3.1/dev-contributing
dune73 Oct 14, 2017
873471c
Update reference links
gpasztor87 Oct 16, 2017
974d83b
Update reference links
gpasztor87 Oct 16, 2017
b14564c
Merge pull request #915 from gpasztor87/v3.1/dev
dune73 Oct 16, 2017
ece9e78
Merge remote-tracking branch 'upstream/v3.1/dev' into sqli-rulerevision2
franbuehler Oct 20, 2017
99c7971
adding missing ignore case flag to 942470 and 942480
franbuehler Oct 20, 2017
ce48026
Merge pull request #910 from fgsch/fgsch/issue-909
dune73 Oct 20, 2017
ef07ec4
added a missing regex to rule 942310
franbuehler Oct 20, 2017
97d5779
Merge branch 'v3.1/dev' into merge-v3.0-commits
dune73 Oct 20, 2017
d0bab2f
example to url rule 920220
coolt Oct 20, 2017
7c8727b
Merge pull request #890 from lifeforms/merge-v3.0-commits
dune73 Oct 20, 2017
d97d086
Add slash after localhost
coolt Oct 20, 2017
d78180a
Merge pull request #921 from coolt/example-920220-3.1
franbuehler Oct 20, 2017
3caaad6
Adding myself as contributor
fzipi Oct 23, 2017
0b5687f
Following category suggestion
fzipi Oct 23, 2017
2eb45e4
changed regexp-942170.data to circumvent regexp-assemble bug
franbuehler Oct 24, 2017
24ecc31
changed regexp-942360.data to circumvent regexp-assemble bug and opti…
franbuehler Oct 24, 2017
e5a65e3
changed regexp-942130.data to circumvent regexp-assemble bug and opti…
franbuehler Oct 24, 2017
580e33b
correction in 942190
franbuehler Oct 30, 2017
12b32f2
correction in 942340
franbuehler Oct 30, 2017
920e963
optimize regexp-942340.data and rule 942340
franbuehler Oct 31, 2017
80a017b
optimize regexp-942340.data and rule 942340
franbuehler Oct 31, 2017
6f8d10d
Merge pull request #907 from franbuehler/sqli-rulerevision2
emphazer Oct 31, 2017
46031e5
Tidy up single quotes and other polishing
fgsch Nov 1, 2017
8901aad
Merge pull request #922 from fzipi/v3.1/dev
csanders-git Nov 6, 2017
c37b1a2
Adding fgsch and spartantri as developers
dune73 Nov 7, 2017
02a163f
Pushing zimmerle up; adding GH handle for Marc Stern
dune73 Nov 7, 2017
5226a30
Merge pull request #950 from dune73/update-contributors-nov-2017
csanders-git Nov 7, 2017
5e6a664
Add configurable timestamp format to our ftw integration
dune73 Nov 9, 2017
0652365
reverting default path to apache error log on linux
dune73 Nov 9, 2017
070484d
syntax fix for setvar crs_exclusions_wordpress
spartantri Nov 10, 2017
97be718
Merge pull request #954 from spartantri/v3.1/dev
dune73 Nov 10, 2017
44bb833
Merge pull request #940 from fgsch/fgsch/rule-cleanup-contd
fzipi Nov 14, 2017
fb67fae
Fix typo
fzipi Nov 14, 2017
b236f6e
Correcting tags for skipping per CONTRIBUTING
fzipi Nov 14, 2017
f223366
Rollback quoting skipAfter
fzipi Nov 16, 2017
68cf450
consistent copyright statement format, update date
paralax Nov 16, 2017
8c72246
update copyright date, it's 2017
paralax Nov 16, 2017
7de2fca
Merge pull request #956 from fzipi/v3.1/dev-marker
fzipi Nov 16, 2017
de9b026
Merge pull request #962 from paralax/v3.1/copyright-update
csanders-git Nov 16, 2017
2362660
More reorder and cleanups
fgsch Nov 16, 2017
82ee8fe
Merge pull request #964 from fgsch/fgsch/more-cleanup
dune73 Nov 25, 2017
a8ea72f
933131 checks should be case -insensitive
spartantri Nov 27, 2017
3a4ac03
Comment 910110 back
fgsch Nov 27, 2017
8bfbbda
Merge pull request #973 from fgsch/fgsch/revert-back-910110
dune73 Nov 27, 2017
c72137f
Commenting out the rest of 910110
dune73 Nov 27, 2017
24bc82e
Merge pull request #976 from dune73/more-commenting-for-910110
emphazer Nov 28, 2017
15d39e8
try to exit early if rules fail to load
fzipi Nov 30, 2017
855583e
Merge badges with 3.0/master
fzipi Dec 4, 2017
b9fdc80
Typo in comment
dune73 Dec 7, 2017
3ea4240
Rules for NextCloud installs (and possibly OwnCloud).
bagley Dec 8, 2017
25b1786
Rules for Dokuwiki.
bagley Dec 8, 2017
a601fec
Also check if Transfer-Encoding is missing
fgsch Dec 10, 2017
c6abfc0
Merge pull request #953 from dune73/add-configurable-timestamp-format…
franbuehler Dec 13, 2017
bf1cffe
Merge pull request #981 from dune73/typo-may
franbuehler Dec 14, 2017
7098fd4
according to PR 957
emphazer Dec 15, 2017
4207ae0
Merge pull request #985 from emphazer/v3_942370_3.1/dev
dune73 Dec 15, 2017
cf4d2f1
Add logdata to some rules (#980)
fzipi Dec 15, 2017
8ddf92f
Remove duplicated variables
fgsch Dec 18, 2017
bc35431
Merge pull request #987 from fgsch/fgsch/duplicated-variables
dune73 Dec 19, 2017
bf632f3
Merge pull request #984 from fgsch/fgsch/issue_975
dune73 Dec 19, 2017
8b6b24d
Java attacks
spartantri Dec 28, 2017
846399d
Java attacks sintax fix
spartantri Dec 28, 2017
c5f106c
Java attacks regex rx
spartantri Dec 28, 2017
212e7bf
Adjusted format to match cContributing.md plus 1 PL4 rule
spartantri Dec 31, 2017
036dcef
Fixed false positive in PL4
spartantri Jan 1, 2018
a360288
Unnecessary auditlog noise reduced
spartantri Jan 2, 2018
a21c199
File upload checks
spartantri Jan 2, 2018
1053a83
File upload checks
spartantri Jan 2, 2018
755a753
Updating year
fzipi Jan 2, 2018
1fb2b57
Fixed indentation
spartantri Jan 2, 2018
95df058
Fixed indentation
spartantri Jan 2, 2018
8eb5163
Fixed indentation
spartantri Jan 2, 2018
9d9a8d4
File upload rules
spartantri Jan 2, 2018
69b25c3
PR990
spartantri Jan 2, 2018
1317ef2
Better rules for editing pages.
bagley Jan 5, 2018
082a02f
Allow the config to be saved.
bagley Jan 5, 2018
e0aee28
Show the index, even if things like "postgresql" or other things show up
bagley Jan 5, 2018
f52221f
Only check login vars if do=login.
bagley Jan 5, 2018
6e9c442
For performance, only do admin rules if do=admin.
bagley Jan 5, 2018
6791f4b
Clean up some comments.
bagley Jan 5, 2018
0bfff6a
Remove white spaces
bagley Jan 5, 2018
96b4fb3
Changed 944100 to nolog
spartantri Jan 8, 2018
c65f065
Adjusted transforms for 944320 due to false negative
spartantri Jan 8, 2018
9c8b72e
921110 add track and path and 921150 lowercase X
spartantri Jan 8, 2018
e93b210
Added ftw template for 944 ruleset
spartantri Jan 9, 2018
b744167
Initial ftw tests for 944100 and 944200
spartantri Jan 10, 2018
0ddaebf
Test 944200-8 test adjusted
spartantri Jan 10, 2018
156bcdb
ftw tests for 944210
spartantri Jan 10, 2018
9999e59
ftw tests for 944300
spartantri Jan 10, 2018
1984633
Uses MULTIPART_MISSING_SEMICOLON instead of MULTIPART_SEMICOLON_MISSING
Jan 11, 2018
07243c6
Merge pull request #995 from zimmerle/v3.1/dev
emphazer Jan 11, 2018
ce36ede
Added struts-pwn UA to list
spartantri Jan 12, 2018
608c9dd
Java attack tests and test generation script
spartantri Jan 14, 2018
875f3af
Script rule generation and more 944 tests
spartantri Jan 14, 2018
b9b0a6f
Undo 933131 change
spartantri Jan 14, 2018
93b2edc
Adjusted rule log messages
spartantri Jan 19, 2018
4d78a1d
944300 raw and b64 tests added
spartantri Jan 23, 2018
766f32b
Add tx.crs_exclusions_nextcloud=1 to crs-setup.conf.example
bagley Jan 24, 2018
fca4fef
Use a tag rather than a range of rules.
bagley Jan 24, 2018
cb95a50
Condense the explanation at the top of the file.
bagley Jan 24, 2018
040e18b
Add crs_exclusions_dokuwik=1 to crs-setup.conf.example
bagley Jan 24, 2018
ae5722a
Condense description at the top of the file.
bagley Jan 24, 2018
0813c16
Use tag for attack-injection-php (930000-933999).
bagley Jan 24, 2018
071b1e8
Don't allow anything on the login username.
bagley Jan 24, 2018
985438f
ruleRemoveTargetByTag=CRS for wikitext/suffix/prefix ARGS on page edits.
bagley Jan 24, 2018
d06651a
Renumbered rules.
bagley Jan 24, 2018
1e49f37
On page edits, remove 'wikitext' check, and allow 930100 for REQUEST_…
bagley Jan 24, 2018
a6382a5
Remove the upload limit for scanned files. Let the user decide on this.
bagley Jan 25, 2018
8ae9c4b
removed conflict
spartantri Jan 30, 2018
eebf625
Merge branch 'v3.1/dev' into v3.1/dev
spartantri Jan 30, 2018
2256ad9
removed tailing blank space at line 344
spartantri Jan 30, 2018
758082a
942120: fix 'superlike' FP
lifeforms Feb 4, 2018
d2a5ac9
Merge pull request #982 from bagley/v3.1/dev-nextcloud
dune73 Feb 5, 2018
714ea3e
Merge branch 'v3.1/dev' into v3.1/dev-dokuwiki
dune73 Feb 5, 2018
b0feead
Merge pull request #983 from bagley/v3.1/dev-dokuwiki
dune73 Feb 5, 2018
36b1a4e
Fixup and small reorg of dokuwiki rule exlcusion package
dune73 Feb 5, 2018
4613df8
Fixed indentation and moved 944340 to 944220
spartantri Feb 5, 2018
456e30b
Fixed indentation and moved 944340 to 944220
spartantri Feb 5, 2018
7d38495
Moved 944340 to 944220
spartantri Feb 5, 2018
2c5593b
Merge pull request #977 from fzipi/v3.1/dev-break-build-if-bad-ruleset
csanders-git Feb 5, 2018
7f44f87
Added pmf to 944230 and java-classes.data
spartantri Feb 5, 2018
0a1e326
942410 had unescaped quotes
spartantri Feb 5, 2018
0b7c589
both rules had unescaped quotes and missing quotes
spartantri Feb 5, 2018
5b94378
localhost to "127.0.0.1"
spartantri Feb 5, 2018
440dd30
944230 set to critical
spartantri Feb 5, 2018
ff5e98c
Removed tests
spartantri Feb 5, 2018
ac0f1e7
undo 942410 test change
spartantri Feb 5, 2018
72011b6
readded the tests
spartantri Feb 5, 2018
d93ce1b
changed all rules to block
spartantri Feb 6, 2018
dd2731c
Merge pull request #1011 from dune73/fixup-dokuwiki2
dune73 Feb 8, 2018
2cdcf28
Adjusted PLs and severities
spartantri Feb 11, 2018
959c1c3
Adjusted PLs and severities
spartantri Feb 11, 2018
59cc1a2
Adjusted tests and test script
spartantri Feb 11, 2018
8f93725
Merge pull request #1009 from lifeforms/superlike
lifeforms Feb 12, 2018
e8cc868
missing transform, 944120 sibbling 944240
spartantri Feb 13, 2018
be4a612
Consistency
fgsch Feb 19, 2018
87ddf88
Quote SecMarkers
fgsch Feb 20, 2018
91dc8ca
Merge pull request #1017 from fgsch/consistency
dune73 Feb 23, 2018
0d5110d
921160: Optimized regex. Using phase 1 and GET only.
allanrbo Feb 2, 2018
c9d1b2c
921160: Updated tests
allanrbo Feb 2, 2018
79bf7ba
Fix Dockerfile in v3/dev
csanders-git Mar 5, 2018
8aeb7af
Update .travis.yml
csanders-git Mar 5, 2018
9bc9ba8
Update .travis.yml
csanders-git Mar 5, 2018
cd19898
Update .travis.yml
csanders-git Mar 5, 2018
c8ec248
Update Dockerfile
csanders-git Mar 5, 2018
3bac233
fix 942410 tests which were split
Mar 5, 2018
325b57c
933100 fix to isolate test to one parameter
csanders-git Feb 4, 2018
aa57da5
Updating PHP variable to be case sensative
csanders-git Feb 4, 2018
62b863b
Fixing FP caused by Apache not processing request
Feb 5, 2018
0b0396c
Switching 920430 test that causes FTW invalid response to expect an e…
Feb 5, 2018
1f8477f
Changing test to look for status codes so it can support Apache block…
Feb 5, 2018
8b8454f
Apache will automagically fix quoted numerical content-lengths
Feb 5, 2018
67833d7
Fixing to account for Apache erroring out instead of pushing through …
Feb 5, 2018
ba48067
Fixing to address apache returning a 400 because of invalid request
Feb 5, 2018
9bc5e41
Fixing which rules trigger to reflect PL levels
Feb 5, 2018
79e074f
933150 was split into 933170 and 933150 and so we need to split the t…
Feb 5, 2018
ce5f04e
Changing the test to isolate to one test and ensure that apache block…
Feb 5, 2018
f5b9637
fixing Apache blocking 920430 before it reaches CRS
Feb 5, 2018
7e4de0c
Fixing false positives caused by apache blocking request prematurely
Feb 5, 2018
7a3d168
Changing response to expect an error as Apache will let this type of …
Feb 5, 2018
4d5689a
Fixed the tests wrongly set to fail
Feb 5, 2018
f56d358
fixing the bad tests for 933110
Feb 5, 2018
a1cba01
Merge pull request #990 from spartantri/v3.1/dev
lifeforms Mar 5, 2018
6c5f455
false positives 942360: move alter and union
franbuehler Feb 10, 2018
3fc606f
description change
franbuehler Feb 10, 2018
1ba8ec7
Fixup of the nextcloud rule exclusions
dune73 Mar 6, 2018
4d42952
Merge pull request #1029 from dune73/fixup-nextcloud-2
dune73 Mar 6, 2018
0e3e374
Update docker to use ubuntu base.
csanders-git Mar 8, 2018
1843914
Fix entrypoint for docker with ubuntu
csanders-git Mar 8, 2018
e9b2786
Update Travis CI config for ubuntu
csanders-git Mar 8, 2018
7c5048e
Update log location to reflect ubuntu
csanders-git Mar 8, 2018
fbf2a58
Remove extra -i from travis update.
csanders-git Mar 8, 2018
81b33f1
fix return code of github.
csanders-git Mar 8, 2018
f144627
Update .travis.yml
csanders-git Mar 8, 2018
fc4a912
Adjust logging location
csanders-git Mar 8, 2018
494a97b
Adding 'F-Secure Radar' vulnerability scanner
dune73 Mar 14, 2018
34e8a40
Skip PUT parsing for invalid encoding / protocol violations in binary…
emphazer Mar 15, 2018
307656c
Update REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf
emphazer Mar 15, 2018
3766cbe
Merge pull request #1040 from emphazer/owncloud1
dune73 Mar 15, 2018
c25b7eb
added nextcloud client support and several other modifications.
emphazer Mar 20, 2018
c425d9a
added nextcloud client support and several other modifications.
emphazer Mar 20, 2018
c986b27
changed version to v3.1
emphazer Mar 20, 2018
1c0a07d
changed rule ids
emphazer Mar 20, 2018
584ba6a
added support for shared writable content
emphazer Mar 20, 2018
76134d1
regex dot correction
emphazer Mar 20, 2018
26cf641
legacy support for v1 filesharing api
emphazer Mar 20, 2018
8491d29
added exclusions for the search field
emphazer Mar 20, 2018
8ec1dd3
Moved 944000 to 901170
spartantri Mar 19, 2018
03f6412
Moved 914 init to 901
spartantri Mar 19, 2018
d2c5091
Update REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf
emphazer Mar 21, 2018
8832c49
Update REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf
emphazer Mar 21, 2018
820e236
added regression test for 942490
emphazer Mar 21, 2018
f637a9c
Update REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf
emphazer Mar 21, 2018
d3f0d8a
Explicitly ignore the user defined rules (v3.1)
csanders-git Mar 21, 2018
d2a22d8
Adding contrib for @everspace
csanders-git Mar 21, 2018
5cb2f51
Update REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf
emphazer Mar 23, 2018
b0195c7
Fix some spellings in the comments
Mar 25, 2018
d757197
Merge pull request #1047 from emphazer/owncloud2
dune73 Apr 2, 2018
190105b
Fix regression test by setting arg length limit.
csanders-git May 7, 2018
b6fcaf8
Update Dockerfile
csanders-git May 7, 2018
15476be
Fix for 933151 rebase
csanders-git May 7, 2018
78f9234
added 2 important php sql connection errors for outbound
emphazer May 9, 2018
06c18ed
added space at the end
emphazer May 9, 2018
407b774
Merge pull request #1091 from emphazer/php-db-error
lifeforms May 9, 2018
f41616a
fix missing strings in 942410
franbuehler May 15, 2018
27312fc
Merge pull request #1093 from franbuehler/fix-942410
emphazer May 15, 2018
eabdd65
bring back PHP closing tag '?>' detection
lifeforms May 20, 2018
ad9f8ca
restricted-upload.data: blacklist for upload file names
lifeforms May 20, 2018
ddd481e
restricted-upload.data: add WordPress config file name
lifeforms May 20, 2018
0725421
Drupal 8: add settings.local.php to restricted files
lifeforms May 21, 2018
2b57e20
lfi-os-files: add entries, most were suggested by emphazer
lifeforms May 27, 2018
37a85b3
lfi-os-files: add more WordPress config variants
lifeforms May 27, 2018
ce09d36
lfi, restricted files: update Node entries
lifeforms May 27, 2018
c1aff25
lfi, restricted files: add Webpack
lifeforms May 27, 2018
13c7bc6
lfi, restricted: sync dotfiles between these two data files
lifeforms May 27, 2018
6ef0c02
lfi, restricted: add common zsh history files
lifeforms May 27, 2018
ef360c9
WordPress: exclude Add Media, Insert Media, Insert into page
lifeforms May 27, 2018
b677e4b
Move 944400 and create variable tx.enforce_bodyproc_urlencoded
dune73 May 30, 2018
c875186
add ws_ftp, DS_Store, nsconfig, netrc
paralax May 31, 2018
44f21c7
Change wording of doc for tx.enforce_bodyproc_urlencoded
dune73 Jun 2, 2018
88e4a5f
Add comment about tx.enforce_bodyproc_urlencoded near 920340
dune73 Jun 2, 2018
dfc42dc
Merge pull request #1101 from lifeforms/wordpress-fp-insertmedia
dune73 Jun 2, 2018
b090c87
cPanel whm-server-status FP report
emphazer Jun 4, 2018
cc8d9ae
cPanel whm-server-status FP report
emphazer Jun 4, 2018
6e1aeb4
Drop unnecessary capture groups
fgsch May 31, 2018
f441428
Merge pull request #1106 from dune73/move-944400
emphazer Jun 4, 2018
07b113f
regexp-cmdline.py: fix bypass by multiple spaces
lifeforms May 27, 2018
acb1783
RCE: fix bypass by using multiple spaces in 'jobs -x'
lifeforms May 27, 2018
811860f
PHP close tag: add comment to refer to new rule
lifeforms Jun 4, 2018
212e42f
PHP close tag: renumber to fit CRS style
lifeforms Jun 4, 2018
a2e24bb
Merge pull request #1094 from lifeforms/php-close-tag
dune73 Jun 4, 2018
2741281
Add or remove capture as appropriate
fgsch May 31, 2018
48f5771
Merge pull request #1107 from fgsch/capture-tidyup
dune73 Jun 5, 2018
acf4d34
Move rule id 944400 to 901350
dune73 Jun 5, 2018
2d3efa2
Merge pull request #1119 from SpiderLabs/renumber-944400-to-901350
dune73 Jun 5, 2018
4e362d8
Merge remote-tracking branch 'upstream/v3.1/dev' into restricted-upload
lifeforms Jun 10, 2018
19f6506
restricted-files, lfi-os-files: add TypeORM ormconfig.json
lifeforms Jun 10, 2018
0fcdb0e
Merge pull request #1095 from lifeforms/restricted-upload
dune73 Jun 12, 2018
c5a44c7
Use phase number instead of string
fgsch Jun 12, 2018
76661d5
init v3.2 commit
csanders-git Jul 4, 2018
26f0be9
Merge branch 'v3.2/dev' into v3.2/dev
spartantri Jul 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
crs-setup.conf
*.swp
*.swo

# User configuration
crs-setup.conf
rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf

# The MaxMind GeoIP database can be downloaded or upgraded by running:
# util/upgrade.py geoip
util/geo-location/GeoIP.dat
Expand All @@ -12,4 +16,4 @@ util/geo-location/GeoIP.dat
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*$py.class
25 changes: 22 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
sudo: required
services:
- docker
language: python
python:
- "2.7"
install: "pip install -r ./util/integration/requirements.txt"
- 2.7
before_install:
- docker build --build-arg REPO=$TRAVIS_PULL_REQUEST_SLUG --build-arg COMMIT=$TRAVIS_PULL_REQUEST_SHA -t modsecurity-crs ./util/
- docker run -ti -e PARANOIA=5 -d --rm -p 80:80 -v /var/log/apache2:/var/log/apache2/ modsecurity-crs
install:
- pip install -r ./util/integration/requirements.txt
- pip install -r ./util/regression-tests/requirements.txt
script:
- py.test -vs ./util/integration/format_tests.py
- docker ps | grep -q modsecurity-crs || exit 1
- py.test -vs ./util/integration/format_tests.py
- py.test -vs util/regression-tests/CRS_Tests.py --rule=util/regression-tests/tests/test.yaml
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-911-METHOD-ENFORCEMENT
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-913-SCANNER-DETECTION
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-921-PROTOCOL-ATTACK
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-930-APPLICATION-ATTACK-LFI
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-941-APPLICATION-ATTACK-XSS
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-942-APPLICATION-ATTACK-SQLI
- py.test -vs util/regression-tests/CRS_Tests.py --ruledir=util/regression-tests/tests/REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION
# safelist
branches:
only:
- v3.0/dev
- v3.0/master
- v3.1/dev
notifications:
irc: "chat.freenode.net#modsecurity"
4 changes: 3 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
or the CRS mailinglist at
* https://lists.owasp.org/mailman/listinfo/owasp-modsecurity-core-rule-set

== Version 3.0.2 - 5/FIXME/2017 ==
== Version 3.1.0 - 6/5/2017 ==

== Version 3.0.2 - 5/12/2017 ==

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

Expand Down
151 changes: 151 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Contributing to the CRS

We value third-party contributions. To keep things simple for you and us,
please adhere to the following contributing guidelines.

## Getting Started

* You will need a [GitHub account](https://github.com/signup/free).
* Submit a [ticket for your issue](https://github.com/SpiderLabs/owasp-modsecurity-crs/issues), assuming one does not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug.
* Make sure you specify the version that you know has the issue.
* Bonus points for submitting a failing test along with the ticket.
* If you don't have push access, fork the repository on GitHub.

## Making Changes

* Please base your changes on branch ```v3.1/dev```
* Create a topic branch for your feature or bug fix.
* Make commits of logical units.
* Make sure your commits adhere to the rules guidelines below.
* Make sure your commit messages are in the [proper format](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html): The first line of the message should have 50 characters or less, separated by a blank line from the (optional) body. The body should be wrapped at 70 characters and paragraphs separated by blank lines. Bulleted lists are also fine.

## General Formatting Guidelines for rules contributions

- 4 spaces per indentation level, no tabs
- no trailing whitespace at EOL or trailing blank lines at EOF
- comments are good, especially when they clearly explain the rule
- try to adhere to a 80 character line length limit
- if it is a [chained rule](https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#chain), alignment should be like
```
SecRule .. ..\
"...."
SecRule .. ..\
"..."
SecRule .. ..\
".."
```
- use quotes even if there is only one action, it improves readability (e.g use `"chain"`, not `chain`, or `"ctl:requestBodyAccess=Off"` instead of `ctl:requestBodyAccess=Off`)
- always use numbers for phases, instead of names
- format your `SecMarker` between double quotes, using UPPERCASE and separating words using hyphens. Examples are
```
SecMarker "END-RESPONSE-959-BLOCKING-EVALUATION"
SecMarker "END-REQUEST-910-IP-REPUTATION"
```
- the proposed order for actions is:
```
id
phase
disruptive-action
status
capture
t:xxx
log
nolog
auditlog
noauditlog
msg
logdata
tag
sanitiseArg
sanitiseRequestHeader
sanitiseMatched
sanitiseMatchedBytes
ctl
setenv
rev
ver
severity
setvar
expirevar
chain
skip
skipAfter
```

## Variables naming conventions

* Variable names are lowercase using chars from `[a-z0-9_]`
* To somewhat reflect the fact that the syntax for variable usage is different when you define it (using setvar) and when you use it, we propose the following visual distinction:
* Lowercase letters for collection, dot as separator, variable name. E.g: `setvar:tx.foo_bar_variable`
* Capital letters for collection, colon as separator, variable name. E.g: `SecRule TX:foo_bar_variable`

## Rules compliance with each Paranoia Level (PL)

Rules in the CRS are organized in Paranoia Levels, which allows you to choose the desired level of rule checks.

Please read file ```crs-setup.conf.example``` for introduction and a more detailed explanation of Paranoia Levels in the section `# -- [[ Paranoia Level Initialization ]]`.

**PL0:**

* Modsec installed, but almost no rules

**PL1:**

* Default level, keep in mind that most installations will normally use this one.
* If there is a complex memory consuming/evaluation rule it surely will be on upper levels, not this one
* Normally we will use atomic checks in single rules
* Confirmed matches only, all scores are allowed
* No false positives / Low FP (Try to avoid adding rules with potential false positives!)
* False negatives could happen

**PL2:**

* Chains usage are OK
* Confirmed matches use score critical
* Matches that cause false positives are limited to use score notice or warning
* Low False positive rates
* False negatives are not desirable

**PL3:**

* Chains usage with complex regex look arounds and macro expansions
* Confirmed matches use score warning or critical
* Matches that cause false positives are limited to use score notice
* False positive rates increased but limited to multiple matches (not single string)
* False negatives should be a very unlikely accident

**PL4:**

* Every item is inspected
* Variable creations allowed to avoid engine limitations
* Confirmed matches use score notice, warning or critical
* Matches that cause false positives are limited to use score notice and warning
* False positive rates increased (even on single string)
* False negatives should not happen here
* Check everything against RFC and white listed values for most popular elements


## ID Numbering Scheme

The CRS project used the numerical id rule namespace from 900,000 to 999,999 for the CRS rules as well as 9,000,000 to 9,999,999 for default CRS rule exclusion packages.

Rules applying to the incoming request use the id range 900,000 to 949,999.
Rules applying to the outgoing response use the id range 950,000 to 999,999.

The rules are grouped by vulnerability class they address (SQLi, RCE, etc.) or functionality (initialization). These groups occupy blocks of thousands (e.g. SQLi: 942,000 - 942,999).
The grouped rules are defined in files dedicated to a single group or functionality. The filename takes up the first three digits of the rule ids defined within the file (e.g. SQLi: REQUEST-942-APPLICATION-ATTACK-SQLI.conf).

The individual rule files for the vulnerability classes are organized by the paranoia level of the rules. PL 1 is first, then PL 2 etc.

The block from 9XX000 - 9XX099 is reserved for use by CRS helper functionality. There are no blocking or filtering rules in this block.

Among the rules serving a CRS helper functionality are rules that skip rules depending on the paranoia level. These rules always use the following reserved rule ids: 9XX011-9XX018 with very few exceptions.

The blocking or filter rules start with 9XX100 with a step width of 10. E.g. 9XX100, 9XX110, 9XX120 etc. The rule id does not correspond directly with the paranoia level of a rule. Given the size of a rule group and the organization by lower PL rules first, PL2 and above tend to have rule IDs with higher numbers.

Within a rule file / block, there are sometimes smaller groups of rules that belong to together. They are closely linked and very often represent copies of the original rules with a stricter limit (alternatively, they can represent the same rule addressing a different target in a second rule where this was necessary). These are stricter siblings of the base rule. Stricter siblings usually share the first five digits of the rule ID and raise the rule ID by one. E.g. Base rule at 9XX160, stricter sibling at 9XX161.

Stricter siblings often have a different paranoia level. This means that the base rule and the stricter sibling do not reside next to one another in the rule file. Instead they are ordered in their appropriate paranoia level and can be linked via the first digits of the rule id. It is a good practice to introduce stricter siblings together with the base rule in the comments of the base rule and to reference the base rule with the keyword stricter sibling in the comments of the stricter sibling. E.g. "... This is
performed in two separate stricter siblings of this rule: 9XXXX1 and 9XXXX2", "This is a stricter sibling of rule 9XXXX0."

10 changes: 0 additions & 10 deletions CONTRIBUTORS

This file was deleted.

48 changes: 48 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Project Lead:

- [Chaim Sanders](https://github.com/csanders-git)

## Core Developers:

- [Christian Folini](https://github.com/dune73)
- [Walter Hop](https://github.com/lifeforms)

## Developers:

- [Franziska Bühler](https://github.com/franbuehler)
- [Christoph Hansen](https://github.com/emphazer)
- [Victor Hora](https://github.com/victorhora)
- [Federico G. Schwindt](https://github.com/fgsch)
- [Manuel Spartan](https://github.com/spartantri)
- [Felipe Zimmerle](https://github.com/zimmerle)
- [Felipe Zipitría](https://github.com/fzipi)

## Contributors:

- [Zack Allen](https://github.com/zmallen)
- [Ryan Barnett](https://github.com/rcbarnett)
- [Jeremy Brown](https://github.com/jwbrown77)
- [Jonathan Claudius](https://github.com/claudijd)
- [Ashish Dixit](https://github.com/tundal45)
- [FrozenSolid](https://github.com/frozenSolid)
- [Aaron Haaf](https://github.com/Everspace)
- [Michael Haas](https://github.com/MichaelHaas)
- [jamuse](https://github.com/jamuse)
- [Krzysztof Kotowicz](https://github.com/koto)
- [Evgeny Marmalstein](https://github.com/shimshon70)
- [Christian Mehlmauer](https://github.com/FireFart)
- [Glyn Mooney](https://github.com/skidoosh)
- [Robert Paprocki](https://github.com/p0pr0ck5)
- [Christian Peron](https://github.com/csjperon)
- [Elia Pinto](https://github.com/yersinia)
- [Brian Rectanus](https://github.com/b1v1r)
- Ofer Shezaf
- Breno Silva
- [Marc Stern](https://github.com/marcstern)
- [Ben Williams](https://github.com/benwilliams)
- [Greg Wroblewski](https://github.com/gwroblew)
- [ygrek](https://github.com/ygrek)
- [Zino](https://github.com/zinoe)
- Josh Zlatin
- [Zou Guangxian](https://github.com/zouguangxian)
- [4ft35t](https://github.com/4ft35t)
3 changes: 2 additions & 1 deletion KNOWN_BUGS
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ or the CRS mailinglist at
with an error such as:
Error parsing actions: Unknown action: \\
Action 'configtest' failed.
This bug is known to plague RHEL 7 and Ubuntu 14.04 LTS users.
This bug is known to plague RHEL/Centos 7 below v7.4 or
httpd v2.4.6 release 67 and Ubuntu 14.04 LTS users.
https://bz.apache.org/bugzilla/show_bug.cgi?id=55910
We advise to upgrade your Apache version. If upgrading is not possible,
we have provided a script in the util/join-multiline-rules directory
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![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)![Travis build v3.1/dev](https://badges.herokuapp.com/travis/SpiderLabs/owasp-modsecurity-crs?branch=v3.1/dev&label=CRS%20v3.1/dev)![Travis build v3.0/dev](https://badges.herokuapp.com/travis/SpiderLabs/owasp-modsecurity-crs?branch=v3.0/dev&label=CRS%20v3.0/dev)![Travis build v3.0/master](https://badges.herokuapp.com/travis/SpiderLabs/owasp-modsecurity-crs?branch=v3.0/master&label=CRS%20v3.0/master)[![OWASP Flagship](https://img.shields.io/badge/owasp-flagship%20project-38a047.svg)](https://www.owasp.org/index.php/OWASP_Project_Inventory#tab=Flagship_Projects)
[![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)![Travis build v3.1/dev](https://badges.herokuapp.com/travis/SpiderLabs/owasp-modsecurity-crs?branch=v3.1/dev&label=CRS%20v3.1/dev)![Travis build v3.0/dev](https://badges.herokuapp.com/travis/SpiderLabs/owasp-modsecurity-crs?branch=v3.0/dev&label=CRS%20v3.0/dev)![Travis build v3.0/master](https://badges.herokuapp.com/travis/SpiderLabs/owasp-modsecurity-crs?branch=v3.0/master&label=CRS%20v3.0/master)
[![OWASP Flagship](https://img.shields.io/badge/owasp-flagship%20project-38a047.svg)](https://www.owasp.org/index.php/OWASP_Project_Inventory#tab=Flagship_Projects)

# OWASP ModSecurity Core Rule Set (CRS)

Expand All @@ -20,7 +21,7 @@ We strive to make the OWASP ModSecurity CRS accessible to a wide audience of beg

## License

Copyright 2006-2018 Trustwave and contributors.
Copyright (c) 2006-2018 Trustwave and contributors. All rights reserved.

The OWASP ModSecurity Core Rule Set is distributed under Apache Software License (ASL) version 2. Please see the enclosed LICENSE file for full details.

41 changes: 36 additions & 5 deletions crs-setup.conf.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ------------------------------------------------------------------------
# OWASP ModSecurity Core Rule Set ver.3.0.2
# Copyright (c) 2006-2016 Trustwave and contributors. All rights reserved.
# OWASP ModSecurity Core Rule Set ver.3.2.0
# Copyright (c) 2006-2017 Trustwave and contributors. All rights reserved.
#
# The OWASP ModSecurity Core Rule Set is distributed under
# Apache Software License (ASL) version 2
Expand Down Expand Up @@ -166,6 +166,10 @@ SecDefaultAction "phase:2,log,auditlog,pass"
# example: [tag "paranoia-level/2"]. This allows you to deduct from the
# audit log how the WAF behavior is affected by paranoia level.
#
# It is important to also look into the variable
# tx.enforce_bodyproc_urlencoded (Enforce Body Processor URLENCODED)
# defined below. Enabling it closes a possible bypass of CRS.
#
# Uncomment this rule to change the default:
#
#SecAction \
Expand All @@ -177,6 +181,30 @@ SecDefaultAction "phase:2,log,auditlog,pass"
# setvar:tx.paranoia_level=1"


#
# -- [[ Enforce Body Processor URLENCODED ]] -----------------------------------
#
# ModSecurity selects the body processor based on the Content-Type request
# header. But clients are not always setting the Content-Type header for their
# request body payloads. This will leave ModSecurity with limited vision into
# the payload. The variable tx.enforce_bodyproc_urlencoded lets you force the
# URLENCODED body processor in these situations. This is off by default, as it
# implies a change of the behaviour of ModSecurity beyond CRS (the body
# processor applies to all rules, not only CRS) and because it may lead to
# false positives already on paranoia level 1. However, enabling this variable
# closes a possible bypass of CRS so it should be considered.
#
# Uncomment this rule to change the default:
#
#SecAction \
# "id:900010,\
# phase:1,\
# nolog,\
# pass,\
# t:none,\
# setvar:tx.enforce_bodyproc_urlencoded=1"


#
# -- [[ Anomaly Mode Severity Levels ]] ----------------------------------------
#
Expand Down Expand Up @@ -288,7 +316,7 @@ SecDefaultAction "phase:2,log,auditlog,pass"
# It is recommended if you run multiple web applications on your site to limit
# the effects of the exclusion to only the path where the excluded webapp
# resides using a rule similar to the following example:
# SecRule REQUEST_URI "@beginsWith /wordpress/" setvar:crs_exclusions_wordpress=1
# SecRule REQUEST_URI "@beginsWith /wordpress/" setvar:tx.crs_exclusions_wordpress=1

#
# Modify and uncomment this rule to select which application:
Expand All @@ -300,7 +328,10 @@ SecDefaultAction "phase:2,log,auditlog,pass"
# pass,\
# t:none,\
# setvar:tx.crs_exclusions_drupal=1,\
# setvar:tx.crs_exclusions_wordpress=1"
# setvar:tx.crs_exclusions_wordpress=1,\
# setvar:tx.crs_exclusions_nextcloud=1,\
# setvar:tx.crs_exclusions_dokuwik=1,\
# setvar:tx.crs_exclusions_cpanel=1"

#
# -- [[ HTTP Policy Settings ]] ------------------------------------------------
Expand Down Expand Up @@ -645,7 +676,7 @@ SecDefaultAction "phase:2,log,auditlog,pass"
#
# Blocking based on reputation is permanent in the CRS. Unlike other rules,
# which look at the indvidual request, the blocking of IPs is based on
# a persistent record in the IP collection, which remains active for a
# a persistent record in the IP collection, which remains active for a
# certain amount of time.
#
# There are two ways an individual client can become flagged for blocking:
Expand Down
Loading