-
Notifications
You must be signed in to change notification settings - Fork 504
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
pre-commit hook reporting error with terrascan #1053
Comments
Hi @ameyaagashe, Can you try running |
@cesar-rodriguez Added that information to the issue. Same behavior. Exit code is 4 rather than 0 |
Are you getting any error messages? Terracan exits 4 when there are errors in the scan although no violations are found. See here. Would like to know if it's exiting 4 due to a bug in Terrascan or an actual error. |
@cesar-rodriguez As you would see in the output or at least to my eyes there are no errors or if there are at least it should spit out those errors? I believe this is a bug in terrascan? |
@cesar-rodriguez Please do let me know if you need any additional information from my side. |
Would you mind running the command as follows so we can pinpoint the issue?
|
|
Hello @ameyaagashe, terrascan's default output format is |
@patilpankaj212 I think this is good. Now we can safely conclude why we are getting error code 4. I am wondering why terrascan is going in docs folder?
|
@cesar-rodriguez @patilpankaj212 is there a flag I can pass and give the directories it should scan ? or directories to omit? |
@ameyaagashe, the terraform iac provider scans all the directories recursively by default. You can get information about all other flags supported for the scan command using |
Description
Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
I am trying to run terrascan via pre-commit hook but it fails for some reason.
Code snippet for terrascan in pre-commit yaml file is like below
I get errors as like below:
I changed the indentation in yaml manifest to like below but still no charm:
Now, error is like below:
What I Did
Explained above. I asked on accurics discord and also on SO but no luck thus far
https://stackoverflow.com/questions/69482759/terrascan-pre-commit-hook-reports-false-positive-alert
Manual terrasacn Run
Manual terrascan runs have the same behavior
Expected Outcome
I expect "Passed" as there is no policy violation. Can you please investigate?
P.S: I am now using -t switch for azure but still there is no graceful exit of terrascan
I am curious to know why it is checking for a Dockerfile when I have provided a type as Azure?
The text was updated successfully, but these errors were encountered: