-
Notifications
You must be signed in to change notification settings - Fork 261
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
Revert to full jdk image for egeria container #7572
Comments
The 'FROM' line is In 3.15 we used So there are two main changes (as well as constant updates to those core images themselves)
We used UBI images, in particular to aim for a platform that is secure as possible. See https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image. The same logic was why the choice of runtime -- minimize the footprint, minimize the attacks. We do not compile java code within the container. Hwever, The -runtime image has lost 'tar' as you mention. I am inclined to agree this is a step so far as it makes debugging harder. The 'kubectl debug' command in theory offers much more flexibility in adding all kinds of tools to the existing environment to debug. However I note that at least on openshift this isn't effective:
However whilst this helps in viewing processes (with more tools), it does not give access to the filesystem. This is down to userids - the new container would need to run with the same user... This is due to several factors followign best practice -
This demonstrates we have more secure containers :-) Actions we need to consider
|
Here's one article suggestion a possibility: https://fabianlee.org/2022/09/10/kubernetes-copying-files-into-and-out-of-containers-without-kubectl-cp/ And here's an example (from lib not extralib, as this is a clean image):
That article also seems to suggest this is becoming more common, so we are probably doing the right thing for security.... |
@lpalashevski @T4ylan @juergenhemelt Interesting question for you -- for typical images you run, what's your view on how tight these images need to be? What's the right balance of usability vs security? Do you think a switch to a fuller image is ok. My inclination is that we maybe should take one step back to use the fuller image (it's otherwise very much the same base) Dan - what do you think? We are very late for v4 to change, although it is quick & should be fairly safe. |
We're in the process of needing to better understand how egeria is functioning. There are many tools in the jdk to help with this -- see standard java tools documentation java 17 These tools are generally not available in the runtime image, which will make further debugging really hard. Given the fact that
I am going to switch the image back to the full jdk. We can continue to discuss if this should be reverted long term, but at this point in time it seems appropriate |
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
From the security perspective, it should be fine because the images are getting updated "regularly", even with the greater attack vector. But to gain access through these tools in a kubernetes environment is unlikely. Imho, the images should be as minimal as possible (aside from a security perspective, e.g., for better startup times if the pod gets moved or killed). |
@T4ylan thanks for the feedback. I think it is the right direction, but we need to ensure we have clear documented approach to work through the alternatives in the short term. Practically speaking, orgs will quite likely build their own image in any case, with ours providing a sample. We could also build both a prod and dev image with the two different bases For now, I needed to make a quick decision for v4, & reverting to the fuller image is required as we need to be able to productively work through some of our challenges with footprint & app behaviour, and most current usage is in dev/poc environments. As we progress with cloud native we should aim to get back to a more minimalist approach & figure out how to address the analysis use cases in the best way. |
Is there a change to the base image used for containers? It seems that basic commands which I thought used to be there are missing - like Vi, Tar etc.
I tried to copy a file into the image from the host command line and it failed..
(base) ➜ egeriaConnectors kubectl cp ./cocoGlossary.csv lab-odpi-egeria-lab-core-0:/deployments
Defaulted container "egeria" out of: egeria, init-connector (init)
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "e9a1457c133e9f7d322dce3d8228da24b3f7e93f3fd30248f141816dc494d452": OCI runtime exec failed: exec failed: unable to start container process: exec: "tar": executable file not found in $PATH: unknown
Is this expected?
The text was updated successfully, but these errors were encountered: