説明
aws_elasticsearch_domain で domain_endpoint_options.enforce_https = true を設定し、クライアントからの平文接続を防ぎます。
想定される影響
HTTP で送受信した検索リクエストや結果は、通信中に読み取りや改ざんを受けるおそれがあります。
対処方法
既存のクライアントを HTTPS に切り替え、サーバー証明書を検証できることを確認します。変更を適用したら、同じエンドポイントで HTTP では検索結果が返らないことを確かめてください。
例
両方の例で同じ Elasticsearch 7.10 ドメインを維持します。この設定はクライアントとの接続に適用されます。ノード間通信と保存データの暗号化は個別に設定してください。
変更前
hcl
resource "aws_elasticsearch_domain" "example" {
domain_name = "my-elasticsearch-domain"
elasticsearch_version = "7.10"
domain_endpoint_options {
enforce_https = false
}
}
変更後
hcl
resource "aws_elasticsearch_domain" "example" {
domain_name = "my-elasticsearch-domain"
elasticsearch_version = "7.10"
domain_endpoint_options {
enforce_https = true
}
}