-
Notifications
You must be signed in to change notification settings - Fork 3
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
Securely share project directory with LXD guest for write #32
Comments
9p servers
Servers that didn't work.
Failed to create the file (docker-archive/go-p9p#25 (comment)). 9p FUSE clients
|
https://github.com/rminnich/go9p server on host was able to provide r/w filesystem to https://github.com/aperezdc/9pfuse client running in LXD. Both projects are about 5-6 years old, and support no fancy Now need to create secure network channel from host to LXD.
Automate server and client bootstrap in |
#32 More work needs to be done to make it work with remote containers by reusing LXD connection.
#32 More work needs to be done to make it work with remote containers by reusing LXD connection.
Using NBD can be more advantageous as it already supports TLS. https://askubuntu.com/questions/836217/how-to-mount-a-compressed-disk-image |
https://github.com/containers/toolbox is a way to work with current project directory with isolation.
|
An alternative to research for |
Problem
lxd-runin.sh
mounts current directory read-only.The official way to share host dirs with containers is to use disk device.
And that makes all files inside container owned by
nobody:nobody
. The issue is described at https://github.com/lxc/lxd/issues/2025 and the solution is to direct kernel to mapuid/gid
of user from host touid/gid
of user from guest (which isroot
in this case).The proposed solution raises a security issue - if container process with mapped
uid/gid
escapes filesystem boundaries, it will be able to steal private keys of host user. Secure solution is to rewrite file owner on filesystem access layer without touching containergid/uid
.Solution 1 - Patch LXD
The logical way is to add another device called
dir-proxy
to LXD that will do the necessary conversion. It requires knowledge of LXD and may not be feasible, because LXD is a wrapper over standard Linux containers and may be limited to what containers are capable of.Solution 2 - Use 9p server on host and access it with FUSE client on guest
While
kernel
has support for9p
filesystem, it won't allow to mount it from unprivileged container. Other FUSE clients don't have this limitation. An additional benefit will be the ability to mount local project dir to remote LXD container (#26) provided that there is a secure channel between guest and host (LXD proxy devices?).I am looking to add these features to
lxd-runin.sh
script. The stumbling block right now is to find a binary for 9p client that will provide FUSE server and could be easily injected in remote container.The text was updated successfully, but these errors were encountered: