MSFT rules update to include filter - #1364
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Microsoft 365 sanitizer rules to support Graph “advanced query” usage by allowing the $filter query param (for directory listing partitioning) and explicitly allowlisting the ConsistencyLevel request header so it can be forwarded when required by Graph APIs.
Changes:
- Allow
$filterfor MSFT directory listing endpoints (Java rules + YAML rule definitions). - Allowlist
ConsistencyLevelas an allowed request header for relevant MSFT endpoints. - Update MSFT rules tests/examples to include
$filter-based user enumeration scenarios.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDriveTests.java | Adds an invocation example using $filter for /users enumeration. |
| java/core/src/test/java/co/worklytics/psoxy/rules/msft/OneDrive_NoAppIds_Tests.java | Mirrors $filter invocation example for the no-app-ids OneDrive ruleset. |
| java/core/src/test/java/co/worklytics/psoxy/rules/msft/EntraIDTests.java | Reworks the $filter test to validate sanitization rather than blocking. |
| java/core/src/main/java/co/worklytics/psoxy/rules/msft/PrebuiltSanitizerRules.java | Allows $filter for Entra ID users endpoints and allowlists ConsistencyLevel header across several MSFT endpoints. |
| docs/sources/microsoft-365/outlook-mail/outlook-mail.yaml | Adds $filter and allowlists ConsistencyLevel header for applicable endpoints. |
| docs/sources/microsoft-365/outlook-mail/outlook-mail_no-app-ids.yaml | Same as above for no-app-ids variant. |
| docs/sources/microsoft-365/outlook-mail/outlook-mail_no-app-ids_no-groups.yaml | Same as above for no-app-ids/no-groups variant. |
| docs/sources/microsoft-365/outlook-cal/outlook-cal.yaml | Adds $filter and allowlists ConsistencyLevel header. |
| docs/sources/microsoft-365/outlook-cal/outlook-cal_no-app-ids.yaml | Same as above for no-app-ids variant. |
| docs/sources/microsoft-365/outlook-cal/outlook-cal_no-app-ids_no-groups.yaml | Same as above for no-app-ids/no-groups variant. |
| docs/sources/microsoft-365/msft-teams/msft-teams.yaml | Allowlists ConsistencyLevel header and adds $filter where needed. |
| docs/sources/microsoft-365/msft-teams/msft-teams_no-userIds.yaml | Same as above for no-userIds variant. |
| docs/sources/microsoft-365/msft-onedrive/msft-onedrive.yaml | Adds $filter (users) and allowlists ConsistencyLevel header for select endpoints. |
| docs/sources/microsoft-365/msft-onedrive/msft-onedrive_no-app-ids.yaml | Same as above for no-app-ids variant. |
| docs/sources/microsoft-365/msft-copilot/msft-copilot.yaml | Adds $filter and allowlists ConsistencyLevel header. |
| docs/sources/microsoft-365/msft-copilot/msft-copilot_no-userIds.yaml | Same as above for no-userIds variant. |
| docs/sources/microsoft-365/entra-id/entra-id.yaml | Adds $filter and allowlists ConsistencyLevel header. |
| docs/sources/microsoft-365/entra-id/entra-id_no-app-ids.yaml | Same as above for no-app-ids variant. |
| docs/sources/microsoft-365/entra-id/entra-id_no-app-ids_no-orig.yaml | Same as above for no-app-ids/no-orig variant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+72
to
+79
| allowedQueryParams: | ||
| - "$top" | ||
| - "$select" | ||
| - "$skiptoken" | ||
| - "$orderby" | ||
| - "$count" | ||
| allowedRequestHeaders: | ||
| - "ConsistencyLevel" |
Comment on lines
+75
to
+82
| allowedQueryParams: | ||
| - "$top" | ||
| - "$select" | ||
| - "$skiptoken" | ||
| - "$orderby" | ||
| - "$count" | ||
| allowedRequestHeaders: | ||
| - "ConsistencyLevel" |
Comment on lines
90
to
94
| static final Endpoint ENTRA_ID_USERS = Endpoint.builder() | ||
| .pathRegex(ENTRA_ID_REGEX_USERS) | ||
| .allowedQueryParams(List.of("$top", "$select", "$skiptoken", "$orderBy", "$count")) | ||
| .allowedQueryParams(List.of("$top", "$select", "$skiptoken", "$orderBy", "$count", "$filter")) | ||
| .allowedRequestHeaders(CONSISTENCY_LEVEL_HEADER) | ||
| .transforms(USER_TRANSFORMS) |
jlorper
approved these changes
Jul 31, 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.
Two things added in all MSFT rules:
$filter: for supporting https://github.com/Worklytics/evalengin/pull/8919ConsistencyLevel: now they have to be declared, otherwise they will be ignoredFixes
Features
Psoxy rules update
Logistics
Change implications
CHANGELOG.mdanything that will show up interraform plan/applythat isn'tobviously a no-op? no
alpha, requires major versionchange no