OpenSearch domain does not require HTTPS

Require HTTPS connections to Elasticsearch and OpenSearch domains.

Description

Set DomainEndpointOptions.EnforceHTTPS to true on the AWS::OpenSearchService::Domain resource to block plaintext access.

Potential impact

Search traffic sent over HTTP can be read or modified in transit and may violate a TLS requirement.

Remediation

Select a TLS policy supported by the service and its clients. Test a search from an authorized client with server certificate verification enabled, then check that HTTP returns no results. Configure domain permissions, node-to-node encryption and storage encryption separately.

Examples

The excerpts define only the endpoint settings. Supply the remaining domain configuration and access policy for your deployment.

Before

yaml
Resources:
  OpenSearchDomain:
    Type: AWS::OpenSearchService::Domain
    Properties:
      DomainEndpointOptions:
        EnforceHTTPS: false
        TLSSecurityPolicy: Policy-Min-TLS-1-2-2019-07

In the first example, TLSSecurityPolicy applies to HTTPS connections. EnforceHTTPS: false still permits HTTP.

After

yaml
Resources:
  OpenSearchDomain:
    Type: AWS::OpenSearchService::Domain
    Properties:
      DomainEndpointOptions:
        EnforceHTTPS: true
        TLSSecurityPolicy: Policy-Min-TLS-1-2-2019-07

The second requires HTTPS while retaining the same TLS policy.

References