Skip to content

Commit e9a6336

Browse files
updates to tests
1 parent bdc4330 commit e9a6336

9 files changed

+147
-6
lines changed

Modules/CIPPCore/Public/Tests/Invoke-CippTestZTNA24541.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Invoke-CippTestZTNA24541 {
44
$TestId = 'ZTNA24541'
55

66
try {
7-
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntunePolicies'
7+
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceCompliancePolicies'
88

99
if (-not $IntunePolicies) {
1010
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Intune policies not found in database' -Risk 'High' -Name 'Compliance policies protect Windows devices' -UserImpact 'Medium' -ImplementationEffort 'Low' -Category 'Tenant'

Modules/CIPPCore/Public/Tests/Invoke-CippTestZTNA24542.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Invoke-CippTestZTNA24542 {
44
$TestId = 'ZTNA24542'
55

66
try {
7-
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntunePolicies'
7+
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceCompliancePolicies'
88

99
if (-not $IntunePolicies) {
1010
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Intune policies not found in database' -Risk 'High' -Name 'Compliance policies protect macOS devices' -UserImpact 'Medium' -ImplementationEffort 'Low' -Category 'Tenant'

Modules/CIPPCore/Public/Tests/Invoke-CippTestZTNA24543.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Invoke-CippTestZTNA24543 {
44
$TestId = 'ZTNA24543'
55

66
try {
7-
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntunePolicies'
7+
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceCompliancePolicies'
88

99
if (-not $IntunePolicies) {
1010
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Intune policies not found in database' -Risk 'High' -Name 'Compliance policies protect iOS/iPadOS devices' -UserImpact 'Medium' -ImplementationEffort 'Low' -Category 'Tenant'

Modules/CIPPCore/Public/Tests/Invoke-CippTestZTNA24545.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Invoke-CippTestZTNA24545 {
44
$TestId = 'ZTNA24545'
55

66
try {
7-
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntunePolicies'
7+
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceCompliancePolicies'
88

99
if (-not $IntunePolicies) {
1010
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Intune policies not found in database' -Risk 'High' -Name 'Compliance policies protect fully managed and corporate-owned Android devices' -UserImpact 'Medium' -ImplementationEffort 'Low' -Category 'Tenant'

Modules/CIPPCore/Public/Tests/Invoke-CippTestZTNA24547.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Invoke-CippTestZTNA24547 {
44
$TestId = 'ZTNA24547'
55

66
try {
7-
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntunePolicies'
7+
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceCompliancePolicies'
88

99
if (-not $IntunePolicies) {
1010
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Intune policies not found in database' -Risk 'High' -Name 'Compliance policies protect personally owned Android devices' -UserImpact 'Medium' -ImplementationEffort 'Low' -Category 'Tenant'

Modules/CIPPCore/Public/Tests/Invoke-CippTestZTNA24553.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Invoke-CippTestZTNA24553 {
44
$TestId = 'ZTNA24553'
55

66
try {
7-
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntunePolicies'
7+
$IntunePolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceCompliancePolicies'
88

99
if (-not $IntunePolicies) {
1010
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Intune policies not found in database' -Risk 'High' -Name 'Windows Update policies are enforced to reduce risk from unpatched vulnerabilities' -UserImpact 'Medium' -ImplementationEffort 'Low' -Category 'Tenant'
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
function Invoke-CippTestZTNA24839 {
2+
param($Tenant)
3+
4+
$TestId = 'ZTNA24839'
5+
6+
try {
7+
$DeviceConfigs = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceConfigurations'
8+
9+
if (-not $DeviceConfigs) {
10+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Device configurations not found in database' -Risk 'High' -Name 'Secure Wi-Fi profiles protect iOS devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Medium' -Category 'Data'
11+
return
12+
}
13+
14+
$iOSWifiConfProfiles = @($DeviceConfigs | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.iosWiFiConfiguration' })
15+
$CompliantIosWifiConfProfiles = @($iOSWifiConfProfiles | Where-Object { $_.wiFiSecurityType -in @('wpa2Enterprise', 'wpaEnterprise') })
16+
$AssignedCompliantProfiles = @($CompliantIosWifiConfProfiles | Where-Object { $_.assignments -and $_.assignments.Count -gt 0 })
17+
$Passed = $AssignedCompliantProfiles.Count -gt 0
18+
19+
if ($Passed) {
20+
$ResultMarkdown = "✅ At least one Enterprise Wi-Fi profile for iOS exists and is assigned.`n`n"
21+
} else {
22+
$ResultMarkdown = "❌ No Enterprise Wi-Fi profile for iOS exists or none are assigned.`n`n"
23+
}
24+
25+
if ($iOSWifiConfProfiles.Count -gt 0) {
26+
$ResultMarkdown += "## iOS WiFi Configuration Profiles`n`n"
27+
$ResultMarkdown += "| Policy Name | Wi-Fi Security Type | Assigned |`n"
28+
$ResultMarkdown += "| :---------- | :------------------ | :------- |`n"
29+
30+
foreach ($policy in $iOSWifiConfProfiles) {
31+
$securityType = if ($policy.wiFiSecurityType) { $policy.wiFiSecurityType } else { 'Unknown' }
32+
$assigned = if ($policy.assignments -and $policy.assignments.Count -gt 0) { '✅ Yes' } else { '❌ No' }
33+
$ResultMarkdown += "| $($policy.displayName) | $securityType | $assigned |`n"
34+
}
35+
} else {
36+
$ResultMarkdown += "No iOS WiFi configuration profiles found.`n"
37+
}
38+
39+
$Status = if ($Passed) { 'Passed' } else { 'Failed' }
40+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status $Status -ResultMarkdown $ResultMarkdown -Risk 'High' -Name 'Secure Wi-Fi profiles protect iOS devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Medium' -Category 'Data'
41+
42+
} catch {
43+
$ErrorMessage = Get-CippException -Exception $_
44+
Write-LogMessage -API 'Tests' -tenant $Tenant -message "Failed to run test: $($ErrorMessage.NormalizedError)" -sev Error -LogData $ErrorMessage
45+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Failed' -ResultMarkdown "Error running test: $($ErrorMessage.NormalizedError)" -Risk 'High' -Name 'Secure Wi-Fi profiles protect iOS devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Medium' -Category 'Data'
46+
}
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
function Invoke-CippTestZTNA24840 {
2+
param($Tenant)
3+
4+
$TestId = 'ZTNA24840'
5+
6+
try {
7+
$DeviceConfigs = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceConfigurations'
8+
9+
if (-not $DeviceConfigs) {
10+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Device configurations not found in database' -Risk 'High' -Name 'Secure Wi-Fi profiles protect Android devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Low' -Category 'Data'
11+
return
12+
}
13+
14+
$AndroidWifiConfProfiles = @($DeviceConfigs | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.androidDeviceOwnerEnterpriseWiFiConfiguration' })
15+
$CompliantAndroidWifiConfProfiles = @($AndroidWifiConfProfiles | Where-Object { $_.wiFiSecurityType -eq 'wpaEnterprise' })
16+
$AssignedCompliantProfiles = @($CompliantAndroidWifiConfProfiles | Where-Object { $_.assignments -and $_.assignments.Count -gt 0 })
17+
$Passed = $AssignedCompliantProfiles.Count -gt 0
18+
19+
if ($Passed) {
20+
$ResultMarkdown = "✅ At least one Enterprise Wi-Fi profile for android exists and is assigned.`n`n"
21+
} else {
22+
$ResultMarkdown = "❌ No Enterprise Wi-Fi profile for android exists or none are assigned.`n`n"
23+
}
24+
25+
if ($CompliantAndroidWifiConfProfiles.Count -gt 0) {
26+
$ResultMarkdown += "## Android Wi-Fi Configuration Profiles`n`n"
27+
$ResultMarkdown += "| Policy Name | Wi-Fi Security Type | Assigned |`n"
28+
$ResultMarkdown += "| :---------- | :------------------ | :------- |`n"
29+
30+
foreach ($policy in $CompliantAndroidWifiConfProfiles) {
31+
$securityType = if ($policy.wiFiSecurityType) { $policy.wiFiSecurityType } else { 'Unknown' }
32+
$assigned = if ($policy.assignments -and $policy.assignments.Count -gt 0) { '✅ Yes' } else { '❌ No' }
33+
$ResultMarkdown += "| $($policy.displayName) | $securityType | $assigned |`n"
34+
}
35+
} else {
36+
$ResultMarkdown += "No compliant Android Enterprise WiFi configuration profiles found.`n"
37+
}
38+
39+
$Status = if ($Passed) { 'Passed' } else { 'Failed' }
40+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status $Status -ResultMarkdown $ResultMarkdown -Risk 'High' -Name 'Secure Wi-Fi profiles protect Android devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Low' -Category 'Data'
41+
42+
} catch {
43+
$ErrorMessage = Get-CippException -Exception $_
44+
Write-LogMessage -API 'Tests' -tenant $Tenant -message "Failed to run test: $($ErrorMessage.NormalizedError)" -sev Error -LogData $ErrorMessage
45+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Failed' -ResultMarkdown "Error running test: $($ErrorMessage.NormalizedError)" -Risk 'High' -Name 'Secure Wi-Fi profiles protect Android devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Low' -Category 'Data'
46+
}
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
function Invoke-CippTestZTNA24870 {
2+
param($Tenant)
3+
4+
$TestId = 'ZTNA24870'
5+
6+
try {
7+
$DeviceConfigs = New-CIPPDbRequest -TenantFilter $Tenant -Type 'IntuneDeviceConfigurations'
8+
9+
if (-not $DeviceConfigs) {
10+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Investigate' -ResultMarkdown 'Device configurations not found in database' -Risk 'High' -Name 'Secure Wi-Fi profiles protect macOS devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Low' -Category 'Data'
11+
return
12+
}
13+
14+
$MacOSWifiConfProfiles = @($DeviceConfigs | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.macOSWiFiConfiguration' })
15+
$CompliantMacOSWifiConfProfiles = @($MacOSWifiConfProfiles | Where-Object { $_.wiFiSecurityType -eq 'wpaEnterprise' })
16+
$AssignedCompliantProfiles = @($CompliantMacOSWifiConfProfiles | Where-Object { $_.assignments -and $_.assignments.Count -gt 0 })
17+
$Passed = $AssignedCompliantProfiles.Count -gt 0
18+
19+
if ($Passed) {
20+
$ResultMarkdown = "✅ At least one Enterprise Wi-Fi profile for macOS exists and is assigned.`n`n"
21+
} else {
22+
$ResultMarkdown = "❌ No Enterprise Wi-Fi profile for macOS exists or none are assigned.`n`n"
23+
}
24+
25+
if ($CompliantMacOSWifiConfProfiles.Count -gt 0) {
26+
$ResultMarkdown += "## macOS WiFi Configuration Profiles`n`n"
27+
$ResultMarkdown += "| Policy Name | Wi-Fi Security Type | Assigned |`n"
28+
$ResultMarkdown += "| :---------- | :------------------ | :------- |`n"
29+
30+
foreach ($policy in $CompliantMacOSWifiConfProfiles) {
31+
$securityType = if ($policy.wiFiSecurityType) { $policy.wiFiSecurityType } else { 'Unknown' }
32+
$assigned = if ($policy.assignments -and $policy.assignments.Count -gt 0) { '✅ Yes' } else { '❌ No' }
33+
$ResultMarkdown += "| $($policy.displayName) | $securityType | $assigned |`n"
34+
}
35+
} else {
36+
$ResultMarkdown += "No compliant macOS Enterprise WiFi configuration profiles found.`n"
37+
}
38+
39+
$Status = if ($Passed) { 'Passed' } else { 'Failed' }
40+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status $Status -ResultMarkdown $ResultMarkdown -Risk 'High' -Name 'Secure Wi-Fi profiles protect macOS devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Low' -Category 'Data'
41+
42+
} catch {
43+
$ErrorMessage = Get-CippException -Exception $_
44+
Write-LogMessage -API 'Tests' -tenant $Tenant -message "Failed to run test: $($ErrorMessage.NormalizedError)" -sev Error -LogData $ErrorMessage
45+
Add-CippTestResult -TenantFilter $Tenant -TestId $TestId -TestType 'Devices' -Status 'Failed' -ResultMarkdown "Error running test: $($ErrorMessage.NormalizedError)" -Risk 'High' -Name 'Secure Wi-Fi profiles protect macOS devices from unauthorized network access' -UserImpact 'Low' -ImplementationEffort 'Low' -Category 'Data'
46+
}
47+
}

0 commit comments

Comments
 (0)