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

Allow tfplan format version 0.2 #1074

Merged
merged 2 commits into from
Feb 3, 2022
Merged

Conversation

mtranter
Copy link
Contributor

A fix for #980

I reverse-engineered the existing pkg/iac-providers/tfplan/v1/testdata/valid-tfplan.json into vanilla terraform, and ran a plan using terraform V1.0.9 to generate the test file at pkg/iac-providers/tfplan/v1/testdata/valid-tfplan-0.2.json

Apologies for any non-idiomatic golang. I'm not that familiar with it.

@sonarcloud
Copy link

sonarcloud bot commented Oct 29, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@cesar-rodriguez
Copy link
Contributor

@mtranter thanks for the PR!

@codecov
Copy link

codecov bot commented Oct 31, 2021

Codecov Report

Merging #1074 (bf88232) into master (6a849d4) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1074      +/-   ##
==========================================
+ Coverage   78.59%   78.61%   +0.01%     
==========================================
  Files         238      238              
  Lines        6495     6499       +4     
==========================================
+ Hits         5105     5109       +4     
  Misses       1077     1077              
  Partials      313      313              
Impacted Files Coverage Δ
pkg/iac-providers/tfplan/v1/load-file.go 77.14% <100.00%> (+2.94%) ⬆️

kanchwala-yusuf
kanchwala-yusuf previously approved these changes Nov 1, 2021
patilpankaj212
patilpankaj212 previously approved these changes Dec 4, 2021
@sonarcloud
Copy link

sonarcloud bot commented Dec 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@cesar-rodriguez cesar-rodriguez merged commit 090d767 into tenable:master Feb 3, 2022
@phoehnel
Copy link

phoehnel commented Apr 1, 2022

Could it be the case, that there is an additional file, that needs to be changed @mtranter @cesar-rodriguez ?

On the most recent version (0.14.0) i get the following error:

user@host: ~/$ terrascan scan $TERRASCAN_ARGS -i tfplan --iac-version "0.2" 
2022-04-01T16:49:37.645Z        error   runtime/validate.go:136 iac type 'tfplan', version '0.2' not supported

The help states something simillar:

[...]
--iac-version string        iac version (arm: v1, cft: v1, docker: v1, helm: v3, k8s: v1, kustomize: v2, v3, v4, terraform: v12, v13, v14, v15, tfplan: v1)

@ruijarimba
Copy link

Hi all, I've started using terrascan recently and I have the same problem reported by @uupascal - how to fix it?

Thanks,
Rui

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

Successfully merging this pull request may close these issues.

6 participants