Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Rule: Lambda functions should be configured with a dead-letter queue

This rule ensures Lambda functions have a dead-letter queue for error handling.

RuleLambda functions should be configured with a dead-letter queue
FrameworkFedRAMP Moderate Revision 4
Severity
Medium

Lambda Function Dead-Letter Queue Configuration for FedRAMP Moderate Revision 4

Description:

In order to comply with the FedRAMP Moderate Revision 4 security requirements, Lambda functions in your AWS environment should be configured with a dead-letter queue. A dead-letter queue helps in capturing and storing failed execution events or messages, providing an additional layer of error handling and troubleshooting capabilities for Lambda functions.

Troubleshooting Steps:

If you encounter any issues related to Lambda function execution failures or need to troubleshoot error handling, follow these steps:

  1. 1.

    Verify Dead-Letter Queue Configuration:

    • Check if the Lambda function is associated with a dead-letter queue.
    • Ensure the dead-letter queue exists in the same AWS region as the Lambda function.
  2. 2.

    Review the Dead-Letter Queue Settings:

    • Ensure that the dead-letter queue has sufficient retention period to store failed messages for an appropriate duration.
    • Confirm that the necessary permission policies are in place to allow Lambda to send messages to the dead-letter queue.
  3. 3.

    Check Function Execution Logs:

    • Analyze the CloudWatch Logs associated with the Lambda function to identify any specific error messages or execution failures.
    • Use the logs to gain insight into the cause of the failures and define a remediation strategy if required.

Necessary Code:

To configure a dead-letter queue for a Lambda function, you need to modify the function's settings using the AWS Command Line Interface (CLI).

Here's an example of the CLI command to associate a dead-letter queue:

aws lambda update-function-configuration \
  --function-name <function-name> \
  --dead-letter-config TargetArn=<dead-letter-queue-ARN>

Replace

<function-name>
with the name of the Lambda function you want to configure, and
<dead-letter-queue-ARN>
with the ARN of the dead-letter queue you want to associate.

Step-by-Step Guide for Remediation:

To configure a dead-letter queue for a Lambda function, follow these steps:

  1. 1.

    Open your AWS Command Line Interface (CLI) or use the AWS Management Console.

  2. 2.

    Identify the Lambda function:

    • If using the CLI, run the following command to list all your Lambda functions:
      aws lambda list-functions
      
    • From the console, navigate to the Lambda service and identify the function you want to configure.
  3. 3.

    Configure the Dead-Letter Queue:

    • If using the CLI:
      • Run the following command, replacing
        <function-name>
        and
        <dead-letter-queue-ARN>
        with appropriate values:
        aws lambda update-function-configuration \
          --function-name <function-name> \
          --dead-letter-config TargetArn=<dead-letter-queue-ARN>
        
    • If using the console:
      • Select the Lambda function.
      • Scroll down to the "Dead letter queue" section in the configuration tab.
      • Enable the option to "Enable active DLQ."
      • Specify the ARN of the dead-letter queue you want to associate.
  4. 4.

    Verify Configuration:

    • Once the configuration is updated, ensure that the Lambda function is associated with the correct dead-letter queue.
    • Test the Lambda function with sample inputs to validate the dead-letter queue functionality.

By following these steps and configuring the dead-letter queue, you will ensure compliance with the FedRAMP Moderate Revision 4 requirements for your Lambda functions.

Is your System Free of Underlying Vulnerabilities?
Find Out Now