-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rerun Update-StandardsComments.ps1 and CRLF to LF
- Loading branch information
1 parent
eda1055
commit 6b26d54
Showing
118 changed files
with
2,891 additions
and
2,653 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
444 changes: 223 additions & 221 deletions
444
Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardAntiPhishPolicy.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
150 changes: 76 additions & 74 deletions
150
Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardAtpPolicyForO365.ps1
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,76 @@ | ||
function Invoke-CIPPStandardAtpPolicyForO365 { | ||
<# | ||
.FUNCTIONALITY | ||
Internal | ||
.COMPONENT | ||
(APIName) AtpPolicyForO365 | ||
.SYNOPSIS | ||
(Label) Default Atp Policy For O365 | ||
.DESCRIPTION | ||
(Helptext) This creates a Atp policy that enables Defender for Office 365 for SharePoint, OneDrive and Microsoft Teams. | ||
(DocsDescription) This creates a Atp policy that enables Defender for Office 365 for SharePoint, OneDrive and Microsoft Teams. | ||
.NOTES | ||
CAT | ||
Defender Standards | ||
TAG | ||
"CIS" | ||
ADDEDCOMPONENT | ||
{"type":"switch","label":"Allow people to click through Protected View even if Safe Documents identified the file as malicious","name":"standards.AtpPolicyForO365.AllowSafeDocsOpen","default":false,"required":false} | ||
IMPACT | ||
Low Impact | ||
POWERSHELLEQUIVALENT | ||
Set-AtpPolicyForO365 | ||
RECOMMENDEDBY | ||
"CIS" | ||
UPDATECOMMENTBLOCK | ||
Run the Tools\Update-StandardsComments.ps1 script to update this comment block | ||
.LINK | ||
https://docs.cipp.app/user-documentation/tenant/standards/list-standards/defender-standards#low-impact | ||
#> | ||
|
||
param($Tenant, $Settings) | ||
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'AtpPolicyForO365' | ||
|
||
$CurrentState = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-AtpPolicyForO365' | | ||
Select-Object EnableATPForSPOTeamsODB, EnableSafeDocs, AllowSafeDocsOpen | ||
|
||
$StateIsCorrect = ($CurrentState.EnableATPForSPOTeamsODB -eq $true) -and | ||
($CurrentState.EnableSafeDocs -eq $true) -and | ||
($CurrentState.AllowSafeDocsOpen -eq $Settings.AllowSafeDocsOpen) | ||
|
||
if ($Settings.remediate -eq $true) { | ||
if ($StateIsCorrect -eq $true) { | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Atp Policy For O365 already set.' -sev Info | ||
} else { | ||
$cmdparams = @{ | ||
EnableATPForSPOTeamsODB = $true | ||
EnableSafeDocs = $true | ||
AllowSafeDocsOpen = $Settings.AllowSafeDocsOpen | ||
} | ||
|
||
try { | ||
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-AtpPolicyForO365' -cmdparams $cmdparams -UseSystemMailbox $true | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Updated Atp Policy For O365' -sev Info | ||
} catch { | ||
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message "Failed to set Atp Policy For O365. Error: $ErrorMessage" -sev Error | ||
} | ||
} | ||
} | ||
|
||
if ($Settings.alert -eq $true) { | ||
|
||
if ($StateIsCorrect -eq $true) { | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Atp Policy For O365 is enabled' -sev Info | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Atp Policy For O365 is not enabled' -sev Alert | ||
} | ||
} | ||
|
||
if ($Settings.report -eq $true) { | ||
Add-CIPPBPAField -FieldName 'AtpPolicyForO365' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant | ||
} | ||
|
||
} | ||
function Invoke-CIPPStandardAtpPolicyForO365 { | ||
<# | ||
.FUNCTIONALITY | ||
Internal | ||
.COMPONENT | ||
(APIName) AtpPolicyForO365 | ||
.SYNOPSIS | ||
(Label) Default Atp Policy For O365 | ||
.DESCRIPTION | ||
(Helptext) This creates a Atp policy that enables Defender for Office 365 for SharePoint, OneDrive and Microsoft Teams. | ||
(DocsDescription) This creates a Atp policy that enables Defender for Office 365 for SharePoint, OneDrive and Microsoft Teams. | ||
.NOTES | ||
CAT | ||
Defender Standards | ||
TAG | ||
"CIS" | ||
ADDEDCOMPONENT | ||
{"type":"switch","label":"Allow people to click through Protected View even if Safe Documents identified the file as malicious","name":"standards.AtpPolicyForO365.AllowSafeDocsOpen","defaultValue":false,"required":false} | ||
IMPACT | ||
Low Impact | ||
ADDEDDATE | ||
2024-03-25 | ||
POWERSHELLEQUIVALENT | ||
Set-AtpPolicyForO365 | ||
RECOMMENDEDBY | ||
"CIS" | ||
UPDATECOMMENTBLOCK | ||
Run the Tools\Update-StandardsComments.ps1 script to update this comment block | ||
.LINK | ||
https://docs.cipp.app/user-documentation/tenant/standards/list-standards/defender-standards#low-impact | ||
#> | ||
|
||
param($Tenant, $Settings) | ||
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'AtpPolicyForO365' | ||
|
||
$CurrentState = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-AtpPolicyForO365' | | ||
Select-Object EnableATPForSPOTeamsODB, EnableSafeDocs, AllowSafeDocsOpen | ||
|
||
$StateIsCorrect = ($CurrentState.EnableATPForSPOTeamsODB -eq $true) -and | ||
($CurrentState.EnableSafeDocs -eq $true) -and | ||
($CurrentState.AllowSafeDocsOpen -eq $Settings.AllowSafeDocsOpen) | ||
|
||
if ($Settings.remediate -eq $true) { | ||
if ($StateIsCorrect -eq $true) { | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Atp Policy For O365 already set.' -sev Info | ||
} else { | ||
$cmdparams = @{ | ||
EnableATPForSPOTeamsODB = $true | ||
EnableSafeDocs = $true | ||
AllowSafeDocsOpen = $Settings.AllowSafeDocsOpen | ||
} | ||
|
||
try { | ||
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-AtpPolicyForO365' -cmdparams $cmdparams -UseSystemMailbox $true | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Updated Atp Policy For O365' -sev Info | ||
} catch { | ||
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message "Failed to set Atp Policy For O365. Error: $ErrorMessage" -sev Error | ||
} | ||
} | ||
} | ||
|
||
if ($Settings.alert -eq $true) { | ||
|
||
if ($StateIsCorrect -eq $true) { | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Atp Policy For O365 is enabled' -sev Info | ||
} else { | ||
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Atp Policy For O365 is not enabled' -sev Alert | ||
} | ||
} | ||
|
||
if ($Settings.report -eq $true) { | ||
Add-CIPPBPAField -FieldName 'AtpPolicyForO365' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.