For the complete documentation index, see llms.txt. This page is also available as Markdown.

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/action

  • Microsoft.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.

Role
Access Level

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

  1. Open Azure Portal -> navigate to the target Linux VM.

  2. Go to Extensions + applications -> verify AADSSHLoginForLinux is installed.

  3. Go to Identity -> verify System assigned identity is enabled.

  4. Go to Access control (IAM) -> check for login role assignments.

Exploitation

SSH with Entra ID Credentials as admin

SSH to a Linux VM as administrator with Azure CLI

ssh using Entra ID Credentials as user

SSH to a Linux VM as user with Azure CLI

Post-Exploitation - Standard User

With Virtual Machine User Login (standard user access):

Request a managed identity token from a Linux VM

Post-Exploitation - Administrator

With Virtual Machine Administrator Login (sudo access):

ssh using az tools

Mitigation

  1. 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.

  2. Use Virtual Machine User Login instead of Administrator Login

    • Grant standard user access unless admin is specifically required.

  3. Restrict Microsoft Entra SSH extension deployment

    • Only deploy the extension on VMs that require Entra-based authentication.

    • Use Azure Policy to audit extension deployments.

  4. Network security

    • Restrict SSH (port 22) access via NSGs.

    • Use Azure Bastion for secure access without public endpoints.

    • Enable Just-in-Time VM access.

  5. Enable PIM for just-in-time access

    • Configure eligible assignments with approval requirements.

Detection

Use the Azure Portal and Microsoft Entra admin center:

  1. In Azure Portal, open the target Linux VM.

  2. Open Activity log and filter Operation for login or loginAsAdmin.

  3. Review Microsoft.Compute/virtualMachines/login/action and Microsoft.Compute/virtualMachines/loginAsAdmin/action events.

  4. Open Microsoft Entra ID -> Sign-in logs and filter Application for Azure Linux VM Sign-In.

  5. Review User, IP address, Location, Date, and Status for unexpected SSH logins.

  6. On the VM blade, open Monitoring -> Metrics and review Network In and Network Out during the same timeframe.

References

Last updated

Was this helpful?