API Gateway Missing Rate Limiting and Throttling Controls Affecting API Gateway (REST APIs) service in AWS


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Availability/ APIs

Is your environment 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 applications
Frameworks
  • Snyk IDSNYK-CC-00754
  • creditSnyk Research Team

Description

Absence of rate limiting and throttling on API Gateway allows unrestricted request rates, potentially leading to denial of service or resource exhaustion. Implementing these controls helps to mitigate abusive behaviors and ensures fair usage by enforcing request quotas and limits.

How to fix?

Set the throttle_settings and api_stages.throttle attributes in the aws_api_gateway_usage_plan resource.

Example Configuration


resource "aws_api_gateway_usage_plan" "usage_plan_754" {
  name = "UsagePlan754"

  api_stages {
    api_id = aws_api_gateway_rest_api.api754.id
    stage  = aws_api_gateway_stage.stage754.stage_name
    throttle {
      path        = "/path1/GET"
      burst_limit = 5
      rate_limit  = 10
    }
  }
  throttle_settings {
    burst_limit = 5
    rate_limit  = 10
  }
}