This rule requires enabling logging for API Gateway stages to ensure proper monitoring and troubleshooting.
Rule | API Gateway stage logging should be enabled |
Framework | SOC 2 |
Severity | ✔ High |
Rule Description
API Gateway stage logging should be enabled for SOC 2 compliance. This rule ensures that all activities related to the API Gateway stages are properly logged and auditable. Enabling logging helps in monitoring and identifying any suspicious or unauthorized activities performed on the API Gateway stages, which is crucial for maintaining the security and compliance standards required for SOC 2 certification.
Troubleshooting Steps (if any)
If stage logging is not enabled for API Gateway, follow these steps to troubleshoot:
Necessary Codes (if any)
To enable stage logging for API Gateway, you can use the AWS Command Line Interface (CLI). Here is an example of the necessary CLI code:
aws apigateway update-stage \ --rest-api-id <your-rest-api-id> \ --stage-name <your-stage-name> \ --patch-operations op=replace,path=/accessLogSettings/destinationArn,value=<your-arn>
In the code above, replace
<your-rest-api-id>
with the ID of your API Gateway and <your-stage-name>
with the name of the specific stage for which you want to enable logging. Also, replace <your-arn>
with the Amazon Resource Name (ARN) of the destination where the log events will be published (e.g., an Amazon CloudWatch Logs group).Step by Step Guide for Remediation
To enable stage logging for API Gateway and ensure SOC 2 compliance, follow these steps:
By following the above steps, you will enable stage logging for API Gateway, ensuring that all activities in the stages are properly logged for SOC 2 compliance.