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

bug: Check with module defaults #53

Open
dsfrederic opened this issue Mar 12, 2022 · 7 comments
Open

bug: Check with module defaults #53

dsfrederic opened this issue Mar 12, 2022 · 7 comments
Labels

Comments

@dsfrederic
Copy link

Is your feature request related to a problem? Please describe.

I'd want to run TfSec before publishing my TF module. It seems like tfsec is not validating the code with default values filled in.

Describe the solution you'd like

Run TFSec with module defaults

Describe alternatives you've considered

Add TFVars file with the same default values?

Additional context

@owenrumney
Copy link
Contributor

hey @dsfrederic - tfsec uses the default values specified for variables when doing scanning unless the tfvars-file flag is used. I wonder if your module isn't being scanned fully - could you try --force-all-dirs flag to ensure that the full path is scanned?

@dsfrederic
Copy link
Author

Hey @owenrumney, this doesn't seem to work either...
I've added the argument and made a change that should trigger tfsec.
image

This is the result
image

So as you can see tfsec didn't pickup the default value.

repository: https://github.com/cgk-ds-be/terraform-azurerm-datalake
reference: https://github.com/cgk-ds-be/terraform-azurerm-datalake/runs/5552484729?check_suite_focus=true

@owenrumney
Copy link
Contributor

I understand now - my bad.

So it looks like you've found a short fall in the tfsec-pr-commenter. I suspect what is happening is that resulting failure doesn't match up to the line that changed in the hunk of the PR.

Its a legit bug and one I'm surprised hasn't hit more people. Leave it with me

Also, I'm going to move this to github.com/aquasecurity/tfsec-pr-commenter-action for tracking

@owenrumney owenrumney changed the title feat: Check with module defaults bug: Check with module defaults Mar 15, 2022
@owenrumney owenrumney transferred this issue from aquasecurity/tfsec Mar 15, 2022
@dsfrederic
Copy link
Author

@owenrumney Actually this might not be a bug. It seems like TFSec doesn't check this parameter.

image

I was thinking it was the same security check as this one: https://aquasecurity.github.io/tfsec/v1.8.0/checks/azure/storage/no-public-access/

My apologies!

@owenrumney
Copy link
Contributor

I think it's a side bug too. Pretty much as soon as I saw it I figured it wouldn't work

@owenrumney
Copy link
Contributor

I just saw you're using the VSCode Plugin - this makes me very happy @dsfrederic 🎉

@dsfrederic
Copy link
Author

Of course! It's awesome! 🚀

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

2 participants