

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

# Amazon RDS の PostgreSQL DB インスタンスに対して暗号化された接続を有効にする
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds"></a>

*Amazon Web Services、Rohit Kapoor*

## 概要
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-summary"></a>

Amazon Relational Database Service (Amazon RDS) は PostgreSQL DB インスタンスの SSL 暗号化をサポートしています。SSL を使用して、アプリケーションと Amazon RDS for PostgreSQL DB インスタンスとの間の PostgreSQL 接続を暗号化できます。デフォルトでは、Amazon RDS for PostgreSQL は SSL/TLS を使用し、すべてのクライアントが SSL/TLS 暗号化を使用して接続することを想定しています。Amazon RDS for PostgreSQL は TLS バージョン 1.1 および 1.2 をサポートします。

このパターンは、Amazon RDS for PostgreSQL DB インスタンスに対して暗号化された接続を有効にする方法を示しています。同じプロセスを使用して、Amazon Aurora PostgreSQL 互換エディションの暗号化接続を有効化できます。

## 前提条件と制限事項
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-prereqs"></a>
+ アクティブな AWS アカウント
+ [Amazon RDS for PostgreSQL DB インスタンス](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_RDS_Configuring.html)
+ [SSL バンドル](https://www.postgresql.org/docs/current/ssl-tcp.html)

## アーキテクチャ
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-architecture"></a>

![\[Amazon RDS の PostgreSQL DB インスタンスに対して暗号化された接続を有効にする\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/images/pattern-img/4f87c6a3-b4ff-4248-96d3-a4a498659735/images/ccc5c880-1191-4c12-a255-6908b96b96a5.png)


## ツール
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-tools"></a>
+ [pgAdmin](https://www.pgadmin.org/) は、オープンソースの PostgreSQL 向けの管理・開発プラットフォームです。pgAdmin を使用すると、Linux、Unix、macOS、および Windows で PostgreSQL 10 以降のデータベースオブジェクトを管理できます。
+ [PostgreSQL エディタ](https://wiki.postgresql.org/wiki/PostgreSQL_Clients) は、クエリを作成、開発、実行したり、要件に応じてコードを編集したりする際に役立つ、よりユーザーフレンドリーなインターフェイスを提供します。

## ベストプラクティス
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-best-practices"></a>
+ セキュアでないデータベース接続をモニタリングします。
+ データベースアクセス権を確認します。
+ バックアップとスナップショットが保管中の場合に暗号化されていることを確認します。
+ データベースアクセスをモニタリングします。
+ 無制限のアクセスグループを避けてください。
+ [Amazon GuardDuty](https://docs.aws.amazon.com/guardduty/latest/ug/what-is-guardduty.html) で通知機能を強化しましょう。
+ ポリシーの遵守状況を定期的にモニタリングします。

## エピック
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-epics"></a>

### 信頼できる証明書をダウンロードして信頼ストアにインポートする
<a name="download-a-trusted-certificate-and-import-it-into-your-trust-store"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| 信頼できる証明書をコンピュータにロードします。 | コンピュータの信頼されたルート証明機関ストアに証明書を追加するには、次の手順に従います。(これらの手順では、例として Windows Server を使用しています)。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds.html) | DevOps エンジニア、移行エンジニア、DBA | 

### 強制的に SSL 接続する
<a name="force-ssl-connections"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| パラメータグループを作成し、rds.force\$1ssl パラメータを設定します。 | PostgreSQL DBインスタンスにカスタムパラメータグループがある場合は、パラメータグループを編集し、`rds.force_ssl` を 1 に変更します。DB インスタンスが `rds.force_ssl` を有効にしていないデフォルトのパラメータグループを使用している場合は、新しいパラメータグループを作成します。新しいパラメータグループは Amazon RDS API を使用するか、以下の手順に従って手動で変更できます。パラメータグループを作成するには：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds.html)パラメータグループを PostgreSQL DB インスタンスに関連付けるには：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds.html)詳細については、「 [Amazon RDS ドキュメント](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithDBInstanceParamGroups.html)」を参照してください。 | DevOps エンジニア、移行エンジニア、DBA | 
| 強制的に SSL 接続するようにします。 | 移行元の Amazon RDS for PostgreSQL インスタンスに接続します。SSL を使用しない接続は拒否され、エラーメッセージが表示されます。詳細については、「 [Amazon RDS ドキュメント](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.SSL.html#PostgreSQL.Concepts.General.SSL.Requiring)」を参照してください。 | DevOps エンジニア、移行エンジニア、DBA | 

### SSL 拡張機能のインストール
<a name="install-ssl-extension"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| SSL 拡張機能をインストールします。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds.html)詳細については、「 [Amazon RDS ドキュメント](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.SSL.html)」を参照してください。 | DevOps エンジニア、移行エンジニア、DBA | 

### PostgreSQL クライアントを SSL 向けに設定します
<a name="configure-your-postgresql-client-for-ssl"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| SSL 向けにクライアントを設定します。 | SSL を使用すると、TLS プロトコルを使用する暗号化接続をサポートする PostgreSQL サーバーを起動できます。サーバーは、同じ TCP ポート上の標準接続と SSL 接続をリッスンし、SS Lを使用するかどうかを接続クライアントとネゴシエートします。デフォルトでは、このクライアントオプションは有効になっています。psql クライアントを使用している場合：　[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds.html)他の PostgreSQL クライアントの場合:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds.html)これらのクライアントについては、以下のページを確認してください。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds.html) | DevOps エンジニア、移行エンジニア、DBA | 

## トラブルシューティング
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-troubleshooting"></a>


| 問題 | ソリューション | 
| --- | --- | 
| SSL 証明書をダウンロードできません。 | ウェブサイトへの接続を確認してから、証明書をローカルコンピュータにダウンロードしてください。 | 

## 関連リソース
<a name="enable-encrypted-connections-for-postgresql-db-instances-in-amazon-rds-resources"></a>
+ 「[Amazon RDS for PostgreSQL ドキュメント](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html)」
+ 「[PostgreSQL DB インスタンスで SSL を使用する](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.SSL.html)」 (Amazon RDS ドキュメント)
+ 「[SSL による TCP/IP 接続のセキュリティ保護](https://www.postgresql.org/docs/9.1/ssl-tcp.html)」 (PostgreSQL ドキュメント)
+ 「[SSL を使用する](https://jdbc.postgresql.org/documentation/ssl/)」 (JDBC ドキュメント)