Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

100% compatibility with OWASP CRS on Coraza v2 (99.96%) #105

Closed
11 tasks done
Tracked by #98
jptosso opened this issue Nov 17, 2021 · 1 comment · Fixed by #125
Closed
11 tasks done
Tracked by #98

100% compatibility with OWASP CRS on Coraza v2 (99.96%) #105

jptosso opened this issue Nov 17, 2021 · 1 comment · Fixed by #125
Labels
bug Something isn't working help wanted Extra attention is needed v2

Comments

@jptosso
Copy link
Member

jptosso commented Nov 17, 2021

Coraza v1 has achieved 90%+ compatibility but a complete redesign on Coraza v2 broke most of the compatibility. In order to get 100% compatibility we must find the issues that are breaking CRS.

  • Check which variables are failing to be created
  • Find bugs in the Coraza testing package
  • Find issues in algorithms like: rule phases, chains, rule flow (secmarks, skip, etc), ctl, tx variables, etc

Note: the coraza testsuite includes plugins for PCRE and libinjection, so please have them installed.

Create a CRS bundle:

  1. Join the default coraza config file, the crs config file and the rules from coreruleset/rules/*.conf
  2. Prepend the test configurations:
SecAction "id:900005,\
  phase:1,\
  nolog,\
  pass,\
  ctl:ruleEngine=DetectionOnly,\
  ctl:ruleRemoveById=910000,\
  setvar:tx.paranoia_level=4,\
  setvar:tx.crs_validate_utf8_encoding=1,\
  setvar:tx.arg_name_length=100,\
  setvar:tx.arg_length=400,\
  setvar:tx.combined_file_sizes=65535"
  1. Copy the .data files from rules/ to your bundle's path

Clone the test suite

git clone https://github.com/jptosso/coraza-testsuite

Update the coraza version

go get github.com/jptosso/coraza-waf/v2@LAST_REVISION

Run the test suite

#Compile or run:
go run *.go run -d ../coreruleset/tests/regression -r ../coreruleset/rules/rules.conf

The current results are posted in the first comment.

Currently detected issues (with status):

The following rules are being ignored because of URL encoding issues

  • 920181-1
  • 942490-17
  • 942260-17
  • 942260-6
  • 942150-6
  • 920240-1
  • 920240-5
  • 920240-6
  • 941130-11
  • 941130-2
  • 941130-4
  • 941130-6
  • 941130-9
  • 941130-10
  • 941130-12
  • 941130-14
  • 941130-16
@jptosso
Copy link
Member Author

jptosso commented Nov 17, 2021

Failed: ["920450-3","930120-5","932140-3","941280-2","941330-1","942100-10","942100-13","942101-6"]
Passed 2454/2462 (99.68% passed)

@jptosso jptosso added bug Something isn't working help wanted Extra attention is needed v2 labels Nov 17, 2021
@jptosso jptosso mentioned this issue Nov 19, 2021
18 tasks
@jptosso jptosso changed the title 100% compatibility with OWASP CRS on Coraza v2 (69%) 100% compatibility with OWASP CRS on Coraza v2 (85%) Nov 19, 2021
@jptosso jptosso changed the title 100% compatibility with OWASP CRS on Coraza v2 (85%) 100% compatibility with OWASP CRS on Coraza v2 (96%) Nov 19, 2021
@jptosso jptosso changed the title 100% compatibility with OWASP CRS on Coraza v2 (96%) 100% compatibility with OWASP CRS on Coraza v2 (97%) Nov 22, 2021
@jptosso jptosso changed the title 100% compatibility with OWASP CRS on Coraza v2 (97%) 100% compatibility with OWASP CRS on Coraza v2 (98%) Nov 22, 2021
@jptosso jptosso changed the title 100% compatibility with OWASP CRS on Coraza v2 (98%) 100% compatibility with OWASP CRS on Coraza v2 (99%) Nov 22, 2021
@jptosso jptosso changed the title 100% compatibility with OWASP CRS on Coraza v2 (99%) 100% compatibility with OWASP CRS on Coraza v2 (99.7%) Dec 10, 2021
@jptosso jptosso changed the title 100% compatibility with OWASP CRS on Coraza v2 (99.7%) 100% compatibility with OWASP CRS on Coraza v2 (99.96%) Dec 10, 2021
@jptosso jptosso linked a pull request Dec 11, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant