Replies: 4 comments 2 replies
-
Outputs are subjective and as a result hard to satisfy every use case with. You can always write a Trivy output plugin that formats the output as you wish https://aquasecurity.github.io/trivy/v0.49/docs/advanced/plugins/#output-plugins |
Beta Was this translation helpful? Give feedback.
-
Maybe I didn't explain the key issue. Trivy is inconsistent in its output based in the input. The format of output should be consistent regardless of whether the input was in YAML or JSON format, if Trivy is claiming to be able to take both inputs as a K8s manifest. |
Beta Was this translation helpful? Give feedback.
-
@simar7 @chen-keinan is this a limitation or a bug? (we don't need to rush to fix it just to understand) |
Beta Was this translation helpful? Give feedback.
-
@huornlmj thanks for flagging it. This is actually a bug in the parser. I'll create an issue from it as the output should be the same for both JSON and YAML scanners. |
Beta Was this translation helpful? Give feedback.
-
Description
If I supply a K8s manifest in YAML format for misconfiguration scanning, Trivy will return findings which include line excerpts from the scanned manifest. For example:
However if I convert the exact same K8s manifest from YAML to JSON and scan the JSON version with Trivy, Trivy finds the same issues but yields a report that omits the line excerpts.
Desired Behavior
Give the user the option to either include or omit line excerpts. The difference in how Trivy operates depending on YAML or JSON input helped show me that I actually prefer the results when they come from JSON, as I think the line excerpts are unnecessary clutter and I would actually like to control whether I see the excerpts or not.
Actual Behavior
Described above
Reproduction Steps
Target
Kubernetes
Scanner
Misconfiguration
Output Format
Table
Mode
Standalone
Debug Output
Operating System
Linux
Version
Checklist
trivy image --reset
Beta Was this translation helpful? Give feedback.
All reactions