AZ_SSH
Summary
Forestall ACL Alias
AZ_SSH
Azure Alias
Virtual Machine User Login / SSH with Entra ID
Affected Object Types
Linux Virtual Machines
Exploitation Certainty
Certain
Azure RBAC Roles
Virtual Machine User Login (fb879df8-f326-4884-b1cf-06f3ad86be52), Virtual Machine Administrator Login (1c0163c0-47e6-4577-8991-ea5c82e286e4)
Custom Role Data Actions:
Microsoft.Compute/virtualMachines/login/actionMicrosoft.Compute/virtualMachines/loginAsAdmin/action
Filter: Linux VMs with the AADSSHLoginForLinux extension and a system-assigned managed identity
Description
AZ_SSH represents the ability to SSH into Linux Azure VMs using Microsoft Entra ID credentials. This is a data-plane permission that enables interactive shell access without requiring local VM credentials.
Prerequisites for this edge:
The VM must have the AADSSHLoginForLinux extension installed.
The VM must have a system-assigned managed identity enabled.
The principal must have Virtual Machine User Login (standard user) or Virtual Machine Administrator Login (sudo) role.
Virtual Machine User Login
Standard user shell access
Virtual Machine Administrator Login
Root/sudo access
This edge is distinct from:
AZ_EXECUTE_COMMAND - Uses RunCommand API, no interactive session.
AZ_VM_ADMIN_LOGIN - Broader scope including RDP to Windows.
Identification
PowerShell (Az Module)
Azure Portal
Open Azure Portal -> navigate to the target Linux VM.
Go to Extensions + applications -> verify AADSSHLoginForLinux is installed.
Go to Identity -> verify System assigned identity is enabled.
Go to Access control (IAM) -> check for login role assignments.
Exploitation
SSH with Entra ID Credentials as admin

ssh using Entra ID Credentials as user

Post-Exploitation - Standard User
With Virtual Machine User Login (standard user access):

Post-Exploitation - Administrator
With Virtual Machine Administrator Login (sudo access):

Mitigation
Minimize login role assignments
Remove Virtual Machine User/Administrator Login from identities that dont need interactive access.
Use AZ_EXECUTE_COMMAND (RunCommand) for automated tasks instead.
Use Virtual Machine User Login instead of Administrator Login
Grant standard user access unless admin is specifically required.
Restrict Microsoft Entra SSH extension deployment
Only deploy the extension on VMs that require Entra-based authentication.
Use Azure Policy to audit extension deployments.
Network security
Restrict SSH (port 22) access via NSGs.
Use Azure Bastion for secure access without public endpoints.
Enable Just-in-Time VM access.
Enable PIM for just-in-time access
Configure eligible assignments with approval requirements.
Detection
Use the Azure Portal and Microsoft Entra admin center:
In Azure Portal, open the target Linux VM.
Open Activity log and filter Operation for
loginorloginAsAdmin.Review
Microsoft.Compute/virtualMachines/login/actionandMicrosoft.Compute/virtualMachines/loginAsAdmin/actionevents.Open Microsoft Entra ID -> Sign-in logs and filter Application for Azure Linux VM Sign-In.
Review User, IP address, Location, Date, and Status for unexpected SSH logins.
On the VM blade, open Monitoring -> Metrics and review Network In and Network Out during the same timeframe.
References
Last updated
Was this helpful?