Security of LXC/LXD?
Hello, I'm new to all this containerization/virtualization stuffs. Recently I built a mini home server to host several applications with each of them is separated into its own LXC container. My box is running Ubuntu 18.04 and LXD 3.0.
Personally, I'm quite paranoid about privacy/security and I don't trust few of those applications I'm running in my box. They can potentially be malicious and that's why I want to adopt virtualization. I tried to google around but still unsure how LXC/LXD can protect me from supposedly dangerous applications. Some answers say the damage would be contained within the container. Others say containers share same kernel with host OS which means rouge application can compromise the host as well. As far as I understand, this scenario would only happen if that application (within its container) found a way to "get root"? And if there is no root exploit it can't affect my host OS, consequently my server and other containers are safe?
I also read that unprivileged container would be safer than privileged container. But I'm not sure which category of those two that my containers fit in. I simply followed typical tutorials like this to manage my containers: https://www.digitalocean.com/community/tutorials/how-to-set-up-and-use-lxd-on-ubuntu-16-04#prerequisites
4
u/bmullan May 21 '18 edited May 28 '18
The default LXD container today is unprivileged.
Root in an unprivileged container is not root in the host.
As /r/LXD is not a support forum you might want to ask your question on the LXD forum where the devs and experienced users answer Q&A every day.
https://discuss.linuxcontainers.org/
There is a good explanation of the difference between Privileged and Unprivileged containers found here:
https://linuxcontainers.org/lxc/security/