Replies: 2 comments
-
Can you share what the error details are? It seems you've redacted it in the log output. |
Beta Was this translation helpful? Give feedback.
-
|
ERROR [rego] Error occurred while parsing. Trying to fallback to embedded check file_path="<home>/.cache/trivy/policy/content/policies/cloud/policies/aws/ec2/specify_ami_owners.rego" err="<home>/.cache/trivy/policy/content/policies/cloud/policies/aws/ec2/specify_ami_owners.rego:30: rego_type_error: undefined ref: input.aws.ec2.requestedamis[local622]\n\tinput.aws.ec2.requestedamis[local622]\n\t ^\n\t have: "requestedamis"\n\t want (one of): ["instances" "launchconfigurations" "launchtemplates" "networkacls" "securitygroups" "subnets" "volumes" "vpcs"]" |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
When performing a trivy aws scan with --exit-code 1 option, the command also returns a non-zero exit code if environment related errors occur: e.g., ERROR [rego] Error occurred while parsing. Trying to fallback to embedded check
Desired Behavior
I only want a non-zero exit code if a test/check fails. Or I want to be able to make the difference between a failed test and another error when I run trivy aws in a pipeline.
Actual Behavior
Returns non-zero exit code when no test/checks are failing. Therefore I can't use it in a pipeline.
Reproduction Steps
1. Deploy a service in AWS 2. Run trivy aws against it and make sure no tests are failing (e.g., by limiting the SEVERITIES or adding an ignore file). I see rego parsing errors displayed as described above. 3. Run it again with --exit-code 1. Exits with FATAL error ...Target
AWS
Scanner
Misconfiguration
Output Format
JSON
Mode
Standalone
Debug Output
Operating System
Ubuntu
Version
Checklist
trivy clean --allBeta Was this translation helpful? Give feedback.
All reactions