Skip to content

Isolated development environments to fend against bugs and malware in code under development, hygiene, etc. #183

Closed as not planned

Description

@markstos

One of the reasons to containerize data is to prevent malicious executable inside the container from getting access to my data. It appears that toolbox always mounts the host home directory in the container. That's convenient, but I would prefer if it was optional.

Not all containers need access to my SSH private key, keychain and other things that might be stored there.

Activity

  1. juhp commented on Jun 1, 2019

    @juhp
    Contributor

    You want a persistent user container without your /home? Just trying to understand the requirement/usecase better. - Say compared to just running a standard throwaway Fedora container?

  2. markstos commented on Jun 3, 2019

    @markstos
    Author

    Consider a Unix account which is used for both home and work. For a work container, I may prefer to mount only my work directory into the the container.

    Consider an untrusted GUI app. It may only need access to a specific folder to load/save files. It doesn't need access to my .ssh folder and other unrelated files.

    For improve security, Chrome OS does not share folders to containers by default from the host. There, if you want to provide data to the containers from your home directory or from a USB drive, you explicitly share it.

    Containerization as a security feature loses significant value if you give the untrusted container all your data by default!

  3. markstos commented on Jun 3, 2019

    @markstos
    Author

    @juhp I see you work a good deal with Haskell packages. Presume that one of the Haskell packages you are install remotely has been compromised. Do Haskell packages need access to your .ssh folder or your Bitcoin wallet? Why share everything into your Haskell dev environment by default?

    Fairly recently there was an NPM module that could still local Bitcoin if it was installed:
    https://www.trendmicro.com/vinfo/nz/security/news/cybercrime-and-digital-threats/hacker-infects-node-js-package-to-steal-from-bitcoin-wallets

    The module was popular and in fact my team had installed it into our tree. We didn't meet the the other criteria for it to trigger a bitcoin theft, but that risk would have been completely mitigated if our dev environment did not have complete access to our home directories by default. No employee would have chosen to share their Bitcoin wallet into this development environment.

  4. cgwalters commented on Jun 3, 2019

    @cgwalters
    Collaborator

    This is totally valid but is going to be hard.

    Practically speaking, I think the best path is to make it easy to run toolboxes as separate users (transiently create new uids, each with their own /home) - requires a privileged system service to do that.

  5. cgwalters commented on Jun 3, 2019

    @cgwalters
    Collaborator

    Now if you want share some files e.g. read-only - that gets messier.

  6. juhp commented on Jun 7, 2019

    @juhp
    Contributor

    Is it possible to exclude files/dirs from a directory bind-mount?

  7. markstos commented on Jun 7, 2019

    @markstos
    Author

    To make sure I understand the challenge, I see that mounting the home directory happens in one line of code

        --volume "$HOME":"$HOME":rslave 
    

    But the challenge here is still making GUI apps and some other features work, because those features expect that the user inside and outside the container is the same?

  8. oskarkook commented on Jul 11, 2019

    @oskarkook

    This is actually a rather important feature. I think it's fine to mount home by default, but it should be possible to use a container in an untrusted manner. Mounting home into a container assumes you trust the container, which in a throwaway container often isn't the case. Even in simple cases like testing some NPM module out, I'd like to have the peace of mind that it isn't going to wreck my home folder.

  9. juhp commented on Jul 12, 2019

    @juhp
    Contributor

    @markstos maybe you can test what you can do without the home mount or if just mounting a specific dir (cwd)?

  10. markstos commented on Jul 12, 2019

    @markstos
    Author

    @juhp Actually this was showstopper for me-- I stopped evaluating Silverblue once I ran into this missing feature. If this addressed, I may give Silverblue a second look. I was also disappointed to find that it wasn't easy to figure out how to run a Ubuntu container, which is the OS I've been using before.

    If Fedora wants to welcome users coming from other Linux distros, making it easy to run their old distro in a container would be a good place to start.

  11. juhp commented on Jul 12, 2019

    @juhp
    Contributor

    @markstos thanks - I am just another Toolbox user. :-)
    I agree completely that extending Toolbox to support more OSes would be very useful indeed.
    Note that Toolbox also works without Silverblue (ie on other Fedora editions).

  12. cgwalters commented on Jul 12, 2019

    @cgwalters
    Collaborator

    @juhp Actually this was showstopper for me-- I stopped evaluating Silverblue once I ran into this missing feature

    What did you do before? Is there some other tool/approach you were using that didn't work on Silverblue?

    Nothing at all stops you from e.g. using a disposable VM (QubesOS like), or for that matter having a custom script which implements some of the suggestions from this thread. Arguably, we should be more opinionated and build in QubesOS-like functionality into Silverblue.

    But anyways existing VM and container technology is there. In fact toolbox today is really a bunch of scripts that make podman intentionally blur with the host. If you don't want the integration, you can start with podman run... since that's the default.

  13. markstos commented on Jul 12, 2019

    @markstos
    Author

    @cgwalters I have started using Chrome OS on my personal laptop and have come to appreciate the security of having my development environment (and nearly everything else) running within a container in VM through the Crostini project. I like that it supports GUI apps as well as command line apps. I also like that containers are private by default. I have to explicitly share data folders or USB drives with them. On the other hand, sound and wayland support is automatically set up in those containers.
    url
    I've been evaluating similar solutions to use on my work laptop instead. One option would be Neverware's Cloudready-- an open source Chrome OS for PC hardware. Sometimes there are ports that Crostini crashes, data is lost and starting over is necessary. For that reason, I hesitate on doubling down on ChromeOS / Crostini now.

    Silverblue also looked compelling until I found it doesn't appear to support Ubuntu containers out of the box and it over-shares my personal data with containers I don't intend to trust. I also looked at Clear Linux. It has same concept of running nearly everything in containers. I am not thrilled with the close ties to Intel and x86. It's also not primarily a desktop OS. A final (default?) option would be to stick with Ubuntu as a desktop and move more my development work into LXD containers, which what Chrome's Crostini is using. I should be able copy LXD containers between my work and personal laptops even though the host OS is different. Using LXD templates, I should be able to set up a template shares enough mounts into the containers for Wayland support.

    side note: Thanks for all the years of maintaining Rhythmbox!

  14. markstos commented on Jul 12, 2019

    @markstos
    Author

    Perhaps I misunderstand the mission of toolbox. From the README:

    .. Intention of these systems is to discourage installation of software on the host

    Why? With the default is to share all your personal data into the container by default, I don't think improved security can be claimed.

    The remaining potential benefit would isolation, so you could install conflicting versions of software side-by-side.

    If the always-share behavior remains, it could be helpful to update the docs clarify that the toolbox shares your entire home directory into the containers, that the behavior can't be disabled and it should not be used with untrusted containers.

    I get that I can use podman directly, but I was interested a container solution with GUI integration. When searching on how to accomplish that with podman, using toolbox is the recommended approach:

    https://discussion.fedoraproject.org/t/how-to-run-a-containerized-gui-application/570

  15. kronenpj commented on Oct 13, 2019

    @kronenpj

    @markstos If you're interested, I've created PR #298 which builds an Ubuntu 19.04 image.

  16. 24 remaining items

  17. martymichal commented on Feb 3, 2022

    @martymichal
    Member

    According to the docs toolbox creates a isolate environment

    Could you, please, point to the part of documentation that mentions this fact. It is wrong and should be amended. Ideally you'd report it by creating a new issue. Thank you!

    my local python installation has it version modified by Anaconda.

    You could open a new issue about this.

  18. abitrolly commented on Aug 6, 2022

    @abitrolly

    /r/Unexpected yesterday at Fedora Nest I expressed the opinion that Fedora would be more awesome to both its community and to people outside if it included safe toolbox. Today it seems like it attracted attention, but the outcome is surprising. Despite it being the most voted issue on this tracker. Guess toolbox is RedHat and not Fedora.

  19. debarshiray commented on Nov 29, 2022

    @debarshiray
    Member

    I do agree that our README.md should be easier to read, though.

    See #1020 for improvements to the README.md and the website.

  20. changed the title [-]Isolated development environments to fend against bugs and malware in code under development[/-] [+]Isolated development environments to fend against bugs and malware in code under development, hygiene, etc.[/+] on Jun 28, 2023
  21. KilianHanich commented on Nov 24, 2023

    @KilianHanich

    So, if I understood this correctly, while this is wanted, it is very low on the priority list of stuff to implement.

    If this is the case, if somebody else would go, implement it and then submit it here, would this (if it's done well), be accepted?

  22. debarshiray commented on Jan 25, 2024

    @debarshiray
    Member

    If this is the case, if somebody else would go, implement it and then submit it here, would this (if it's done well), be accepted?

    If it works well with everything else (eg., moving data in and out of the container, handling Git and SSH configuration, making containers with different HOME directories interact, etc.), then sure.

    Note that it's already possible to achieve a Toolbx container that's isolated from the HOME directory on the host by overriding HOME:

    $ HOME=/some/other/path toolbox create
    

    However, people find it hacky for the exact reasons why a proper solution for this isn't as easy as they claim to me. If we are going to change the Toolbx sources then it better be something that's better than overriding HOME.

  23. dongdigua commented on May 18, 2025

    @dongdigua
    $ HOME=/some/other/path toolbox create
    

    With toolbox 0.1.1 (podman 5.4.2), this workaround seems not working.
    #1564

  24. debarshiray commented on Sep 5, 2025

    @debarshiray
    Member
    $ HOME=/some/other/path toolbox create
    

    With toolbox 0.1.1 (podman 5.4.2), this workaround seems not working. #1564

    You need Toolbx 0.2: https://github.com/containers/toolbox/releases/tag/0.2

  25. abitrolly commented on Sep 5, 2025

    @abitrolly

    @debarshiray because the toolbox is not safe and security is not planned, it doesn't matter for this issue,

  26. goosethedev commented on Jan 14, 2026

    @goosethedev

    Putting some thought on this, I came up with what I think would be a better approach for Home containerization:

    • Have a real home, with the base configurations that all containers inherit (e.g. fish, bottom, atuin, htop, tmux, etc).
    • When creating a container, it mounts the real home as read-only and all new files created in the container are persisted as a sort of overlay over the real home.
    • If a container wants to modify a file set in the real home, it creates a copy in the overlay with the changes, so the real file is untouched.
    • Changes to the real home (outside containers) are re-diffed if the container is active or next time is started.

    This way, changes in the real home are set in all containers, but changes made inside a container are completely isolated and gone when the container is removed.

    Although I don't know the technical challenges and possibilities to actually implement this, I think most users would see this more intuitive and useful.

  27. abitrolly commented on Jan 14, 2026

    @abitrolly

    @goosethedev how to exclude SSH keys from being accessible from the container?

  28. eamonburns commented on Feb 2, 2026

    @eamonburns

    @goosethedev how to exclude SSH keys from being accessible from the container?

    Toolbox is not trying to be used to run untrusted software (#1020 was mentioned above)

  29. abitrolly commented on Feb 23, 2026

    @abitrolly

    Toolbox is not trying to be used to run untrusted software (#1020 was mentioned above)

    I kept missing the exact information from README, so I filled this #1762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions