More Info:
This rule verifies whether Amazon API Gatewayv2 API routes have an authorization type configured. It ensures that appropriate authentication and authorization mechanisms are in place for accessing the API routes. The rule is marked as non-compliant if the authorization type is set to NONE, indicating that no authentication is required to access the routesRisk Level
MediumAddress
SecurityCompliance Standards
CBP,SEBITriage and Remediation
- Cause
- Remediation
Check Cause
Using Console
Using Console
- Log in to the AWS Management Console and navigate to the API Gateway service.
- In the API Gateway dashboard, select the API Gateway V2 that you want to check.
- In the API Gateway V2 details page, select the ‘Routes’ option from the left-hand side menu.
- For each route, check the ‘Authorization’ column. If the value is ‘NONE’ or not set, then the API Gateway V2 does not have an Authorization Type configuration.
Using CLI
Using CLI
-
Install and configure AWS CLI: Before you can start using AWS CLI, you need to install it on your local machine and configure it with your AWS account credentials. You can do this by running the following commands:
Installation:
Configuration:You will be prompted to provide your AWS Access Key ID, Secret Access Key, Default region name, and Default output format.
-
List all API Gateway V2 APIs: Use the following AWS CLI command to list all your API Gateway V2 APIs:
This command will return a list of all your APIs, including their API ID, name, protocol type, and other details.
-
Get the details of each API: For each API in the list, use the following AWS CLI command to get its details:
Replace
<API_ID>with the ID of the API you want to check. This command will return the details of the specified API, including its authorization type. -
Check the authorization type: In the output of the previous command, look for the
AuthorizationTypefield. If this field is not present or its value isNONE, it means that the API does not have an authorization type configured.
Using Python
Using Python
-
Install the necessary Python libraries: Before you start, you need to install the AWS SDK for Python (Boto3) to interact with AWS services. You can install it using pip:
-
Set up AWS credentials: You need to configure your AWS credentials. You can do this by creating the files ~/.aws/credentials and ~/.aws/config. In the credentials file, add:
In the config file, add:
-
Write a Python script to check the authorization type configuration: You can use the following Python script to check the authorization type configuration in API Gateway V2:
-
Run the Python script: You can run the Python script using the command:
This script will print the name of each API, the name of its authorizer (if any), and the authorization type. If an API does not have an authorizer configured, it will print a message indicating this.

