4 ms·
If you run programs that you can't trust (for example because the source is unavailable and/or nobody reads it, no one is a gatekeeper of program updates etc),
by dannymi 3y ago
If you run programs that you can't trust (for example because the source is unavailable and/or nobody reads it, no one is a gatekeeper of program updates etc), then you are opening yourself to attack because the default unix security model is just as bad as the Windows one. (The Windows one used to be much worse, but it isn't anymore, now they are the same badness)
Nowadays, the web browser is used as a platform to run programs on and so it has a lot of access to weird things (multiple monitors, local filesystem, ...) so one has to be careful what you enable there--since you probably run a lot of Javascript written by shady people you don't know.
The Linux desktop security model has user accounts, and then files have permissions for those users (yeah, there are also user groups, whatever). That means if you have a misbehaving (or malicious) program, it can read stuff in your home directory since that's owned by the same user account--so it can read your saved passwords, delete all your photos, figure out your banking info--but hey, at least it can't remove your printer (since for the latter you need to use the root user account :P) /s .
There are mitigations against that and the easiest (and crappiest) one is containerization: just run each program in an isolated virtual-machine-like-thing and they can't access other program's data (i.e. the rest of YOUR data) in the first place.
Then there's SELinux which flips this entire thing on its head. By default, nobody can do anything (that's the first very good decision!). If a process wants to do things, there has to be a policy installed that mentions that specific thing to be allowed and when. Otherwise no go. This way of working is much safer, BUT someone has to maintain those policies! And it must not be the program's author since he could just add whatever line he wants to have to the policy--and that's obviously bad. So who does it? Usually the Linux distribution's maintainer. Or, more commonly, nobody--so there's no policy for your favorite program and so it won't work.
- anthk 3y agoContainers are not virtual machines.
- egberts1 3y agoBut container is a form of virtualization.
- anthk 3y agoNo. Just a form of setting namespaces. Nothing it's virtualized.
- red-iron-pine 3y agoessentially just a very robust deployment of a chroot jail. which can totally happen on a VM, but not a VM in-and-of-itself
- anthk 3y agoThen you don't have a container. You have a VM with a container.
- kmarc 3y agoAlthough I use the term "virtualization" the same way as you want to understand it, containers are still called "virtualization", as this wikipedia page suggests: https://en.wikipedia.org/wiki/OS-level_virtualization https://en.wikipedia.org/wiki/OS-level_virtualization Good to know about it. Especially once you meet decades-experienced folks (mainframe guys), they rather use the word "virtualization" in its broader sense, yet they understand the difference between containers and virtual machines.
- anthk 3y agoUserspace namespaces/chroots/jails are NOT virtualizations, period. Plan9/9front it's composed/run on namespaces and no one would say every window(1) process it's being virtualized because it has instances of different Plan9 devices such as their own /dev/draw.
- egberts1 3y agoHere's what those IBM guys have to say about container and virtualization: https://www.ibm.com/cloud/blog/containers-vs-vms#:~:text=Containers%20use%20a%20form%20of,CPUs%2C%20memory%20and%20desk%20space https://www.ibm.com/cloud/blog/containers-vs-vms#:~:text=Con.... Carnegie Melon University chimes in as well: https://insights.sei.cmu.edu/blog/virtualization-via-containers/ https://insights.sei.cmu.edu/blog/virtualization-via-contain... Amazon AWS: is container virtualization