-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from Snozzberries/cisaExo
CISA EXO Adds
- Loading branch information
Showing
68 changed files
with
1,320 additions
and
62 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Microsoft Purview Audit (Standard) logging SHALL be enabled. | ||
|
||
Rationale: Responding to incidents without detailed information about activities that took place slows response actions. Enabling Microsoft Purview Audit (Standard) helps ensure agencies have visibility into user actions. Furthermore, Microsoft Purview Audit (Standard) is required for government agencies by OMB M-21-31 (referred to therein by its former name, Unified Audit Logs). | ||
|
||
#### Remediation action: | ||
|
||
To enable auditing via the Microsoft Purview compliance portal: | ||
1. Sign in to the **Microsoft Purview compliance portal**. | ||
2. Under **Solutions**, select [**Audit**](https://purview.microsoft.com/audit/auditsearch). | ||
3. If auditing is not enabled, a banner is displayed to notify the administrator to start recording user and admin activity. | ||
4. Click the **Start recording user and admin activity**. | ||
|
||
#### Related links | ||
|
||
* [Purview portal - Audit search](https://purview.microsoft.com/audit/auditsearch) | ||
* [CISA 17 Audit Logging - MS.EXO.17.1](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/baselines/exo.md#msexo171v1) | ||
* [CISA ScubaGear Rego Reference](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/Rego/EXOConfig.rego#L898) | ||
|
||
<!--- Results ---> | ||
%TestResult% |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks state of purview | ||
.DESCRIPTION | ||
Microsoft Purview Audit (Standard) logging SHALL be enabled. | ||
.EXAMPLE | ||
Test-MtCisaAuditLog | ||
Returns true if audit log enabled | ||
.LINK | ||
https://maester.dev/docs/commands/Test-MtCisaAuditLog | ||
#> | ||
function Test-MtCisaAuditLog { | ||
[CmdletBinding()] | ||
[OutputType([bool])] | ||
param() | ||
|
||
if(!(Test-MtConnection ExchangeOnline)){ | ||
Add-MtTestResultDetail -SkippedBecause NotConnectedExchange | ||
return $null | ||
}elseif(!(Test-MtConnection SecurityCompliance)){ | ||
Add-MtTestResultDetail -SkippedBecause NotConnectedSecurityCompliance | ||
return $null | ||
} | ||
|
||
$config = Get-AdminAuditLogConfig | ||
|
||
$testResult = $config.UnifiedAuditLogIngestionEnabled | ||
|
||
$portalLink = "https://purview.microsoft.com/audit/auditsearch" | ||
|
||
if ($testResult) { | ||
$testResultMarkdown = "Well done. Your tenant has [unified audit log enabled]($portalLink).`n`n%TestResult%" | ||
} else { | ||
$testResultMarkdown = "Your tenant does not have [unified audit log enabled]($portalLink).`n`n%TestResult%" | ||
} | ||
|
||
Add-MtTestResultDetail -Result $testResultMarkdown | ||
|
||
return $testResult | ||
} |
16 changes: 16 additions & 0 deletions
16
powershell/public/cisa/exchange/Test-MtCisaAuditLogPremium.md
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Microsoft Purview Audit (Premium) logging SHALL be enabled. | ||
|
||
Rationale: Standard logging may not include relevant details necessary for visibility into user actions during an incident. Enabling Microsoft Purview Audit (Premium) captures additional event types not included with Standard. Furthermore, it is required for government agencies by OMB M-21-13 (referred to therein by its former name, Unified Audit Logs w/Advanced Features). | ||
|
||
#### Remediation action: | ||
|
||
To set up Microsoft Purview Audit (Premium), see [Set up Microsoft Purview Audit (Premium) | Microsoft Learn](https://learn.microsoft.com/en-us/purview/audit-premium-setup?view=o365-worldwide). | ||
|
||
#### Related links | ||
|
||
* [Purview portal - Audit search](https://purview.microsoft.com/audit/auditsearch) | ||
* [CISA 17 Audit Logging - MS.EXO.17.2](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/baselines/exo.md#msexo172v1) | ||
* [CISA ScubaGear Rego Reference](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/Rego/EXOConfig.rego#L913) | ||
|
||
<!--- Results ---> | ||
%TestResult% |
66 changes: 66 additions & 0 deletions
66
powershell/public/cisa/exchange/Test-MtCisaAuditLogPremium.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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks state of purview | ||
.DESCRIPTION | ||
Microsoft Purview Audit (Premium) logging SHALL be enabled. | ||
.EXAMPLE | ||
Test-MtCisaAuditLogPremium | ||
Returns true if audit log enabled | ||
.LINK | ||
https://maester.dev/docs/commands/Test-MtCisaAuditLogPremium | ||
#> | ||
function Test-MtCisaAuditLogPremium { | ||
[CmdletBinding()] | ||
[OutputType([bool])] | ||
param() | ||
|
||
if(!(Test-MtConnection ExchangeOnline)){ | ||
Add-MtTestResultDetail -SkippedBecause NotConnectedExchange | ||
return $null | ||
}elseif(!(Test-MtConnection SecurityCompliance)){ | ||
Add-MtTestResultDetail -SkippedBecause NotConnectedSecurityCompliance | ||
return $null | ||
}elseif($null -eq (Get-MtLicenseInformation -Product AdvAudit)){ | ||
Add-MtTestResultDetail -SkippedBecause NotLicensedAdvAudit | ||
return $null | ||
} | ||
|
||
Write-Warning "In tenants with a substantial number of mailboxes this test may take time" | ||
$mailboxes = Get-EXOMailbox -Properties AuditOwner | ||
|
||
$resultMailboxes = $mailboxes | Where-Object { ` | ||
$_.AuditOwner -notcontains "SearchQueryInitiated" | ||
} | ||
|
||
$testResult = ($resultMailboxes|Measure-Object).Count -ge 1 | ||
|
||
$portalLink = "https://purview.microsoft.com/audit/auditsearch" | ||
$passResult = "✅ Pass" | ||
$failResult = "❌ Fail" | ||
|
||
if ($testResult) { | ||
$testResultMarkdown = "Well done. Your tenant has [SearchQueryInitiated audit log enabled]($portalLink).`n`n%TestResult%" | ||
} else { | ||
$testResultMarkdown = "Your tenant does not have [SearchQueryInitiated audit log enabled]($portalLink).`n`n%TestResult%" | ||
} | ||
|
||
$result = "| Mailbox | SearchQueryInitiated |`n" | ||
$result += "| --- | --- |`n" | ||
foreach($item in $mailboxes | Sort-Object -Property UserPrincipalName){ | ||
if($item.Guid -notin $resultMailboxes.Guid){ | ||
$result += "| $($item.UserPrincipalName) | $($passResult) |`n" | ||
}else{ | ||
$result += "| $($item.UserPrincipalName) | $($failResult) |`n" | ||
} | ||
} | ||
|
||
$testResultMarkdown = $testResultMarkdown -replace "%TestResult%", $result | ||
|
||
Add-MtTestResultDetail -Result $testResultMarkdown | ||
|
||
return $testResult | ||
} |
16 changes: 16 additions & 0 deletions
16
powershell/public/cisa/exchange/Test-MtCisaAuditLogRetention.md
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Audit logs SHALL be maintained for at least the minimum duration dictated by OMB M-21-31 (Appendix C). | ||
|
||
Rationale: Audit logs may no longer be available when needed if they are not retained for a sufficient time. Increased log retention time gives an agency the necessary visibility to investigate incidents that occurred some time ago. OMB M-21-13, Appendix C, Table 5 specifically calls out Unified Audit Logs in the Cloud Azure log category. | ||
|
||
#### Remediation action: | ||
|
||
To create one or more custom audit retention policies, if the default retention policy is not sufficient for agency needs, follow [Create an audit log retention policy](https://learn.microsoft.com/en-us/purview/audit-log-retention-policies?view=o365-worldwide&tabs=microsoft-purview-portal#create-an-audit-log-retention-policy) instructions. Ensure the duration selected in the retention policies is at least one year, in accordance with OMB M-21-31. | ||
|
||
#### Related links | ||
|
||
* [Purview portal - Audit policies](https://purview.microsoft.com/audit/auditpolicies) | ||
* [CISA 17 Audit Logging - MS.EXO.17.3](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/baselines/exo.md#msexo173v1) | ||
* [CISA ScubaGear Rego Reference](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/Rego/EXOConfig.rego#L928) | ||
|
||
<!--- Results ---> | ||
%TestResult% |
Oops, something went wrong.