Skip to content

Commit ec3dfb1

Browse files
committed
feat: Anti-Phishing additional defaults
* Enable user to protect by default * Enable include custom domains by default * Resolves https://discord.com/channels/905453405936447518/1199069319850639410/1370012245488046112
1 parent 01531ac commit ec3dfb1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardAntiPhishPolicy.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function Invoke-CIPPStandardAntiPhishPolicy {
7373
}
7474

7575
$CurrentState = $ExistingPolicy |
76-
Select-Object Name, Enabled, PhishThresholdLevel, EnableMailboxIntelligence, EnableMailboxIntelligenceProtection, EnableSpoofIntelligence, EnableFirstContactSafetyTips, EnableSimilarUsersSafetyTips, EnableSimilarDomainsSafetyTips, EnableUnusualCharactersSafetyTips, EnableUnauthenticatedSender, EnableViaTag, AuthenticationFailAction, SpoofQuarantineTag, MailboxIntelligenceProtectionAction, MailboxIntelligenceQuarantineTag, TargetedUserProtectionAction, TargetedUserQuarantineTag, TargetedDomainProtectionAction, TargetedDomainQuarantineTag, EnableOrganizationDomainsProtection
76+
Select-Object Name, Enabled, PhishThresholdLevel, EnableMailboxIntelligence, EnableMailboxIntelligenceProtection, EnableSpoofIntelligence, EnableFirstContactSafetyTips, EnableSimilarUsersSafetyTips, EnableSimilarDomainsSafetyTips, EnableUnusualCharactersSafetyTips, EnableUnauthenticatedSender, EnableViaTag, AuthenticationFailAction, SpoofQuarantineTag, MailboxIntelligenceProtectionAction, MailboxIntelligenceQuarantineTag, TargetedUserProtectionAction, TargetedUserQuarantineTag, TargetedDomainProtectionAction, TargetedDomainQuarantineTag, EnableOrganizationDomainsProtection, EnableTargetedDomainsProtection, EnableTargetedUserProtection
7777

7878
if ($MDOLicensed) {
7979
$StateIsCorrect = ($CurrentState.Name -eq $PolicyName) -and
@@ -96,6 +96,8 @@ function Invoke-CIPPStandardAntiPhishPolicy {
9696
($CurrentState.TargetedUserQuarantineTag -eq $Settings.TargetedUserQuarantineTag) -and
9797
($CurrentState.TargetedDomainProtectionAction -eq $Settings.TargetedDomainProtectionAction) -and
9898
($CurrentState.TargetedDomainQuarantineTag -eq $Settings.TargetedDomainQuarantineTag) -and
99+
($CurrentState.EnableTargetedDomainsProtection -eq $true) -and
100+
($CurrentState.EnableTargetedUserProtection -eq $true) -and
99101
($CurrentState.EnableOrganizationDomainsProtection -eq $true)
100102
} else {
101103
$StateIsCorrect = ($CurrentState.Name -eq $PolicyName) -and
@@ -144,6 +146,8 @@ function Invoke-CIPPStandardAntiPhishPolicy {
144146
TargetedUserQuarantineTag = $Settings.TargetedUserQuarantineTag
145147
TargetedDomainProtectionAction = $Settings.TargetedDomainProtectionAction
146148
TargetedDomainQuarantineTag = $Settings.TargetedDomainQuarantineTag
149+
EnableTargetedDomainsProtection = $true
150+
EnableTargetedUserProtection = $true
147151
EnableOrganizationDomainsProtection = $true
148152
}
149153
} else {
@@ -218,8 +222,9 @@ function Invoke-CIPPStandardAntiPhishPolicy {
218222
}
219223

220224
if ($Settings.report -eq $true) {
221-
Set-CIPPStandardsCompareField -FieldName 'standards.AntiPhishPolicy' -FieldValue $StateIsCorrect -TenantFilter $tenant
222-
Add-CIPPBPAField -FieldName 'AntiPhishPolicy' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant
225+
$FieldValue = $StateIsCorrect ? $true : $CurrentState
226+
Set-CIPPStandardsCompareField -FieldName 'standards.AntiPhishPolicy' -FieldValue $FieldValue -TenantFilter $Tenant
227+
Add-CIPPBPAField -FieldName 'AntiPhishPolicy' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $Tenant
223228
}
224229

225230
}

0 commit comments

Comments
 (0)