Skip to content
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

bug(k8s): k8s scan works too long #7662

Closed
afdesk opened this issue Oct 7, 2024 Discussed in #7661 · 0 comments · Fixed by #7690
Closed

bug(k8s): k8s scan works too long #7662

afdesk opened this issue Oct 7, 2024 Discussed in #7661 · 0 comments · Fixed by #7690
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@afdesk
Copy link
Contributor

afdesk commented Oct 7, 2024

Description

Trivy kubernetes scan takes a lot of time for small minikube cluster:

$ time trivy k8s --report summary --debug --disable-node-collector --timeout 30m0s  
491,23s user 49,05s system 55% cpu 16:21,43 total

As said in #7661 Trivy fails even for test environment.

Reason

Trivy creates a new scanner for each kubernetes artifact:

imageReport, err := s.runner.ScanImage(ctx, opts)

configReport, err := s.runner.ScanFilesystem(ctx, s.opts)

Solution

As an idea we can try to optimize using of scanners.

Reproduction Steps

$ trivy k8s --report summary --debug --disable-node-collector --timeout 30m0s  

Discussed in #7661

@afdesk afdesk added the kind/bug Categorizes issue or PR as related to a bug. label Oct 7, 2024
@afdesk afdesk self-assigned this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant