-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
Noticed while testing ZTA in my sandbox
Steps to reproduce:
- Run the test in an environment with no Conditional Access policies targeting includeGuestsOrExternalUsers
Expected behavior:
The test should fail when no policies enforce sign-in frequency for guests.
Actual behavior:
The test passes incorrectly.
Root cause:
- When no policies target
includeGuestsOrExternalUsers,$filteredCAPoliciesis null/empty $matchedPoliciesis derived from$filteredCAPolicies, so it's also null/empty- The final validation checks
$filteredCAPolicies.Count -eq $matchedPolicies.Count - Since
0 -eq 0(or$null -eq $null), the condition evaluates to$trueand the test passes
Suggested Fix:
Validate if at least one policy exists
| if ($filteredCAPolicies.Count -eq $matchedPolicies.Count) { |
Metadata
Metadata
Assignees
Labels
No labels