1. Resources
  2. Detection rules
  3. Machine Configuration Assignment Created on a Virtual Machine or Arc Server

Machine Configuration Assignment Created on a Virtual Machine or Arc Server detection rules

Someone creates a machine configuration (guest configuration) assignment on an Azure VM or an Arc-enabled server. The agent in the machine downloads the assigned package and can apply it, which runs the package's code there.

Platform
Azure
Severity
Medium
Log source
Azure Activity log
Last updated
MITRE ATT&CK technique
T1651Cloud Administration Command
Tactic
Execution
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A role with the guest assignment write action on a virtual machine or Arc-enabled server, such as Guest Configuration Resource Contributor or Contributor.
Impact
Code from a package the attacker chose runs inside the machine, also on Arc-enabled servers on premises, and can be applied again after it is removed.
Response
Delete the assignment, contain the caller and review every machine that received a configuration nobody can explain.
Mitigation
Limit the roles that can write guest assignments and review the assignments on important machines for ones that no policy explains.
Operation
MICROSOFT.GUESTCONFIGURATION/GUESTCONFIGURATIONASSIGNMENTS/WRITE
Threat groups
APT29VOID MANTICORE

How the attack works

Machine configuration, formerly guest configuration, is the Azure Policy feature that audits or configures operating system settings inside machines that run in Azure and inside Arc-enabled machines outside it. A configuration reaches a machine as a guest assignment, an extension resource of type Microsoft.GuestConfiguration/guestConfigurationAssignments on the virtual machine or Arc machine. The assignment names a content package by an HTTPS address and a hash, and an assignment type: Audit only reports, while ApplyAndMonitor and ApplyAndAutoCorrect apply the configuration. Microsoft documents that the service in the machine asks for its assignments every 5 minutes, that the configuration is PowerShell Desired State Configuration on both Windows and Linux, and that in the applying modes the Set method of each resource in the package runs on the machine.

Azure Policy normally creates these assignments, but Microsoft documents that they can also be created directly in Azure Resource Manager with any client. Whoever can write an assignment on a machine can therefore point its agent at a package of their own and have it applied, which is code execution inside the machine that is ordered through the control plane, like a VM extension or Run Command but along a path that fewer teams watch. On Arc-enabled servers the same write reaches machines in the organization's own data centers. The Azure Activity log records the write (Microsoft.GuestConfiguration/guestConfigurationAssignments/write) with its caller. It does not show the package or the assignment type. No public incident report was found that describes an assignment used this way, so the page rests on what Microsoft documents the feature does.

What an attacker needs

  • A role with Microsoft.GuestConfiguration/guestConfigurationAssignments/write on the machine: Guest Configuration Resource Contributor, Contributor or Owner, or the managed identity of an Azure Policy assignment that deploys configurations.
  • A machine with the machine configuration agent: the extension on an Azure virtual machine, or the Azure Connected Machine agent on an Arc-enabled server.
  • A content package at an HTTPS address that the machine can reach.

Impact

Code from the assigned package runs inside every machine the attacker can write an assignment for, with the rights of the machine configuration service on that machine. With ApplyAndAutoCorrect the configuration is applied again whenever the machine drifts from it, so a change the defender removes by hand comes back. On Arc-enabled servers this is a path from an Azure role to on-premises systems.

Detection rules

Machine Configuration Guest Assignment Created or Changed

Detects a successful create or update of a machine configuration guest assignment on an Azure virtual machine or an Arc-enabled server (Microsoft.GuestConfiguration/guestConfigurationAssignments/write). The assignment names a content package that the agent in the machine downloads, and in the assignment types ApplyAndMonitor and ApplyAndAutoCorrect the agent applies the configuration, which runs the package's code on the machine. The event does not say which package or assignment type was set, and Azure Policy writes these assignments routinely, so the rule is a starting point for a baseline of expected callers and not an alert on its own. Read the assignment resource for callers outside that baseline.

LevelLowStatusExperimentalLog sourceAzure Activity log
title: Machine Configuration Guest Assignment Created or Changed
id: 58bc5703-2263-4c20-b064-0a80a1726b93
status: experimental
description: >-
  Detects a successful create or update of a machine configuration guest
  assignment on an Azure virtual machine or an Arc-enabled server
  (Microsoft.GuestConfiguration/guestConfigurationAssignments/write). The
  assignment names a content package that the agent in the machine downloads,
  and in the assignment types ApplyAndMonitor and ApplyAndAutoCorrect the
  agent applies the configuration, which runs the package's code on the
  machine. The event does not say which package or assignment type was set,
  and Azure Policy writes these assignments routinely, so the rule is a
  starting point for a baseline of expected callers and not an alert on its
  own. Read the assignment resource for callers outside that baseline.
