Skip to content

feat(query): lambda function without dead letter queue query implemented for Terraform/aws#7620

Merged
cx-artur-ribeiro merged 3 commits into
masterfrom
AST-40696
Aug 14, 2025
Merged

feat(query): lambda function without dead letter queue query implemented for Terraform/aws#7620
cx-artur-ribeiro merged 3 commits into
masterfrom
AST-40696

Conversation

@cx-ricardo-jesus

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • Currently we have no support in Terraform when there's a "Lambda Function Without Dead Letter Queue", which we currently have for the CloudFormation platform.

Proposed Changes

  • To develop this query for Terraform platform, I used a similar approach as the one used for the CloudFormation query.
  • This query only has one policy, that uses a helper function called is_dead_letter_queue_undefined_or_empty used to check if the resource aws_lambda_function does not have the field dead_letter_config field defined or when it's defined but the field target_arn inside it, has a empty value(empty string).
  • Comparing with the CloudFormation query implementation, this one does not return a positive result is the target_arn field is defined but with nothing within, not even a empty string, because having this field defined with nothing is not valid for this resource on Terraform since it is a field that is required when the field dead_letter_config is defined.
  • Instead of that, I made a verification that check's the cases when the field target_arn is defined with a empty string.
  • Added one negative sample that has the field dead_letter_config.target_arn correctly defined.
  • Added two positive samples, one of them returns a positive result because the field dead_letter_config field is not defined and the other one returns a positive result because the field dead_letter_config.target_arn is defined with a empty string.

I submit this contribution under the Apache-2.0 license.

@cx-ricardo-jesus cx-ricardo-jesus requested a review from a team as a code owner July 31, 2025 16:54
@github-actions github-actions Bot added feature New feature query New query feature cloudformation CloudFormation query terraform Terraform query aws PR related with AWS Cloud labels Jul 31, 2025
@github-actions

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.11

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

@cx-ricardo-jesus cx-ricardo-jesus changed the title feat(query): "Lambda Function Without Dead Letter Queue" query implemented for Terraform feat(query): "lambda function without dead letter queue" query implemented for Terraform Jul 31, 2025
@cx-ricardo-jesus cx-ricardo-jesus changed the title feat(query): "lambda function without dead letter queue" query implemented for Terraform feat(query): "lambda function without dead letter queue" query implemented for Terraform/aws Jul 31, 2025
@cx-ricardo-jesus cx-ricardo-jesus changed the title feat(query): "lambda function without dead letter queue" query implemented for Terraform/aws feat(query): lambda function without dead letter queue query implemented for Terraform/aws Jul 31, 2025

@cx-eduardo-semanas cx-eduardo-semanas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gitguardian

gitguardian Bot commented Aug 14, 2025

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
4266022 Triggered Generic Password dcf0cee assets/queries/cloudFormation/aws/amplify_app_basic_auth_config_password_exposed/test/negative7.yaml View secret
9419039 Triggered Username Password dcf0cee assets/queries/cloudFormation/aws/amplify_branch_basic_auth_config_password_exposed/test/positive6.json View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@cx-artur-ribeiro cx-artur-ribeiro merged commit 461e073 into master Aug 14, 2025
28 checks passed
@cx-artur-ribeiro cx-artur-ribeiro deleted the AST-40696 branch August 14, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws PR related with AWS Cloud cloudformation CloudFormation query feature New feature query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants