fix(terraform): resolve counted IAM policy documents#8051
Open
omribz156 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8050
Reason for Proposed Changes
data.aws_iam_policy_document.<name>.json, but counted policy documents referenced asdata.aws_iam_policy_document.<name>[0].jsonstayed unresolved and could makeS3 Bucket Policy Accepts HTTP Requestsreport a false positive.Proposed Changes
countdoes not break policy JSON generation.Verification:
go test ./pkg/parser/terraform -count=1go test ./test -run 'TestQueries/.*s3_bucket_policy_accepts_http_requests_negative' -count=1go run ./cmd/console/main.go scan -p assets/queries/terraform/aws/s3_bucket_policy_accepts_http_requests/test/negative9.tf -q assets/queries/terraform/aws/s3_bucket_policy_accepts_http_requests --type Terraform --disable-secrets --no-progress --silent --report-formats json --output-path .tmp-kics-output --output-name negative9 --ignore-on-exit resultsreturnedtotal_counter: 0.This was implemented with Codex assistance, with the patch kept focused and manually reviewed.
I submit this contribution under the Apache-2.0 license.