> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/mashinsukyan/azure-virtual-machine-scanning-setup.md).

# Azure 仮想マシンのスキャン設定

{% hint style="info" %}
この機能はご利用いただけます **Pro** に設定し、 **Advanced** 対象プランのみです。 [お問い合わせください](https://www.aikido.dev/contact) 詳細については。
{% endhint %}

### なぜ仮想マシンをスキャンする必要があるのですか？ <a href="#why-should-i-scan-my-virtual-machines" id="why-should-i-scan-my-virtual-machines"></a>

仮想マシンスキャンを使うと、Aikido は仮想マシンのハードドライブをスキャンして、脆弱なパッケージ、古いランタイム、リスクの高いライセンスを検出できます。

### 前提条件

クライアント シークレットを含む Entra ID のアプリ登録が必要です。すでにクラウド スキャン用に Azure クラウドを Aikido に接続している場合は、同じアプリ登録を再利用でき、新しく作成する必要はありません。そうでない場合は、まず次から設定してください： [Azure クラウドを接続](https://help.aikido.dev/cloud-scanning/connect-your-cloud/azure/connect-azure-cloud-account-to-aikido).

### カスタム ロールを作成する <a href="#getting-started" id="getting-started"></a>

Aikido は、仮想マシンのスキャンに必要な最小権限に限定したカスタム Azure ロールを使用します。

{% stepper %}
{% step %}

### アクセス制御 (IAM) に移動

移動先： **サブスクリプション** （または、 **管理グループ**）、仮想マシンに該当するスコープを見つけて、次をクリックします： **アクセス制御 (IAM)**.
{% endstep %}

{% step %}

### カスタム ロールを追加

クリック **追加**、次に **カスタム ロールを追加**.
{% endstep %}

{% step %}

### スコープを選択

ロールを割り当て可能にする場所を **サブスクリプション レベル** または **管理グループ レベル**:

* **単一のサブスクリプション：** 1つのサブスクリプション内の VM のみを対象にします。
* **管理グループ：** その下にあるすべてのサブスクリプションを対象にします。VM が複数のサブスクリプションにまたがっている場合に便利です。

{% hint style="info" %}
管理グループのスコープでは、別途 ID を調べる必要はありません。次を使用してください： **ディレクトリ (テナント) ID**アプリ登録の概要ページと同じものです。これは組織のルート管理グループに対応します。
{% endhint %}
{% endstep %}

{% step %}

### ロールの JSON を貼り付け

次の **JSON** タブを開き、 **編集**。以下のロール定義を貼り付けます。

次を設定します】【： `assignableScopes` 選択したスコープに基づきます：

単一のサブスクリプションの場合：

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

管理グループの場合：

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

完全なロール定義：

```json
{
  "properties": {
    "roleName": "Aikido VM Scanner",
    "description": "",
    "assignableScopes": [
      "<上記のスコープを挿入>"
    ],
    "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": []
      }
    ]
  }
}
```

クリック **保存**.
{% endstep %}

{% step %}

### 確認して作成

下部にある次をクリックします **確認して割り当て**、次に **作成**.
{% endstep %}
{% endstepper %}

### ロールをアプリ登録に割り当てる

{% stepper %}
{% step %}

### アクセス制御 (IAM) に戻る

同じスコープ（サブスクリプションまたは管理グループ）に移動し、次をクリックします： **アクセス制御 (IAM)**.
{% endstep %}

{% step %}

### ロールの割り当てを追加

次の **ロールの割り当て** タブで、次をクリックします： **追加**、次に **ロールの割り当てを追加**.
{% endstep %}

{% step %}

### カスタム ロールを選択

の **ロール** タブで、検索して選択します： **Aikido VM Scanner**、次にクリック **次に**.
{% endstep %}

{% step %}

### アプリ登録に割り当てる

有効のままにし **アクセスの割り当て先** は既定値のままにします。次をクリックします： **メンバーを選択**、アプリ登録名（例：「AikidoSecurity」）を検索して選択します。次をクリックします： **選択します**、次に **確認して割り当て** 2回クリックします。
{% endstep %}
{% endstepper %}

{% hint style="info" %}
これで、アプリ登録に Azure 仮想マシンをスキャンするために必要な権限が付与されました。
{% endhint %}

### VM のグループ化

スキャン効率を最適化するため、Aikido は一部の Azure VM をグループ化し、各グループから 1 インスタンスのみをスキャンします。グループ化は次のとおりです：

* **仮想マシン スケール セット (VMSS)**：同じ VMSS に属するすべての VM は、Aikido では 1 つの VM グループとして表示されます。VM グループ名は VMSS の識別子と一致します。
* **グループ化なし**：VMSS の一部ではない VM は、単独の VM として扱われ、個別にスキャンされます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/mashinsukyan/azure-virtual-machine-scanning-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
