# Octopus Deploy

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fk7TUHIrWo2XD8EwqVOyr%2Fimage.png?alt=media&#x26;token=ec05aa36-3f28-41cb-9dc1-05d8daa8c286" alt=""><figcaption></figcaption></figure>

## 機能

* Keeperボルトからシークレットを取得し、Octopus Deployのライブラリで利用可能
* 認証情報をOctopus Deployのプロジェクトに直接挿入
* Keeperボルトからファイルを取得

{% hint style="info" %}
Keeperシークレットマネージャーの機能一覧については、[概要ページ](/keeperpam/jp/secrets-manager/overview.md)をご参照ください。
{% endhint %}

## 要件

* Keeperシークレットマネージャーへのアクセス ([クイックスタートガイド](/keeperpam/jp/secrets-manager/quick-start-guide.md)をご参照ください)
  * Keeperのサブスクリプションでシークレットマネージャーアドオンが有効になっていること
  * シークレットマネージャーポリシーが有効なロールに所属していること
* シークレットが共有されているKeeper[シークレットマネージャーアプリケーション](/keeperpam/jp/secrets-manager/about/terminology.md)
  * アプリケーションの作成手順については、[クイックスタートガイド](/keeperpam/jp/secrets-manager/quick-start-guide.md)をご参照ください
* Keeper[シークレットマネージャーの構成](/keeperpam/jp/secrets-manager/about/secrets-manager-configuration.md)が初期化されていること
  * Octopus Deploy連携では、Base64形式の構成を使用できます

## 概説

KeeperのOctopus Deployステップテンプレートでは、Keeperシークレットマネージャーを通じて、Keeperボルトに保存されたシークレットの認証情報を利用できます。このスクリプトを使用することで、Keeperのゼロ知識基盤を活用しながら、シークレットを安全にOctopus Deployのプロジェクトへ直接組み込むことが可能です。

## インストール

### コミュニティステップテンプレート

[コミュニティステップテンプレート](https://octopus.com/docs/projects/community-step-templates)から直接ステップテンプレートを使用します。

**場所:** Library (ライブラリ) > Step Templates (ステップテンプレート) > Community Step Templates (コミュニティステップテンプレート) > Browse Library (ライブラリを参照)

**検索:** 「Keeper Secrets Manager - Retrieve Secrets」を検索し、インストールしてから保存します。

### カスタムステップテンプレート

[カスタムステップテンプレート](https://octopus.com/docs/projects/custom-step-templates)として追加します。

**場所:** Library (ライブラリ) > Step Templates (ステップテンプレート) > Custom Step Templates (カスタムステップテンプレート) > Import (インポート)

コミュニティで提供されている[テンプレートライブラリ](https://library.octopus.com/listing)から取得したJSONを貼り付けます。

## ステップの構成

### 設定

**名前**: Keeper Secrets Manager - Retrieve Secrets\
\
**説明**: このステップでは、Keeperボルトからシークレットを取得し、取得した各値に対して機密出力変数を作成します。作成された変数は、デプロイやランブックの他のステップで利用できます。

シークレットの取得にはKeeper表記法URIを使用でき、各シークレットごとに出力変数名を任意に指定できます。\
\
**要件:**

* Keeperボルトからシークレットを取得する権限を持つKeeperシークレットマネージャーアプリケーション。
* PowerShell 6.0以降
* `Microsoft.Powershell.SecretManagement` モジュール
* 対象マシンまたはワーカーに、`SecretManagement.Keeper.Extension` PowerShellモジュールがインストールされている必要があります。このモジュールが見つからない場合、ステップは失敗します。`SecretManagement.Keeper` モジュールは、[PowerShellギャラリー](https://www.powershellgallery.com/packages/SecretManagement.Keeper)からインストールできます。
  * `SecretManagement.Keeper.Extension` は、`SecretManagement.Keeper` モジュール内に含まれています。

### パラメータ

**Keeperシークレットマネージャーの構成** (種類: 機密)

**変数名:** `#{Keeper.SecretsManager.RetrieveSecrets.Config}`

Keeperボルトからシークレットを取得する権限を持つ[KSMアプリケーション](/keeperpam/jp/secrets-manager/quick-start-guide.md)用に、Keeperシークレットマネージャーの[構成](/keeperpam/jp/secrets-manager/about/one-time-token.md)が必要です。

ウェブボルトでKSM構成を生成するには、**\[シークレットマネージャー]** → **KSMアプリケーション名** → **\[編集]** → **\[デバイスを追加]** の順に進み、方式を **\[構成ファイル]** に切り替えます。形式はBase64を推奨します。

**取得するボルトシークレット** (種類: 複数行テキストボックス)

**変数名:** `#{Keeper.SecretsManager.RetrieveSecrets.VaultSecrets}`

Keeperボルトから取得するシークレットは、[Keeper表記法](/keeperpam/jp/secrets-manager/about/keeper-notation.md)を使用して指定します。指定形式は次のとおりです。

`SecretsManagerNotation URI | OutputVariableName`

* `OutputVariableName` は、シークレットの値を保存するOctopusの[出力変数](https://octopus.com/docs/projects/variables/output-variables)名 (任意) です。この値を指定しない場合は、出力変数名が自動的に生成されます。

{% hint style="info" %}
複数のフィールドを取得する場合は、それぞれを1行ずつ入力します。各行の形式は「記法URI | 変数名」です。変数名は任意で、省略した場合は `KsmSecret1`、`KsmSecret2` などの自動生成された変数名が使用されます。
{% endhint %}

```
V8lFbio0Bs0LuvaSD5DDHA/field/login | MyLogin
V8lFbio0Bs0LuvaSD5DDHA/field/password | MyPass
V8lFbio0Bs0LuvaSD5DDHA/custom_field/phone[1][number] | MyOtherPhoneNum
V8lFbio0Bs0LuvaSD5DDHA/file/IMG_0036.png | MyImageBase64
```

**出力変数名を表示** (種類: チェックボックス)

**変数名:** `#{Keeper.SecretsManager.RetrieveSecrets.PrintVariableNames}`

Octopus[出力変数](https://octopus.com/docs/projects/variables/output-variables)名をタスクログに書き出します。\
デフォルト: `False`


---

# 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/secrets-manager/integrations/octopus-deploy.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.
