This rule specifies that API Gateway stage logging should be enabled for better monitoring and security measures.
Rule | API Gateway stage logging should be enabled |
Framework | Federal Financial Institutions Examination Council (FFIEC) |
Severity | ✔ High |
Rule Description
The API Gateway stage logging should be enabled for the Federal Financial Institutions Examination Council (FFIEC). Enabling stage logging ensures the collection of detailed information about API calls made to the stage, such as request and response payloads, headers, and any errors encountered. This information is crucial for monitoring and troubleshooting purposes, as well as for meeting compliance requirements imposed by the FFIEC.
By enabling stage logging, the log data is stored in Amazon CloudWatch Logs or another logging service configured for the API Gateway stage. This allows authorized individuals to analyze the logs, gain insights about the API usage, and identify any potential issues or anomalies.
Troubleshooting Steps
Check API Gateway Stage Configuration: Verify that the API Gateway stage associated with FFIEC has logging enabled. Go to the API Gateway console and navigate to the specific stage. Check the "Logs/Tracing" section to ensure it is configured correctly for logging.
Cross-Check CloudWatch Logs Configuration: If using CloudWatch Logs, ensure that the logs are set up properly. Confirm that the log group exists, and the corresponding log stream is created for the specific API Gateway stage.
Verify IAM Permissions: Ensure that the role or user associated with the API Gateway stage has the necessary permissions to write logs to CloudWatch Logs. Check the IAM policies and confirm that the required permissions are granted.
Review Execution Logs: If stage logging is enabled but there seems to be an issue with logs not appearing, review the execution logs for any error details or warnings. These logs might provide insights into the root cause of the problem.
Necessary Code
There is no specific code required for enabling stage logging in API Gateway. The configuration is performed through the AWS Management Console or via AWS CLI commands.
Step-by-Step Guide for Remediation
To enable stage logging for the FFIEC in API Gateway, follow these steps:
Open AWS Management Console: Sign in to the AWS Management Console using appropriate credentials.
Navigate to API Gateway: Go to the API Gateway service by searching for "API Gateway" in the service search bar and selecting it.
Select the API: From the APIs list, select the API that is associated with the FFIEC requirements.
Choose Stages: In the left-hand menu, choose "Stages" to view the list of stages for the selected API.
Select the Stage: Identify the stage that needs logging enabled and click on the stage name to access its settings.
Configure Logs/Tracing: In the stage settings, navigate to the "Logs/Tracing" section.
Enable Logging: Enable the logging option for the stage by selecting the "Enable CloudWatch Logs" checkbox.
Specify Log Level: Choose the log level based on the desired level of detail. Options include ERROR, INFO, and VERBOSE. (Note: VERBOSE level can result in more substantial log data, so consider the associated costs and storage requirements.)
Choose CloudWatch Logs Group: Select the appropriate CloudWatch Logs group where the API Gateway logs should be stored. If the group does not exist, create a new one using the CloudWatch Logs service.
Save Changes: Save the stage configuration changes.
Once the logging is enabled, API Gateway will start sending the logs to CloudWatch Logs or the specified logging service. The logs can be accessed and analyzed either through the AWS Management Console or programmatically using the AWS CLI or SDKs.
Conclusion
Enabling API Gateway stage logging for the FFIEC ensures the collection of essential information about API calls made to the stage. Following the troubleshooting steps, verifying the configuration, and enabling logging as per the provided guide will allow proper logging and monitoring of the API Gateway stage, meeting compliance requirements and enhancing troubleshooting capabilities.