Ensure stage caching is enabled for AWS API Gateway Method Settings

MEDIUM

Description

API Gateway caching can be enabled and configured to allow for better response times on request processing. When enabled for a stage, caching will be available for the GET method by default; it is recommended that this setting is not changed, however there are other methods available by setting an override. For more information on stage caching, see the AWS API Gateway documentation.
References:
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html

Remediation

In AWS Console -

  1. Go to the API Gateway console.
  2. Select the API.
  3. Select the Stages.
  4. In the Stages list for the API, choose the stage.
  5. Choose the Settings tab.
  6. Enable API cache.
  7. Ensure cache creation is complete.

In Terraform -

  1. In the aws_api_gateway_method_settings resource, set 'settings.caching_enabled' to 'true'.

References:
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method_settings#caching_enabled

Policy Details

Rule Reference ID: AC_AWS_0008
CSP: AWS
Remediation Available: Yes
Resource Category: Virtual Network
Resource Type: API Gateway

Frameworks