Control: 5 AWS AppSync GraphQL APIs should not be authenticated with API keys
Description
This control checks whether your application uses an API key to interact with an AWS AppSync GraphQL API. The control fails if an AWS AppSync GraphQL API is authenticated with an API key.
An API key is a hard-coded value in your application that is generated by the AWS AppSync service when you create an unauthenticated GraphQL endpoint. If this API key is compromised, your endpoint is vulnerable to unintended access. Unless you are supporting a publicly accessible application or website, we don't recommend using an API key for authentication.
Remediation
To set an authorization option for your AWS AppSync GraphQL API, see Authorization and authentication in the AWS AppSync Developer Guide.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.foundational_security_appsync_5
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.foundational_security_appsync_5 --share
SQL
This control uses a named query:
select arn as resource, case when authentication_type = 'API_KEY' then 'alarm' else 'ok' end as status, name || ' uses ' || authentication_type || ' authentication method.' as reason , region, account_idfrom aws_appsync_graphql_api;