AWS AppSync GraphQL APIs should not be authenticated with API keys
Flags AppSync GraphQL APIs that use API key authentication. API keys are hard-coded values that, if compromised, expose the endpoint to unauthorized access; stronger authentication methods should be used instead.
- service
- AppSync
- severity
- High
- scope
- evaluated in every region
How to fix it
Switch the named API's default authorization mode off API_KEY to one that identifies the caller: AWS_IAM, a Cognito user pool, OpenID Connect, or a Lambda authorizer. Adding the new mode as an additional provider first lets clients move one at a time. Then delete the keys: this check reads the default mode alone, so a key kept as an additional provider still works and still passes. The update operation replaces the API's configuration rather than merging, so carry the logging, tracing and additional provider settings through or they are dropped.
In the console
AppSync → APIs → the API → Settings → Default authorization mode
With Terraform
resource "aws_appsync_graphql_api" "this" {
name = var.api_name
authentication_type = "AWS_IAM"
}
See which of your accounts this check is failing on.
Book a demo