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/api_gateway_without_ssl_certificate.md.
A documentation index is available at /llms.txt.
API Gateway integrations must validate TLS/SSL certificates to ensure backend endpoints are authentic and prevent man-in-the-middle attacks that can expose credentials or sensitive data.
The validate_certs property in Ansible community.aws.api_gateway and api_gateway tasks must be defined and set to a truthy value (Ansible yes or true). Resources missing this property or with validate_certs set to no or false are flagged.
If your backend uses self-signed certificates, prefer adding the CA to a trusted store or using proper certificate management rather than disabling certificate validation.
Secure example Ansible task:
- name:Create API Gateway with TLS validationcommunity.aws.api_gateway:name:my-apistate:presentvalidate_certs:yes
Compliant Code Examples
- name:update API v2community.aws.api_gateway:name:my-apiapi_id:abc123321cbastate:presentswagger_file:my_api.ymlvalidate_certs:yes- name:Setup AWS API Gateway setup on AWS and deploy API definition v2community.aws.api_gateway:name:my-api-v2swagger_file:my_api.ymlstage:productioncache_enabled:truecache_size:'1.6'tracing_enabled:trueendpoint_type:EDGEstate:presentvalidate_certs:yes
Non-Compliant Code Examples
- name:update APIcommunity.aws.api_gateway:name:my-apiapi_id:'abc123321cba'state:presentswagger_file:my_api.ymlvalidate_certs:no- name:update API v1community.aws.api_gateway:name:my-api-v1api_id:'abc123321cba'state:presentswagger_file:my_api.yml- name:Setup AWS API Gateway setup on AWS and deploy API definitioncommunity.aws.api_gateway:name:my-api-v2swagger_file:my_api.ymlstage:productioncache_enabled:truecache_size:'1.6'tracing_enabled:trueendpoint_type:EDGEstate:presentvalidate_certs:no- name:Setup AWS API Gateway setup on AWS and deploy API definition v1community.aws.api_gateway:name:my-api-v3swagger_file:my_api.ymlstage:productioncache_enabled:truecache_size:'1.6'tracing_enabled:trueendpoint_type:EDGEstate:present
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.