# AWS CLI認証プロセス

![](/files/sgT1N3PdwIBGhJ3qNNCH)

## 概説 <a href="#about" id="about"></a>

AWS CLIは、デフォルトでは `~/.aws/credentials` に平文で保存された認証情報を使用します。本認証プロセスを使用すると、AWS認証情報をKeeperボルトに保存でき、ディスク上に認証情報を置く必要がなくなります。

認証時は、Keeperシークレットマネージャー (KSM) と実行可能ファイルを通じて、ボルトからAWS認証情報が安全に取得されます。

## 機能 <a href="#features" id="features"></a>

* ボルトに保存されたAWSアクセスキーを使用してAWS CLIに認証

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

本ページでは、AWS CLI認証プロセスについて取り扱います。本連携を利用するには、以下が必要です。

* Keeperシークレットマネージャーへのアクセス（[クイックスタートガイド](/jp/keeperpam/secrets-manager/quick-start-guide.md)をご参照ください）
  * Keeperのサブスクリプションでシークレットマネージャーアドオンが有効になっていること
  * シークレットマネージャーポリシーが有効なロールに所属していること
* アクセスキーが共有されているKeeper[シークレットマネージャーアプリケーション](/jp/keeperpam/secrets-manager/about/terminology.md#application)
  * アプリケーションの作成手順については、[クイックスタートガイド](https://newdocs.keeper.io/jp/keeperpam/secrets-manager/integrations/pages/-MeRAVfQmDBzKQBC0f_c#2.-create-an-application)をご参照ください
* 初期化済みのKeeper[シークレットマネージャー構成](/jp/keeperpam/secrets-manager/about/secrets-manager-configuration.md)
  * 本連携ではJSON形式の構成のみ使用可能
* [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)がインストールされていること

## 設定 <a href="#setup" id="setup"></a>

### ボルト <a href="#vault" id="vault"></a>

まず、AWSの `Access Key ID` と `Secret Access Key` をボルト内のレコードに追加します。この種類のシークレット専用の組み込みレコードタイプはありませんが、[カスタムレコードタイプ](/jp/enterprise-guide/record-types.md#custom-record-types)を作成して対応できます。

{% hint style="warning" %}
**新しい**カスタムレコードタイプを作成するには、**\[ボルト内のレコードタイプを管理]** 権限が有効な管理者ロールに所属している必要があります ([権限の詳細](/jp/enterprise-guide/record-types.md#custom-record-types))。
{% endhint %}

{% hint style="info" icon="pencil-line" %}
**注** フィールド名は大文字と小文字を区別します。
{% endhint %}

![](/files/ENcd8JdMAhrgtlcsTVxY)

カスタムレコードタイプに必要な最小限のフィールドの例

カスタムレコードタイプを作成したら、AWSアクセスキー用のレコードを作成します。このレコードは、KSMアプリケーションがアクセス権を持つ共有フォルダに保存します。

レコードへの保存が完了したら、AWS認証情報ファイルからアクセスキーを削除できます。

### KSM <a href="#ksm" id="ksm"></a>

KSMアプリケーション構成ファイルは、ユーザーのホームディレクトリ内の `.config/keeper/aws-credential-process.json` または `aws-credential-process.json` に配置します。必要なAWSアクセスキーを含む共有フォルダへのアクセス権も必要です。

JSON形式のKSM構成の取得方法については、[構成ドキュメント](/jp/keeperpam/secrets-manager/about/secrets-manager-configuration.md#creating-a-secrets-manager-configuration)をご参照ください。新しいデバイスを作成したら、対応する `config.json` を取得し、ユーザーのホームディレクトリに `aws-credential-process.json` としてコピーします。

### AWS構成 <a href="#aws-config" id="aws-config"></a>

[GitHubリリースページ](https://github.com/Keeper-Security/aws-credential-process/tags)から `keeper-aws-credential-process` 実行可能ファイルの最新バージョンをダウンロードし、任意の場所に保存します。

CLIで使用する各プロファイルのAWS設定ファイル (通常 `~/.aws/config`) に、以下の行を追加します。

```ini
# Add the UID for your AWS Access Key
#credential_process = /path/to/keeper-aws-credential-process --uid <Record UID>
credential_process = /opt/keeper-aws-credential-process-v0.1.1_linux_amd64  --uid <Record UID>
```

{% hint style="danger" %}
マシンに残った[AWS CLI構成](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)が自動的に選ばれたり、認証プロセスの設定ミスを招いたりする可能性があります。不要な構成が残っていないことを確認してください。
{% endhint %}

## 使用方法 <a href="#usage" id="usage"></a>

上記のとおり設定すると、KeeperボルトからAWS CLI用の認証情報が自動的に取得されます。動作確認には、適切なIAM権限が必要なCLIコマンドを実行します。以下に例を示します。

```shell
# List all s3 buckets
aws s3 ls
```

エラーなく完了すれば、セットアップは完了です。

## 機能リクエスト / 不具合報告 <a href="#feature-request-report-an-issue" id="feature-request-report-an-issue"></a>

本認証プロセスはオープンソースで、[GitHub](https://github.com/Keeper-Security/aws-credential-process)で公開されています。不具合の報告や認証ユースケースの拡張をご要望の場合は、[GitHub Issue](https://github.com/Keeper-Security/aws-credential-process/issues)を作成してください。


---

# 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://newdocs.keeper.io/jp/keeperpam/secrets-manager/integrations/aws-cli-credential-process.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.
