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

Azure Virtual Machine Scanning Setup

This functionality is available for Pro and Advanced plans only. Contact us for more information.

Why should I scan my virtual machines?

With virtual machine scanning, Aikido can scan the hard drives of your virtual machines for vulnerable packages, outdated runtimes and risky licenses.

Prerequisites

You'll need an Entra ID app registration with a client secret. If you've already connected your Azure cloud to Aikido for cloud scanning, you can reuse that same app registration, no need to create a new one. Otherwise, set that up first via Connect your Azure cloud.

Create a custom role

Aikido uses a custom Azure role scoped to the minimum permissions needed to scan your virtual machines.

1

Go to Access control (IAM)

Navigate to Subscriptions (or your management group), find the relevant scope for your virtual machines, and click Access control (IAM).

2

Add a custom role

Click Add, then Add custom role.

3

Choose your scope

Decide whether the role should be assignable at subscription level or management group level:

  • Single subscription: covers VMs in one subscription only.

  • Management group: covers all subscriptions underneath it, useful if your VMs are spread across multiple subscriptions.

For management group scope, you don't need to look up a separate ID. Use your Directory (tenant) ID, the same one from your app registration overview page. This maps to your organization's root management group.

4

Paste the role JSON

Go to the JSON tab and click Edit. Paste the role definition below.

Set assignableScopes based on the scope you chose:

For a single subscription:

"assignableScopes": [
  "/subscriptions/<your-subscription-id>"
]

For a management group:

"assignableScopes": [
  "/providers/Microsoft.Management/managementGroups/<your-directory-tenant-id>"
]

Full role definition:

{
  "properties": {
    "roleName": "Aikido VM Scanner",
    "description": "",
    "assignableScopes": [
      "<insert scope from above>"
    ],
    "permissions": [
      {
        "actions": [
          "Microsoft.Compute/virtualMachines/read",
          "Microsoft.Compute/disks/beginGetAccess/action",
          "Microsoft.Compute/disks/endGetAccess/action",
          "Microsoft.Compute/disks/read",
          "Microsoft.Compute/snapshots/read",
          "Microsoft.Compute/snapshots/write",
          "Microsoft.Compute/snapshots/delete",
          "Microsoft.Compute/snapshots/beginGetAccess/action",
          "Microsoft.Compute/snapshots/endGetAccess/action",
          "Microsoft.Authorization/roleAssignments/read"
        ],
        "notActions": [],
        "dataActions": [],
        "notDataActions": []
      }
    ]
  }
}

Click Save.

5

Review and create

At the bottom, click Review + assign, then Create.

Assign the role to your app registration

1

Go back to Access control (IAM)

Navigate to the same scope (subscription or management group) and click Access control (IAM).

2

Add a role assignment

Go to the Role assignments tab, click Add, then Add role assignment.

3

Select the custom role

In the Role tab, search for and select Aikido VM Scanner, then click Next.

4

Assign it to your app registration

Leave Assign access to on its default value. Click Select members, search for your app registration name (e.g. "AikidoSecurity"), and select it. Click Select, then Review + assign twice.

Your app registration now has the permissions it needs to scan your Azure virtual machines.

VM grouping

To optimize scanning efficiency, Aikido groups certain Azure VMs and scans only one instance from each group. Grouping works as follows:

  • Virtual Machine Scale Sets (VMSS): All VMs that belong to the same VMSS are shown as a single VM group in Aikido. The VM group's name matches the VMSS identifier.

  • No grouping: VMs that aren't part of a VMSS are treated as standalone VMs and scanned individually.

Last updated

Was this helpful?