Skip to content

Commit

Permalink
test: create regression tests 9520130 9520131 9520132
Browse files Browse the repository at this point in the history
  • Loading branch information
EsadCetiner authored Jan 8, 2024
1 parent f36bc03 commit fdabd00
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/sogo-rule-exclusions-before.conf
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Contacts/[^/]+/save$" \
#

# When creating/modifying a calendar task
# Attaching external URLs to a calendar task
SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Calendar/[^/]+/[^/]+\.ics/(?:saveAsTask|save)$" \
"id:9520130,\
phase:1,\
Expand All @@ -180,6 +181,7 @@ SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Calendar/[^/]+/[^/]+\.ics/(?:saveA
ver:'sogo-rule-exclusions-plugin/1.0.0'"

# When creating/modifying a calendar event
# Attaching external URLs to a calendar event
SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Calendar/[^/]+/[^/]+\.ics/(?:saveAsAppointment|occurence[0-9]+/save)$" \
"id:9520131,\
phase:1,\
Expand All @@ -198,6 +200,7 @@ SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Calendar/[^/]+/[^/]+\.ics/(?:saveA
ver:'sogo-rule-exclusions-plugin/1.0.0'"

# When modifying properties for Calendars
# Adding a remote webcal
SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Calendar/[^/]+/save$" \
"id:9520132,\
phase:1,\
Expand Down
37 changes: 37 additions & 0 deletions tests/regression/sogo-rule-exclusions-plugin/9520130.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
meta:
author: "Esad Cetiner"
description: "SOGo Rule Exclusions Plugin"
enabled: true
name: 9520130.yaml
tests:
- test_title: 9520130-1
desc: Disable 931130 for ARGS:json.attachUrls.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/[email protected]/Calendar/mycalendar/calendar.ics/saveAsTask?json.attachUrls.array_0.value=https://example.com/
output:
no_log_contains: id "931130"
- test_title: 9520130-2
desc: Disable 931130 for ARGS:json.attachUrls.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/[email protected]/Calendar/mycalendar/calendar.ics/save?json.attachUrls.array_0.value=https://example.com/
output:
no_log_contains: id "931130"
37 changes: 37 additions & 0 deletions tests/regression/sogo-rule-exclusions-plugin/9520131.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
meta:
author: "Esad Cetiner"
description: "SOGo Rule Exclusions Plugin"
enabled: true
name: 9520131.yaml
tests:
- test_title: 9520131-1
desc: Disable 931130 for ARGS:json.attachUrls.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/[email protected]/Calendar/mycalendar/calendar.ics/occurence42/save?json.attachUrls.array_0.value=https://example.com/
output:
no_log_contains: id "931130"
- test_title: 9520131-2
desc: Disable 931130 for ARGS:json.attachUrls.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/[email protected]/Calendar/mycalendar/calendar.ics/saveAsAppointment?json.attachUrls.array_0.value=https://example.com/
output:
no_log_contains: id "931130"
82 changes: 82 additions & 0 deletions tests/regression/sogo-rule-exclusions-plugin/9520132.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
meta:
author: "Esad Cetiner"
description: "SOGo Rule Exclusions Plugin"
enabled: true
name: 9520132.yaml
tests:
- test_title: 9520132-1
desc: Disable 931130 for ARGS:json.urls.webDavICSURL
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/[email protected]/Calendar/mycalendar/save?json.urls.webDavICSURL=https://example.com/
output:
no_log_contains: id "931130"
- test_title: 9520132-2
desc: Disable 931130 for ARGS:json.urls.webDavXMLURL
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/[email protected]/Calendar/mycalendar/save?json.urls.webDavXMLURL=https://example.com/
output:
no_log_contains: id "931130"
- test_title: 9520132-3
desc: Disable 931130 for ARGS:json.urls.webDavURL
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/[email protected]/Calendar/mycalendar/save?json.urls.webDavURL=https://example.com/
output:
no_log_contains: id "931130"
- test_title: 9520132-4
desc: Disable 931130 for ARGS:json.urls.calDavURL
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/[email protected]/Calendar/mycalendar/save?json.urls.calDavURL=https://example.com/
output:
no_log_contains: id "931130"
- test_title: 9520132-5
desc: Disable 931130 for ARGS:json.urls.webCalendarURL
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/[email protected]/Calendar/mycalendar/save?json.urls.webCalendarURL=https://example.com/
output:
no_log_contains: id "931130"

0 comments on commit fdabd00

Please sign in to comment.