This rule requires enabling logging for API Gateway REST and WebSocket API.
Rule | API Gateway REST and WebSocket API logging should be enabled |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Medium |
Rule Description: API Gateway REST and WebSocket API logging should be enabled for AWS Foundational Security Best Practices. Enabling logging for API Gateway REST and WebSocket APIs helps monitor and analyze API traffic, detect potential security threats, and investigate suspicious activities.
Troubleshooting Steps: If logging is not enabled for your API Gateway REST and WebSocket APIs, you can follow the steps below to enable it:
Step 1: Open the API Gateway Console
Step 2: Select an API
Step 3: Configure Logging
Step 4: Enable Access Logging
Step 5: Enable Execution Logging (optional for REST APIs)
Step 6: Save Changes
Step 7: Repeat for Other Stages (if applicable)
Necessary Code: No code snippets are required for this configuration.
Remediation Guide: To enable logging for API Gateway REST and WebSocket APIs, follow these steps:
By following these steps, you have successfully enabled logging for your API Gateway REST and WebSocket APIs. The logs will now be sent to the specified CloudWatch log group, allowing you to monitor and analyze the API traffic effectively.