API Gateway classic is not using authentication mechanisms Affecting API Gateway (REST APIs) service in AWS
Severity Framework
Snyk CCSS
Rule category
IAM / Authentication
Is your enviroment affected by this misconfiguration?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsFrameworks
- Snyk ID SNYK-CC-00772
- credit Snyk Research Team
Description
Enabling authentication on API Gateway Classic helps prevent unauthorized access to APIs, mitigating the risk of data exposure and service misuse. Without proper authentication, sensitive data could be exposed, or services could be used inappropriately, leading to potential security breaches.
How to fix?
Set the authorization
attribute in aws_api_gateway_method
to an appropriate value other than NONE
.
Example Configuration
resource "aws_api_gateway_method" "allowed" {
rest_api_id = aws_api_gateway_rest_api.snyk-772-api.id
resource_id = aws_api_gateway_resource.snyk-772-resource.id
http_method = "ANY"
authorization = "COGNITO_USER_POOLS"
authorizer_id = aws_api_gateway_authorizer.snyk-772-auth.id
}