01 Run vm list command (Windows/macOS/Linux) with custom query filters to list the name and the associated resource group of each virtual machine (VM) provisioned in the current Azure subscription:
az vm list
--output table
--query '[*].{name:name, resourceGroup:resourceGroup}'
02 The command output should return the requested virtual machine (VM) identifiers:
Name ResourceGroup
----------------------- ------------------------------
cc-prod-app-server cloud-shell-storage-westeurope
cc-internal-app-server cloud-shell-storage-westeurope
03 AADSSHLoginForLinux extension is installed automatically when you enable Microsoft Entra ID login for VM instances. Run vm extension list command (Windows/macOS/Linux) to describe the extensions installed on the virtual machine (VM) instance identified by the --vm-name parameter:
az vm extension list
--vm-name cc-prod-app-server
--resource-group cloud-shell-storage-westeurope
--query '[*].name'
04 The command output should return the names of the extensions installed on the specified VM server. If the AADSSHLoginForLinux extension is available in the extensions list, as shown in the example below, you can continue the Audit process with the next step:
[
"AADSSHLoginForLinux",
"IaaSAntimalware"
]
05 Run ad user list command (Windows/macOS/Linux) with query filters to list all Microsoft Entra ID identities (users):
az ad user list
--query '[].{userPrincipalName:userPrincipalName}'
--output table
06 The command output should return a table that contains all your Microsoft Entra ID principal user names:
UserPrincipalName
-----------------------------------------------
vmazuremanager@trendmicro.onmicrosoft.com
azadministrator@trendmicro.onmicrosoft.com
07 Run role assignment list command (Windows/macOS/Linux) with custom query filters to return the name of each role assigned to the Microsoft Entra ID identity (user) that you want to examine. For the --resource-group parameter specify the name of the resource group used to deploy your VM instance:
az role assignment list
--resource-group cloud-shell-storage-westeurope
--assignee vmazuremanager@trendmicro.onmicrosoft.com
--query '[].{"roleDefinitionName":roleDefinitionName}'
08 The command output should return an array that contains the name of the role assigned to the specified Microsoft Entra ID user. Role assignment of Virtual Machine Administrator Login or Virtual Machine User Login is required when using Microsoft Entra ID login. If the "roleDefinitionName" is set to Virtual Machine Administrator Login or Virtual Machine User Login, as shown in the example below, you can continue the Audit process with the next step.
[
{
"roleDefinitionName": "Virtual Machine Administrator Login"
}
]
09 Open an elevated Windows PowerShell command prompt (i.e. run PowerShell as an administrator) and run Install-Module MSOnline command to install MSOnline PowerShell module for Microsoft Entra ID:
10 Run Connect-MsolService PowerShell command to connect to your Microsoft Entra ID environment. Once the command request is made you should be prompted for your Microsoft Entra ID credentials. To connect to a specific environment of Microsoft Entra ID, use -AzureEnvironment parameter, as shown in the example above (replace \ with your own Microsoft Entra ID environment name):
Connect-MsolService -AzureEnvironment "<ad-environment-name>"
11 Run Get-MsolUser PowerShell command (using MSOnline module) with custom query filters to identify if the selected Microsoft Entra ID user has registered for Multi-Factor Authentication (MFA):
Get-MsolUser -All | where {$_.StrongAuthenticationMethods.Count -eq 0} | Select-Object -Property vmazuremanager@trendmicro.onmicrosoft.com
12 The command output returns the verified Microsoft Entra ID user name if MFA is disabled. Otherwise, the Get-MsolUser command does not produce an output:
vmazuremanager@trendmicro.onmicrosoft.com
-----------------------------------------
If the
Get-MsolUser command output returns the name of the examined user, Multi-Factor Authentication (MFA) is not enabled for the selected identity, therefore, the access to your Microsoft Entra ID-enabled VM instance is not MFA-protected.
13 Repeat steps no. 7 – 12 for each identity (user) with the role assignment of Virtual Machine Administrator Login or Virtual Machine User Login.
14 Repeat steps no. 3 - 13 for each Azure virtual machine (VM) provisioned in the selected subscription.
15 Repeat steps no. 1 – 14 for each subscription created within your Microsoft Azure cloud account.