references:
  - https://attack.mitre.org/techniques/T1651/
  - https://learn.microsoft.com/en-us/azure/governance/machine-configuration/concepts/assignments
  - https://learn.microsoft.com/en-us/azure/governance/machine-configuration/concepts/remediation-options
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/management-and-governance
author: Forestall
date: 2026-11-18
tags:
  - attack.execution
  - attack.t1651
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue: MICROSOFT.GUESTCONFIGURATION/GUESTCONFIGURATIONASSIGNMENTS/WRITE
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
falsepositives:
  - Azure Policy assignments in the Guest Configuration category and their remediation tasks, which create a guest assignment on every machine in scope. Exclude the managed identities of those policy assignments in a filter_ selection by Caller.
  - Services that manage machines with machine configuration, and administrators who assign a configuration by hand. Confirm them and exclude their identities.
level: low

False positives

  • Azure Policy assignments in the Guest Configuration category and their remediation tasks, which create a guest assignment on every machine in scope. Exclude the managed identities of those policy assignments in a filter_ selection by Caller.
  • Services that manage machines with machine configuration, and administrators who assign a configuration by hand. Confirm them and exclude their identities.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Guest assignment with a custom package that applies changes

Detection hypothesisCompares with an earlier valueNeeds your own lists

The write event is the same for a Microsoft baseline that only audits and for a package from an unknown address that changes the machine. The difference is in the assignment resource. Reading the assignment after each write by a caller outside the known policy identities separates the two.

  1. In the Azure Activity log, find MICROSOFT.GUESTCONFIGURATION/GUESTCONFIGURATIONASSIGNMENTS/WRITE with status Success. Keep the Caller and the resource ID of the assignment.
  2. Skip callers on your list of managed identities of Azure Policy assignments in the Guest Configuration category.
  3. For the rest, read the assignment resource and take contentUri and assignmentType from its guestConfiguration properties.
  4. Flag an assignment whose assignmentType is ApplyAndMonitor or ApplyAndAutoCorrect, or whose contentUri points to storage that your organization does not own.

EventsMICROSOFT.GUESTCONFIGURATION/GUESTCONFIGURATIONASSIGNMENTS/WRITE

LimitsIt needs a job that reads the resource soon after the event, and your own list of policy identities and storage accounts. An attacker who changes a policy definition gets the assignment written by a policy identity on the list, which this check skips. An assignment that is deleted before the job runs is missed.

Triage

  • Identify the Caller, the caller's IP address and the machine. An assignment created by Azure Policy has the identity of the policy assignment as its caller.
  • Read the assignment on the machine. Its properties name the content package address, the hash and the assignment type.
  • Check whether the package is a built-in configuration or comes from a storage location your organization controls, and whether the assignment type applies changes.
  • Look for the same caller writing assignments on several machines, and for a matching policy assignment or remediation task.
  • On the machine, review the logs of the machine configuration agent and recent changes for what the configuration did.

Response

Once the attack is confirmed:

  1. Delete the guest assignment from the machine. Microsoft documents that assignments created by hand must be deleted by hand.
  2. Contain the caller. Revoke its sessions, rotate its credentials and remove the role that allowed the write.
  3. Treat a machine that received an unexplained applying configuration as compromised. Isolate it, review it and rebuild it where the change cannot be explained.
  4. Look for the same package address or caller on other machines and Arc servers, and remove those assignments too.
  5. If a policy definition or assignment created the assignments, correct or remove it, and review who changed it.

Mitigation

  • Limit Guest Configuration Resource Contributor, Contributor and Owner on machines and Arc servers, and treat the managed identities of policy assignments that deploy configurations as privileged.
  • Let Azure Policy be the only source of assignments, and review the guest assignments of important machines for ones that no policy explains.
  • Limit who can change Azure Policy definitions and assignments in the Guest Configuration category, because a policy can create assignments at scale.
  • Remove the machine configuration extension from machines that do not use the feature.
  • Send the Azure Activity log to your SIEM and baseline which identities write assignments.

Frequently asked questions

Does the Activity log show which package was assigned?

No. It records the write of the guest assignment with its caller and the machine. The content package address, its hash and the assignment type are properties of the assignment resource. Read the assignment on the machine after the rule fires, before somebody deletes it.

Are all machine configuration assignments able to change a machine?

No. An assignment of type Audit only reports the state of the machine. The types ApplyAndMonitor and ApplyAndAutoCorrect apply the configuration, and Microsoft documents that in those modes the Set method of each resource in the package runs. The assignment type is therefore the first property to read during triage.

Why is the rule low when the impact is code execution?

Because Azure Policy creates these assignments all the time in organizations that use the feature, for example for security baselines. The event alone does not separate a baseline audit from a custom package that applies changes. The rule is meant for a baseline of expected callers, which are mostly the identities of policy assignments, and anything outside that baseline deserves a look.

Is there a public incident that used a machine configuration assignment for code execution?

No public incident report was found that describes it at the level of the audit event. The page is based on what Microsoft documents, which is that an assignment can be created directly in Azure Resource Manager and that an applying assignment runs the configuration from its content package on the machine.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.