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

v9 terraform scans failing #1866

Closed
vjeffrey opened this issue Sep 23, 2023 · 5 comments · Fixed by #1944
Closed

v9 terraform scans failing #1866

vjeffrey opened this issue Sep 23, 2023 · 5 comments · Fixed by #1944
Assignees
Labels
bug Something isn't working v9
Milestone

Comments

@vjeffrey
Copy link
Contributor

i was trying to do scan compare for terraform, against https://github.com/scottford-io/private-aws-ec2-no-publicIP

everything failed out very quickly

@vjeffrey vjeffrey added the v9 label Sep 23, 2023
@czunker czunker added the bug Something isn't working label Sep 25, 2023
@czunker czunker added this to the v9 milestone Sep 25, 2023
@czunker
Copy link
Contributor

czunker commented Sep 26, 2023

I pinged Scott to get access to the repo.

@vjeffrey Do you have some more data what failed?

Basic queries against on of the other repos work:

cnquery run terraform /home/christian/workspace/aws-no-publicIP-check/terraform -c "asset{ name title platform ids }"
→ found a new version for 'terraform' provider installed=9.0.1 latest=9.0.2
→ successfully installed terraform provider path=/home/christian/.config/mondoo/providers/terraform version=9.0.2
→ loaded configuration from /etc/opt/mondoo/mondoo.yml using source default
asset: {
  title: "Terraform HCL"
  platform: "terraform-hcl"
  ids: [
    0: "//platformid.api.mondoo.app/runtime/terraform/hash/63d1759f90c65f9da43544d9586fbd6a4a70600db5a9c3194981f0a5cda5f4a9"
  ]
  name: "Terraform Static Analysis directory terraform"
}

@czunker
Copy link
Contributor

czunker commented Sep 26, 2023

Also, with access to the repo: Basic queries work. I need some more info.

@vjeffrey
Copy link
Contributor Author

this was the policy scan compare testing, so i ran one of the terraform policies we have against it. i'll check which one

@vjeffrey
Copy link
Contributor Author

go run apps/cnspec/cnspec.go scan terraform ../private-aws-ec2-no-publicIP -f ../server/policy/bundles-enterprise/terraform-cis-gcp.mql.yaml

@vjeffrey
Copy link
Contributor Author

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1032987cc]

goroutine 65 [running]:
go.mondoo.com/cnquery/providers/terraform/resources.initTerraformPlan(0x10349d600?, 0x140002b8240?)
	/home/runner/_work/cnquery/cnquery/providers/terraform/resources/tfplan.go:28 +0x3c
go.mondoo.com/cnquery/providers/terraform/resources.NewResource(0x140003112c0, {0x14000278d70, 0xe}, 0x140002b99b0)
	/home/runner/_work/cnquery/cnquery/providers/terraform/resources/terraform.lr.go:89 +0x84
go.mondoo.com/cnquery/providers/terraform/provider.(*Service).GetData(0x0?, 0x1400023c1c0)
	/home/runner/_work/cnquery/cnquery/providers/terraform/provider/provider.go:180 +0x80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v9
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants