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

terrascan scan fails if path and rego_subdir are not provided together in the toml configfile #619

Closed
devang-gaur opened this issue Mar 15, 2021 · 0 comments · Fixed by #576
Assignees

Comments

@devang-gaur
Copy link
Contributor

  • terrascan version: master
  • Operating System: mac os

What I Did

╭─dev-gaur@Devangs-MacBook-Pro ~/go/src/github.com/accurics/terrascan ‹master*›
╰─$ rm -rf ~/.terrascan/                                                                                                                                                                                                                                  3 ↵
╭─dev-gaur@Devangs-MacBook-Pro ~/go/src/github.com/accurics/terrascan ‹master*›
╰─$ TERRASCAN_CONFIG=demo/config.toml ./bin/terrascan scan -d pkg/iac-providers/terraform/v12/testdata/deep-modules/modules/m1
2021-03-16T02:52:55.342+0530	error	opa/engine.go:250	error loading rego files{policy path 15 0 /Users/dev-gaur/.terrascan/pkg/policies/opa/rego/aws <nil>} {error 26 0  lstat /Users/dev-gaur/.terrascan/pkg/policies/opa/rego/aws: no such file or directory}
2021-03-16T02:52:55.342+0530	error	runtime/executor.go:121	failed to initialize OPA policy engine
2021-03-16T02:52:55.342+0530	error	cli/run.go:107	scan run failed{error 26 0  failed to initialize OPA policy engine}

configfile.toml looks like this :

[policy]
path = "/Users/dev-gaur/.terra1"
#rego_subdir = "/Users/dev-gaur/.terra2/pkg/policies/opa/rego"

if you comment out either path or rego_subdir... opa engine will error out while trying to compile the rego files.

There should be a check to warn the user to use the use both of these complimentary fields together properly.

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

Successfully merging a pull request may close this issue.

1 participant