Misconfiguration scanning not producing a failing exit code on parse error #8249
Closed
green-leader
started this conversation in
Bugs
Replies: 3 comments 2 replies
-
thanks for the report @green-leader! @nikpivkin currently we don't have an |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi @green-leader ! Trivy should not return an error code, since the parsing error was only logged and the scan itself continued without fail. I will create an issue to fix the handling of configs with timestamp. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Track #8252 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I'm using Trivy from within a Github action paired with yamllint on a FluxCD Kubernetes repo. It looks like sometime ago I had some potentially yaml that was causing the kubernetes scanner to choke. On an error such as this I expect it to raise some kind of error code based on the config given.
2025-01-16T19:41:33Z ERROR [kubernetes scanner] Failed to parse file file_path="helmrelease-sample.yml" err="unmarshal yaml: node tag is not supported !! 'timestamp"
config file given:
helmrelease-sample.yml
The offending line is the date at the end. yamllint has no issues with it and as far as I can tell it's valid YAML. If I put it in quotes the error goes away.
Desired Behavior
I should be alerted when there's an error parsing or scanning a file. Either with a new severity level or caught under severity unknown
Actual Behavior
Exit code is not changed, and documentation doesn't reflect if we can be alerted on a parsing or scanning error.
Reproduction Steps
Target
Filesystem
Scanner
Misconfiguration
Output Format
Table
Mode
Standalone
Debug Output
Operating System
Linux codespaces-2fdcbf 6.5.0-1025-azure #26~22.04.1-Ubuntu SMP Thu Jul 11 22:33:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Version
Checklist
trivy clean --all
Beta Was this translation helpful? Give feedback.
All reactions