Skip to content

Commit 25445c6

Browse files
committed
Update Oauth standards with conflict information
1 parent c5a732d commit 25445c6

3 files changed

Lines changed: 23 additions & 9 deletions

File tree

Config/standards.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,8 +1587,8 @@
15871587
"ZTNA21807",
15881588
"ZTNA21810"
15891589
],
1590-
"helpText": "Disables users from being able to consent to applications, except for those specified in the field below",
1591-
"docsDescription": "Requires users to get administrator consent before sharing data with applications. You can preapprove specific applications.",
1590+
"helpText": "Disables users from being able to consent to applications, except for those specified in the field below. This standard conflicts with the \"Allow users to consent to applications with low security risk\" standard; only one of the two should be assigned per tenant.",
1591+
"docsDescription": "Requires users to get administrator consent before sharing data with applications. You can preapprove specific applications. This standard conflicts with the \"Allow users to consent to applications with low security risk\" (OauthConsentLowSec) standard. Enabling both on the same tenant causes a remediation conflict, so only assign one.",
15921592
"executiveText": "Requires administrative approval before employees can grant applications access to company data, preventing unauthorized data sharing and potential security breaches. This protects against malicious applications while allowing approved business tools to function normally.",
15931593
"addedComponent": [
15941594
{
@@ -1609,8 +1609,8 @@
16091609
"name": "standards.OauthConsentLowSec",
16101610
"cat": "Entra (AAD) Standards",
16111611
"tag": ["IntegratedApps"],
1612-
"helpText": "Sets the default oauth consent level so users can consent to applications that have low risks.",
1613-
"docsDescription": "Allows users to consent to applications with low assigned risk.",
1612+
"helpText": "Sets the default oauth consent level so users can consent to applications that have low risks. This standard conflicts with the \"Require admin consent for applications\" standard; only one of the two should be assigned per tenant.",
1613+
"docsDescription": "Allows users to consent to applications with low assigned risk. This standard conflicts with the \"Require admin consent for applications (Prevent OAuth phishing)\" (OauthConsent) standard. Enabling both on the same tenant causes a remediation conflict, so only assign one.",
16141614
"executiveText": "Allows employees to approve low-risk applications without administrative intervention, balancing security with productivity. This provides a middle ground between complete restriction and open access, enabling business agility while maintaining protection against high-risk applications.",
16151615
"label": "Allow users to consent to applications with low security risk (Prevent OAuth phishing. Lower impact, less secure)",
16161616
"impact": "Medium Impact",

Modules/CIPPStandards/Public/Standards/Invoke-CIPPStandardOauthConsent.ps1

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ function Invoke-CIPPStandardOauthConsent {
77
.SYNOPSIS
88
(Label) Require admin consent for applications (Prevent OAuth phishing)
99
.DESCRIPTION
10-
(Helptext) Disables users from being able to consent to applications, except for those specified in the field below
11-
(DocsDescription) Requires users to get administrator consent before sharing data with applications. You can preapprove specific applications.
10+
(Helptext) Disables users from being able to consent to applications, except for those specified in the field below. This standard conflicts with the "Allow users to consent to applications with low security risk" standard; only one of the two should be assigned per tenant.
11+
(DocsDescription) Requires users to get administrator consent before sharing data with applications. You can preapprove specific applications. This standard conflicts with the "Allow users to consent to applications with low security risk" (OauthConsentLowSec) standard. Enabling both on the same tenant causes a remediation conflict, so only assign one.
1212
.NOTES
1313
CAT
1414
Entra (AAD) Standards
@@ -66,7 +66,13 @@ function Invoke-CIPPStandardOauthConsent {
6666
}
6767
$StateIsCorrect = if ($State.permissionGrantPolicyIdsAssignedToDefaultUserRole -eq 'ManagePermissionGrantsForSelf.cipp-consent-policy') { $true } else { $false }
6868

69-
if ($Settings.remediate -eq $true) {
69+
$Standards = Get-CIPPStandards -Tenant $tenant
70+
$ConflictingStandard = $Standards | Where-Object -Property Standard -EQ 'OauthConsentLowSec'
71+
72+
if ($Settings.remediate -eq $true -and $ConflictingStandard -and $State.permissionGrantPolicyIdsAssignedToDefaultUserRole -contains 'ManagePermissionGrantsForSelf.microsoft-user-default-low') {
73+
# A conflicting low security OAuth consent standard is enabled and currently applied. Skip remediation so we don't fight the other standard, but still fall through to alert/report.
74+
Write-LogMessage -API 'Standards' -tenant $tenant -message 'There is a conflicting OAuth Consent policy standard enabled for this tenant. Remove the Allow users to consent to applications with low security risk (Prevent OAuth phishing. Lower impact, less secure) standard from this tenant to apply the require admin consent standard.' -sev Error
75+
} elseif ($Settings.remediate -eq $true) {
7076
$DidRemediationChange = $false
7177
try {
7278
if (-not $CompareIncludesFetched) {
@@ -222,6 +228,14 @@ function Invoke-CIPPStandardOauthConsent {
222228
permissionGrantPolicyIdsAssignedToDefaultUserRole = $State.permissionGrantPolicyIdsAssignedToDefaultUserRole
223229
includes = $CurrentIncludesForCompare
224230
}
231+
# Add conflicting standard info if applicable
232+
if ($ConflictingStandard) {
233+
$CurrentValue.conflictingStandard = @{
234+
name = $ConflictingStandard.Standard
235+
templateid = $ConflictingStandard.TemplateId
236+
}
237+
}
238+
225239
$ExpectedValue = @{
226240
permissionGrantPolicyIdsAssignedToDefaultUserRole = @('ManagePermissionGrantsForSelf.cipp-consent-policy')
227241
includes = $ExpectedIncludesForCompare

Modules/CIPPStandards/Public/Standards/Invoke-CIPPStandardOauthConsentLowSec.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ function Invoke-CIPPStandardOauthConsentLowSec {
77
.SYNOPSIS
88
(Label) Allow users to consent to applications with low security risk (Prevent OAuth phishing. Lower impact, less secure)
99
.DESCRIPTION
10-
(Helptext) Sets the default oauth consent level so users can consent to applications that have low risks.
11-
(DocsDescription) Allows users to consent to applications with low assigned risk.
10+
(Helptext) Sets the default oauth consent level so users can consent to applications that have low risks. This standard conflicts with the "Require admin consent for applications" standard; only one of the two should be assigned per tenant.
11+
(DocsDescription) Allows users to consent to applications with low assigned risk. This standard conflicts with the "Require admin consent for applications (Prevent OAuth phishing)" (OauthConsent) standard. Enabling both on the same tenant causes a remediation conflict, so only assign one.
1212
.NOTES
1313
CAT
1414
Entra (AAD) Standards

0 commit comments

Comments
 (0)