For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-aws-elasticsearch-with-https-disabled.md.
A documentation index is available at /llms.txt.
OpenSearch domain endpoints must enforce HTTPS to ensure client connections use TLS and prevent interception or tampering of sensitive data such as queries and credentials. In Ansible tasks using the community.aws.opensearch or opensearch modules, the domain_endpoint_options.enforce_https property must be set to true. Tasks that omit domain_endpoint_options or enforce_https, or that set enforce_https: false, are flagged.
Secure Ansible task example:
- name:create opensearch domain with HTTPS enforcedcommunity.aws.opensearch:domain_name:my-domaindomain_endpoint_options:enforce_https:true
- name:Create OpenSearch domain for dev environment, no zone awareness, no dedicated masterscommunity.aws.opensearch:domain_name:"dev-cluster"engine_version:Elasticsearch_1.1cluster_config:instance_type:"t2.small.search"instance_count:2zone_awareness:falsededicated_master:falsedomain_endpoint_options:enforce_https:falseebs_options:ebs_enabled:truevolume_type:"gp2"volume_size:10access_policies:"{{ lookup('file', 'policy.json') | from_json }}"
- name:Create OpenSearch domain for dev environment, no zone awareness, no dedicated masterscommunity.aws.opensearch:domain_name:"dev-cluster"engine_version:Elasticsearch_1.1cluster_config:instance_type:"t2.small.search"instance_count:2zone_awareness:falsededicated_master:falsedomain_endpoint_options:custom_endpoint_enabled:falseebs_options:ebs_enabled:truevolume_type:"gp2"volume_size:10access_policies:"{{ lookup('file', 'policy.json') | from_json }}"
- name:Create OpenSearch domain for dev environment, no zone awareness, no dedicated masterscommunity.aws.opensearch:domain_name:"dev-cluster"engine_version:Elasticsearch_1.1cluster_config:instance_type:"t2.small.search"instance_count:2zone_awareness:falsededicated_master:falseebs_options:ebs_enabled:truevolume_type:"gp2"volume_size:10access_policies:"{{ lookup('file', 'policy.json') | from_json }}"
1
2
rulesets:- Ansible / AWS # Rules to enforce / AWS.
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.