# PAMリソースのインポート

## 概要 <a href="#overview" id="overview"></a>

KeeperコマンダーのCLIを使うと、PAMリソースを一括でインポートできます。PAM構成、ゲートウェイ、プロジェクトフォルダとともに、大量のリソースをまとめて取り込めます。

本ページでは、ドメイン参加済みのWindowsサーバーとローカル管理者アカウントを多数インポートする手順を説明します。

***

### ワークフローの概要 <a href="#overview-of-the-workflow" id="overview-of-the-workflow"></a>

1. プロジェクトとリソースの情報を含む**JSONファイル**を作成します。

   この**JSONファイル**の作成やマージには**CSVファイル**も利用できます。手順は[こちら](https://docs.keeper.io/jp/keeperpam/privileged-access-manager/references/importing-pam-resources/using-a-csv-template)をご参照ください。
2. `pam project import` コマンドで**JSONファイル**をインポートします。

***

### 要件 <a href="#prerequisites" id="prerequisites"></a>

| 要件                   | 備考                            |
| -------------------- | ----------------------------- |
| Keeperコマンダーv17.1.8以上 | `keeper version` で確認可能        |
| KeeperPAMライセンス       | Keeper管理コンソールで有効化されている必要があります |
| 「PAMの管理」権限を持つ管理者ロール  | Keeper管理コンソールで有効化されている必要があります |

***

### 1 - JSONの構造 <a href="#id-1-json-structure" id="id-1-json-structure"></a>

以下はJSONの例です。

{% code expandable="true" %}

```json
{
    "project": "XXX:Project1",
    "shared_folder_users": {
        "manage_users": true,
        "manage_records": true,
        "can_edit": true,
        "can_share": true
    },
    "shared_folder_resources": {
        "manage_users": true,
        "manage_records": true,
        "can_edit": true,
        "can_share": true
    },
    "pam_configuration": {
        "environment": "local",
        "connections": "on",
        "rotation": "on",
        "graphical_session_recording": "on"
    },
    "pam_data": {
        "resources": [
            {
                "_comment1": "Every key that starts with '_' is a comment and can be ignored or deleted",
                "_comment2": "Every value that starts with uppercase 'XXX:' must be replaced with actual value (removed if not required)",
                "_comment3": "Every value that starts with lowercase 'xxx:' is just a placeholder - can be replaced with anything but must be present",
                "type": "pamDirectory",
                "title": "XXX:Project1 AD",
                "directory_type": "XXX:active_directory|ldap",
                "host": "XXX:demo.local",
                "port": "XXX:636",
                "use_ssl": true,
                "domain_name": "XXX:demo.local",
                "pam_settings": {
                    "options": {
                        "rotation": "on",
                        "connections": "on",
                        "tunneling": "on",
                        "graphical_session_recording": "on"
                    },
                    "connection": {
                        "protocol": "rdp",
                        "port": "XXX:3389",
                        "security": "XXX:any",
                        "ignore_server_cert": true,
                        "_comment_administrative_credentials": "Must match the unique title of one of the users below",
                        "administrative_credentials": "XXX:DomainAdmin"
                    }
                },
                "users": [
                    {
                        "type": "pamUser",
                        "_comment_title": "Must match administrative_credentials above if this is the admin user",
                        "title": "XXX:DomainAdmin",
                        "_comment_login_password": "Must provide valid credentials but delete sensitive data/json after import",
                        "login": "XXX:administrator@demo.local",
                        "password": "XXX:P4ssw0rd_123",
                        "rotation_settings": {
                            "rotation": "general",
                            "enabled": "on",
                            "schedule": {
                                "type": "on-demand"
                            }
                        }
                    }
                ]
            },
            {
                "_comment4": "While pamDirectory section above is static, the pamMachine section below is dynamicly generated",
                "_comment5": "One pamMachine with one pamUser will be generated per each line from the CSV file",
                "_comment6": "Only one pamMachine is needed and it will be used as a template for all CSV rows",
                "_comment7": "Please do NOT edit lines with xxx: in them - these are placeholders",
                "_comment8": "Any other line that don't contain xxx: can be altered/added/deleted in the template",
                "_comment9": "CSV Format: server_name,username,password",
                "type": "pamMachine",
                "_comment_title_and_host": "server value from CSV",
                "title": "xxx:server1",
                "host": "xxx:server1",
                "port": "5986",
                "ssl_verification": true,
                "operating_system": "Windows",
                "pam_settings": {
                    "options": {
                        "rotation": "on",
                        "connections": "on",
                        "tunneling": "on",
                        "graphical_session_recording": "on"
                    },
                    "connection": {
                        "protocol": "rdp",
                        "port": "3389",
                        "security": "any",
                        "ignore_server_cert": true,
                        "_comment_administrative_credentials": "Format: pamDirectory#title.pamDirectory#administrative_credentials - exact match needed",
                        "administrative_credentials": "XXX:Project1 AD.DomainAdmin"
                    }
                },
                "users": [
                    {
                        "type": "pamUser",
                        "_comment_title": "username value from CSV or server-username if --prefix-names option is used",
                        "title": "xxx:admin",
                        "_comment_login": "username value from CSV",
                        "login": "xxx:Administrator",
                        "_comment_password": "password value from CSV",
                        "password": "xxx:P4ssw0rd_123",
                        "rotation_settings": {
                            "rotation": "general",
                            "enabled": "on",
                            "schedule": {
                                "type": "on-demand"
                            }
                        }
                    }
                ]
            }
        ]
    }
}
```

{% endcode %}

JSON本文は、おおむね以下の要素で構成されます。

{% code overflow="wrap" %}

```
project 
  └ Name of your project (will be used for naming the application, gateway and folders)
shared_folder_users
  └ Settings to set for the default "Users" folder
shared_folder_resources
  └ Settings to set for the default "Resources" folder
pam_configuration
  └ Settings to set for the PAM Configuration record
  
pam_data
  └ resources
    ├  <resource>
    │    ├ type: pamDirectory
    │    ├ pam_settings
    │    │    ├ options
    │    │    │  └ Enabling PAM settings
    │    │    └ connection
    │    │       ├ administrative_credentials (format:pamUser title)
    │    │       │  └ title of a user resource to map as Administrative Credentials
    │    │       └ launch_credentials (format:pamUser title)
    │    │          └ title of a user resource to map as Launch Credentials
    │    └ users
    │      └ <user>
    │        └ user login and rotation data. General rotation maps to the parent resource
    └  <resource>
         ├ type: pamMachine
         ├ pam_settings
         │    ├ options
         │    │  └ Enabling PAM settings
         │    └ connection
         │       ├ administrative_credentials (format:pamDirectory title.pamUser title)
         │       │  └ title of a user resource to map as Administrative Credentials
         │       └ launch_credentials (format:pamDirectory title.pamUser title)
         │          └ title of a user resource to map as Launch Credentials
         └ users
           └ <user>
             └ user login and rotation data. General rotation maps to the parent resource
```

{% endcode %}

リソースおよびユーザーオブジェクトに指定できる属性の多くは、[GitHub上のREADME](https://github.com/Keeper-Security/Commander/blob/master/keepercommander/commands/pam_import/README.md)に記載されています。

Active Directoryアカウントのローテーションを扱う場合は `pamDirectory` リソースの `users` 配列に、マシンローカルアカウントのローテーションを扱う場合は `pamMachine` リソースの `users` 配列に、それぞれユーザー情報を定義します。本ドキュメントの例では後者（ローカル）のモデルを使います。

***

### 2 – JSONテンプレートの作成 <a href="#id-2-create-the-json-template" id="id-2-create-the-json-template"></a>

前述のとおりJSONテンプレートを作成します。簡単な例として、以下の内容を `pam_import.json` というファイル名で保存します。

{% code expandable="true" %}

```json
{
  "project": "Example Project",
  "shared_folder_users": {
    "manage_users": true,
    "manage_records": true,
    "can_edit": true,
    "can_share": true
  },
  "shared_folder_resources": {
    "manage_users": true,
    "manage_records": true,
    "can_edit": true,
    "can_share": true
  },
  "pam_configuration": {
    "environment": "local",
    "connections": "on",
    "rotation": "on",
    "graphical_session_recording": "on"
  },
  "pam_data": {
    "resources": [
      {
        "type": "pamDirectory",
        "title": "Example AD",
        "directory_type": "active_directory",
        "host": "demo.local",
        "port": "636",
        "use_ssl": true,
        "domain_name": "demo.local",
        "pam_settings": {
          "options": {
            "rotation": "on",
            "connections": "on",
            "tunneling": "on",
            "graphical_session_recording": "on"
          },
          "connection": {
            "protocol": "rdp",
            "port": "3389",
            "security": "any",
            "ignore_server_cert": true,
            "administrative_credentials": "DomainAdmin"
          }
        },
        "users": [
          {
            "type": "pamUser",
            "title": "DomainAdmin",
            "login": "administrator@demo.local",
            "password": "P4ssw0rd_123",
            "rotation_settings": {
              "rotation": "general",
              "enabled": "on",
              "schedule": {
                "type": "on-demand"
              }
            }
          }
        ]
      },
      {
        "type": "pamMachine",
        "title": "srv\u201101",
        "host": "srv\u201101",
        "port": "5986",
        "ssl_verification": true,
        "operating_system": "Windows",
        "pam_settings": {
          "options": {
            "rotation": "on",
            "connections": "on",
            "tunneling": "on",
            "graphical_session_recording": "on"
          },
          "connection": {
            "protocol": "rdp",
            "port": "3389",
            "security": "any",
            "ignore_server_cert": true,
            "administrative_credentials": "Example AD.DomainAdmin"
          }
        },
        "users": [
          {
            "type": "pamUser",
            "title": "srv\u201101-Administrator",
            "login": "Administrator",
            "password": "LocalAdminPassword123",
            "rotation_settings": {
              "rotation": "general",
              "enabled": "on",
              "schedule": {
                "type": "on-demand"
              }
            }
          }
        ]
      },
      {
        "type": "pamMachine",
        "title": "srv\u201102",
        "host": "srv\u201102",
        "port": "5986",
        "ssl_verification": true,
        "operating_system": "Windows",
        "pam_settings": {
          "options": {
            "rotation": "on",
            "connections": "on",
            "tunneling": "on",
            "graphical_session_recording": "on"
          },
          "connection": {
            "protocol": "rdp",
            "port": "3389",
            "security": "any",
            "ignore_server_cert": true,
            "administrative_credentials": "Example AD.DomainAdmin"
          }
        },
        "users": [
          {
            "type": "pamUser",
            "title": "srv\u201102-Administrator",
            "login": "Administrator",
            "password": "LocalAdminPassword123",
            "rotation_settings": {
              "rotation": "general",
              "enabled": "on",
              "schedule": {
                "type": "on-demand"
              }
            }
          }
        ]
      }
    ]
  }
}
```

{% endcode %}

***

### 3 – Keeperへのリソースインポート <a href="#id-3-import-resources-into-keeper" id="id-3-import-resources-into-keeper"></a>

`pam_import.json` をKeeperコマンダーのCLIからインポートします。まずKeeperコマンダーのセッションを開始します。未設定の場合は、[セットアップ手順](https://docs.keeper.io/jp/keeperpam/commander-cli/commander-installation-setup)をご参照ください。

```
keeper shell
```

以下のコマンドでインポートします（`pam_import.json` がコマンダーの作業ディレクトリにある想定です。絶対パスでも指定できます）。

```bash
pam project import -f pam_import.json
```

完了すると、コマンダーの出力にアクセストークンが含まれます。

```
"access_token": "XXXXXXXX...."
```

引用符内の値（XXXXX.....）を控えておき、以下のステップでゲートウェイを初期化するときに使います。

補足: インポート完了後、ボルト内のリソースが更新されます。Keeperボルトを開いたまま作業している場合は、**\[完全同期]** を実行するか、ページを再読み込みすることを推奨します。

### 4 – ゲートウェイの起動 <a href="#id-4-start-the-gateway" id="id-4-start-the-gateway"></a>

本ページでは、Keeperゲートウェイのインストール手順は扱いません。未作成の場合は、利用環境に合わせて[ゲートウェイのセットアップ手順](https://docs.keeper.io/jp/keeperpam/privileged-access-manager/getting-started/gateways)をご参照ください。

* ゲートウェイの設定で、インポート完了時に得たアクセストークンを `GATEWAY_CONFIG` に反映します。Dockerの場合は `docker-compose.yaml`、Windowsの場合は `C:\ProgramData\KeeperGateway\config\gateway-config.json` に記述します。
* ゲートウェイを再起動します。

これでゲートウェイが起動し、インポートしたすべてのリソースと関連付けられます。デフォルトでは、インポートしたPAMプロジェクトはすべて **\[PAM Environments]** フォルダに追加されます。

### インポート結果 <a href="#import-results" id="import-results"></a>

本例と同じ手順でインポートしたあとにできる主なリソースは以下のとおりです。画面の例は以下のスクリーンショットを参照してください。

* シークレットマネージャーアプリケーション
* Keeperゲートウェイ
* PAM構成
* PAMディレクトリ (Active Directoryサービス)
* ドメイン管理者を表すPAMユーザー
* PAMマシンリソース (Windowsサーバー)
* 各PAMマシン用のPAMユーザー (ローカル管理者)

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-904981ba2aba955725a8529d0fb5e0002e9f5f3e%2FScreenshot%202025-06-20%20at%204.21.52%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>KSMアプリケーション</p></figcaption></figure>

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-7eead7af86bd1516d2fc06ef7365be9121c338ad%2FScreenshot%202025-06-20%20at%204.21.41%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>PAM構成</p></figcaption></figure>

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-904981ba2aba955725a8529d0fb5e0002e9f5f3e%2FScreenshot%202025-06-20%20at%204.21.52%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>PAMゲートウェイ</p></figcaption></figure>

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-eca8f5a0cd8e60916cb00b2ee57b83befc8e7a58%2FScreenshot%202025-06-20%20at%204.00.26%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>PAMリソース</p></figcaption></figure>

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-a4b5055d43c3894497df929387b269e9056708d0%2FScreenshot%202025-06-20%20at%204.00.36%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>PAMユーザー</p></figcaption></figure>

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-6072ba3fcc71f6bbe799d478dad591000d6c3c1a%2FScreenshot%202025-06-20%20at%204.17.05%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>ドメインコントローラー</p></figcaption></figure>

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-d9d4fe9f166a1169b4f49fb3c433d927983ead81%2FScreenshot%202025-06-20%20at%204.17.47%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>PAMマシン</p></figcaption></figure>

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fgit-blob-6ff7d54a766c76637b99b3d2541e048c00438278%2FScreenshot%202025-06-20%20at%204.18.02%E2%80%AFPM.png?alt=media" alt=""><figcaption><p>PAMユーザー (ローカル管理者)</p></figcaption></figure>

### 高度なインポート形式 <a href="#advanced-import-formats" id="advanced-import-formats"></a>

本ページでは、接続・トンネル・パスワードの自動ローテーションを目的として、複数のWindowsサーバーをインポートする基本的な例を示しました。接続とリソースの構成はシンプルにしています。

JSONテンプレートの全機能を含む高度なインポート方法は、[GitHubのREADME](https://github.com/Keeper-Security/Commander/blob/master/keepercommander/commands/pam_import/README.md)に記載されています。インポート処理で変更可能な設定の一覧を確認できます。やり直す場合は、ボルトからフォルダ、PAM構成、ゲートウェイを削除してから、最初から手順を実行し直せば問題ありません。

インポート手順で不明点がある場合は、アカウント担当者までご連絡いただくか、<commander@keepersecurity.com>までお問い合わせください。

***

### CSVからJSONファイルを生成する <a href="#generate-the-json-file-from-csv" id="generate-the-json-file-from-csv"></a>

CSVからインポート用のJSONを生成する手順は、[CSVテンプレートの利用](https://docs.keeper.io/jp/keeperpam/privileged-access-manager/references/importing-pam-resources/using-a-csv-template)をご参照ください。

***

### 既存データがある状態でのインポート <a href="#importing-with-existing-data" id="importing-with-existing-data"></a>

新しいアプリケーションを作らず、既存のPAMモデルに内容を追加する場合は、[既存モデルへのPAMリソースの追加](https://docs.keeper.io/jp/keeperpam/privileged-access-manager/references/importing-pam-resources/adding-pam-resources-to-an-existing-model)をご参照ください。

***

### 関連トピック <a href="#related-topics" id="related-topics"></a>

PAMの自動化をさらに進めるための[Keeperコマンダー](https://docs.keeper.io/jp/keeperpam/commander-cli/command-reference/keeperpam-commands)のオプションについてもご覧ください。

* PAMの自動化をさらに進めるには、Keeperコマンダーの[コマンドリファレンス](https://docs.keeper.io/jp/keeperpam/commander-cli/command-reference/keeperpam-commands)をご参照ください。


---

# 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/jp/keeperpam/privileged-access-manager/references/importing-pam-resources.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.
