fix: 2.1.3 simplified output and added object comment
This commit is contained in:
@@ -237,6 +237,21 @@ function Get-CISExoOutput {
|
|||||||
# Test-NotifyMalwareInternal.ps1
|
# Test-NotifyMalwareInternal.ps1
|
||||||
# 2.1.3 Ensure notifications for internal users sending malware is Enabled
|
# 2.1.3 Ensure notifications for internal users sending malware is Enabled
|
||||||
# Retrieve all 'Custom' malware filter policies and check notification settings
|
# Retrieve all 'Custom' malware filter policies and check notification settings
|
||||||
|
# $malwareNotifications Mock Object
|
||||||
|
<#
|
||||||
|
$malwareNotifications = @(
|
||||||
|
[PSCustomObject]@{
|
||||||
|
Identity = "Default"
|
||||||
|
EnableInternalSenderAdminNotifications = $true
|
||||||
|
RecommendedPolicyType = "Custom"
|
||||||
|
},
|
||||||
|
[PSCustomObject]@{
|
||||||
|
Identity = "Anti-malware-Policy"
|
||||||
|
EnableInternalSenderAdminNotifications = $true
|
||||||
|
RecommendedPolicyType = "Custom"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
#>
|
||||||
$malwareNotifications = Get-MalwareFilterPolicy | Where-Object { $_.RecommendedPolicyType -eq 'Custom' }
|
$malwareNotifications = Get-MalwareFilterPolicy | Where-Object { $_.RecommendedPolicyType -eq 'Custom' }
|
||||||
# [object[]]
|
# [object[]]
|
||||||
return $malwareNotifications
|
return $malwareNotifications
|
||||||
|
@@ -27,6 +27,7 @@ function Test-NotifyMalwareInternal {
|
|||||||
#. .\source\Classes\CISAuditResult.ps1
|
#. .\source\Classes\CISAuditResult.ps1
|
||||||
# Initialization code, if needed
|
# Initialization code, if needed
|
||||||
$recnum = "2.1.3"
|
$recnum = "2.1.3"
|
||||||
|
Write-Verbose "Running Test-NotifyMalwareInternal for $recnum..."
|
||||||
}
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
@@ -34,6 +35,21 @@ function Test-NotifyMalwareInternal {
|
|||||||
# 2.1.3 Ensure notifications for internal users sending malware is Enabled
|
# 2.1.3 Ensure notifications for internal users sending malware is Enabled
|
||||||
|
|
||||||
# Retrieve all 'Custom' malware filter policies and check notification settings
|
# Retrieve all 'Custom' malware filter policies and check notification settings
|
||||||
|
# $malwareNotifications Mock Object
|
||||||
|
<#
|
||||||
|
$malwareNotifications = @(
|
||||||
|
[PSCustomObject]@{
|
||||||
|
Identity = "Default"
|
||||||
|
EnableInternalSenderAdminNotifications = $true
|
||||||
|
RecommendedPolicyType = "Custom"
|
||||||
|
},
|
||||||
|
[PSCustomObject]@{
|
||||||
|
Identity = "Anti-malware-Policy"
|
||||||
|
EnableInternalSenderAdminNotifications = $true
|
||||||
|
RecommendedPolicyType = "Custom"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
#>
|
||||||
$malwareNotifications = Get-CISExoOutput -Rec $recnum
|
$malwareNotifications = Get-CISExoOutput -Rec $recnum
|
||||||
|
|
||||||
# Condition B: Using PowerShell, the `NotifyInternal` property in the anti-malware policy is set to `True` and includes at least one valid email address for notifications.
|
# Condition B: Using PowerShell, the `NotifyInternal` property in the anti-malware policy is set to `True` and includes at least one valid email address for notifications.
|
||||||
@@ -60,7 +76,7 @@ function Test-NotifyMalwareInternal {
|
|||||||
"All custom malware policies have notifications enabled."
|
"All custom malware policies have notifications enabled."
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
"Misconfigured Policies: $($policiesToReport -join ', ')"
|
"Misconfigured Policies: $($policiesToReport -join '`n')"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create and populate the CISAuditResult object
|
# Create and populate the CISAuditResult object
|
||||||
|
Reference in New Issue
Block a user