# 以下のメッセージに対する調査 ``` Hello, We are reaching out because there are TLS 1.0 or TLS 1.1 connections to Amazon Simple Storage Service (Amazon S3) objects hosted in your account. As AWS is updating the TLS configuration for all AWS API endpoints to a minimum of version TLS 1.2 [1], you must take action as soon as possible for these connections to maintain their access to your S3 objects. What actions can I take to maintain access? To avoid potential interruption, you must update all client software accessing your Amazon S3 objects using TLS 1.0 or 1.1, to use TLS 1.2 or higher. If you are unable or would prefer to not update all impacted clients, we recommend replacing direct client access to the S3 objects with use of a proxy, such as an Amazon CloudFront distribution. This will allow clients to access your S3 objects via Amazon CloudFront using any TLS version you choose to allow. Amazon CloudFront will forward the calls to your S3 objects using TLS 1.2 or higher. For more guidance for how to setup your CloudFront distribution to front your S3 object access, please review the Knowledge Center article [2]. How can I determine the client(s) I need to update? We have provided the affected S3 bucket(s) in your account following this messaging. In order to gather additional information about the affected objects and user agents performing these calls, we recommend enabling Amazon CloudTrail data events on the affected S3 bucket(s) [3][4]. The information contained in the S3 data events will help you pinpoint your client software that is responsible for using TLS 1.0 or TLS 1.1, so you may update it accordingly. Additionally, our related AWS Security blog post [1] provides information on how you may use TLS information in the CloudTrail tlsDetails field. Please note there is an associated cost for enabling CloudTrail data events, please see the CloudTrail pricing page for more detail [5]. Another alternative is to use Amazon S3 server-access logs, see the S3 Logging options page for more details and pricing information [6]. How can I enforce connections to my bucket(s) be over TLSv1.2 and above? As a best practice, and to prepare for our enforcement of TLS 1.2 or higher, we recommend you proactively enforce a minimum of TLS 1.2 directly on all of your shared S3 bucket(s). You may do this by applying a bucket policy with the s3:TlsVersion condition key as per the documented Knowledge Center article [7] If you need further guidance or assistance, please contact AWS Support [8] or your Technical Account Manager. [1] https://aws.amazon.com/blogs/security/tls-1-2-required-for-aws-endpoints [2] https://aws.amazon.com/premiumsupport/knowledge-center/s3-access-old-tls/ [3] https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-s3-info.html#cloudtrail-object-level-tracking [4] https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-cloudtrail-logging-for-s3.html#enable-cloudtrail-events [5] https://aws.amazon.com/cloudtrail/pricing/ [6] https://docs.aws.amazon.com/AmazonS3/latest/userguide/logging-with-S3.html [7] https://aws.amazon.com/premiumsupport/knowledge-center/s3-enforce-modern-tls/ [8] https://aws.amazon.com/support Please see the following for S3 buckets in which object-level calls were made over TLS 1.0 or TLS 1.1 connections between May 27, 2023 and June 4, 2023 (the UserAgent may be truncated due to a limit in the number of characters that can be displayed): Connections details will be in the following format: Region | Bucket name(s) | APIAction | TLSVersion | NumCalls | UserAgent us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 21 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.PUT.OBJECT | TLSv1 | 32 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.PUT.OBJECT | TLSv1 | 80 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 24 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 2 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 126 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.PUT.OBJECT | TLSv1 | 4 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 149 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 67 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 14 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 116 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.PUT.OBJECT | TLSv1 | 54 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.PUT.OBJECT | TLSv1 | 52 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.PUT.OBJECT | TLSv1 | 5 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.PUT.OBJECT | TLSv1 | 46 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] us-east-1 | k-society | REST.GET.OBJECT | TLSv1 | 97 | [aws-sdk-php2/2.8.31 Guzzle/3.9.3 curl/7.19.7 PHP/5.4.25] ``` ``` こんにちは、 お客様のアカウントでホストされている Amazon Simple Storage Service (Amazon S3) オブジェクトに TLS 1.0 または TLS 1.1 接続があるため、ご連絡を差し上げました。AWSはすべてのAWS APIエンドポイントのTLS設定を最小バージョンのTLS 1.2 [1]に更新しているため、これらの接続がS3オブジェクトへのアクセスを維持するためには、できるだけ早く対処する必要があります。 アクセスを維持するためにどのようなアクションを取ればよいですか? 中断の可能性を避けるために、TLS 1.0または1.1を使用してAmazon S3オブジェクトにアクセスするすべてのクライアントソフトウェアを、TLS 1.2以上を使用するように更新する必要があります。影響を受けるすべてのクライアントを更新できない、または更新しないことを希望する場合は、S3オブジェクトへのクライアントからの直接アクセスを、Amazon CloudFrontディストリビューションなどのプロキシの使用に置き換えることをお勧めします。これにより、クライアントは、あなたが許可するように選択した任意のTLSバージョンを使用して、Amazon CloudFront経由でS3オブジェクトにアクセスできるようになります。Amazon CloudFrontは、TLS 1.2以上を使用してS3オブジェクトへのコールを転送します。CloudFrontディストリビューションがS3オブジェクトへのアクセスを転送するように設定する方法については、Knowledge Centerの記事[2]を参照してください。 アップデートが必要なクライアントはどのように特定できますか? このメッセージングに従って、お客様のアカウントで影響を受けるS3バケットを提供しています。影響を受けたオブジェクトとこれらの呼び出しを実行しているユーザーエージェントに関する追加情報を収集するために、影響を受けたS3バケット[3][4]のAmazon CloudTrailデータイベントを有効にすることをお勧めします。S3データイベントに含まれる情報は、TLS 1.0またはTLS 1.1を使用しているクライアントソフトウェアを特定するのに役立ちます。さらに、関連するAWS Securityのブログポスト[1]では、CloudTrailのtlsDetailsフィールドでTLS情報を使用する方法についての情報を提供しています。CloudTrailのデータイベントを有効にするには、関連コストがかかることに注意してください。詳細はCloudTrailの価格ページを参照してください[5]。別の選択肢として、Amazon S3のサーバアクセスログを使用することもできます。詳細と価格情報については、S3ロギングオプションのページを参照してください[6]。 バケットへの接続をTLSv1.2以上で強制するにはどうすればいいですか? ベストプラクティスとして、またTLS 1.2以上の強制に備えるために、共有S3バケット全てに最低TLS 1.2を直接強制することをお勧めします。これは、ドキュメント化されたナレッジセンターの記事[7]に従って、s3:TlsVersion条件キーを持つバケットポリシーを適用することで行うことができます。 さらに詳しいガイダンスやサポートが必要な場合は、AWSサポート[8]またはテクニカルアカウントマネージャーにお問い合わせください。 ``` ## 原因 S3バケット(k-society)に対してのアクセスにがTLS 1.0 または TLS 1.1が使用されている。 6/28日を期限にawsは通信プロトコルの最低バージョンを 1.2に更新したため、TLS 1.0、1.1では通信できない。(7/16現時点でアクセスできない?) ## 対応の必要性 [参照(元記事は2022/6/28に掲載)](https://aws.amazon.com/jp/blogs/news/tls-1-2-required-for-aws-endpoints/) > 2023 年 6 月 28 日までにすべての AWS リージョンで、すべての AWS API で TLS バージョン 1.0 と 1.1 が使用できなくなる > 私たちは TLS 1.0 または TLS 1.1 を使用している接続がないか監視を行います。もし影響を受ける可能性のあるお客様がいた場合には、AWS Health Dashboard および電子メールでお知らせします。2023 年 6 月 28 日以降、AWS は API エンドポイントの設定を更新し、TLS 1.0 および TLS 1.1 を使用している接続が残っている場合でも、これらのバージョンを削除する予定です。 ということで対応は必要。 ※ AWS サービス API エンドポイント = AWSの各サービスへのアクセスを可能にするためのURLまたはネットワークアドレス ## 対策 パターンA: アプリ側でAWS SDK for PHP(デフォルトで最新のセキュリティプロトコルを使用)を導入 ※ すでに導入済みの場合はシステム間のバージョンの互換性の問題があるかも。 [参考 AWS SDK for PHPバージョン 3 とは](https://docs.aws.amazon.com/ja_jp/sdk-for-php/v3/developer-guide/welcome.html) [参考 CakePHPにAWS SDK for PHPを導入しS3のファイル操作を行う](https://www.ritolab.com/posts/104) パターンB: AWS側でCloudFrontを利用してTLS 1.2以上を使用してS3オブジェクトへのコールを転送 ※ アプリ側で直接S3をにアクセスせずにcloudfrontにアクセスする必要がある ※ S3をオリジンに設定する場合は転送に料金は発生しないっぽい? [料金](https://aws.amazon.com/jp/cloudfront/pricing/) [手順](https://repost.aws/ja/knowledge-center/s3-access-old-tls) 必須ではないがペストプラクティスではバケットごとに最低TLS 1.2を直接強制すべきらしい [Amazon S3 バケットに TLS 1.2 以降の使用を強制するにはどうすればよいですか?](https://repost.aws/ja/knowledge-center/s3-enforce-modern-tls) ## 結論 - パターンAでもパターンBでもアプリ側の改修が必要になる。 - パターンAは無料。パターンBも無料? Aの方がアプリ側だけの対応で済みそうだから簡単そう。 だが、バージョンの互換性の問題がある場合PHPなどバージョンアップが必要かもしれない。