-
Notifications
You must be signed in to change notification settings - Fork 799
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
Replace vim with nano in hub image to reduce known vulnerabilities #2917
Replace vim with nano in hub image to reduce known vulnerabilities #2917
Conversation
I would really really really really really like to not remove vim and also avoid a conversation about editors :) |
Maybe we can switch to nvim? |
Installing
I'll investigate if Conclusion: both |
I do a lot of debugging work in the hub pod and removing vim completely in there would have a serious effect on that. We also don't really have conda in there so I can't really just install it either. I also personally believe these CVEs won't really apply to us in this context (which is one of the reasons I hate simple CVE scans). But I understand they cause noise which might drown out useful signals. I'm not sure what is the right thing to do :( |
That you voiced this part makes me feel heard, this is the key reason for me to look into this atm! |
Thank you so much @consideRatio for working on this! |
One option to consider is publishing two Hub images:
We can default to the second one in |
Question for @manics idea: with our chartpress setup, is it feasible to inherit from one image to another? I think it might not be easy because the tag of one image isn't known or accessible in the build of another. I was thinking the simplest version of this would be to have the bigger image FROM the smaller one, with a couple extra install lines, but I don't know how I'd do that with chartpress. Lockfiles and such aren't kind to layering either, so maybe the two having the same Dockerfile only differing by apt.txt/requirements.txt would be the easiest in practice. |
Opinion about multiple hub imagesI'm quite strongly opinionated currently that its not worth the complexity of having two different kinds of images, or even a common base image, and would argue that whatever isn't a good compromise in what we provide by default, users would have to adjust to. I see the complexity related to multiple images or more base images etc is that it adds significantly to the complexity of maintaining source code, CI system, tooling, and documentation related to it. More info needed for a decisionI'd like to postpone opining on a choice or action point until we have a better understanding about the security reports for the
Overall, I want low amounts of unpatched CVEs by default in all images we maintain for many reasons, where the key action point as I see it from us as maintainers is to make our fresh releases not show up with F rating on artifacthub.io: CVE detections in
|
It's not supported in Chartpress at the moment, but I think it's a reasonable addition if there's demand for a more secure minimal image. The approach I'd take is to have a single multi-stage Dockerfile, and tag an intermediate stage This ensures the multiple images are always in sync and rebuilt/tagged together, since they originate from the same Dockerfile. |
That sounds cool! I've not done that before. I think it's reasonable to ask what's the role of these debugging tools in the default image:
For instance, when I'm If we lost these tools in the default image, what would be involved for a deployment that wanted an additional apt package added to the default image? I guess this is the general 'custom hub image' case. Maybe the value of having them in the default image is because it's too much of a pain to maintain an extended image, and that's the problem we should work on? For the more short-term choice, I think switching to ubuntu base makes perfect sense, based on @consideRatio's findings. I like the simpler, more straightforward installation of Python from apt instead of conda for simple environments like ours, but that doesn't allow easy selection of the Python version itself, so if we want to get e.g. Python 3.11 in a relatively short time frame, micromamba makes sense. We can do micromamba for just Python itself, and keep dependabot-compatible pip-compile tooling, or we could switch to conda-lock, which doesn't need to run in a container, and wouldn't have issues with e.g. pycurl compilation dependencies, because there would never be a compile step. |
A big 👍 for just using it to install Python. I propsed it over Strategy on providing hub-slimIf tagging a layer is easy, I'm +1 for doing it. If it means adding notable complexity in tooling or similar I'm hesitant. I've not tried this, but if this would work that would be simple enough in my book to have it worth supporting it. zero-to-jupyterhub-k8s/chartpress.yaml Lines 21 to 25 in bb951c5
And make it... images:
# hub, the container where JupyterHub, KubeSpawner, and the configured
# Authenticator are running.
hub:
valuesPath: hub.image
# hub-slim, an alternative hub image that doesn't include some
# basic utilities for k8s admins
hub-slim:
contextPath: "images/hub"
extraBuildCommandOptions:
- --target=slim-stage |
I'm closing this as...
|
I hope we don't need to discuss what editors to use in general, but agree that
nano
can do the trick for the occational debugging needed in thehub
pod.vim
withnano
in the hub image #2916