fix(o365): stop alert floods from nine Office 365 rules - #2776
Merged
Merged
Conversation
These rules alerted on routine Microsoft 365 activity once v11.2.14 kept OneDrive file access and download records, and the rule flood guard then switched them off. Each changed rule now raises one alert per identity and suppresses repeats for seven days instead of grouping every event, and triggers only on volumes far above everyday use: - Microsoft 365 Mailbox Mass Item Access: 2,000 MailItemsAccessed records per identity within 1h (was every record). Exchange groups the messages one client reads within two minutes into one record. - OneDrive Mass File Access: 1,000 FileAccessed, FileAccessedExtended or FilePreviewed records per operation and identity within 1h (was 67 in 30m). - SharePoint Mass File Download: 500 FileDownloaded records per identity within 1h (was 100 in 30m). - Suspicious Teams Message Export Activity: 100 Teams records per identity within 1h (was 20). MessagesListed is logged only for Graph API reads, which backup and compliance tools make continuously. - Mass Email Deletion: 200 HardDelete or 5,000 SoftDelete records per user within 1h (was 100 of either in 15m). - Potential Password Spraying: 50 UserLoginFailed records per IP address within 10m (was any 5 records from the address in 60s). - O365 Audit Log Purge: HardDelete is a mailbox purge, not audit data, and no longer triggers it; mass purges are Mass Email Deletion. - O365 Admin Role Assignment: only "Add member to role."; group membership and user consent grants are not role assignments. - O365 Admin Role/Permission Granted is removed: its "Update user." proxy matched almost every user update, and real role assignments are covered by O365 Admin Role Assignment. Operation meanings come from Microsoft's audit log activities reference. o365_alert_volume_test.go pins the thresholds, windows, history scopes and de-duplication keys with fabricated records. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kryonsx
marked this pull request as ready for review
September 29, 2026 22:32
Resolve the conflict in the password spraying rule: keep rule version v1.1.0 from this branch and the failed/denied actionResult condition from v11. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Since v11.2.14 these Office 365 rules alert on routine Microsoft 365 activity, and the rule flood guard switches them off. Filter 1.4.1 now keeps OneDrive and SharePoint file access and download records, several rules count far below everyday volume, two rules added on 2026-09-25 have no volume threshold, and grouped rules still store one child alert for every matching event. The target is fewer than 10 alerts per hour per rule on any server.
Noise is reduced only by de-duplication, trigger thresholds, or removing a trigger or rule that does not belong. No account or application is excluded by name. Thresholds were set from 30 days of per-identity volumes on v11 deployments, far above everyday use.
What changes
Every changed rule raises one alert per identity (per IP address for password spraying) and drops repeats for seven days with
deduplicateBy, instead ofgroupBy.Why each trigger means what it now claims, from Microsoft's audit log activities, Teams activities and MailItemsAccessed references:
Update user.condition matches almost every user update. The startup definition sync deletes shipped rules whose names disappear, so deployments drop it.Tests
plugins/alerts/o365_alert_volume_test.go(new) runs fabricated records through the checked-in O365 filter and the pinned go-sdk v1.1.36 CEL and history code. It pins every threshold, window, history scope and de-duplication key: below the threshold, at it, outside the window, a different identity, and the records that must no longer match.o365_action_result_rules_test.go: the password spraying history case moves to 10m, 50 and theactionterm.go test ./...inplugins/alerts: all O365, contract, grouping and placeholder tests pass.TestBitdefenderActionResultRawfails in the same way on untouchedv11(dda9d45a) and is unrelated.Local EventProcessor lab (engine
8a3ade7, go-sdk v1.1.36, production events and alerts plugins, OpenSearch 2.19.1), fabricated identities, seed events spread over several runs so the history counts are real:plugins/alertschecks for duplicates in parallel. A per-rule-and-key lock around the duplicate check and store would remove these copies for every rule.Follow-up, not in this PR
"Office 365 App Consent Grants Detected" and "Office 365 OAuth Application Anomalous Activity" test
Consent to applicationwithout the final period that Microsoft records (Consent to application.), so they never match. With consent grants out of O365 Admin Role Assignment, those two rules are where user consent should be detected, once fixed with their own volume check.🤖 Generated with Claude Code