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

test: add missing test for rule 9520111 #4

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions plugins/sogo-rule-exclusions-before.conf
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,21 @@ SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Preferences/save$" \
t:none,\
nolog,\
ctl:ruleRemoveTargetById=920272;REQUEST_BODY,\
ctl:ruleRemoveTargetById=920273;REQUEST_BODY,\
ctl:ruleRemoveTargetById=920272;ARGS:defaults.SOGoTimeFormat,\
ctl:ruleRemoveTargetById=920273;ARGS:defaults.SOGoTimeFormat,\
ctl:ruleRemoveTargetById=920272;ARGS:defaults.SOGoLongDateFormat,\
ctl:ruleRemoveTargetById=920273;ARGS:defaults.SOGoLongDateFormat,\
ctl:ruleRemoveTargetById=920272;ARGS:defaults.SOGoShortDateFormat,\
ctl:ruleRemoveTargetById=920273;ARGS:defaults.SOGoShortDateFormat,\
ctl:ruleRemoveTargetById=920272;ARGS:json.defaults.SOGoTimeFormat,\
ctl:ruleRemoveTargetById=920273;ARGS:json.defaults.SOGoTimeFormat,\
ctl:ruleRemoveTargetById=920272;ARGS:json.defaults.SOGoLongDateFormat,\
ctl:ruleRemoveTargetById=920273;ARGS:json.defaults.SOGoLongDateFormat,\
ctl:ruleRemoveTargetById=920272;ARGS:json.defaults.SOGoShortDateFormat,\
ctl:ruleRemoveTargetById=920273;ARGS:json.defaults.SOGoShortDateFormat,\
ctl:ruleRemoveTargetById=931130;ARGS,\
ctl:ruleRemoveTargetById=932236;ARGS,\
ctl:ruleRemoveTargetById=942131;ARGS,\
ver:'sogo-rule-exclusions-plugin/1.0.0'"

