Review HTTPS enforcement for an OpenSearch domain

Restrict requests between clients and the domain to HTTPS.

Description

Set domain_endpoint_options.enforce_https on the existing OpenSearch domain to require HTTPS from clients.

Potential impact

Queries, responses and credentials sent over HTTP can be read or changed in transit.

Remediation

Choose a TLS policy your clients support. Check that a search over HTTPS succeeds with server certificate verification enabled and that the same domain serves no results over HTTP. Configure network and identity access, node-to-node encryption and encryption at rest separately.

Examples

Supply the existing domain name in opensearch_domain_name. The tasks omit engine and capacity settings for creating a domain.

Before

yaml
- name: Configure an existing OpenSearch domain endpoint
  community.aws.opensearch:
    domain_name: "{{ opensearch_domain_name }}"
    domain_endpoint_options:
      enforce_https: false

With false, clients can still use HTTP.

After

yaml
- name: Configure an existing OpenSearch domain endpoint
  community.aws.opensearch:
    domain_name: "{{ opensearch_domain_name }}"
    domain_endpoint_options:
      enforce_https: true

With true, the same endpoint requires HTTPS.

References