More Info:
API Gateway execution logging should be enabledRisk Level
LowAddress
MonitoringCompliance Standards
CBP,GDPR,HIPAA,ISO27001,SEBI,RBI_MD_ITF,RBI_UCBTriage and Remediation
- Cause
- Remediation
Check Cause
Using Console
Using Console
- Sign in to the AWS Management Console.
- Navigate to the API Gateway console. You can find this by typing ‘API Gateway’ into the search bar at the top of the console.
- In the API Gateway console, select the API you want to check.
- In the left navigation pane, under the selected API, click on ‘Stages’. Here, you will see a list of all the stages for your API.
- Select a stage, then in the main panel, click on the ‘Logs/Tracing’ tab. Here, you can check if the ‘Enable CloudWatch Logs’ option is enabled. If it is not, then API Gateway Execution Logging is not enabled for that API stage. Repeat this process for all stages of the API to ensure logging is enabled across the entire API.
Using CLI
Using CLI
- First, you need to install and configure AWS CLI on your local machine. You can do this by following the instructions provided by AWS. Make sure you have the necessary permissions to access the API Gateway.
-
Once the AWS CLI is set up, you can list all the APIs in your account by running the following command:
This command will return a list of all the REST APIs in your account.
-
For each API, you can check the CloudWatch settings by running the following command:
Replace
<restApiId>and<stageName>with the ID and name of the API and stage you want to check. This command will return the settings for the specified stage. -
In the output of the above command, look for the
methodSettingsfield. If theloggingLevelis set toOFF, then execution logging is not enabled for that API. If theloggingLevelis set toERRORorINFO, then execution logging is enabled.
Using Python
Using Python
-
Install the necessary Python libraries: Before you start, you need to install the AWS SDK for Python (Boto3) in your environment. This can be done using pip:
-
Import the necessary libraries and initialize the client: In your Python script, you need to import Boto3 and initialize the API Gateway client.
-
Fetch the list of Rest APIs: Use the
get_rest_apismethod to fetch the list of all Rest APIs in your AWS account. -
Check if Execution Logging is enabled: For each Rest API, check if the
loggingLevelis set toERRORorINFO. If it’s not, then Execution Logging is not enabled.