Expand Down Expand Up @@ -261,6 +269,7 @@ SecRule REQUEST_FILENAME "@beginsWith /SOGo/dav" \
t:none,\
nolog,\
ctl:ruleRemoveTargetById=920272;REQUEST_BODY,\
ctl:ruleRemoveTargetById=920273;REQUEST_BODY,\
ctl:ruleRemoveTargetById=920273;XML:/*,\
ctl:ruleRemoveTargetById=942430;XML:/*,\
ctl:ruleRemoveTargetById=942431;XML:/*,\
Expand Down
49 changes: 49 additions & 0 deletions tests/regression/sogo-rule-exclusions-plugin/9520111.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
meta:
author: "Esad Cetiner"
description: "SOGo Rule Exclusions Plugin"
enabled: true
name: 9520111.yaml
tests:
- test_title: 9520111-1
desc: Changing settings
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: application/json;charset=UTF-8
port: 80
method: POST
uri: /SOGo/so/user@example.com/Preferences/save
data: |
{"nextAlarm":null,"nextInboxPoll":{},"currentToast":{},"lastUid":null,"notifications":{},
"defaults":{"SOGoLDAPGroupExpansionEnabled":0,"SOGoTimeFormat":"%H:%M","SOGoMailLabelsColors":{"$label2":["Work","#FF9900"],
"$label5":["Later","#993399"],"$label1":["Important","#FF0000"],"$label4":["To Do","#3333FF"],"$mdnsent":["Return Receipt Sent","#006600"],
"$label3":["Personal","#009900"],"$forwarded":["Forwarded","#B01FE3"]},"SOGoMailAutoSave":5,"SOGoAppointmentSendEMailNotifications":1,
"SOGoMailAddOutgoingAddresses":0,"SOGoCalendarCategories":["Customer","Calls","Favorites","Meeting","Ideas","Miscellaneous","Birthday",
"Anniversary","Vacation","Travel","Projects","Suppliers","Gifts","Clients","Issues","Business","Holidays","Personal","Status","Competition",
"Follow up","Public Holiday"],"SOGoMailUseSignatureOnReply":1,"UserTimeZoneSecondsFromGMT":-18000,
"SOGoCalendarCategoriesColors":{"Customer":"#F8D800","Calls":"#0396FF","Favorites":"#EA5455","Meeting":"#7367F0","Ideas":"#32CCBC","Miscellaneous":"#F6416C","Birthday":"#28C76F","Anniversary":"#9F44D3",
"Vacation":"#623AA2","Travel":"#F55555","Projects":"#8C1BAB","Suppliers":"#9708CC","Gifts":"#736EFE","Clients":"#E96D71","Issues":"#3677FF","Business":"#FA016D","Holidays":"#0E197D","Personal":"#DE4313","Status":"#002661",
"Competition":"#6018DC","Follow up":"#D939CD","Public Holiday":"#E80505"},"SOGoCalendarDefaultReminder":"NONE","SOGoPasswordRecoveryQuestion":"SecretQuestion1","CDefaultsSize":16777215,"SOGoLoginModule":"Mail","SOGoDayStartTime":"08:00",
"SOGoCalendarTasksDefaultClassification":"PUBLIC","SOGoCalendarWeekdays":["SU","MO","TU","WE","TH","FR","SA"],"SOGoPasswordRecoveryMode":"Disabled","SOGoTimeZone":"America/New_York","SOGoRefreshViewCheck":"every_5_minutes","SOGoAnimationMode":"normal",
"SOGoLanguage":"English","SOGoMailUseSignatureOnForward":1,"SOGoMailDisplayFullEmail":0,"LocaleCode":"en","SOGoSelectedAddressBook":"collected","SOGoMailUseSignatureOnNew":1,"SOGoContactsCategories":[" VIP"," Press"," Family","Colleague"," Customer"," Business Partner",
" Provider"," Friend"," Competitor"],"SOGoFirstWeekOfYear":"January1","SOGoShortDateFormat":"%d-%b-%y","SOGoMailHideInlineAttachments":0,"SOGoDefaultCalendar":"selected","SOGoFirstDayOfWeek":1,"SOGoTOTPEnabled":0,
"SOGoCalendarEventsDefaultClassification":"PUBLIC","SOGoMailComposeMessageType":"html","SOGoGravatarEnabled":0,"SOGoLongDateFormat":"%A, %B %d, %Y","AuxiliaryMailAccounts":[{"tlsVerifyMode":"allowInsecureLocalhost",
"specialMailboxes":{"Sent":"Sent","Trash":"Trash","Junk":"Junk","Drafts":"Drafts","Templates":"Templates"},"identities":[{"email":"postmaster@example.com","fullName":"postmaster","isDefault":1}],
"smtpTlsVerifyMode":"allowInsecureLocalhost","delegates":[],"smtpServerName":"127.0.0.1","serverName":"127.0.0.1","receipts":{"receiptNonRecipientAction":"ignore","receiptAnyAction":"ignore","receiptAction":"ignore","receiptOutsideDomainAction":"ignore"},
"encryption":"tls","smtpEncryption":"tls","name":"postmaster@example.com","smtpPort":587,"userName":"postmaster@example.com","port":143}],"SOGoMailDisplayRemoteInlineImages":"never","SOGoMailAutoMarkAsReadDelay":0,
"SOGoMailComposeFontSize":0,"SOGoMailMessageForwarding":"inline","SOGoMailReplyPlacement":"below","SOGoDayEndTime":"18:00","Vacation":{"days":[],"autoReplyEmailAddresses":["postmaster@example.com"],"daysBetweenResponse":7},"emailSeparatorKeys":[9,13,186,188],
"ckLocaleCode":"en","hasActiveExternalSieveScripts":false,"SOGoDesktopNotifications":0},"settings":{"Mail":{},"Contact":{"SortingState":["c_cn","1"]},"Calendar":{"FoldersOrder":["personal","1C0-65E5E900-1B-2141CA00"],"View":"monthview","FolderColors":{"postmaster@example.com:Calendar/personal":"#AAAAAA",
"postmaster@example.com:Calendar/1C0-65E5E900-1B-2141CA00":"#AAAAAA"},"NotifyOnPersonalModifications":{"postmaster@example.com:Calendar/personal":0,"postmaster@example.com:Calendar/1C0-65E5E900-1B-2141CA00":0},"EventsFilterState":"view_next7","SelectedList":"eventsListView",
"FreeBusyExclusions":{"postmaster@example.com:Calendar/personal":0,"postmaster@example.com:Calendar/1C0-65E5E900-1B-2141CA00":0},"WebCalendars":{"postmaster@example.com:Calendar/1C0-65E5E900-1B-2141CA00":"https://example.com/"},"InactiveFolders":[],
"NotifyOnExternalModifications":{"postmaster@example.com:Calendar/personal":1,"postmaster@example.com:Calendar/1C0-65E5E900-1B-2141CA00":1},"AutoReloadedWebCalendars":{"postmaster@example.com:Calendar/1C0-65E5E900-1B-2141CA00":1},
"NotifyUserOnPersonalModifications":{"postmaster@example.com:Calendar/personal":0,"postmaster@example.com:Calendar/1C0-65E5E900-1B-2141CA00":0},"TasksFilterState":"view_incomplete","TasksSortingState":["status","1"],"FolderSynchronize":{"postmaster@example.com:Calendar/personal":1},
"PreventInvitationsWhitelist":{},"EventsSortingState":["start","1"]},"ShowCompletedTasks":"0","General":{"PrivateSalt":"6c92b8b8d902cee3228ecacd0c33ad7433b451bf"}},"inboxSyncToken":"7-11"}
output:
no_log_contains: |
id "(?:920272|920273|931130|932236|942131)"