Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive on CKV_TF_2 using shallow clone #6308

Closed
mouellet opened this issue May 15, 2024 · 5 comments · Fixed by #6314
Closed

False positive on CKV_TF_2 using shallow clone #6308

mouellet opened this issue May 15, 2024 · 5 comments · Fixed by #6314
Labels
checks Check additions or changes

Comments

@mouellet
Copy link

Describe the issue

Introduced in #6213, CKV_TF_2 generates a false positive when using shallow clone.

Examples

module "bogus" {
  source = "git::https://example.com/bogus.git?depth=1&ref=v1.2.0"
}

Check: CKV_TF_2: "Ensure Terraform module sources use a tag with a version number"
	FAILED for resource: bogus
	File: /bogus.tf:28-59

Version (please complete the following information):

@mikeurbanski1
Copy link
Contributor

Hey @mouellet - sorry about that. Thanks for raising it. We'll merge a fix shortly.

@mikeurbanski1
Copy link
Contributor

Apologies for the delay - I am having an issue with an unrelated integration test that I want to make sure gets fixed.

@rubfcsilva
Copy link

Hello, does this fix also apply when you have the version after the source? I think my case is a false positive for this as well.

Check: CKV_TF_2: "Ensure Terraform module sources use a tag with a version number" FAILED for resource: module.key.module.keyring_label.label File: /common/label/main.tf:12-27 Calling File: /gcp/components/kms/key/main.tf:5-12 12 | module "label" { 13 | source = "cloudposse/label/null" 14 | version = "0.25.0"

@mikeurbanski1
Copy link
Contributor

Hello, does this fix also apply when you have the version after the source? I think my case is a false positive for this as well.

Check: CKV_TF_2: "Ensure Terraform module sources use a tag with a version number" FAILED for resource: module.key.module.keyring_label.label File: /common/label/main.tf:12-27 Calling File: /gcp/components/kms/key/main.tf:5-12 12 | module "label" { 13 | source = "cloudposse/label/null" 14 | version = "0.25.0"

Hmm... Does CKV_TF_1 also fail?

@rubfcsilva
Copy link

Hmm... Does CKV_TF_1 also fail?

We are skipping that rule, as of now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checks Check additions or changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants