Skip to content

Commit

Permalink
updates PolicyConditionsMatch function to handle excluded items
Browse files Browse the repository at this point in the history
  • Loading branch information
dagarwal-mitre committed Jan 9, 2025
1 parent 1b76e1e commit 3d5ef2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions PowerShell/ScubaGear/Rego/Utils/AAD.rego
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,16 @@ GroupExclusionsFullyExempt(Policy, PolicyID) := true if {
# Return true if policy matches all conditions:
# All for include users & applications,
# block for built in controls, enabled,
# & NO excluded roles.
# & NO excluded users, roles, groups, & applications.
PolicyConditionsMatch(Policy) := true if {
Contains(Policy.Conditions.Users.IncludeUsers, "All") == true
Contains(Policy.Conditions.Applications.IncludeApplications, "All") == true
Count(Policy.Conditions.Users.ExcludeUsers) == 0
Count(Policy.Conditions.Users.ExcludeRoles) == 0
Count(Policy.Conditions.Users.ExcludeGroups) == 0
Count(Policy.Conditions.Applications.ExcludeApplications) == 0

Policy.State == "enabled"
IsEmptyContainer(Policy.Conditions.Users.ExcludeRoles) == true
} else := false

# Save the Allowed MFA items as a set, check if there are any MFA
Expand Down

0 comments on commit 3d5ef2d

Please sign in to comment.