For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

AWS API Gateway method settings do not enable caching misconfiguration detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_AWS_225

Category - Subcategory

Compute - Unsanctioned Resource Or Type

Provider

AWS

Severity

LOW

Framework

Terraform

Impact

Enabling caching for API Gateway helps improve your API's performance by allowing clients to retrieve responses from a cache instead of making a request to the backend service. This can reduce the load on your backend service and improve the overall responsiveness of your API. It can reduce the cost of using your API by reducing the number of requests your backend service needs to handle. It can also improve the reliability of your API by allowing it to continue functioning even if the backend service is unavailable or experiencing problems.

How to Fix

[source,go]

resource "aws_api_gateway_method_settings" "pass" { rest_api_id = aws_api_gateway_rest_api.fail.id stage_name = aws_api_gateway_stage.fail.stage_name method_path = "path1/GET"

settings { caching_enabled = true metrics_enabled = false logging_level = "INFO" cache_data_encrypted = true data_trace_enabled = false } }

Last updated

Was this helpful?