[New Rule] M365 SharePoint Site Sharing Policy Weakened#5795
Open
terrancedejesus wants to merge 3 commits intomainfrom
Open
[New Rule] M365 SharePoint Site Sharing Policy Weakened#5795terrancedejesus wants to merge 3 commits intomainfrom
terrancedejesus wants to merge 3 commits intomainfrom
Conversation
Contributor
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
Aegrah
approved these changes
Mar 4, 2026
imays11
approved these changes
Mar 4, 2026
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.
Pull Request
Issue link(s):
Summary - What I changed
Adds a new detection rule for Microsoft 365 SharePoint/OneDrive
SharingPolicyChangedevents that indicate a weakened security posture.A blanket
SharingPolicyChangedrule is too noisy, this event fires for every sharing policy modification across all SharePoint sites, including routine administrative changes. The alternative detection approaches have limitations:o365.audit.ModifiedProperties.ShareWithGuests.NewValue), not in field values. New Terms only tracks new values, not new field keys.ModifiedProperties.*field name structure at query time.The solution is a scenario-driven approach: target specific
ModifiedPropertiesfield names where a value transition from restrictive → permissive represents a meaningful security posture degradation.ModifiedProperties field schema
The M365 audit log stores policy changes in
o365.audit.ModifiedPropertiesas dynamic keys:Where
<SettingName>is the specific policy setting that was modified. Microsoft uses inconsistent value formats across settings, some use keyword stringsTrue/Falsewhile others useEnabled/Disabled. The rule accounts for both formats using OR logic:(true or "Enabled")and(false or "Disabled").Selected scenarios
Each OR branch in the query targets a specific setting transition from disabled → enabled:
ShareWithGuestsShareUsingAnonymousLinksIsPublicAllowGuestUserAllowFederatedUsersAllowTeamsConsumerThese settings were identified via
_field_capsagainst live M365 audit data and validated with terms aggregations filtered toSharingPolicyChangedevents. TheOldValuecheck ensures the rule only fires on actual weakening transitions (disabled -> enabled), not idempotent re-applications or strengthening changes.How To Test
Query can be used in the TRADE stack.
Checklist
Rule: Newmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist