Open JohnathonMohr opened 2 years ago
I've also confirmed this is a problem for Docker templates as well, scanning the TerraGoat repository.
d:\terrascan-1.13.2>terrascan.exe scan -i docker -d ..\terragoat
Violation Details -
Description : Ensure platform flag with FROM command is not used for Docker file
File : terraform\aws\resources\Dockerfile
Line : 1
Severity : MEDIUM
-----------------------------------------------------------------------
Scan Summary -
File/Folder : d:\terragoat
IaC Type : docker
Scanned At : 2022-04-21 00:32:25.3564555 +0000 UTC
Policies Validated : 3
Violated Policies : 1
Low : 0
Medium : 1
High : 0
Description
I tried scanning a copy of the Azure Quickstart Templates repository to get an idea of what types of issues would be found. I noticed that in all violations reported, the line number is always 1. It would be helpful if the line number reported was actually where the failure is found in the template. For example, in the violations below, the line numbers should be a line within the declarations of the storage account and subnet that violate the rules.
More IaC file types may have this same issue, but I only tested this with ARM.
What I Did