# Azureプラグイン

{% hint style="warning" %}
KeeperPAMを使用したゼロトラストのパスワードローテーション機能もリリースされました。この新機能は、パスワードローテーションのほとんどの用途で推奨されます。詳細については以下をご参照ください。

* [KeeperPAMを使用したパスワードローテーション](/keeperpam/jp/secrets-manager/password-rotation.md)
* [コマンダーのKeeperPAMコマンド](/keeperpam/jp/commander-cli/command-reference/keeperpam-commands.md)
  {% endhint %}

このプラグインは、任意のユーザーのAzure ADパスワードを生成/ローテーションします。

## 前提条件

#### [Python用MSAL (Microsoft Authentication Library)](https://github.com/AzureAD/microsoft-authentication-library-for-python) のインストール

```
pip install msal
```

#### Azureアプリケーションがユーザー管理権限を持つように設定

<details>

<summary>Azureアプリケーションのローテーション設定</summary>

Azureローテーションの1度限りの設定として以下の手順に従ってください

**新しいアプリケーションの登録手順**

1. 新しいアプリの登録ページに移動します。

   Azureポータル（Azure portal） -> `Azure Active Directory` -> `App Registrations` -> `New Registration`
2. アプリケーションに名前を付け、サポートされるアカウントの種類を「この組織ディレクトリのアカウントのみ（既定のディレクトリのみ - シングルテナント）」のままにします
3. 「登録（Register）」をクリックします

**アプリケーションにロールを追加する手順**

1. 「ロールと管理者（Roles and Administrators）」ページに移動します。

   Azureポータル（Azure portal） -> `Azure Active Directory` -> `Roles and administrators`
2. `Helpdesk Administrator` ロールを検索して、クリックします
3. `+ Add assignments` をクリックします
4. 上記で作成したアプリケーションを検索して選択し、「追加（Add）」をクリックします

**アプリシークレットを作成**

1. 「証明書とシークレット（Certificates & Secrets）」に移動します。

   Azureポータル（Azure portal） -> `Azure Active Directory` -> `App Registrations` -> 上記で作成したアプリを選択 -> `Certificates & secrets`
2. 「クライアントのシークレット（Client secrets）」の下の `+ New client secret` をクリックします
3. シークレットに説明を入力し、「追加（Add）」をクリックします
4. シークレットの「値（Value）」を必ずコピーしてください。

</details>

## ローテーション用のレコードを準備

### ローテーション用のレコードを作成

ローテーションは、従来のレコードにもタイプ指定されたレコードにも対応しています。 タイプ指定されたレコードを使用する場合は、「ログイン」タイプのフィールドが必要です。 ローテーションの種類に応じて、その他のフィールドを追加することもできます。 以下の手順をご参照ください。

{% hint style="info" %}
従来のレコードとタイプ指定されたレコードの詳細については、[トラブルシューティング](/keeperpam/jp/commander-cli/troubleshooting-commander-cli.md#typed-vs-untyped-records-v3-vs-v2)セクションをご参照ください。
{% endhint %}

### Azureのログイン名を設定

**Keeperのレコードの「ログイン」フィールドにAzureのログイン名を入力します**

![](https://762006384-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJXOXEifAmpyvNVL1to%2F-Mf3OKL0C-A5D2nQFew1%2F-Mf3_72XQ3z1I6frpa2m%2Fimage.png?alt=media\&token=a85def6d-1882-4e7a-a9e5-022cee7d6ec2)

### 必須フィールドを追加

Azure ADローテーションには、以下のフィールドが必要です。ラベルを指定して各フィールドを作成し、必要な情報を入力します。

<table><thead><tr><th width="218">ラベル</th><th>説明</th></tr></thead><tbody><tr><td>cmdr:azure_secret</td><td>新しいアプリケーションの登録時に表示されます。Azureポータル -> <code>Azure Active Directory</code> -> <code>App Registrations</code> -> <code>New Registration</code>。</td></tr><tr><td>cmdr:azure_client_id</td><td>Azureポータル -> <code>Azure Active Directory</code> -> <code>App Registrations</code> -> [App name] (アプリ名) -> <code>Application (client) ID</code></td></tr><tr><td>cmdr:azure_tenant_id</td><td>Azureポータル -> <code>Azure Active Directory</code> -> <code>App Registrations</code> -> [App name] (アプリ名) -> <code>Directory (tenant) ID</code></td></tr><tr><td>cmdr:azure_cloud</td><td>オプション。Azureクラウド。Azureクラウドの物理的な場所は4か所あります。<br>1. <code>Global</code> 既定の場所。このプロパティは省略します。<br>2. <code>China</code><br>3. <code>German</code><br>4. <code>USGov</code></td></tr></tbody></table>

{% hint style="info" %}
新しいAzureローテーションレコードを簡単に作成するには、これらのテキストタイプフィールドを定義してカスタムのレコードタイプを作成します。
{% endhint %}

#### その他のローテーション設定

ローテーションパラメータをカスタマイズできる値は以下のとおりです。 これらのオプションをテキストフィールドとしてレコードに追加し、表に示すように、パラメータに相当するラベルを設定します。

<table><thead><tr><th width="154">ラベル</th><th width="124">値</th><th>説明</th></tr></thead><tbody><tr><td>cmdr:plugin</td><td>azureadpwd</td><td>(任意) Azure ADキーローテーションを使用するようにコマンダーに指示します。 これは、レコードに設定するか、またはローテーションコマンドに指定する必要があります</td></tr><tr><td>cmdr:rules</td><td></td><td>(任意) <a href="https://github.com/Keeper-Security/Commander/tree/master/keepercommander/plugins/password_rules.md">パスワードの複雑度ルール</a></td></tr></tbody></table>

## ローテーション

Azureのパスワードをローテーションするには、コマンダーで `rotate` コマンドを使用します。 コマンドにレコードタイトルもしくはUIDを渡します (複数のレコードを1度にローテーションさせるには、正規表現で `--match` を使用します)

```
rotate "My Azure Credentials" --plugin azureadpwd
```

{% hint style="info" %}
プラグインは、こちらに示すようにコマンドに指定することも、レコードのフィールドに追加することもできます (上記のオプションを参照)。\
レコードにプラグインタイプを追加すると、プラグインの異なる複数のレコードを1度にローテーションできます。
{% endhint %}

#### 出力

ローテーションが完了すると、新しいパスワードがレコードの**パスワード**フィールドに格納されます


---

# Agent Instructions: 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:

```
GET https://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/plugins/azure-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
