Xpra Isolation of Containerized X11 Applications #4160
-
Hi there. Was hoping to get feedback on a simple xpra setup. BACKGROUND: I'm building a containerization schema with FreeBSD Jails, to emulate Qubes (Jails are kernel-level virtualization). X11 jails access the host display with a nullfs_mount (called bind mount in Linux) to the host's .X11-unix socket. Meaning that all X11 jails share that socket, and can see each others keystrokes and windows. Not good. XPRA SETUP: Quite simply I maintain the above setup, but run a startup script inside each jail: While on the surface this seems to work and it's definitely an improvement over the current situation, I'm still somewhat concerned about jails sharing the same unix socket with the host. But perhaps the nature of how that socket functions in combination with the jailed xpra server/client, makes it a low attack surface vector? Thanks for taking the time to read this. Looking forward to any feedback people might have. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Not a good start..
I think a better approach would be to only expose the xpra socket, potentially using a different bind mount for each one. |
Beta Was this translation helpful? Give feedback.
-
Just wanted to stop by, say thanks. This worked. I thought it was interesting that I was able to attach to either socket for the xpra server in the jail and it still worked: I was actually able to use --socket-dir from the host, with a different hostname and a different relative path from what the jail sees, and it seemed to work fine, but I'll stick with socket: just in case. I handle audio via a different mechanism, and input devices, browsing, video seemed to work fine without the specific --start mechanism. To keep the implementation simpler, I'll probably leave that out unless I'm experiencing problems. If I do have broken input devices or problems related to dbus inside a jail, I'll consider that to be my error, and fix the xpra implementation before asking here. |
Beta Was this translation helpful? Give feedback.
It creates as many sockets as it can in all of the
socket-dirs
withbind=auto
.Alternatively, create just the one you need with
--bind=/path/to/your/socket
Try
xpra attach socket://path/to/the/socket
(not the directory)socket-dir
might not work if the hostname is not the same inside and outside the jail.To get the correct environment:
dbus
,pulseaudio
, input devices, etc..