For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cloudformation-aws-api-gateway-with-open-access.md.
A documentation index is available at /llms.txt.
API Gateway methods must not set AuthorizationType to NONE except for CORS preflight (OPTIONS) requests, because leaving a method unauthenticated allows anyone to invoke the endpoint and can lead to unauthorized access, data exposure, or backend abuse.
For AWS::ApiGateway::Method resources, AuthorizationType must specify an authentication mechanism (for example, AWS_IAM, CUSTOM, or COGNITO_USER_POOLS) when HttpMethod is not OPTIONS. This rule flags Resources.<name>.Properties where AuthorizationType is NONE and HttpMethod is not OPTIONS.
If you use CUSTOM, also set AuthorizerId to reference a configured authorizer. If you use COGNITO_USER_POOLS or AWS_IAM, ensure the corresponding user pool or IAM policies and roles are correctly configured.
Secure configuration example (CloudFormation YAML):