[AWS]RDSのSSL証明書「rds-ca-2015」を「rds-ca-2019」に更新する

rds_ssl_update_2019_top

この記事には広告を含む場合があります。

記事内で紹介する商品を購入することで、当サイトに売り上げの一部が還元されることがあります。

Amazon RDS の SSL の入れ替え作業

Amazon Relational Database Service (Amazon RDS) の暗号化通信である SSL/TLS の SSL 証明書(CA)が期限を迎えるため、SSL 証明書入れ替えが実施されます。

2019年11月以降に AWS 側が任意のタイミングで適用を行ってくれますが、再起動(ダウンタイム)を伴うため稼働中のサービスでは問題が発生します。そのため AWS サポートチームからのメールで気づいたタイミングで SSL 証明書の入れ替えを実施してみたので、SSL 更新の手順や RDS の停止時間について結果報告としてまとめます。

 

AWS サポートチームからのメール

まずは SSL の期限切れに伴う AWS サポートチームからの連絡メールを少し長いですが載せておきます。

Update Your Amazon RDS SSL/TLS Certificates by October 31, 2019

Hello,

Please act before October 31, 2019 to address an upcoming interruption of your applications using RDS and Aurora database instances.

To protect your communications with RDS database instances, a Certificate Authority (CA) generates time-bound certificates that are checked by your database client software to authenticate any RDS database instance(s) before exchanging information. Following industry best practices, AWS renews the CA and creates new certificates on a routine basis to ensure RDS customer connections are properly protected for years to come. The current CA expires on March 5, 2020, requiring updates to existing RDS database instances with certificates referencing the current CA.

You are receiving this message because you have an Amazon RDS database instance(s) in the US-WEST-2 Region. If your applications connect to those instances using the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol please follow the detailed instructions in the link below to complete your update(s). If not completed, your applications will fail to connect to your DB instances using SSL/TLS after March 5, 2020.

We encourage you to test these steps within a development or staging environment before implementing them in your production environments. Beginning today, you can start testing and updating your existing RDS database instances. For detailed instructions, please visit: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html

Any new RDS instances created after November 1, 2019 will default to using the new certificates. If you wish to temporarily modify new instances manually to use the old (rds-ca-2015) certificates, you can do so using the AWS console or the AWS CLI. Any instances created prior to November 1, 2019 will have the rds-ca-2015 certificates until you update them to the rds-ca-2019 version.

簡単に日本語で要約すると
・Amazon RDS で使用している SSL 証明書である「rds-ca-2015」は2020年03月05日に有効期限が切れるので、「rds-ca-2019」に変更する対応をしてください。
・RDS の予期せぬ中断が困るなら、2019年10月31日までに対応してください。
・「2019年11月01日」以降に作成した RDS は新しい証明書が適用されます。
になります。

[2019/10/12 追記]
上記のメールは「US-WEST-2(オレゴン)」リージョンの事ではないですか?とのご指摘がありました。確かに東京リージョンの SSL 有効期限は「US-WEST-2(オレゴン)」と差異があるかもしれませんが、既に東京リージョンにも「rds-ca-2019」が用意されています。僕も東京リージョンの rds で3台分の証明書を「rds-ca-2019」に変更しましたので、どちらにしても時間の問題なので気づいた時に対応した方が良いと思います。

もし東京リージョンの SSL 証明書の有効期限が判明したら情報を追記します。

[2019/10/16 追記]
東京リージョンを含めた

AP-NORTHEAST-1 東京
AP-NORTHEAST-2 ソウル
AP-SOUTHEAST-1 シンガポール
AP-SOUTHEAST-2 シドニー

に対しても同じ内容のメールが届きました。

期限は上記のメールと同じでしたので、rds に関して AWS 側で再起動を行われると困る方は2019年10月31日までに対応する必要があります。

 

RDS にて SSL証明書の更新作業の手順

では RDS の SSL 更新手順を確認していきます。

まずは SSL 証明書を更新する RDS を選択して、「変更」をクリックします。
rds_ssl_update_2019_1

 

認証機関
この DB インスタンスの認証機関。

の欄に「rds-ca-2019」が追加されているので、「rds-ca-2015」から「rds-ca-2019」に変更します。
rds_ssl_update_2019_2

 

勝手に再起動されると困るので、「すぐに適用」で再起動を実施します。サーバーの再起動が完了すれば、作業完了です。
rds_ssl_update_2019_3

 

最後に SSL 更新の反映にかかった時間の目安を載せておきます。下記に掲載した写真では、反映に12秒かかっていますね。
実稼働中のサービスも含めて、RDS 7台に対して実行したところ、「最近のイベント」のログに記入された「DB instance shutdown」と「DB instance restarted」の間に経過した秒数は、11秒~14秒という結果でした。
rds_ssl_update_2019_4

 

さいごに

念のため開発環境やステージング環境で動作確認を行った上で、SSL の更新作業を行ってください。また本番環境で SSL の更新作業後は動作確認を忘れないで実施してください。

僕としては、今回のような近日中に作業してね!の対応は気づいたときに対応しておくことをおすすめします。数日後には忘れて作業自体を行わない危険性があるので(苦笑)。

なお AWS の日本チームが Amazon Web Services の公式ブログにて、証明書に関する Q&A をまとめるページを公開しています。

Amazon Relational Database Service (RDS)とAmazon AuroraのSSL/TLS 証明書のアップデートについて
https://aws.amazon.com/jp/blogs/news/amazon-rds-certificate-rotation-2019/

サーバーの停止時間や証明書をアップロードしなかった場合の影響など細かく日本語で解説してくれています。AWS 公式ページも参考にしながら、みなさんも早めの対応を心掛けくださいね。

 

 

Linuxの知識については下記の本も参考になるので、スキルアップにお役立てください。

三宅 英明 (著)、大角 祐介 (著)
ページ数: 440ページ
出版社:SBクリエイティブ
発売日:2015/06/06

出典:amazon