Triage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration “Lambda Functions Should Have Tracing Enabled” for AWS using the AWS console, follow the below steps:
- Open the AWS Lambda console.
- Select the Lambda function for which you want to enable tracing.
- Click on the “Configuration” tab.
- Scroll down to the “Debugging and error handling” section.
- Under “Debugging and error handling”, click on the “Edit” button.
- In the “Edit function” page, scroll down to the “Tracing” section.
- Under “Tracing”, select the “Active” option.
- In the “Tracing mode” drop-down, select the “AWS X-Ray” option.
- Click on the “Save” button at the top of the page to save the changes.
Using CLI
Using CLI
To remediate the misconfiguration of Lambda Functions not having tracing enabled in AWS using AWS CLI, follow these steps:Replace This command will return the configuration details of the Lambda function, including the tracing mode. If the tracing mode is set to “Active”, then tracing is enabled on the function.By following these steps, you can remediate the misconfiguration of Lambda Functions not having tracing enabled in AWS using AWS CLI.
- Open the AWS CLI on your local machine or EC2 instance.
- Run the following command to enable tracing on all Lambda functions in the AWS account:
- If you want to enable tracing only on specific Lambda functions, run the following command:
<function-name>
with the name of the Lambda function that you want to enable tracing on.- Verify that tracing is enabled on the Lambda function by running the following command:
Using Python
Using Python
To remediate the misconfiguration of Lambda Functions not having tracing enabled in AWS, you can follow the below steps using Python:
- Import the necessary AWS SDK libraries for Python:
- Create an AWS Lambda client object:
- List all the available Lambda functions:
- For each function, check if tracing is enabled or not:
- Save the Python script and execute it to enable tracing for all the available Lambda functions.