Skip to content

test(query): missing tests for s3_bucket_notifications_disabled#7672

Merged
cx-artur-ribeiro merged 3 commits into
masterfrom
test(query)-S3_Bucket_Notifications_Disabled
Aug 25, 2025
Merged

test(query): missing tests for s3_bucket_notifications_disabled#7672
cx-artur-ribeiro merged 3 commits into
masterfrom
test(query)-S3_Bucket_Notifications_Disabled

Conversation

@cx-andre-pereira

@cx-andre-pereira cx-andre-pereira commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • The newly added query "s3_bucket_notifications_disabled" was taking into account instances of aws_sns_topic ,aws_sqs_queue or aws_lambda_function as arrays but there were no tests to show this behaviour.
  • Moreover the positive4 test could be applied to the other fields besides just "aws_sns_topic"

Proposed Changes

  • Added 3 new negative tests to show that arrays of the relevant resources are supported. (multiple of the same resource inside the "aws_s3_bucket_notification")
  • Added 8 new positive tests :
    • 2 missing tests identical to the original positive4 but for the 2 other resources (positive11 and 12), positive4 is now positive10.
    • positive1-3 now show support for arrays much like the new negative tests
    • positive4-6 show a "aws_s3_bucket_notification" resource with the correct field but with a different reference name like "different_function" vs the actual name "func" for positive6.tf
    • positive7-9 are similar to the original positive1-3 tests

I submit this contribution under the Apache-2.0 license.

@github-actions github-actions Bot added query New query feature terraform Terraform query aws PR related with AWS Cloud labels Aug 22, 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-andre-pereira cx-andre-pereira changed the title Test(query) s3 bucket notifications disabled test(query): missing tests for s3_bucket_notifications_disabled Aug 22, 2025
@Checkmarx Checkmarx deleted a comment from kicsbot Aug 22, 2025
@cx-andre-pereira cx-andre-pereira marked this pull request as ready for review August 22, 2025 13:49
@cx-andre-pereira cx-andre-pereira requested a review from a team as a code owner August 22, 2025 13:49

@cx-artur-ribeiro cx-artur-ribeiro 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

@cx-artur-ribeiro cx-artur-ribeiro merged commit 522a9a2 into master Aug 25, 2025
27 checks passed
@cx-artur-ribeiro cx-artur-ribeiro deleted the test(query)-S3_Bucket_Notifications_Disabled branch August 25, 2025 08:31
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 query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants