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

Support newer format versions for terraform JSON plan #1691

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

zied-elouaer
Copy link

The format versions currently supported by Terrascan are very outdated (since Terraform 1.1.x). This PR adds support for the newer versions.
This was already tested and confirm not to break Terrascan functionality.

@zied-elouaer zied-elouaer requested a review from a team as a code owner August 13, 2024 15:52
sixstone-qq and others added 13 commits August 22, 2024 15:44
As decoratedName in SARIF report
…urce-address

Add support to report resource id
Some large files may take longer than 100ms.

It also fixes a wrong log message, only in this file, there are
more in other parts of the project.
Some large files may take longer than 100ms.

It also fixes a wrong log message, only in this file, there are more in
other parts of the project.

Before that:
```
❯ terrascan scan -i tfplan -f large.tfplan.json
2024-08-30T10:30:07.848+0200    warn    utils/jqhelper.go:56    error in processing jq query; error: '%v'context deadline exceeded
2024-08-30T10:30:07.848+0200    error   cli/run.go:141  scan run failed{error 26 0  failed to decode processed jq output. error: 'unexpected end of JSON input'}
```
*Note the wrong log message*

Increase the timeout to 1s it works.
This PR adds the `resource_type` field from the rule metadata to the
output of passed rules, and further to the rule properties in the Sarif
report.

This field is useful to know which resource rules were applied to, in
particular for rules without violations where we have no way of knowing
this otherwise.
Copy link

sonarcloud bot commented Oct 11, 2024

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.

3 participants