Join our Newsletter — 33% off our NHI Course
Home› Guides› Azure Arc-Enabled Servers Security Guide: Protecting Managed Identities…
Guide Endpoint Security

Azure Arc-Enabled Servers Security Guide: Protecting Managed Identities on On-Premises Hosts

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 15 min read
On this page

Every server you connect to Azure Arc receives a Microsoft Entra managed identity, and the credential behind it is a certificate file sitting on the server's own disk. That turns each on-premises or other-cloud host into a holder of a cloud workload identity, with a local token endpoint that applications, extensions and any sufficiently privileged attacker can use. This guide is the deep dive on that identity: how the token flow works, who can reach it, how the certificate is stored and rotated, what to grant it, how to monitor it and how to respond when it may be compromised. It is written for platform engineers, identity teams and detection engineers who run Arc at scale. For the wider Arc picture (agent services, extension allowlists, Run Command and the onboarding service principal) read the Azure Arc Security Guide first; this page does not repeat it.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • The certificate is the identity. Microsoft states that anyone with the managed identity certificate can request a token from Entra ID, so the files under the agent's Certs folder are a cloud credential and must be protected like a private key.
  • Local group membership equals cloud access. Local administrators, root, the Windows Hybrid Agent Extension Applications group and the Linux himds group can read the challenge token and obtain Entra tokens for the machine.
  • Conditional Access does not cover it. Entra Conditional Access for workload identities explicitly excludes managed identities, so least privilege on Azure RBAC and monitoring are the only real controls.
  • Rotation is automatic only while connected. The certificate lasts 90 days and renews at 45 days or fewer remaining; an agent offline past expiry needs a fresh onboarding credential to reconnect.
  • Compromise response is disconnect and reconnect. Disconnecting deletes the Azure resource and its managed identity, so reconnecting issues a new identity, and every role assignment must be recreated.

How identity and access work in Azure Arc-enabled servers

When Arc onboards a machine, Azure Resource Manager creates a service principal for a system-assigned managed identity in the Entra tenant that trusts the subscription, then gives the agent's identity service (HIMDS) that identity's client ID and certificate. The identity appears in Entra ID as an enterprise application with the same name as the server resource, so a server called prodsvr01 produces an enterprise app called prodsvr01. Each one counts as a directory object against the tenant's object quota, which Microsoft says to check (the directorySizeLimit value) before large deployments.

The local token endpoint

ItemValue on an Arc-enabled serverDifference from an Azure VM
Endpointhttp://localhost:40342/metadata/identity/oauth2/token, published in the IDENTITY_ENDPOINT environment variable, with IMDS_ENDPOINT=http://localhost:40342Azure VMs use the link-local address 169.254.169.254
ReachabilityOnly from processes on the server itselfSame principle: no remote access to the endpoint
Authentication of the callerChallenge-response: the first request returns WWW-Authenticate: Basic realm=<path>, the caller reads that file and repeats the request with Authorization: Basic <secret>Azure VM IMDS needs only the Metadata: true header, so any local process can get a token
Who can read the challenge fileWindows: local Administrators and Hybrid Agent Extension Applications. Linux: root and the himds groupNo file check on Azure VMs
Non-token metadataAvailable to any process on the machineSimilar
Identity typesSystem-assigned. The Azure Identity SDK raises an error if Arc returns the system-assigned token when a user-assigned identity was requestedAzure VMs support system and user-assigned

Where the credential lives

PlatformManaged identity certificateChallenge token files
WindowsC:\ProgramData\AzureConnectedMachineAgent\Certs\C:\ProgramData\AzureConnectedMachineAgent\Tokens
Linux/var/opt/azcmagent/certs/var/opt/azcmagent/tokens

The agent sets an ACL on the certificate that limits access to local administrators and the himds account, and Microsoft tells you not to change those permissions or touch the certificates. The challenge-response flow raises the bar above Azure VM IMDS, but it is not a boundary against an attacker who already has administrator or root rights: such an attacker can read the challenge file or the certificate itself. Reading the certificate is the more serious case, because it can be used off the box until it expires, which maps to MITRE ATT&CK T1552.004 Private Keys and then T1078.004 Cloud Accounts. Requesting tokens through the endpoint maps to T1552.005 Cloud Instance Metadata API and T1528 Steal Application Access Token.

How applications use it

  • SDK support: the Azure Identity libraries list Azure Arc as a supported managed identity environment for both DefaultAzureCredential and ManagedIdentityCredential, so most code written for Azure VMs works on Arc without change.
  • SDK safety checks: the Python implementation validates that the challenge file is inside the expected Tokens directory, has a .key extension and is at most 4,096 bytes before reading it. Custom scripts that follow the header path blindly should apply the same checks.
  • Token audience: only services that accept Entra ID tokens can be reached. The resource parameter selects the audience, for example https://management.azure.com/ for Azure Resource Manager or a Key Vault or Storage audience.
  • Typical use: Microsoft's own example is pulling TLS certificates for IIS or Linux web servers from Key Vault with the server identity, replacing a stored client secret. See the Azure Key Vault Security Guide.

Admin roles and privileged access

Two different sets of people control the managed identity, and both need governing.

WhoWhat they can do to the identityControl
Local administrators and root on the serverRead the challenge file or certificate, add accounts to Hybrid Agent Extension Applications or himds, disconnect the agentTiered administration, LAPS or PAM for local admin, alerting on group changes
Owners and User Access Administrators on the Arc scopeGrant the identity new Azure roles (role assignments with the machine as principal)PIM-eligible only, alerts on role assignment writes
Contributor and Azure Connected Machine Resource AdministratorDeploy extensions that run as Local System or root and can therefore use the identity; read, modify, reonboard and delete the machineMicrosoft says to treat any Contributor on the resource as an indirect administrator of the server
Azure Connected Machine OnboardingCreate new Arc machines, each with a new identity; cannot manage extensions or delete serversOnboarding service principal only
Entra administratorsView and manage the enterprise application object that represents the identityRestrict Application Administrator and Cloud Application Administrator roles
  • Tier the server and its identity together: a Tier 0 server (domain controller, PKI, identity sync) must not have an identity with rights over Tier 1 or 2 Azure resources, and nobody outside Tier 0 administration should hold local admin on it. See the Tiered Administration and Enterprise Access Model Guide.
  • Grant at the narrowest scope: assign the machine identity data-plane roles on a single resource (Key Vault Secrets User on one vault, Storage Blob Data Reader on one container) rather than Contributor at resource group or subscription scope. See the Azure RBAC and Service Principals Guide.
  • Record an owner: the enterprise application is named after the server, not the workload, so tag the Arc resource with the application owner who justifies each role assignment. See the NHI Ownership Guide.

Integrations, API tokens and service accounts

Giving an application access to the identity

Microsoft's documented way to let a custom application use the machine identity is to add the application's local service account to Hybrid Agent Extension Applications (Windows) or himds (Linux). That grant is all or nothing: the account can then obtain tokens for every Azure role the machine identity holds.

  • One workload per identity: if a server hosts two applications with different Azure needs, the machine identity ends up holding the union of their rights. Split them onto separate servers, or keep one on a narrowly scoped app registration with a certificate credential held in a vault.
  • Dedicated service accounts: add only a specific, non-interactive service account to the group, never a human admin group or a broad domain group.
  • Review membership quarterly: group membership is the access list for the cloud credential, and Entra access reviews can include the managed identity's role assignments. See the Access Reviews Guide.

Replacing stored secrets

Option for an on-premises workloadCredential on the serverRotationWhen it fits
Client secret in a config fileStatic string, often in plain textManualAvoid; the most common leaked credential type
App registration with certificatePrivate key you deploy and protectYour own processWorkloads that need their own identity separate from the server, or several identities per host
Arc system-assigned managed identityAgent-managed certificate under CertsAutomatic every 90 days while connectedOne workload per server, Entra-protected resources only
Workload identity federationExternal token from an issuer you trust (for example Kubernetes or a CI system)Short-lived tokensWorkloads that already have a trusted identity provider

See the Azure Entra Client Secrets Security Guide and the Workload Identity Federation Guide.

Credentials used to manage the agent itself

  • Reconnect credentials: an expired agent cannot reconnect itself, so recovery needs an onboarding credential. Keep that credential in a vault for operators, not on servers.
  • Prefer certificates or short-lived tokens: azcmagent connect and disconnect accept a service principal certificate (PEM, or PFX without a password) or an --access-token; if a secret is unavoidable, pass it in a --config file so it stays out of console history and logs.
  • Images: the certificate on disk is the credential, so an image or backup captured from a connected server carries that server's identity. Build golden images before onboarding and connect each machine at first boot. See the Server Build and Golden Image Hardening Guide.

Logging and detection

Token use and identity changes show up in three places: Entra ID, the Azure Activity Log and the server. Correlate them, because a stolen certificate used from elsewhere leaves Entra and resource logs but nothing on the server.

SourceEvent or dataWhat to alert on
Entra sign-in logs: managed identity sign-insSign-ins by the identity, grouped by identity, status and target resourceNew target resources for a machine identity; sign-ins for a server that is offline or decommissioned
Azure Activity LogMicrosoft.Authorization/roleAssignments/write where the principal is a machine identityAny new role for an Arc identity, especially Owner, Contributor or User Access Administrator
Azure Activity LogDelete and create of Microsoft.HybridCompute/machinesUnplanned reonboarding, which issues a new identity
Resource diagnostic logs (Key Vault, Storage)Caller object ID of the machine identityAccess to secrets or blobs outside the workload's normal set
Windows Security logEvent ID 4732 (member added to a security-enabled local group)Additions to Hybrid Agent Extension Applications or Administrators
Linux auditdWatch rules on /etc/group and on /var/opt/azcmagent/certs and tokenshimds group changes; reads of the certificate by anything other than the agent
Agent logshimds.log in the agent Log folderRepeated token requests, certificate renewal errors
Resource Health and AdvisorHeartbeat and agent versionAgents disconnected long enough to approach certificate expiry

Stream Entra sign-in logs to your SIEM through Entra diagnostic settings (Log Analytics, an event hub or storage; Microsoft notes delivery can take time). On Windows, file-system auditing on the Certs folder generates event 4663 when a SACL is configured. See the Entra ID Sign-In and Audit Log Detection Guide.

Metrics that show it is working

  • Privileged machine identities: number of Arc identities holding Owner, Contributor or User Access Administrator at any scope (target zero).
  • Scope breadth: percentage of Arc identity role assignments made at single-resource scope rather than resource group or subscription.
  • Group hygiene: accounts in Hybrid Agent Extension Applications or himds without a recorded owner (target zero).
  • Certificate risk: agents disconnected for more than 30 days, which are at risk of certificate expiry and forced reonboarding.
  • Orphaned identities: role assignments whose principal no longer exists after a disconnect, cleaned up each month.

Hardening baseline

  1. Inventory first: list every Arc machine, whether its identity holds any role assignment, and which local accounts are in the extension groups. Azure Resource Graph and a role assignment export by principal type give the cloud side.
  2. Remove what is unused: most Arc servers are onboarded for patching, Defender or monitoring and need no role assignment for their identity at all. Strip assignments that have no named workload.
  3. Narrow what remains: move assignments to single-resource scope and data-plane roles. Test the application in a pilot group, and roll back by reinstating the previous assignment from the export.
  4. Lock local access: restrict local admin and root to the server's own tier, keep the certificate ACL as the agent set it, and add only dedicated service accounts to the extension groups.
  5. Restrict extensions on servers whose identity matters: extensions run as Local System or root and can use the identity, so apply an allowlist or monitor mode locally as described in the Azure Arc Security Guide.
  6. Turn on detection: stream managed identity sign-ins and the Activity Log to the SIEM, add Windows group and file auditing or auditd rules, and test by adding a test account to the group in a pilot.
  7. Write the compromise runbook: export the identity's role assignments, run azcmagent disconnect (which deletes the resource and its identity), investigate the host, reconnect with a fresh onboarding credential, then reapply only the roles still justified.

Decision guidance

  • Managed identity or app registration: use the machine identity when one workload owns the server and needs a few Entra-protected resources. Use a separate app registration with a vaulted certificate when the workload moves between servers, needs Conditional Access (available for single-tenant service principals with Workload Identities Premium, not for managed identities), or shares a host with other applications.
  • Small estates: a single rule, no role assignments for Arc identities without a change record, plus an alert on new ones, covers most of the risk.
  • Large estates: drive role assignments for machine identities through infrastructure as code, and plan directory object quota before onboarding thousands of servers.

Framework mapping

Control areaNIST SP 800-53 Rev 5NIST CSF 2.0CIS Controls v8.1ISO/IEC 27001:2022 Annex A
Machine identity and certificateIA-9, IA-5, SC-12PR.AA-015 Account ManagementA.5.17 Authentication information
Least privilege for the identityAC-6PR.AA-056 Access Control ManagementA.8.2 Privileged access rights
Limiting extensions and local accessCM-7PR.PS-014 Secure ConfigurationA.8.9 Configuration management
Sign-in and Activity Log reviewAU-6DE.CM-098 Audit Log ManagementA.8.15 Logging

Common misconfigurations

  • Contributor on the subscription for the server identity: granted to "make the script work", it turns any local admin compromise of an on-premises server into control of an Azure subscription. Every Arc server becomes a path into the cloud.
  • Broad groups in Hybrid Agent Extension Applications: adding a domain group or an interactive admin account gives every member the machine's Azure tokens with no Conditional Access check.
  • Assuming Conditional Access protects it: teams build workload identity policies for service principals and believe Arc servers are covered. Managed identities are excluded by design.
  • Imaging connected servers: cloning or backing up an onboarded machine and restoring it elsewhere copies the certificate, so two hosts can act as one identity.
  • Letting agents expire: servers disconnected for months lose their certificate, operators reonboard with a broad credential found in an old script, and the new identity silently loses or regains roles nobody reviewed.
  • No owner on the identity: the Entra enterprise app is named after a server, so nobody recognises it in access reviews and its roles survive the application that needed them.

Practitioner checklist

  • Export every role assignment held by Arc machine identities and remove any without a named workload and owner.
  • Replace subscription or resource group scope assignments with single-resource, data-plane roles.
  • Restrict Hybrid Agent Extension Applications and himds to dedicated service accounts, and alert on changes.
  • Leave the agent certificate ACLs untouched and audit reads of the Certs and Tokens folders.
  • Build images before onboarding and connect each machine at first boot.
  • Stream managed identity sign-ins and Activity Log role assignment events to the SIEM.
  • Alert on agents disconnected long enough to approach the 90-day certificate lifetime.
  • Use a separate certificate-based app registration where Conditional Access or per-workload identity is required.
  • Keep reconnect credentials in a vault, prefer certificates or access tokens, and pass any secret through a config file.
  • Rehearse the disconnect and reconnect runbook, including re-creating only justified role assignments.

Standards and references

Related NHI Mgmt Group resources: Azure Arc Security Guide · Azure Managed Identities Security Guide · Cloud Workload Identity Guide · Windows Server Hardening Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.