Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

how to suppress these error reported by Terrascan #1270

Open
ravitomardevops opened this issue May 23, 2022 · 4 comments
Open

how to suppress these error reported by Terrascan #1270

ravitomardevops opened this issue May 23, 2022 · 4 comments

Comments

@ravitomardevops
Copy link

ravitomardevops commented May 23, 2022

  • terrascan version: v14
  • Operating System: Ubuntu (Github Action)

Description

trying to run terrascan on my modules
Showing false scanning errors :

IaC Type            :	terraform
Directory           :	/path/to/module/modules
Error Message       :	directory '/path/to/module/modules' has no terraform config files

-----------------------------------------------------------------------

IaC Type            :	terraform
Directory           :	/home/runner/work/path/to/module/modules/compute
Error Message       :	directory '/home/runner/path/to/module/modules/compute' has no terraform config files

What I Did

I ran simple terrsacan

Paste the command(s) you ran and the output.
terrascan scan  -d . -i terraform --iac-version v14 -t all --log-output-dir $(pwd)

-----------------------------------------------------------------------
	
	IaC Type            :	terraform
	Directory           :	/path/to/module/modules
	Error Message       :	directory '/path/to/module/modules' has no terraform config files
	
	-----------------------------------------------------------------------
	
	IaC Type            :	terraform
	Directory           :	/home/runner/work/path/to/module/modules/compute
	Error Message       :	directory '/home/runner/path/to/module/modules/compute' has no terraform config files


@ravitomardevops ravitomardevops changed the title unwanted issue error reported by Terrscan unwanted issue error reported by Terrascan May 23, 2022
@ravitomardevops ravitomardevops changed the title unwanted issue error reported by Terrascan how to suppress these error reported by Terrascan May 23, 2022
@ravitomardevops
Copy link
Author

@Rchanger please help how i can supress these warning

@Rchanger
Copy link
Contributor

@ravitomardevops we added these logs since we were receiving multiple bugs stating we don't see any error but the exit code is non-zero. We will start a discussion about these to make it controlled via flag. I'll update you on this once we decide something. Thank you

@shadycuz
Copy link

shadycuz commented Jul 4, 2022

@Rchanger It would be really nice to have an option to not fail the scan just because it found an empty directory.

I want to use terrascan to scan a terraform module but it fails because examples/ and modules/ don't have any terraform in them even though they have subdirectories that do.

Maybe the title of this issue could be updated?

@lexyiouroukis
Copy link

flagging --non-recursive resolves this problem for me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants