-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: create regression tests for all rules (#1)
* test: create 9520100 regression test * test: fix folder location * test: create 9520101 regression test * test: create 9520102 regression test * test: create 9520141, 9520142 and 9520143 regression tests * test: create 9520133, 9520110, 9502104 regression tests * test: create 9520140 regression test * test: create regression tests 9520130 9520131 9520132 * test: create 9520121 and 9520120 regression tests * fix: add blank newline to actions * fix: typos
- Loading branch information
1 parent
6d46b65
commit 905cad8
Showing
19 changed files
with
744 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
integration-tests: | ||
uses: coreruleset/crs-plugin-test-action/.github/workflows/integration.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
plugin-lint: | ||
uses: coreruleset/crs-plugin-test-action/.github/workflows/lint.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
meta: | ||
author: "Esad Cetiner" | ||
description: "SOGo Rule Exclusions Plugin" | ||
enabled: true | ||
name: 9520100.yaml | ||
tests: | ||
- test_title: 9520100-1 | ||
desc: Disable 920272 for cookie header | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
cookie: \% | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/ | ||
output: | ||
no_log_contains: id "920272" | ||
- test_title: 9520100-2 | ||
desc: Disable 942450 for XSRF-TOKEN cookie | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
cookie: XSRF-TOKEN=0x0806 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/ | ||
output: | ||
no_log_contains: id "942450" | ||
- test_title: 9520100-3 | ||
desc: Disable 942450 for 0xHIGHFLYxSOGo cookie | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
cookie: 0xHIGHFLYxSOGo=0x0800 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/ | ||
output: | ||
no_log_contains: id "942450" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
meta: | ||
author: "Esad Cetiner" | ||
description: "SOGo Rule Exclusions Plugin" | ||
enabled: true | ||
name: 9520101.yaml | ||
tests: | ||
- test_title: 9520101-1 | ||
desc: Disable OWASP_CRS for password box when logging in | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/connect?json.password=<script> | ||
output: | ||
no_log_contains: id "941110" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
meta: | ||
author: "Esad Cetiner" | ||
description: "SOGo Rule Exclusions Plugin" | ||
enabled: true | ||
name: 9520102.yaml | ||
tests: | ||
- test_title: 9520102-1 | ||
desc: Disable 920440 if uri ends in com | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/example.com | ||
output: | ||
no_log_contains: id "920440" | ||
- test_title: 9520102-2 | ||
desc: Disable 920440 if uri ends in com | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/so/example.com | ||
output: | ||
no_log_contains: id "920440" | ||
- test_title: 9520102-3 | ||
desc: Disable 920440 if uri ends in com | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/dav/example.com | ||
output: | ||
no_log_contains: id "920440" | ||
- test_title: 9520102-4 | ||
desc: Disable 920440 if uri ends in inc | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/example.inc | ||
output: | ||
no_log_contains: id "920440" | ||
- test_title: 9520102-5 | ||
desc: Disable 920440 if uri ends in inc | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/so/example.inc | ||
output: | ||
no_log_contains: id "920440" | ||
- test_title: 9520102-6 | ||
desc: Disable 920440 if uri ends in inc | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
port: 80 | ||
method: POST | ||
uri: /SOGo/dav/example.inc | ||
output: | ||
no_log_contains: id "920440" |
135 changes: 135 additions & 0 deletions
135
tests/regression/sogo-rule-exclusions-plugin/9520104.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
--- | ||
meta: | ||
author: "Esad Cetiner" | ||
description: "SOGo Rule Exclusions Plugin" | ||
enabled: true | ||
name: 9520104.yaml | ||
tests: | ||
- test_title: 9520104-1 | ||
desc: Disable OWASP CRS for email body when sending an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/send?json.text=<script> | ||
output: | ||
no_log_contains: id "941110" | ||
- test_title: 9520104-2 | ||
desc: Disable OWASP CRS for email body when saving an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/save?json.text=<script> | ||
output: | ||
no_log_contains: id "941110" | ||
- test_title: 9520104-3 | ||
desc: Disable OWASP CRS for email subject when sending an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/send?json.subject=<script> | ||
output: | ||
no_log_contains: id "941110" | ||
- test_title: 9520104-4 | ||
desc: Disable OWASP CRS for email subject when saving an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/save?json.subject=<script> | ||
output: | ||
no_log_contains: id "941110" | ||
- test_title: 9520104-5 | ||
desc: Disable 942131 for source email address when saving an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/save?json.from=<[email protected]>Postmaster | ||
output: | ||
no_log_contains: id "942131" | ||
- test_title: 9520104-6 | ||
desc: Disable 942131 for source email address when sending an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/send?json.from=<[email protected]>Postmaster | ||
output: | ||
no_log_contains: id "942131" | ||
- test_title: 9520104-7 | ||
desc: Disable 942131 for destination email address when saving an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/save?json.to.array_0=<[email protected]>Postmaster | ||
output: | ||
no_log_contains: id "942131" | ||
- test_title: 9520104-8 | ||
desc: Disable 942131 for destination email address when sending an email | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: SOGo rule exclusions plugin | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: text/vcard | ||
port: 80 | ||
method: GET | ||
uri: /SOGo/so/[email protected]/Mail/4/folderDrafts/newDraft-4/send?json.to.array_0=<[email protected]>Postmaster | ||
output: | ||
no_log_contains: id "942131" |
Oops, something went wrong.