# 静的トークン

<figure><img src="https://4041518992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ7s6LQJaKa1G17O787JG%2Fuploads%2FhSvObhft75qAv4rsTZAz%2Fimage.png?alt=media&#x26;token=a99678dc-f717-46d1-bb2d-61a667683552" alt=""><figcaption></figcaption></figure>

## 静的トークン

コネクションマネージャーは、共有フォルダ内に格納された特定のKeeperボルトのレコードの特定のフィールドに対応可能な静的なカスタムトークンの設定をサポートしています。これらの静的トークンは、プラットフォームのインストールメソッドに応じて、Docker composeで、または直接guacamoleの設定ファイルで指定する必要があります。通常は、動的トークンが連携方法としてはお勧めです。

### **Dockerの自動インストールメソッド**

Docker自動インストールメソッドを使用してKeeperコネクションマネージャーをインストールした場合、自動生成されたDocker Composeファイルを変更して静的トークンを定義する必要があります。

rootとして、`/etc/kcm-setup/docker-compose.yml`ファイルを編集します。

「guacamole」dockerイメージの下の「environment」 (環境) セクションを編集します。複数行にわたるカスタムトークンの定義が含まれた`KSM_TOKEN_MAPPING`という環境変数を挿入します。以下の例では、Keeperボルトの共有フォルダ内の特定のフィールドに3つのカスタムトークンがあります。トークンの構文は、[Keeper表記法](/keeperpam/jp/secrets-manager/about/keeper-notation.md)を使用しています。

{% code overflow="wrap" lineNumbers="true" %}

```
    guacamole:
        image: xxx
        restart: unless-stopped
        volumes:
            - common-storage:/var/lib/guacamole
        environment:
            ACCEPT_EULA:"Y"
            GUACD_HOSTNAME: "guacd"
            MYSQL_HOSTNAME: "db"
            MYSQL_DATABASE: "guacamole_db"
            MYSQL_USERNAME: "guacamole_user"
            MYSQL_PASSWORD: "xxxxxxx"
            KSM_CONFIG: "xxxxxxx"
            KSM_TOKEN_MAPPING: |
                MY_CUSTOM_SECRET: keeper://cps2OgKHpFQ8Ye30L9587w/field/password
                MY_OTHER_CUSTOM_SECRET: keeper://sS6jDVv0HoM0yGMU4OaOAw/file/linuxssoconnect.pem
                RDP_INITIAL_PROGRAM: keeper://cps2OgKHpFQ8Ye30L9587w/custom_field/program
```

{% endcode %}

ファイルの変更を保存したら、コンテナを更新します。

```
$ sudo ./kcm-setup.run upgrade
```

### Docker Composeのインストールメソッド

`docker-compose.yml`ファイルを編集します。「guacamole」dockerイメージと環境変数を定義する「environment」セクションを探します。

複数行にわたるカスタムトークンの定義が含まれた`KSM_TOKEN_MAPPING`という環境変数を挿入します。以下の例では、Keeperボルトの共有フォルダ内の特定のフィールドに3つのカスタムトークンがあります。トークンの構文は、[Keeper表記法](/keeperpam/jp/secrets-manager/about/keeper-notation.md)を使用しています。

{% code overflow="wrap" lineNumbers="true" %}

```
    guacamole:
        image: xxx
        environment:
            ACCEPT_EULA:"Y"
            GUACD_HOSTNAME: "guacd"
            MYSQL_HOSTNAME: "db"
            MYSQL_DATABASE: "guacamole_db"
            MYSQL_USERNAME: "guacamole_user"
            MYSQL_PASSWORD: "xxxxxxx"
            KSM_CONFIG: "xxx"
            KSM_TOKEN_MAPPING: |
                MY_CUSTOM_SECRET: keeper://cps2OgKHpFQ8Ye30L9587w/field/password
                MY_OTHER_CUSTOM_SECRET: keeper://sS6jDVv0HoM0yGMU4OaOAw/file/linuxssoconnect.pem
                RDP_INITIAL_PROGRAM: keeper://cps2OgKHpFQ8Ye30L9587w/custom_field/program
```

{% endcode %}

ファイルの変更を保存したら、コンテナを更新します。

```
sudo su
docker-compose up -d
```

### カスタムトークンの使用方法

カスタムトークンを使用する場合、レコードは自由に設定できます。マッピングファイルでKeeper表記法を使用して、指定した任意のフィールドを識別できます。

これで、トークンは、コネクションマネージャーのパラメータ画面内で${*XXX*}形式で使用できるようになります。以下に例をいくつか示します。

<figure><img src="https://4041518992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ7s6LQJaKa1G17O787JG%2Fuploads%2FXEFHinR9pXBIRGDJJQM1%2Fimage.png?alt=media&#x26;token=2dcfda1f-07a4-41be-be45-204d9567b11b" alt=""><figcaption><p>カスタムトークンの例</p></figcaption></figure>

<figure><img src="https://4041518992-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ7s6LQJaKa1G17O787JG%2Fuploads%2F43IdX4xmU0B0ldG8BAAN%2Fimage.png?alt=media&#x26;token=cfa81fb2-3459-4442-9b5e-790f927786fa" alt=""><figcaption><p>カスタムトークンの例</p></figcaption></figure>

{% hint style="info" %}
レコードは、シークレットマネージャーアプリケーションがアクセスできる共有フォルダ内にあることが必要です。
{% 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/keeper-connection-manager/jp/vault-integration/static-tokens.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.
