Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Rule: API Gateway stage logging should be enabled

Implement the necessary steps to enable logging on API Gateway stages.

RuleAPI Gateway stage logging should be enabled
FrameworkNIST 800-171 Revision 2
Severity
High

Rule Description:

API Gateway stage logging should be enabled for NIST 800-171 Revision 2 compliance. This logging requirement helps ensure that all activities performed in the API Gateway stages are recorded, allowing for auditing and monitoring of potential security incidents or unauthorized access attempts.

Troubleshooting Steps:

  1. 1.
    Check if the API Gateway stage logging is currently enabled.
  2. 2.
    Verify if the API Gateway stages are correctly configured to log all relevant activities.
  3. 3.
    Ensure that the logging settings comply with the requirements outlined in NIST 800-171 Revision 2.
  4. 4.
    Review the logs periodically to identify any security incidents or unauthorized access attempts.

Necessary Code:

If the API Gateway stage logging is not enabled, you will need to add or modify the following code in your API Gateway configuration.

// Sample code to enable API Gateway stage logging
// Replace <stage-name> with the name of your API Gateway stage

aws apigateway update-stage \
--rest-api-id <rest-api-id> \
--stage-name <stage-name> \
--patch-operations op=replace,path=/logging/dataTrace,value=true

Step-by-Step Guide for Remediation:

Follow the steps below to enable API Gateway stage logging for NIST 800-171 Revision 2 compliance:

  1. 1.
    Identify the API Gateway stage(s) you want to enable logging for.
  2. 2.
    Verify if logging is already enabled for the selected stage(s) by checking the current configuration.
  3. 3.
    If logging is not enabled, proceed with the following steps. If it is already enabled, you can skip to step 6.
  4. 4.
    Open the AWS Command Line Interface (CLI) or use the AWS Management Console.
  5. 5.
    Execute the necessary command to enable logging for the selected stage(s), as shown in the "Necessary Code" section above. Replace '<rest-api-id>' with the ID of your API Gateway REST API, and '<stage-name>' with the name of the desired stage.
  6. 6.
    Once the command has been executed successfully, API Gateway stage logging will be enabled for NIST 800-171 Revision 2 compliance.
  7. 7.
    Validate and review the logs periodically to ensure compliance with the logging requirements outlined in NIST 800-171 Revision 2.

Note: It is recommended to refer to the AWS API Gateway documentation and NIST 800-171 Revision 2 guidelines for additional details and best practices regarding API Gateway stage logging.

Is your System Free of Underlying Vulnerabilities?
Find Out Now