> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/sso-connect-cloud/jp/device-approvals/automator/docker-on-linux.md).

# LinuxベースのDocker

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FwBR1r9mpprXuoyKqxELU%2FDocker.jpg?alt=media&#x26;token=0b34fd80-7f7b-4f52-9335-20e6dcbe1dcc" alt=""><figcaption></figcaption></figure>

## LinuxベースのDocker

本ページでは、Dockerを実行できるLinuxインスタンスにKeeperオートメーターを公開する手順を取り扱います。

{% hint style="info" %}
SSL証明書がすでに用意できていることをご確認ください。用意できていない場合は、[SSL証明書作成](/sso-connect-cloud/jp/device-approvals/automator/custom-ssl-certificate.md)のページの手順をご参照ください。SSL証明書の秘密鍵および `.pfx` ファイルはKeeperボルトに保存してください。
{% endhint %}

### セットアップ

1. **Dockerをインストール**

Dockerをインストールしていない場合は、ご利用のプラットフォームの手順に従ってセットアップします。たとえば、yumパッケージインストーラーを使用する場合は、以下のようになります。

```
sudo yum install docker
```

Dockerサービスが実行されていない場合は、Dockerサービスを開始します。

```
sudo service docker start
```

続いて、サービスが自動的に開始するように設定します。

```
sudo systemctl enable docker.service
```

root以外のユーザーにDockerの実行を許可するには (セキュリティ要件を満たしている場合)、以下のコマンドを実行します。

```
sudo chmod 666 /var/run/docker.sock
```

2. **オートメーターイメージを取得**

`docker pull` コマンドを使用して、最新のKeeperオートメーターイメージを取得します。

```
docker pull keeper/automator
```

3. **サービスを開始**

以下のコマンドでサービスを開始します。以下の例では、ポート443をリッスンしています。

```
docker run -d -p443:443/tcp \
  --name "Keeper-Automator" \
 --restart on-failure:3 \
 keeper/automator
```

4. **証明書を更新**

Dockerコンテナ内に `config` フォルダを作成します。

```
docker exec -it Keeper-Automator mkdir /usr/mybin/config
```

[SSL証明書作成](/sso-connect-cloud/jp/device-approvals/automator/custom-ssl-certificate.md)のページで作成した `ssl-certificate.pfx` ファイルをコンテナにコピーします。

```
docker cp ssl-certificate.pfx \
  Keeper-Automator:/usr/mybin/config/ssl-certificate.pfx
```

`.pfx` ファイルがパスフレーズで保護されている場合は、`ssl-certificate-password.txt` という名前のファイルを作成します。

```
echo "my_pfx_password..." > ssl-certificate-password.txt
```

そのファイルをDockerコンテナに配置します。

```
docker cp ssl-certificate-password.txt \
  Keeper-Automator:/usr/mybin/config/ssl-certificate-password.txt
```

コンテナ内の `keeper.properties` ファイルで、`ssl_mode` パラメータが `certificate` に設定されていることを確認してください。

{% code overflow="wrap" %}

```
docker exec -it Keeper-Automator sed -i 's/^ssl_mode=.*/ssl_mode=certificate/' settings/keeper.properties
```

{% endcode %}

5. **SSL証明書を使用してコンテナを再起動**

証明書をインストールしたら、Dockerコンテナを再起動します。

```
docker restart "Keeper-Automator"
```

6. **Keeperコマンダーをインストール**

この時点でサービスは実行中ですが、Keeperとはまだ通信できない状態です。

ご利用のワークステーション、サーバー、コンピュータなどにKeeperコマンダーCLIをインストールします。バイナリインストーラーを含むインストール手順については[こちら](/keeperpam/jp/commander-cli/commander-installation-setup.md)のページをご参照ください。\
\
コマンダーをインストールした後、`keeper shell` と入力してセッションを開き、`login` コマンドを使用してログインできます。オートメーターを設定するには、Keeper管理者、またはSSOノードを管理できる管理者としてログインする必要があります。

```
$ keeper shell

My Vault> login admin@company.com
.
.
My Vault>
```

7. **コマンダーで初期化**

Keeperコマンダーにログインし、`automator create` で始まる一連のコマンドを使用してオートメーターを有効化します。

```
My Vault> automator create --name="My Automator" --node="Azure Cloud"
```

ノード名 (この場合は「Azure Cloud」) は、以下に示すように管理コンソールのUIに表示されます。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FNdYz9XWKABSVqtIAV5Ff%2FScreen%20Shot%202021-09-10%20at%203.59.58%20PM.png?alt=media&#x26;token=3c897624-3ae2-465e-9749-c4357015dacc" alt=""><figcaption><p>オートメーターの作成</p></figcaption></figure>

コマンドの出力には、IDプロバイダから取得したメタデータを含むオートメーターの設定が表示されます。

```
                    Automator ID:1477468749950
                            Name:My Automator
                             URL:
                         Enabled:No
                     Initialized:No
                          Skills:Device Approval
```

URLはまだ設定されていません。これはKeeperバックエンドが通信するパブリックURLです (例: automator.mycompany.com)。

以下のように `automator edit` コマンドを実行します。これによりURLとスキルが設定されます (`team`、 `team_for_user`、`device`)。

{% code overflow="wrap" %}

```
automator edit --url https://<application URL> --skill=team --skill=team_for_user --skill=device "My Automator"
```

{% endcode %}

続いてキーを交換します。オートメーター公開キーで暗号化されたエンタープライズ秘密キーがオートメーターへ渡されます。

```
automator setup "My Automator"
```

新しい設定でオートメーターを初期化します。

```
automator init "My Automator"
```

オートメーターサービスを有効にします。

```
automator enable "My Automator"
```

この時点で設定は完了です。

自動ヘルスチェックには、以下のURLを使用できます。

**https\://\<server>/health**

以下は、curlコマンドの例です。

```
$ curl https://automator.lurey.com/health
OK
```

#### AD FSを使用した環境の場合

IDプロバイダとしてAD FSを使用してKeeperオートメーターを有効にする場合、以下の手順に従ってKeeper証明書を更新するまでログインできません。

* Keeper管理コンソールへログインします。
* **\[管理者]** > **SSOノード** > **\[プロビジョニング]** に移動し、クラウドSSOコネクト設定を確認します。
* **\[SP証明書をエクスポート]** をクリックします。
* AD FS管理コンソールで、KeeperクラウドSSO証明書利用者信頼プロパティを選択します。
* **\[暗号化]** タブで、古い証明書をこの新しい証明書に置き換えます。
* **\[署名]** タブで、新しいSP証明書をこの新しい証明書に置き換えます。

### ネットワークアクセスの制限

Keeperのサーバーおよび運用担当のワークステーションなど、必要な送信元だけがサービスに届くようネットワークアクセスを制限することを推奨します。許可するIPアドレスの一覧は、[イングレス要件](/sso-connect-cloud/jp/device-approvals/automator/ingress-requirements.md)をご参照ください。

## ユーザー体験のテスト

Keeperオートメーターをデプロイしたら、エンドユーザー体験をテストできます。ユーザーがSSOのIDプロバイダーで認証したあとは、承認を求めるプロンプトは表示されません。

最も簡単なテスト方法は、ブラウザのシークレットウィンドウからKeeperウェブボルトを開き、クラウドSSOコネクトでログインすることです。デバイス承認を求めるプロンプトは表示されません。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FnAGBNvh99hgIOnNOuJdv%2FScreen%20Shot%202021-09-10%20at%205.17.42%20PM.png?alt=media&#x26;token=e8222ad6-49b4-4b22-9e5b-bde5fd35beb0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FbqTOKRYMbSo5HTGpHTQX%2FScreen%20Shot%202021-09-10%20at%205.18.15%20PM.png?alt=media&#x26;token=73817b67-9c8b-4e42-b585-3e73d0a6b437" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F2ePvTbVgjp70enV5sTmc%2FScreen%20Shot%202021-09-10%20at%205.30.15%20PM.png?alt=media&#x26;token=ed4aff69-cdc9-494c-bcc3-29523f8cc65a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FhKfNZnzP0MelaFgtnj7s%2FScreen%20Shot%202021-09-10%20at%205.32.12%20PM.png?alt=media&#x26;token=7fb689ee-343e-4117-825b-beaeff2e9409" alt=""><figcaption></figcaption></figure>

## サービスの再起動

Keeperオートメーターサービスを停止/開始する場合、Dockerサービスは自動的に状態を保持します。

```
docker restart "Keeper-Automator"
```

## コンテナの更新

Keeperオートメーターの新しいバージョンが利用可能になったら、上記の手順2〜7を繰り返すことでオートメーターサービスを更新できます。以下は、その例です。

```
docker pull keeper/automator
docker stop Keeper-Automator
docker rm Keeper-Automator

docker run -d -p443:443/tcp \
  --name "Keeper-Automator" \
 --restart on-failure:3 \
 keeper/automator

docker exec -it Keeper-Automator mkdir /usr/mybin/config

docker cp ssl-certificate.pfx \
  Keeper-Automator:/usr/mybin/config/ssl-certificate.pfx

docker cp ssl-certificate-password.txt \
 Keeper-Automator:/usr/mybin/config/ssl-certificate-password.txt

docker exec -it Keeper-Automator \
  sed -i 's/^ssl_mode=.*/ssl_mode=certificate/' settings/keeper.properties
  
docker restart "Keeper-Automator"
```

続いて、Keeperコマンダーのコマンドを実行します。

```
automator setup "My Automator"
automator init "My Automator"
automator enable "My Automator"
```

## トラブルシューティング

#### サービスが始まらない

Keeperオートメーターのログを確認してください。通常これで問題がわかります。Docker環境では、以下のコマンドを使用してログファイルを追跡できます。

```
docker logs -f "Keeper-Automator"
```

以下のコマンドを使用して、コンテナに接続してログファイルを確認できます。

```
docker exec -it "Keeper-Automator" /bin/sh
```


---

# 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://docs.keeper.io/sso-connect-cloud/jp/device-approvals/automator/docker-on-linux.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.
