trivy
trivy copied to clipboard
bug: Trivy doesn’t use context in dependency parsers to stop the run.
Description
We use the Context.WithTimeout function to stop Trivy by timeout.
But we don't use context for the Parser interface. That is why Trivy doesn't stop the run, if file parsing takes a long time (e.g. fetching dependencies of pom.xml file).
Solution
Add and use context in the Parse() functions to stop Trivy by timeout.
Related issues
- https://github.com/aquasecurity/trivy-action/issues/485