diff --git a/plugins/sogo-rule-exclusions-before.conf b/plugins/sogo-rule-exclusions-before.conf index 7ab74ae..9cc8a14 100644 --- a/plugins/sogo-rule-exclusions-before.conf +++ b/plugins/sogo-rule-exclusions-before.conf @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------------------------- # sogo rule exclusions plugin -# Copyright (c) 2023 Esad Cetiner +# Copyright (c) 2023-2024 Esad Cetiner # # This plugin is distributed under GPLv2 # Please see the included LICENSE file for full details @@ -132,6 +132,7 @@ SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Preferences/save$" \ # # When creating/modifying contacts +# Adding websites for contacts SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Contacts/[^/]+/[^/]+\.vcf/saveAsContact$" \ "id:9520120,\ phase:1,\ diff --git a/plugins/sogo-rule-exclusions-config.conf b/plugins/sogo-rule-exclusions-config.conf index 03256d6..f42ba5f 100644 --- a/plugins/sogo-rule-exclusions-config.conf +++ b/plugins/sogo-rule-exclusions-config.conf @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------------------------- # sogo rule exclusions plugin -# Copyright (c) 2023 Esad Cetiner +# Copyright (c) 2023-2024 Esad Cetiner # # This plugin is distributed under GPLv2 # Please see the included LICENSE file for full details diff --git a/tests/regression/sogo-rule-exclusions-plugin/9520120.yaml b/tests/regression/sogo-rule-exclusions-plugin/9520120.yaml new file mode 100644 index 0000000..61a6298 --- /dev/null +++ b/tests/regression/sogo-rule-exclusions-plugin/9520120.yaml @@ -0,0 +1,22 @@ +--- +meta: + author: "Esad Cetiner" + description: "SOGo Rule Exclusions Plugin" + enabled: true + name: 9520120.yaml +tests: + - test_title: 9520120-1 + desc: Disable 931130 for ARGS:json.urls.array_0.value + 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: GET + uri: /SOGo/so/user@example.com/Contacts/work-contacts/john-doe.vcf/saveAsContact?json.urls.array_0.value=https://example.com/ + output: + no_log_contains: id "931130" diff --git a/tests/regression/sogo-rule-exclusions-plugin/9520121.yaml b/tests/regression/sogo-rule-exclusions-plugin/9520121.yaml new file mode 100644 index 0000000..d78c2c0 --- /dev/null +++ b/tests/regression/sogo-rule-exclusions-plugin/9520121.yaml @@ -0,0 +1,22 @@ +--- +meta: + author: "Esad Cetiner" + description: "SOGo Rule Exclusions Plugin" + enabled: true + name: 9520121.yaml +tests: + - test_title: 9520121-1 + desc: Disable 931130 for ARGS:json.cardDavURL + 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: GET + uri: /SOGo/so/user@example.com/Contacts/work-contacts/save?json.cardDavURL=https://example.com/ + output: + no_log_contains: id "931130"