AppSync GraphQL API Caching is not restricted Affecting AppSync service in AWS


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Data/ Access Control

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-00740
  • creditSnyk Research Team

Description

Enforce restrictions on AppSync GraphQL API caching to mitigate the risk of unauthorized access to cached data. Properly configuring caching settings can prevent potential exposure of sensitive information and ensure data privacy and integrity. This rule helps protect against data leakage and unauthorized access to cached data in the AWS AppSync service.

How to fix?

Set the api_caching_behavior attribute in aws_appsync_api_cache resource to FULL_REQUEST_CACHING or PER_RESOLVER_CACHING.

Example Configuration

resource "aws_appsync_graphql_api" "api1" {
  authentication_type = "API_KEY"
  name                = "api1"
}

resource "aws_appsync_api_cache" "cache1" {
  api_id               = aws_appsync_graphql_api.api1.id
  api_caching_behavior = "FULL_REQUEST_CACHING"
  type                 = "LARGE"
  ttl                  = 900
}
resource "aws_appsync_graphql_api" "api2" {
  authentication_type = "API_KEY"
  name                = "api2"
}

resource "aws_appsync_api_cache" "cache2" {
  api_id               = aws_appsync_graphql_api.api2.id
  api_caching_behavior = "PER_RESOLVER_CACHING"
  type                 = "LARGE"
  ttl                  = 900
}