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

Set a shortcut key to run Vuln Scanning on a resource. Don't scan every resource at every startup. #2331

Closed
NeckBeardPrince opened this issue Dec 7, 2023 · 4 comments
Labels
enhancement New feature or request noodle question Further information is requested

Comments

@NeckBeardPrince
Copy link
Sponsor




Is your feature request related to a problem? Please describe.
Scanning every resource on a cluster every time you run k9s is going to cause a lot of traffic over and over again. Especially if you connect to several clusters at the same time.

Describe the solution you'd like
If you can set a shortcut key to run on a selected Deployment, Pod, StatefulSet it would allow you to be more selective on when you want those scans to run. Maybe you could do two shortcut keys, one to scan that specific resource and another to do a full cluster scan.

Also, maybe there should be a cache of vuln results so that every time you launch k9s it doesn't do an automatic vuln scan on every resource all over again, could perhaps set a maxCache time?

As always, I couldn't live without k9s, love your work.

@derailed derailed added enhancement New feature or request question Further information is requested noodle labels Dec 7, 2023
@derailed
Copy link
Owner

derailed commented Dec 7, 2023

@NeckBeardPrince Thank you for the feedback Adam! I'll noodle on this. Caching is less than ideal imho as you still have to refresg that cache once in a while. In the meantime, you can always toggle theenableImageScan feature flag to check where your scans are at prior to releasing your apps?
That said perhaps white/black listing certain images from scan might be another option??

@NeckBeardPrince
Copy link
Sponsor Author

That said perhaps white/black listing certain images from scan might be another option??

Maybe namespaces would provide extra flexibility? Scanning a cloud hosted kube-system isn't all that useful, really. I could see blacklisting kube-system and others as helpful, that could work.

@andre161292
Copy link

First of all: Thanks for the nice feature!

Aside from the traffic, another problem for me is the CPU utilization on my local computer, when opening k9s in a ~170 pod cluster. Also, the images might take a lot of space on my disk i didn't intend to waste.

Wouldn't a good solution be to offload the work into the cluster, such as installing a job that does the work? There'd be no need to transfer or replicate images and also no intense CPU utilization locally.
Aside from the advantages of such an offloading, the option to run the scan locally should still be kept for various reasons, such as only having "read"-access to a cluster or not wanting to install random stuff in a cluster.

The white/ignorelist thingy and the idea to only scan on purpose by hitting a key or sth alike, sound both good to me too.

@derailed
Copy link
Owner

@NeckBeardPrince @andre161292 @gerhard Thank you all for piping in!
I see you points and added a way to opt out scans in v0.30.x. Please let me know if that flips the bill on this deal. Tx!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request noodle question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants