

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# シークレットマネージャー
<a name="secret-manager-component"></a>

シークレットマネージャーコンポーネント (`aws.greengrass.SecretManager`) は、 AWS Secrets Manager から Greengrass コアデバイスにシークレットをデプロイします。このコンポーネントを使用して、Greengrass コアデバイスのカスタムコンポーネントでパスワードなどの認証情報を安全に使用します。Secrets Manager の詳細については、「AWS Secrets Manager ユーザーガイド」の「[AWS Secrets Managerとは](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html)」を参照してください。

カスタム Greengrass コンポーネントでこのコンポーネントのシークレットにアクセスするには、 AWS IoT Device SDKで [GetSecretValue](ipc-secret-manager.md#ipc-operation-getsecretvalue) 操作を使用します。詳細については、「[を使用して AWS IoT Device SDK Greengrass nucleus、その他のコンポーネント、および と通信します。 AWS IoT CoreGreengrass nucleus、その他のコンポーネント、および と通信する AWS IoT Core](interprocess-communication.md)」および「[シークレット値を取得する](ipc-secret-manager.md)」を参照してください。

このコンポーネントは、コアデバイスのシークレットを暗号化して、認証情報およびパスワードを使用する必要があるまで安全に保ちます。コアデバイスのプライベートキーを使用して、シークレットを暗号化および復号化します。

**Topics**
+ [バージョン](#secret-manager-component-versions)
+ [タイプ](#secret-manager-component-type)
+ [オペレーティングシステム](#secret-manager-component-os-support)
+ [要件](#secret-manager-component-requirements)
+ [依存関係](#secret-manager-component-dependencies)
+ [設定](#secret-manager-component-configuration)
+ [ローカルログファイル](#secret-manager-component-log-file)
+ [変更ログ](#secret-manager-component-changelog)

## バージョン
<a name="secret-manager-component-versions"></a>

このコンポーネントには、次のバージョンがあります。
+ 2.2.x
+ 2.1.x
+ 2.0.x

## タイプ
<a name="secret-manager-component-type"></a>

<a name="public-component-type-plugin-para1"></a>このコンポーネントはプラグインコンポーネント (`aws.greengrass.plugin`) です。[Greengrass nucleus](greengrass-nucleus-component.md) は、nucleus と同じ Java バーチャルマシン (JVM) でこのコンポーネントを実行します。コアデバイスでこのコンポーネントのバージョンを変更するとき、nucleus が再起動します。

<a name="public-component-type-plugin-para2"></a>このコンポーネントは、Greengrass nucleus と同じログファイルを使用します。詳細については、「[AWS IoT Greengrass ログのモニタリング](monitor-logs.md)」を参照してください。

<a name="public-component-type-more-information"></a>詳細については、「[コンポーネントタイプ](develop-greengrass-components.md#component-types)」を参照してください。

## オペレーティングシステム
<a name="secret-manager-component-os-support"></a>

このコンポーネントは、次のオペレーティングシステムを実行するコアデバイスにインストールできます。
+ Linux
+ Server 

## 要件
<a name="secret-manager-component-requirements"></a>

このコンポーネントには次の要件があります。
+ 次の IAM ポリシーの例で示されているように、[Greengrass デバイスのロール](device-service-role.md)は `secretsmanager:GetSecretValue` アクションを許可する必要があります。

------
#### [ JSON ]

****  

  ```
  {
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Action": [
          "secretsmanager:GetSecretValue"
        ],
        "Effect": "Allow",
        "Resource": [
        "arn:aws:secretsmanager:us-east-1:123456789012:secret:MySecret"
        ]
      }
    ]
  }
  ```

------

  ```
  ```
**注記**  
カスタマーマネージド AWS Key Management Service キーを使用してシークレットを暗号化する場合、デバイスロールは `kms:Decrypt`アクションも許可する必要があります。

  Secrets Manager の IAM ポリシーの詳細については、「AWS Secrets Manager ユーザーガイド」の以下を参照してください。
  + [の認証とアクセスコントロール AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html)
  + [[Actions, resources, and context keys you can use in an IAM policy or secret policy for AWS Secrets Manager]](https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html) ( の IAM ポリシーまたはシークレットポリシーで使用できるアクション、リソース、およびコンテキストキー)
+ カスタムコンポーネントは、このコンポーネントで保存したシークレットを `aws.greengrass#GetSecretValue` が取得できるようにするための認可ポリシーを定義する必要があります。この認可ポリシーでは、コンポーネントのアクセスを特定のシークレットに制限できます。詳細については、「[シークレットマネージャー IPC 認可](ipc-secret-manager.md#ipc-secret-manager-authorization)」を参照してください。
+ (オプション) コアデバイスのプライベートキーと証明書を [[hardware security module]](hardware-security.md) (ハードウェアセキュリティモジュール) (HSM) に保存する場合、HSM は RSA キーをサポートし、プライベートキーには `unwrap` アクセス許可が必要で、パブリックキーには `wrap` アクセス許可が必要です。

### エンドポイントおよびポート
<a name="secret-manager-component-endpoints"></a>

このコンポーネントは、基本的な操作に必要なエンドポイントとポートに加えて、次のエンドポイントとポートに対し、アウトバウンドリクエストを実行できる必要があります。詳細については、「[プロキシまたはファイアウォールを介したデバイストラフィックを許可する](allow-device-traffic.md)」を参照してください。


| Endpoint | ポート | 必要 | 説明 | 
| --- | --- | --- | --- | 
|  `secretsmanager.region.amazonaws.com`  | 443 | はい |  コアデバイスにシークレットをダウンロードします。  | 

## 依存関係
<a name="secret-manager-component-dependencies"></a>

コンポーネントをデプロイすると、 は互換性のあるバージョンの依存関係 AWS IoT Greengrass もデプロイします。つまり、コンポーネントを正常にデプロイするには、コンポーネントとその依存関係のすべての要件を満たす必要があります。このセクションでは、このコンポーネントの[リリースされたバージョン](#secret-manager-component-changelog)の依存関係と、各依存関係に対するコンポーネントのバージョンを定義するセマンティックバージョン制約をリスト表示しています。コンポーネントの各バージョンの依存関係は、[AWS IoT Greengrass コンソール](https://console.aws.amazon.com//greengrass)でも確認できます。コンポーネントの詳細ページで **[Dependencies]** (依存関係) リストを確認します。

------
#### [ 2.2.7 ]

次の表に、このコンポーネントのバージョン 2.2.7 に関する依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.17.0 | ソフト | 

------
#### [ 2.2.6 ]

次の表に、このコンポーネントのバージョン 2.2.6 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.16.0 | ソフト | 

------
#### [ 2.2.2 – 2.2.5 ]

次の表に、このコンポーネントのバージョン 2.2.2 から 2.2.5 までの依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.15.0 | ソフト | 

------
#### [ 2.2.0 ]

次の表に、このコンポーネントのバージョン 2.2.0 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.13.0 <2.14.0 | ソフト | 

------
#### [ 2.1.7 – 2.1.8 ]

次の表に、このコンポーネントのバージョン 2.1.7 および 2.1.8 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.13.0 | ソフト | 

------
#### [ 2.1.6 ]

次の表に、このコンポーネントのバージョン 2.1.6 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.12.0 | ソフト | 

------
#### [ 2.1.5 ]

次の表に、このコンポーネントのバージョン 2.1.5 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.11.0 | ソフト | 

------
#### [ 2.1.4 ]

次の表に、このコンポーネントのバージョン 2.1.4 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.10.0 | ソフト | 

------
#### [ 2.1.3 ]

次の表に、このコンポーネントのバージョン 2.1.3 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.9.0 | ソフト | 

------
#### [ 2.1.2 ]

次の表に、このコンポーネントのバージョン 2.1.2 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.8.0 | ソフト | 

------
#### [ 2.1.1 ]

次の表に、このコンポーネントのバージョン 2.1.1 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.7.0 | ソフト | 

------
#### [ 2.1.0 ]

次の表に、このコンポーネントのバージョン 2.1.0 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.0 <2.6.0 | ソフト | 

------
#### [ 2.0.9 ]

次の表に、このコンポーネントのバージョン 2.0.9 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) |  >=2.0.0 <2.5.0  | ソフト | 

------
#### [ 2.0.8 ]

次の表に、このコンポーネントのバージョン 2.0.8 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) |  >=2.0.0 <2.4.0  | ソフト | 

------
#### [ 2.0.7 ]

次の表に、このコンポーネントのバージョン 2.0.7 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) |  >=2.0.0 <2.3.0  | ソフト | 

------
#### [ 2.0.6 ]

次の表に、このコンポーネントのバージョン 2.0.6 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) |  >=2.0.0 <2.2.0  | ソフト | 

------
#### [ 2.0.4 and 2.0.5 ]

次の表に、このコンポーネントのバージョン 2.0.4 および 2.0.5 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) |  >=2.0.3 <2.1.0  | ソフト | 

------

コンポーネントの依存関係の詳細については、「[コンポーネント recipe のリファレンス](component-recipe-reference.md#recipe-reference-component-dependencies)」を参照してください。

## 設定
<a name="secret-manager-component-configuration"></a>

このコンポーネントには、コンポーネントのデプロイ時にカスタマイズできる次の設定パラメータが用意されています。

`periodicRefreshIntervalMin` (オプション)  
このコンポーネントがコアデバイスに設定されているシークレットを AWS Secrets Manager サービスの最新のシークレット値と同期する分単位の間隔。この間隔が設定されていない場合、シークレットマネージャーは設定されたシークレットを定期的に更新しません。  

```
{
  "cloudSecrets": [
    {
      "arn": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyGreengrassSecret-abcdef"
    }
  ],
  "periodicRefreshIntervalMin" : 60
}
```

`cloudSecrets`  
コアデバイスにデプロイする Secrets Manager シークレットのリスト。ラベルを指定して、デプロイする各シークレットのバージョンを定義できます。バージョンを指定しない場合、このコンポーネントはステージングラベル `AWSCURRENT` がアタッチされたバージョンをデプロイします。詳細については、「*AWS Secrets Manager ユーザーガイド*」の「[Staging labels](https://docs.aws.amazon.com/secretsmanager/latest/userguide/terms-concepts.html#term_staging-label)」を参照してください。  
シークレットマネージャーコンポーネントはローカルでキャッシュします。シークレットマネージャーでシークレット値が変更された場合、このコンポーネントは新しい値を自動的に取得しません。ローカルコピーを更新するには、シークレットに新しいラベルを付け、新しいラベルで識別されたシークレットを取得するようにこのコンポーネントを設定します。  
各オブジェクトには、次の情報が含まれます:    
`arn`  
デプロイするシークレットの ARN。シークレットの ARN は、完全な ARN または部分的な ARN のいずれかにすることができます。部分的な ARN ではなく、完全な ARN を指定することをお勧めします。詳細については、「[部分 ARN からのシークレットの検索](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen)」を参照してください。以下は、完全な ARN と部分的な ARN の例です。  
+ 完全な ARN: `arn:aws:secretsmanager:us-east-2:111122223333:secret:SecretName-abcdef`
+ 部分的な ARN: `arn:aws:secretsmanager:us-east-2:111122223333:secret:SecretName`  
`labels`  
(オプション) コアデバイスにデプロイするシークレットのバージョンを識別するためのラベルのリスト。  
各ラベルは文字列である必要があります。

**Example 例: 設定マージの更新**  

```
{
  "cloudSecrets": [
    {
      "arn": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyGreengrassSecret-abcdef"
    }
  ]
}
```

## ローカルログファイル
<a name="secret-manager-component-log-file"></a>

このコンポーネントは、[Greengrass nucleus](greengrass-nucleus-component.md) コンポーネントと同じログファイルを使用します。

------
#### [ Linux ]

```
/greengrass/v2/logs/greengrass.log
```

------
#### [ Windows ]

```
C:\greengrass\v2\logs\greengrass.log
```

------

**このコンポーネントのログを確認するには**
+ コアデバイスに次のコマンドを実行して、このコンポーネントのログファイルをリアルタイムに確認します。`/greengrass/v2` または *C:\$1greengrass\$1v2* を AWS IoT Greengrass ルートフォルダへのパスに置き換えます。

------
#### [ Linux ]

  ```
  sudo tail -f /greengrass/v2/logs/greengrass.log
  ```

------
#### [ Windows (PowerShell) ]

  ```
  Get-Content C:\greengrass\v2\logs\greengrass.log -Tail 10 -Wait
  ```

------

## 変更ログ
<a name="secret-manager-component-changelog"></a>

次の表は、コンポーネントの各バージョンにおける変更を示します。


|  **バージョン**  |  **変更**  | 
| --- | --- | 
|  2.2.7  |  Greengrass nucleus バージョン 2.16.0 リリース用にバージョンが更新されました。  | 
|  2.2.6  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.2.5  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.2.4  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.2.3  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.2.2  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.2.1  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.2.0  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.1.8  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.1.7  | Greengrass nucleus バージョン 2.12.0 のリリース用にバージョンが更新されました。 | 
|  2.1.6  | Greengrass nucleus バージョン 2.11.0 のリリース用にバージョンが更新されました。 | 
|  2.1.5  | Greengrass nucleus バージョン 2.10.0 のリリース用にバージョンが更新されました。 | 
|  2.1.4  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.1.3  | Greengrass nucleus バージョン 2.8.0 のリリース用にバージョンが更新されました。 | 
|  2.1.2  |  Greengrass nucleus バージョン 2.7.0 のリリース用にバージョンが更新されました。  | 
|  2.1.1  |  Greengrass nucleus バージョン 2.6.0 のリリース用にバージョンが更新されました。  | 
|  2.1.0  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.0.9  |  Greengrass nucleus バージョン 2.4.0 のリリース用にバージョンが更新されました。  | 
|  2.0.8  |  Greengrass nucleus バージョン 2.3.0 のリリース用にバージョンが更新されました。  | 
|  2.0.7  |  Greengrass nucleus バージョン 2.2.0 のリリース用にバージョンが更新されました。  | 
|  2.0.6  |  Greengrass nucleus バージョン 2.1.0 のリリース用にバージョンが更新されました。  | 
|  2.0.5  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/secret-manager-component.html)  | 
|  2.0.4  |  当初のバージョン  | 