API Gateway REST API cache data should be encrypted at rest
Checks that every method in the REST API stage that caches responses has its cache data encrypted at rest; a stage where no method caches passes. Encryption adds a layer of access control, so cached responses on disk cannot be read without permission to decrypt them.
- service
- APIGateway
- severity
- Medium
- scope
- evaluated in every region
How to fix it
In the console
API Gateway → APIs → the REST API → Stages → the stage → Stage details → Cache settings
- Encrypt cache data
- On
- Method overrides
- Encrypt cache data on in every method override that turns caching on
With the AWS CLI
aws apigateway update-stage --rest-api-id <rest-api-id> --stage-name <stage-name> --patch-operations 'op=replace,path=/*/*/caching/dataEncrypted,value=true'With Terraform
- Overwrites existing settings: Unless the settings block also sets throttling_burst_limit and throttling_rate_limit, both become -1, removing any stage-wide throttling already on the stage.
resource "aws_api_gateway_method_settings" "all" {
rest_api_id = var.rest_api_id
stage_name = var.stage_name
method_path = "*/*"
settings {
cache_data_encrypted = true
}
}
See which of your accounts this check is failing on.
Book a live scan