Skip to content

Commit 4403e7b

Browse files
Updated tests after testing
1 parent ac7a4dc commit 4403e7b

36 files changed

+237
-221
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function Invoke-CippTestZTNA21896 {
22
param($Tenant)
3-
3+
#tested
44
try {
55
$ServicePrincipals = New-CIPPDbRequest -TenantFilter $Tenant -Type 'ServicePrincipals'
66
if (-not $ServicePrincipals) {
@@ -47,8 +47,7 @@ function Invoke-CippTestZTNA21896 {
4747
$Result = $ResultLines -join "`n"
4848

4949
Add-CippTestResult -TenantFilter $Tenant -TestId 'ZTNA21896' -TestType 'Identity' -Status $Status -ResultMarkdown $Result -Risk 'Medium' -Name 'Service principals do not have certificates or credentials associated with them' -UserImpact 'Low' -ImplementationEffort 'Medium' -Category 'Application management'
50-
}
51-
catch {
50+
} catch {
5251
$ErrorMessage = Get-CippException -Exception $_
5352
Write-LogMessage -API 'Tests' -tenant $Tenant -message "Failed to run test: $($ErrorMessage.NormalizedError)" -sev Error -LogData $ErrorMessage
5453
Add-CippTestResult -TenantFilter $Tenant -TestId 'ZTNA21896' -TestType 'Identity' -Status 'Failed' -ResultMarkdown "Test failed: $($ErrorMessage.NormalizedError)" -Risk 'Medium' -Name 'Service principals do not have certificates or credentials associated with them' -UserImpact 'Low' -ImplementationEffort 'Medium' -Category 'Application management'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function Invoke-CippTestZTNA21941 {
1616
[Parameter(Mandatory = $true)]
1717
[string]$Tenant
1818
)
19-
19+
#Tested
2020
try {
2121
# Get CA policies from cache
2222
$CAPolicies = New-CIPPDbRequest -TenantFilter $Tenant -Type 'ConditionalAccessPolicies'

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

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,24 @@ function Invoke-CippTestZTNA21953 {
1515
[Parameter(Mandatory = $true)]
1616
[string]$Tenant
1717
)
18+
#Tested
1819

1920
try {
2021
# Get device registration policy from cache
2122
$DeviceRegPolicy = New-CIPPDbRequest -TenantFilter $Tenant -Type 'DeviceRegistrationPolicy'
2223

2324
if (-not $DeviceRegPolicy) {
2425
$TestParams = @{
25-
TestId = 'ZTNA21953'
26-
TenantFilter = $Tenant
27-
TestType = 'ZeroTrustNetworkAccess'
28-
Status = 'Skipped'
29-
ResultMarkdown = 'Unable to retrieve device registration policy from cache.'
30-
Risk = 'High'
31-
Name = 'Deploy Windows Local Administrator Password Solution (LAPS)'
32-
UserImpact = 'Low'
26+
TestId = 'ZTNA21953'
27+
TenantFilter = $Tenant
28+
TestType = 'ZeroTrustNetworkAccess'
29+
Status = 'Skipped'
30+
ResultMarkdown = 'Unable to retrieve device registration policy from cache.'
31+
Risk = 'High'
32+
Name = 'Deploy Windows Local Administrator Password Solution (LAPS)'
33+
UserImpact = 'Low'
3334
ImplementationEffort = 'Low'
34-
Category = 'Device security'
35+
Category = 'Device security'
3536
}
3637
Add-CippTestResult @TestParams
3738
return
@@ -51,31 +52,31 @@ function Invoke-CippTestZTNA21953 {
5152
}
5253

5354
$TestParams = @{
54-
TestId = 'ZTNA21953'
55-
TenantFilter = $Tenant
56-
TestType = 'ZeroTrustNetworkAccess'
57-
Status = $Status
58-
ResultMarkdown = $ResultMarkdown
59-
Risk = 'High'
60-
Name = 'Deploy Windows Local Administrator Password Solution (LAPS)'
61-
UserImpact = 'Low'
55+
TestId = 'ZTNA21953'
56+
TenantFilter = $Tenant
57+
TestType = 'ZeroTrustNetworkAccess'
58+
Status = $Status
59+
ResultMarkdown = $ResultMarkdown
60+
Risk = 'High'
61+
Name = 'Deploy Windows Local Administrator Password Solution (LAPS)'
62+
UserImpact = 'Low'
6263
ImplementationEffort = 'Low'
63-
Category = 'Device security'
64+
Category = 'Device security'
6465
}
6566
Add-CippTestResult @TestParams
6667

6768
} catch {
6869
$TestParams = @{
69-
TestId = 'ZTNA21953'
70-
TenantFilter = $Tenant
71-
TestType = 'ZeroTrustNetworkAccess'
72-
Status = 'Failed'
73-
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
74-
Risk = 'High'
75-
Name = 'Deploy Windows Local Administrator Password Solution (LAPS)'
76-
UserImpact = 'Low'
70+
TestId = 'ZTNA21953'
71+
TenantFilter = $Tenant
72+
TestType = 'ZeroTrustNetworkAccess'
73+
Status = 'Failed'
74+
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
75+
Risk = 'High'
76+
Name = 'Deploy Windows Local Administrator Password Solution (LAPS)'
77+
UserImpact = 'Low'
7778
ImplementationEffort = 'Low'
78-
Category = 'Device security'
79+
Category = 'Device security'
7980
}
8081
Add-CippTestResult @TestParams
8182
Write-LogMessage -API 'ZeroTrustNetworkAccess' -tenant $Tenant -message "Test ZTNA21953 failed: $($_.Exception.Message)" -sev Error

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ function Invoke-CippTestZTNA21954 {
1515
[Parameter(Mandatory = $true)]
1616
[string]$Tenant
1717
)
18-
18+
#Tested
1919
try {
2020
# Get authorization policy from cache
2121
$AuthPolicy = New-CIPPDbRequest -TenantFilter $Tenant -Type 'AuthorizationPolicy'
2222

2323
if (-not $AuthPolicy) {
2424
$TestParams = @{
25-
TestId = 'ZTNA21954'
26-
TenantFilter = $Tenant
27-
TestType = 'ZeroTrustNetworkAccess'
28-
Status = 'Skipped'
29-
ResultMarkdown = 'Unable to retrieve authorization policy from cache.'
30-
Risk = 'Low'
31-
Name = 'Restrict non-admin users from reading BitLocker recovery keys'
32-
UserImpact = 'Low'
25+
TestId = 'ZTNA21954'
26+
TenantFilter = $Tenant
27+
TestType = 'ZeroTrustNetworkAccess'
28+
Status = 'Skipped'
29+
ResultMarkdown = 'Unable to retrieve authorization policy from cache.'
30+
Risk = 'Low'
31+
Name = 'Restrict non-admin users from reading BitLocker recovery keys'
32+
UserImpact = 'Low'
3333
ImplementationEffort = 'Low'
34-
Category = 'Device security'
34+
Category = 'Device security'
3535
}
3636
Add-CippTestResult @TestParams
3737
return
@@ -51,31 +51,31 @@ function Invoke-CippTestZTNA21954 {
5151
}
5252

5353
$TestParams = @{
54-
TestId = 'ZTNA21954'
55-
TenantFilter = $Tenant
56-
TestType = 'ZeroTrustNetworkAccess'
57-
Status = $Status
58-
ResultMarkdown = $ResultMarkdown
59-
Risk = 'Low'
60-
Name = 'Restrict non-admin users from reading BitLocker recovery keys'
61-
UserImpact = 'Low'
54+
TestId = 'ZTNA21954'
55+
TenantFilter = $Tenant
56+
TestType = 'ZeroTrustNetworkAccess'
57+
Status = $Status
58+
ResultMarkdown = $ResultMarkdown
59+
Risk = 'Low'
60+
Name = 'Restrict non-admin users from reading BitLocker recovery keys'
61+
UserImpact = 'Low'
6262
ImplementationEffort = 'Low'
63-
Category = 'Device security'
63+
Category = 'Device security'
6464
}
6565
Add-CippTestResult @TestParams
6666

6767
} catch {
6868
$TestParams = @{
69-
TestId = 'ZTNA21954'
70-
TenantFilter = $Tenant
71-
TestType = 'ZeroTrustNetworkAccess'
72-
Status = 'Failed'
73-
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
74-
Risk = 'Low'
75-
Name = 'Restrict non-admin users from reading BitLocker recovery keys'
76-
UserImpact = 'Low'
69+
TestId = 'ZTNA21954'
70+
TenantFilter = $Tenant
71+
TestType = 'ZeroTrustNetworkAccess'
72+
Status = 'Failed'
73+
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
74+
Risk = 'Low'
75+
Name = 'Restrict non-admin users from reading BitLocker recovery keys'
76+
UserImpact = 'Low'
7777
ImplementationEffort = 'Low'
78-
Category = 'Device security'
78+
Category = 'Device security'
7979
}
8080
Add-CippTestResult @TestParams
8181
Write-LogMessage -API 'ZeroTrustNetworkAccess' -tenant $Tenant -message "Test ZTNA21954 failed: $($_.Exception.Message)" -sev Error

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ function Invoke-CippTestZTNA21955 {
1515
[Parameter(Mandatory = $true)]
1616
[string]$Tenant
1717
)
18-
18+
#Tested
1919
try {
2020
# Get device registration policy from cache
2121
$DeviceRegPolicy = New-CIPPDbRequest -TenantFilter $Tenant -Type 'DeviceRegistrationPolicy'
2222

2323
if (-not $DeviceRegPolicy) {
2424
$TestParams = @{
25-
TestId = 'ZTNA21955'
26-
TenantFilter = $Tenant
27-
TestType = 'ZeroTrustNetworkAccess'
28-
Status = 'Skipped'
29-
ResultMarkdown = 'Unable to retrieve device registration policy from cache.'
30-
Risk = 'Medium'
31-
Name = 'Manage local admins on Entra joined devices'
32-
UserImpact = 'Low'
25+
TestId = 'ZTNA21955'
26+
TenantFilter = $Tenant
27+
TestType = 'ZeroTrustNetworkAccess'
28+
Status = 'Skipped'
29+
ResultMarkdown = 'Unable to retrieve device registration policy from cache.'
30+
Risk = 'Medium'
31+
Name = 'Manage local admins on Entra joined devices'
32+
UserImpact = 'Low'
3333
ImplementationEffort = 'Low'
34-
Category = 'Device security'
34+
Category = 'Device security'
3535
}
3636
Add-CippTestResult @TestParams
3737
return
@@ -51,31 +51,31 @@ function Invoke-CippTestZTNA21955 {
5151
}
5252

5353
$TestParams = @{
54-
TestId = 'ZTNA21955'
55-
TenantFilter = $Tenant
56-
TestType = 'ZeroTrustNetworkAccess'
57-
Status = $Status
58-
ResultMarkdown = $ResultMarkdown
59-
Risk = 'Medium'
60-
Name = 'Manage local admins on Entra joined devices'
61-
UserImpact = 'Low'
54+
TestId = 'ZTNA21955'
55+
TenantFilter = $Tenant
56+
TestType = 'ZeroTrustNetworkAccess'
57+
Status = $Status
58+
ResultMarkdown = $ResultMarkdown
59+
Risk = 'Medium'
60+
Name = 'Manage local admins on Entra joined devices'
61+
UserImpact = 'Low'
6262
ImplementationEffort = 'Low'
63-
Category = 'Device security'
63+
Category = 'Device security'
6464
}
6565
Add-CippTestResult @TestParams
6666

6767
} catch {
6868
$TestParams = @{
69-
TestId = 'ZTNA21955'
70-
TenantFilter = $Tenant
71-
TestType = 'ZeroTrustNetworkAccess'
72-
Status = 'Failed'
73-
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
74-
Risk = 'Medium'
75-
Name = 'Manage local admins on Entra joined devices'
76-
UserImpact = 'Low'
69+
TestId = 'ZTNA21955'
70+
TenantFilter = $Tenant
71+
TestType = 'ZeroTrustNetworkAccess'
72+
Status = 'Failed'
73+
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
74+
Risk = 'Medium'
75+
Name = 'Manage local admins on Entra joined devices'
76+
UserImpact = 'Low'
7777
ImplementationEffort = 'Low'
78-
Category = 'Device security'
78+
Category = 'Device security'
7979
}
8080
Add-CippTestResult @TestParams
8181
Write-LogMessage -API 'ZeroTrustNetworkAccess' -tenant $Tenant -message "Test ZTNA21955 failed: $($_.Exception.Message)" -sev Error

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function Invoke-CippTestZTNA21964 {
22
param($Tenant)
33

44
$TestId = 'ZTNA21964'
5-
5+
#Tested
66
try {
77
$AuthStrengths = New-CIPPDbRequest -TenantFilter $Tenant -Type 'AuthenticationStrengths'
88

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Invoke-CippTestZTNA21992 {
44
try {
55
$Apps = New-CIPPDbRequest -TenantFilter $Tenant -Type 'Apps'
66
$ServicePrincipals = New-CIPPDbRequest -TenantFilter $Tenant -Type 'ServicePrincipals'
7-
7+
#Tested
88
if (-not $Apps -and -not $ServicePrincipals) {
99
Add-CippTestResult -TenantFilter $Tenant -TestId 'ZTNA21992' -TestType 'Identity' -Status 'Investigate' -ResultMarkdown 'Application and service principal data not found in database' -Risk 'High' -Name 'Application certificates must be rotated on a regular basis' -UserImpact 'Low' -ImplementationEffort 'High' -Category 'Application management'
1010
return

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ function Invoke-CippTestZTNA22124 {
1515
[Parameter(Mandatory = $true)]
1616
[string]$Tenant
1717
)
18-
18+
#Tested
1919
try {
2020
# Get directory recommendations from cache
2121
$Recommendations = New-CIPPDbRequest -TenantFilter $Tenant -Type 'DirectoryRecommendations'
2222

2323
if (-not $Recommendations) {
2424
$TestParams = @{
25-
TestId = 'ZTNA22124'
26-
TenantFilter = $Tenant
27-
TestType = 'ZeroTrustNetworkAccess'
28-
Status = 'Skipped'
29-
ResultMarkdown = 'Unable to retrieve directory recommendations from cache.'
30-
Risk = 'High'
31-
Name = 'Address high priority Entra recommendations'
32-
UserImpact = 'Medium'
25+
TestId = 'ZTNA22124'
26+
TenantFilter = $Tenant
27+
TestType = 'ZeroTrustNetworkAccess'
28+
Status = 'Skipped'
29+
ResultMarkdown = 'Unable to retrieve directory recommendations from cache.'
30+
Risk = 'High'
31+
Name = 'Address high priority Entra recommendations'
32+
UserImpact = 'Medium'
3333
ImplementationEffort = 'Medium'
34-
Category = 'Governance'
34+
Category = 'Governance'
3535
}
3636
Add-CippTestResult @TestParams
3737
return
@@ -67,31 +67,31 @@ function Invoke-CippTestZTNA22124 {
6767
}
6868

6969
$TestParams = @{
70-
TestId = 'ZTNA22124'
71-
TenantFilter = $Tenant
72-
TestType = 'ZeroTrustNetworkAccess'
73-
Status = $Status
74-
ResultMarkdown = $ResultMarkdown
75-
Risk = 'High'
76-
Name = 'Address high priority Entra recommendations'
77-
UserImpact = 'Medium'
70+
TestId = 'ZTNA22124'
71+
TenantFilter = $Tenant
72+
TestType = 'ZeroTrustNetworkAccess'
73+
Status = $Status
74+
ResultMarkdown = $ResultMarkdown
75+
Risk = 'High'
76+
Name = 'Address high priority Entra recommendations'
77+
UserImpact = 'Medium'
7878
ImplementationEffort = 'Medium'
79-
Category = 'Governance'
79+
Category = 'Governance'
8080
}
8181
Add-CippTestResult @TestParams
8282

8383
} catch {
8484
$TestParams = @{
85-
TestId = 'ZTNA22124'
86-
TenantFilter = $Tenant
87-
TestType = 'ZeroTrustNetworkAccess'
88-
Status = 'Failed'
89-
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
90-
Risk = 'High'
91-
Name = 'Address high priority Entra recommendations'
92-
UserImpact = 'Medium'
85+
TestId = 'ZTNA22124'
86+
TenantFilter = $Tenant
87+
TestType = 'ZeroTrustNetworkAccess'
88+
Status = 'Failed'
89+
ResultMarkdown = "❌ **Error**: $($_.Exception.Message)"
90+
Risk = 'High'
91+
Name = 'Address high priority Entra recommendations'
92+
UserImpact = 'Medium'
9393
ImplementationEffort = 'Medium'
94-
Category = 'Governance'
94+
Category = 'Governance'
9595
}
9696
Add-CippTestResult @TestParams
9797
Write-LogMessage -API 'ZeroTrustNetworkAccess' -tenant $Tenant -message "Test ZTNA22124 failed: $($_.Exception.Message)" -sev Error

0 commit comments

Comments
 (0)