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

Terraform Plan scanning with --repo-root-for-plan-enrichment inconsistent file references in sarif/json report #6943

Open
kpervin opened this issue Jan 9, 2025 · 0 comments
Labels

Comments

@kpervin
Copy link

kpervin commented Jan 9, 2025

Describe the issue
When following the Terraform Plan Scanning documentation and outputting a sarif/json report using --repo-root-for-plan-enrichment, console log outputs will show the affected file correctly while the report will reference the JSON plan file that was input.

Sarif

When inspecting the sarif file output, /runs/[]/results/[]/locations/[]/physicalLocation/artifactLocation/uri will reference the tfplan.json file rather than the actual Terraform plan file. However, the /runs/[]/results/[]/locations/[]/physicalLocation/region startLine and endLine are correct in referencing the Terraform configuration file and not the tfplan.json.

JSON

When inspecting the json file output, we see that /results/failed_checks/[]/file_path DOES reference the correct file as a filename (not path), but /results/failed_checks/[]/file_abs_path and /results/failed_checks/[]/repo_file_path will reference the tfplan.json file.

@kpervin kpervin added the outputs label Jan 9, 2025
@kpervin kpervin changed the title Terraform Plan scanning with --repo-root-for-plan-enrichment inconsistent file references in sarif report Terraform Plan scanning with --repo-root-for-plan-enrichment inconsistent file references in sarif/json report Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant