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

fix: Don't install recommended packages in base image #314

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

MoritzWeber0
Copy link
Member

Get rid of pynvim, which is flagged as malicious in XRAY.

Resolves #313.

Get rid of pynvim, which is flagged as malicious in XRAY.
@MoritzWeber0
Copy link
Member Author

Tried the change with the t4c/client/remote image and works fine so far. Quickly checked the list of installed packages. The only relevant missing one was gnupg, added it to the list.

Copy link
Contributor

@jamilraichouni jamilraichouni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust you :-)

@MoritzWeber0 MoritzWeber0 merged commit af1eb24 into main Sep 6, 2024
22 checks passed
@MoritzWeber0 MoritzWeber0 deleted the no-install-recommends branch September 6, 2024 12:41
@kacper-ka
Copy link

Apparently this fix has broken the image for me: I have relied on the presence of ssh inside the container and have used it along with other components in order to use the identity keys present on the host (mounting gpg-agent and ssh-agent sockets inside the container). What would be your recommended approach to mitigating this? On the host I use KeePassXC and its ssh-agent feature in order to not store private keys on the disk. I require maintaining this state, therefore it would be necessary for the Eclipse inside the container to fetch the keys from the agent running on the host.

I would be grateful for any insight regarding this issue, either some solution I haven't thought of or simply adding ssh to the container explicitly.

@MoritzWeber0
Copy link
Member Author

MoritzWeber0 commented Sep 24, 2024

Apparently this fix has broken the image for me: I have relied on the presence of ssh inside the container and have used it along with other components in order to use the identity keys present on the host (mounting gpg-agent and ssh-agent sockets inside the container). What would be your recommended approach to mitigating this? On the host I use KeePassXC and its ssh-agent feature in order to not store private keys on the disk. I require maintaining this state, therefore it would be necessary for the Eclipse inside the container to fetch the keys from the agent running on the host.

I would be grateful for any insight regarding this issue, either some solution I haven't thought of or simply adding ssh to the container explicitly.

Hey @kacper-ka, definitely an interesting use case that I didn't consider yet. Until there is a solution, you can continue to use version v2.5.2.

I mainly see two options:

  1. You create a small Dockerfile that inherits from our image and installs an ssh-agent on top. This would be the easiest solution.

    FROM [IMAGE_THAT_YOU_CURRENTLY_USE]
    USER root
    RUN apt-get update && apt-get install openssh-client
    USER techuser

    Then, you have to build the image with docker build -t [NAME_OF_THE_NEW_IMAGE] .. Please note that you have to repeat the step after each update of the base image.

  2. We add openssh-client to the image again. I just see the risk that we don't want to have ssh installed in the remote image for security reasons. The remote image inherits from the base image, so that would be affected as well. This situation will improve with buildpacks because we can individually combine layers, but it will take some time to finish the buildpacks PR and there are some higher priorities in the next few weeks. (build: Use buildpacks for better caching #300).

@MoritzWeber0
Copy link
Member Author

MoritzWeber0 commented Sep 25, 2024

Hey @kacper-ka, a short update from my side. We decided in the team that we want to support SSH officially in the image. Thanks for raising the nice use-case. The client was added in #319 and will be part of the next release (next week).

@kacper-ka
Copy link

Great, thanks for the update @MoritzWeber0 !

@MoritzWeber0
Copy link
Member Author

Great, thanks for the update @MoritzWeber0 !

Took a bit longer than expected because we had to fix the pipeline first. The update is released in v2.6.0. Feel free to try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XRAY-586869: pynvim:0.4.2 Malicious package in remote and client docker images
3 participants