Skip to content

Commit a9869ae

Browse files
authored
Merge pull request #711 from microsoft/Feature-25403
Feature - 25403 - DC Agent is deployed and enforcing strong authentication policies.
2 parents 1bfa643 + 3e041d0 commit a9869ae

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Without the Microsoft Entra Private Access Sensor agent deployed to domain controllers, threat actors can exploit Kerberos authentication requests from any device on the network. This includes unmanaged or compromised endpoints that can obtain service tickets for on-premises resources without multifactor authentication or device compliance validation. Once initial access is established through weak authentication to domain controllers, threat actors can request Kerberos tickets for privileged resources such as file shares, database servers, and remote desktop services. This enables lateral movement across the on-premises environment. The absence of identity-centric access controls on domain controllers allows threat actors to bypass conditional access policies. Kerberos authentication traditionally operates within a perimeter-based trust model where any authenticated user can request tickets regardless of authentication strength or device posture. This creates opportunities for threat actors to maintain persistence by continuously requesting service tickets from compromised or unmanaged devices, escalating privileges by targeting Service Principal Names associated with sensitive systems, and exfiltrating data from resources that rely solely on Kerberos authentication without additional security layers. The gap becomes particularly problematic when threat actors compromise user credentials through phishing or credential theft, as they can immediately leverage those credentials to access domain-authenticated resources. This can occur without triggering conditional access policies or multifactor authentication requirements that would normally apply to cloud-based access scenarios.
2+
3+
**Remediation Resources**
4+
5+
- [Configure Microsoft Entra Private Access for Active Directory domain controllers](https://learn.microsoft.com/en-us/entra/global-secure-access/how-to-configure-domain-controllers)
6+
7+
<!--- Results --->
8+
%TestResult%
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<#
2+
.SYNOPSIS
3+
Validates that Private Access Sensors are deployed on domain controllers and enforcing strong authentication policies.
4+
5+
.DESCRIPTION
6+
This test checks if Microsoft Entra Private Access Sensors are deployed to domain controllers
7+
and configured to enforce strong authentication policies (status active and not in audit mode).
8+
9+
.NOTES
10+
Test ID: 25403
11+
Category: Private Access
12+
Required API: onPremisesPublishingProfiles/privateAccess/sensors (beta)
13+
#>
14+
15+
function Test-Assessment-25403 {
16+
[ZtTest(
17+
Category = 'Private Access',
18+
ImplementationCost = 'Medium',
19+
MinimumLicense = ('Entra_Suite', 'Entra_Premium_Private_Access'),
20+
Pillar = 'Network',
21+
RiskLevel = 'High',
22+
SfiPillar = 'Protect networks',
23+
TenantType = ('Workforce'),
24+
TestId = 25403,
25+
Title = 'DC Agent is deployed and enforcing strong authentication policies',
26+
UserImpact = 'Medium'
27+
)]
28+
[CmdletBinding()]
29+
param()
30+
31+
#region Data Collection
32+
Write-PSFMessage '🟦 Start' -Tag Test -Level VeryVerbose
33+
34+
$activity = 'Checking Private Access Sensors on domain controllers'
35+
Write-ZtProgress -Activity $activity -Status 'Getting Private Access Sensors'
36+
37+
# Query all Private Access Sensors
38+
$sensors = Invoke-ZtGraphRequest -RelativeUri 'onPremisesPublishingProfiles/privateAccess/sensors' -ApiVersion beta
39+
#endregion Data Collection
40+
41+
#region Assessment Logic
42+
# Initialize test variables
43+
$testResultMarkdown = ''
44+
$passed = $false
45+
46+
if ($null -eq $sensors -or $sensors.Count -eq 0) {
47+
# No sensors found - fail
48+
$passed = $false
49+
$testResultMarkdown = "❌ Microsoft Entra Private Access Sensors for domain controllers is not deployed.`n`n%TestResult%"
50+
}
51+
else {
52+
# Identify sensors that are active and enforcing (not in audit mode)
53+
$enforcingSensors = $sensors | Where-Object { $_.status -eq 'active' -and $_.isAuditMode -eq $false }
54+
$nonEnforcingSensors = $sensors | Where-Object { $_.status -ne 'active' -or $_.isAuditMode -eq $true }
55+
56+
# Determine pass/fail status
57+
if ($enforcingSensors.Count -gt 0 -and $nonEnforcingSensors.Count -eq 0) {
58+
# All sensors are active and enforcing - pass
59+
$passed = $true
60+
$testResultMarkdown = "✅ Microsoft Entra Private Access for domain controllers is deployed and enforcing strong authentication policies.`n`n%TestResult%"
61+
}
62+
elseif ($enforcingSensors.Count -eq 0) {
63+
# No sensors are enforcing - fail
64+
$passed = $false
65+
$testResultMarkdown = "❌ Microsoft Entra Private Access Sensors are deployed but strong authentication policies are not configured.`n`n%TestResult%"
66+
}
67+
else {
68+
# Some sensors enforcing, some not - partial deployment warning (fail)
69+
$passed = $false
70+
$testResultMarkdown = "⚠️ Microsoft Entra Private Access Sensors are partially configured. Some domain controllers are not enforcing strong authentication policies.`n`n%TestResult%"
71+
}
72+
}
73+
#endregion Assessment Logic
74+
75+
#region Report Generation
76+
# Build detailed markdown information
77+
$mdInfo = ''
78+
79+
if ($sensors -and $sensors.Count -gt 0) {
80+
$reportTitle = "Private Access Sensors"
81+
82+
$mdInfo += "`n## $reportTitle`n`n"
83+
$mdInfo += "[Open Private Access in Entra Portal](https://entra.microsoft.com/#view/Microsoft_Azure_Network_Access/PrivateAccessOverview.ReactView)`n`n"
84+
85+
# Summary statistics
86+
$mdInfo += "- **Total sensors**: $($sensors.Count)`n"
87+
$mdInfo += "- **Active and enforcing**: $($enforcingSensors.Count)`n"
88+
$mdInfo += "- **Not enforcing**: $($nonEnforcingSensors.Count)`n`n"
89+
90+
# Show warning for sensors not enforcing
91+
if ($nonEnforcingSensors.Count -gt 0) {
92+
$mdInfo += "**⚠️ Sensors not enforcing policies:** $($nonEnforcingSensors.Count)`n`n"
93+
}
94+
95+
# Build table rows - show problematic sensors first
96+
$allSensors = @()
97+
$allSensors += $nonEnforcingSensors | ForEach-Object { $_ | Add-Member -NotePropertyName 'Priority' -NotePropertyValue 1 -PassThru -Force }
98+
$allSensors += $enforcingSensors | ForEach-Object { $_ | Add-Member -NotePropertyName 'Priority' -NotePropertyValue 2 -PassThru -Force }
99+
100+
$tableRows = $allSensors | Sort-Object -Property Priority, machineName | ForEach-Object {
101+
$statusIcon = if ($_.status -eq 'active') { '' } else { '' }
102+
$auditModeIcon = if ($_.isAuditMode) { '⚠️ Yes' } else { '✅ No' }
103+
$machineName = Get-SafeMarkdown $_.machineName
104+
$version = Get-SafeMarkdown $_.version
105+
$externalIp = Get-SafeMarkdown $_.externalIp
106+
107+
"| $machineName | $statusIcon $($_.status) | $auditModeIcon | $version | $externalIp |"
108+
}
109+
110+
$mdInfo += @'
111+
| Machine name | Status | Audit mode | Version | External IP |
112+
| :----------- | :----- | :--------- | :------ | :---------- |
113+
{0}
114+
115+
'@ -f ($tableRows -join "`n")
116+
}
117+
118+
# Replace the placeholder with detailed information
119+
$testResultMarkdown = $testResultMarkdown -replace '%TestResult%', $mdInfo
120+
#endregion Report Generation
121+
122+
$params = @{
123+
TestId = '25403'
124+
Title = 'DC Agent is deployed and enforcing strong authentication policies'
125+
Status = $passed
126+
Result = $testResultMarkdown
127+
}
128+
129+
Add-ZtTestResultDetail @params
130+
}

0 commit comments

Comments
 (0)