tenable / terrascan

Detect compliance and security violations across Infrastructure as Code to mitigate risk before provisioning cloud native infrastructure.
https://runterrascan.io
Apache License 2.0
4.68k stars 495 forks source link

When performing a tfplan scan the resource name is incomplete #1562

Open jbrule opened 1 year ago

jbrule commented 1 year ago

Description

Running custom policy scan on Terraform plan file and expecting to fail but the output does not include a complete resource name. I think the address would be more helpful in the check output. Currently the ambiguous Resource name makes it really difficult for developers to trace the source module/resource.

I have performed a config test and that includes the module path which is useful but we are seeing false positives as our modules make use of for_each and variable maps which Terrascan is not correctly resolving.

What I Did

terrascan scan -v --log-output-dir ../scanner-logs -i tfplan -t gcp --use-terraform-cache -p custom-policies -f tfplan.json

Resource in tfplan Screenshot 2023-05-16 at 2 08 41 PM

Check Output Screenshot 2023-05-16 at 2 16 15 PM

jbrule commented 1 year ago

Any suggestion? Been awhile.