# Windowsサービス

本ガイドでは、Dockerを使用せずにオートメーターサービスをWindowsサーバーで実行するための手順を解説します。

{% hint style="info" %}
SSL証明書が必要となりますので、お持ちでない場合は[カスタムSSL証明書の作成](/sso-connect-cloud/jp/device-approvals/automator/custom-ssl-certificate.md)ページをご参照ください。
{% endhint %}

#### **1. オートメーターサービスをインストール**

オートメーターインスタンスで、以下のURLからKeeperオートメーターのインストーラーをダウンロードし、解凍して実行します。

<https://keepersecurity.com/automator/keeper-automator-windows.zip>

設定画面でJavaのチェックボックスをオンにして、Javaランタイムをインストールに含めます。現在はJava 17ランタイムが同梱されており、新バージョンのリリースに合わせて更新されます。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F3D6Kh3n1ZpgdLU1uxKts%2FScreenshot%202023-04-05%20at%201.51.14%20PM.jpg?alt=media&#x26;token=309cabec-363b-47fe-90fb-1bc7a32ddfb3" alt=""><figcaption><p>インストーラーにJavaを組み込む</p></figcaption></figure>

これにより、Keeperオートメーターが以下のフォルダにインストールされます。

`C:\Program Files\Keeper Security\Keeper Automator\`

設定は以下のフォルダに保存されます。

`C:\ProgramData\Keeper Automator\`

#### 2. configフォルダを作成

**C:\ProgramData\Keeper Automator**フォルダにconfigというフォルダを作成します。

#### 3. 証明書ファイルとパスワードファイルをコピー

`ssl-certificate.pfx`ファイル ([SSL証明書作成](/sso-connect-cloud/jp/device-approvals/automator/custom-ssl-certificate.md)のページで保存) を**C:\ProgramData\Keeper Automator\Config**に配置します。

`ssl-certificate.pfx`ファイルがパスフレーズで保護されている場合は、`ssl-certificate-password.txt`という名前のファイルも**C:\ProgramData\Keeper Automator\Config**に作成する必要があります。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FZDZgOUTIUpE5nzLAWmEq%2FScreen%20Shot%202022-08-02%20at%204.39.00%20PM.png?alt=media&#x26;token=0d8b5922-4740-42eb-b653-323b3096871d" alt=""><figcaption><p>SSL証明書ファイルとパスワードファイル</p></figcaption></figure>

#### **4. サービスの再起動**

サービス画面でKeeperオートメーターを選択し、サービスを再起動します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F0OMd7BT7ReYmJ7w5iEB9%2FScreen%20Shot%202022-01-15%20at%203.07.54%20PM.png?alt=media&#x26;token=d838f40a-20dc-4981-8d25-69493a10898d" alt=""><figcaption><p>Keeperオートメーターサービスを起動</p></figcaption></figure>

ウェブブラウザでサービスが実行中であることを確認します (テストしているデバイスからポート443が解放されている必要があります）。\
\
この場合のURLは、\*\*<https://automator.company.com/api/rest/status**となります。>

自動ヘルスチェックには以下のURLもご使用になれます。

**<https://automator.company.com/health>**

### **Windowsファイアウォール**

Defenderファイアウォールが実行されているWindowsでデプロイしている場合は、Windows Defenderファイアウォールでポート443 (または任意の指定ポート) を開く必要がありますので、 以下の手順に従います。

**\[スタート]**&#x30E1;ニューを開き、**\[Windows Defenderファイアウォール]**&#x3068;入力して、結果の一覧から選択します。横のナビゲーションメニュー&#x3067;**\[詳細設定]**&#x3092;選択し、**\[受信の規則]**&#x3092;選択します。ポートを開くには、**\[新しい規則]**&#x3092;選択して手順を完了します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FRyNmSpVAueVx9lGdF1U7%2FScreen%20Shot%202021-10-14%20at%205.28.31%20PM%20(1).png?alt=media&#x26;token=db8ac5a9-156d-40a4-a0b7-bdfa9e047d53" alt=""><figcaption><p>「ポート」を選択</p></figcaption></figure>

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F3xmtmBQNqY7p1xnihU9F%2Finbound.jpg?alt=media&#x26;token=58b6de6b-3f20-4df6-ba60-aa14e568ba33" alt=""><figcaption><p>ポート番号を入力</p></figcaption></figure>

### コマンダーを使用した最後の設定

サービスが実行中となりましたので、Keeperコマンダーを使用してオートメーターをご利用のKeeperの環境に統合します。

#### 5. Keeperコマンダーをインストールします

ご利用のワークステーション、サーバー、コンピュータなどにKeeper Commander CLIをインストールします。バイナリインストーラーを含むインストール手順については[こちら](/keeperpam/jp/commander-cli/commander-installation-setup.md)をご覧ください。

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

```
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がまだ入力されいませんので、以下のように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"
```

{% hint style="info" %}
この手順でエラーが発生した場合は、Windows サービスを停止してから開始し、ポートが使用可能であることを確かにします。
{% endhint %}

次に、以下のコマンドを使用して新しい設定でオートメーターを初期化します。

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

最後に、以下のコマンドでオートメーターサービスを有効にします。

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

この時点で設定は完了となります。

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

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

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

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

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><p>ログイン画面</p></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><p>SSOログイン</p></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><p>デバイス承認</p></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><p>ボルト復号化</p></figcaption></figure>

## サービスの更新

Keeperオートメーターサービスを再設定する際は、Keeperコマンダーを使用してサービスエンドポイントを再初期化する必要があります。

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

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

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

Keeperオートメーターのログを確認してください。通常これで問題がわかります。Windowsの場合、ログは**C:\ProgramData\Keeper Automator\logs**にあります。

#### 常に承認のプロンプトが表示される

Keeperオートメーターサービスを再インストールする際、Keeperコマンダーを使用してサービスエンドポイントを再初期化する必要がある場合があります。Keeperコマンダーについては[こちら](/keeperpam/jp/commander-cli/overview.md)をご覧ください。

Keeperコマンダーでオートメーターインスタンスを再初期化するのに必要なコマンドは以下のとおりです。

```
$ keeper shell

My Vault> automator list
288797895952179 My Automator True https://something.company.com 

(find the Name corresponding to your Automator)

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


---

# 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/sso-connect-cloud/jp/device-approvals/automator/windows-service.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.
