Open hajapy opened 1 year ago
I'm experiencing this as well!
Got this annoying problem too. Does anyone have a solution to workaround this issue using the super linter ? Thanks in advance.
Nothing yet on my end. We've just reverted and told dependabot to ignore this dependency.
An idea on how to suspend this provider check using super-linter or use any config file to do so? I'd like to keep the latest version of terrascan actually. Thanks in advance for anyone having an idea
I had the same problem, I have tested with terrascan 1.18.1 image and it seems is resolved (I've used the example pasted above):
➜ docker run --rm -it -v "$(pwd):/iac" -w /iac tenable/terrascan:1.18.11 scan -i terraform -f resources.tf
2023/12/27 21:10:00 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/aws/versions
Scan Summary -
File/Folder : /iac/resources.tf
IaC Type : terraform
Scanned At : 2023-12-27 21:10:02.581214144 +0000 UTC
Policies Validated : 0
Violated Policies : 0
Low : 0
Medium : 0
High : 0
Description
I recently updated super-linter to 4.10.0, which has picked up terrascan 1.17.1. In its output I started to see the error:
which wasn't appearing in super-linter 4.9.7, using terrascan 1.15.2. I traced this back to https://github.com/tenable/terrascan/blob/e4a4aec1776049cdede0457fa91a8e88be8e3499/pkg/iac-providers/terraform/commons/terraform-provider.go#L112 which was added in 1.17.1. I am not sure if this error is innocuous or could be problematic as the scan does appear to proceed and complete despite its appearance.
What I Did
I can reproduce this in a minimal example. Put these two files in a folder
Now run:
and see output:
In 1.17.0, this error doesn't appear:
In 1.17.1, if I omit the -f flag giving it the individual file that lacks a terraform provider block, there is no problem. I think super-linter runs file-by-file so I believe that could be the reason the required provider cannot be seen when scanning the
resources.tf
file.