From a538daef0336307f18e8cb845a684a37ff2d2a41 Mon Sep 17 00:00:00 2001 From: Esad Cetiner <104706115+EsadCetiner@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:40:37 +1100 Subject: [PATCH] test: create 9520100 regression test --- .github/workflows/integration.yml | 6 ++++ .github/workflows/lint.yml | 6 ++++ tests/9520100.yaml | 55 +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 .github/workflows/integration.yml create mode 100644 .github/workflows/lint.yml create mode 100644 tests/9520100.yaml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..07c6990 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,6 @@ +--- +on: [push, pull_request] + +jobs: + integration-tests: + uses: coreruleset/crs-plugin-test-action/.github/workflows/integration.yaml@main \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..0c64c25 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,6 @@ +--- +on: [push, pull_request] + +jobs: + plugin-lint: + uses: coreruleset/crs-plugin-test-action/.github/workflows/lint.yaml@main \ No newline at end of file diff --git a/tests/9520100.yaml b/tests/9520100.yaml new file mode 100644 index 0000000..77ea322 --- /dev/null +++ b/tests/9520100.yaml @@ -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: /post + 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: /post + output: + no_log_contains: id "942450" + - test_title: 9520100-3 + desc: Disable 942450 for identviewsplitter cookie name + 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: /post + output: + no_log_contains: id "942450"