Review the API Gateway custom domain TLS policy

Choose a policy that provides the minimum TLS version and cipher suites required for the API Gateway custom domain.

Description

When an API Gateway custom domain omits security_policy, check its effective policy. An existing domain can differ from the default for newly created domains. The TLS_1_0 policy allows clients to connect with TLS 1.0 or 1.1.

Potential impact

Clients can negotiate older TLS versions or ciphers that fall short of your security requirements.

Remediation

Choose a policy supported by the endpoint and Terraform provider with a minimum of TLS 1.2 or later and the required ciphers. Set the endpoint access mode for an enhanced policy. After applying it, validate the certificate and negotiated protocol and cipher with a production client.

Examples

Both excerpts concern one custom domain. Supply a certificate appropriate to the endpoint type, plus DNS and API mappings.

Before

hcl
resource "aws_api_gateway_domain_name" "example" {
  domain_name = "api.example.com"
}

After

hcl
resource "aws_api_gateway_domain_name" "example" {
  domain_name     = "api.example.com"
  security_policy = "TLS_1_2"
}

The first leaves the policy implicit. The second sets security_policy = "TLS_1_2". If the domain already had a TLS 1.2 minimum, the change makes that minimum explicit.

References