Entra Connect Health Is the Privileged Agent Nobody Remembers Installing

A monitoring agent installed years ago and forgotten now has a line of sight into administrator mailboxes and tenant data, and attackers are using it.

Entra Connect Health Is the Privileged Agent Nobody Remembers Installing

A health-monitoring agent you probably installed in an afternoon four years ago, ticked “done,” and never looked at again is now showing up in active-exploitation headlines. That’s the whole uncomfortable shape of this story. The thing watching your sync infrastructure had a line of sight into administrator mailboxes and tenant data, and someone used it.

Before anyone forwards this to their CISO with the subject line “WE ARE BREACHED”: slow down. What’s circulating right now is a news headline and a LinkedIn write-up, not a Microsoft Security Response Center advisory with a CVE, a fixed build number, and a KB. I’m not going to invent any of those for you. When the authoritative version lands, the version and patch details in it win over anything in this post. Treat what follows as how to reduce your exposure to this class of problem while the specifics firm up, which, conveniently, is exactly what you should have done last year anyway.

What this agent actually is, and why it’s a juicy target

Microsoft Entra Connect Health, the thing older runbooks still call Azure AD Connect Health, is a monitoring service. You install agents on your hybrid identity plumbing: the Entra Connect sync servers, AD FS and Web Application Proxy boxes, and domain controllers. Those agents phone home to a cloud service that renders dashboards, alerts you when the token-signing cert is about to expire, flags sync errors, and shows AD FS sign-in trends.

To do that job, the agent and its backing service principal need to be trusted by your tenant. That’s the part people forget. This is not a passive log shipper. It’s an authenticated bridge from on-prem infrastructure into your Entra tenant, with visibility into the identity layer. Anything that can impersonate that trust, or read what that service can read, inherits a privileged vantage point. The reporting says that vantage point exposed administrator emails and tenant data. Given where this thing sits, that’s depressingly plausible rather than shocking.

Note the blast radius, though, and don’t inflate it. This is about Connect Health, the monitoring layer. It is not the same as “every Entra Connect sync deployment is compromised.” If you run sync but never deployed the Health agents, you are, on current information, not in the exposed population. Verify that before you panic or, worse, before you tell leadership you’re fine.

Figure out whether you’re even in the blast zone

Start in the portal. In the Microsoft Entra admin center, go to Identity > Hybrid management > Microsoft Entra Connect > Connect Health. (On older tenants the trail reads Azure AD > Azure AD Connect > Connect Health.) If you see registered services and agents, you have Connect Health deployed and you’re in scope for this conversation. An empty blade is the best news you’ll get today.

Then pull the receipts. This read-only query walks your directory audit log for the activity around hybrid health and service-principal changes so you can eyeball anything you didn’t do. It paginates and it doesn’t change a thing:

audit.ps1PowerShell
Connect-MgGraph -Scopes "AuditLog.Read.All","Directory.Read.All" -NoWelcome
​
$startDate = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ssZ")
​
try {
    $filter = "activityDateTime ge $startDate"
    $auditEvents = Get-MgAuditLogDirectoryAudit -Filter $filter -All -ErrorAction Stop
}
catch {
    Write-Error "Failed to read directory audit logs: $($_.Exception.Message)"
    return
}
​
# Narrow to the noise that matters: anything touching health, sync, or service principals
$suspect = $auditEvents | Where-Object {
    $_.Category -in @('ApplicationManagement','ServicePrincipal','DirectoryManagement') -or
    $_.ActivityDisplayName -match 'health|sync|service principal|credential|certificate'
}
​
$suspect |
    Select-Object ActivityDateTime, ActivityDisplayName,
        @{N='Actor';E={ $_.InitiatedBy.User.UserPrincipalName ?? $_.InitiatedBy.App.DisplayName }},
        @{N='Target';E={ ($_.TargetResources.DisplayName) -join ', ' }} |
    Sort-Object ActivityDateTime |
    Format-Table -AutoSize
​
Write-Host "Reviewed $($auditEvents.Count) audit events; $($suspect.Count) flagged for review." -ForegroundColor Cyan

Do the same for interactive and service-principal sign-ins over the same window, and pay attention to source IPs and any sign-ins attributed to the Connect Health service that don’t line up with your agent servers. Export it, read it with human eyes, and keep it, if this turns into a real incident you’ll want the before picture.

Two ways out, judged on what matters

Once you’ve confirmed you’re exposed, there are two camps, and admins are already arguing about which is right. Camp one: keep Connect Health running, lock it down, and patch when Microsoft ships a fix. Camp two: decommission Connect Health now and decide later whether you ever want it back. Let’s run them against the criteria that actually decide this, not a feature grid.

Round one, blast-radius reduction. Removing the agents and the trust relationship removes the attack surface entirely; there’s nothing left to exploit. Patching reduces risk only after a patch exists, and right now one may not. Decommission wins, and it isn’t close. Score: Remove 1, Keep 0.

Round two, forensics and detection. This one flips. If you rip everything out in a panic on Monday, you’ve just destroyed the telemetry and the registration state that an investigation needs. The agents and their sign-in trail are evidence. Keeping the deployment intact, isolated, but intact, while you preserve logs gives you a better forensic position. Keep wins. Score: Remove 1, Keep 1.

Round three, operational visibility you give up. Here’s what the “just delete it” crowd waves away. For shops still running AD FS at scale, Connect Health is often the only thing watching token-signing certificate expiry, extranet account lockout, and sync latency. Pull it blind and your next outage is self-inflicted, a cert nobody was watching, expiring on a Saturday. Keep wins again on this axis. Score: Remove 1, Keep 2.

Round four, rollback safety. Re-registering Connect Health agents later is annoying but entirely recoverable; nothing is destroyed by removing them. Leaving a potentially exploited trust in place because removal felt risky is the worse gamble. On reversibility, removal is the safer default. Score: Remove 2, Keep 2.

The verdict, and the one time you do the opposite

Tied on points, which means the tiebreaker is sequencing, not ideology. Do both, in order. First preserve and export the audit and sign-in logs, that’s the forensic round, and you only get one shot at it. Then reduce the attack surface aggressively: remove agents you don’t genuinely need, and for the Connect Health service principal, rotate credentials and tighten who can touch it. Don’t bulk-disable service principals straight from a live query and hope; export the list, have a second person review it, and run any change in dry-run first.

audit.ps1PowerShell
# Dry run FIRST. Review the exported object before removing -WhatIf.
# $targetSpId must come from a reviewed export, never a raw live query.
Update-MgServicePrincipal -ServicePrincipalId $targetSpId `
    -AccountEnabled:$false -WhatIf

So: remove-and-rebuild is the right default for most tenants, after you’ve banked the evidence. The exception, the one case to side with the losing camp and keep it running, is the large AD FS estate where Connect Health is your sole early-warning system for cert expiry and lockouts. There, ripping it out blind trades a possible breach for a certain outage. Isolate it, restrict it, watch it like a hawk, and patch the moment Microsoft publishes a build, but don’t go dark on your own identity plane.

The broader lesson is the one this industry keeps failing the retake on. Every agent you install to watch privileged infrastructure becomes privileged infrastructure. Monitoring tools get the same “set it and forget it” treatment as a screensaver, and then one of them turns up in a headline. Go find out how many of these quiet little bridges you’ve got standing. That number is almost always higher than you think.