News for hackers. Stuff that matters.
Re:SELinux is unmanageable; just turn it off if it gets in y... by mindwok on Wednesday April 27, 2022 @12:42AM (#31176388)
As an experienced RHEL admin, a few years ago I probably would have said this is very bad advice in any professional context, and you should spend the time to learn it because it will save you one day.

Now, I think my advice would be: Put everything in a container, and learn how to run Docker or Podman (or k8s) in a secure way (ie no root containers, be very careful with volume mounts, etc). Yes, they aren’t as mature as SELinux, but containers aim to provide many of the same benefits that SELinux does (and even more) except in a way that’s much easier to manage. Even better is that these container runtimes often come with SELinux and AppArmor policies out of the box on good Linux distros.

Re:SELinux is unmanageable; just turn it off if it gets in y... by ximm on Wednesday April 27, 2022 @01:25AM (#31176635)
I agree that containers are easier to manage than SELinux, but still not easy enough. Linux provides many low level primitives for restricting applications and SELinux, Apparmor, Docker, Flatpak, and systemd all provide high level abstractions for those. But IMHO none of them really finds a sweet spot between flexibility and usability. `systemd-analyze security` for example lists 80 (!) different settings, even though some of them are very high level such as `ProtectSystem`.

Containers have made the conceptual shift from allow/deny to isolate/share. Somehow this feels better even though it is effecitvely the same.

I am still waiting for an abstraction that uses all the low level features and wraps them in a high-level interface that puts usability front and center.

I am not sure if this is even possible though because many applications are not built with sandboxing in mind. Adding another file somewhere on the system that needs to be accessed is not considered a breaking change by most. So maybe we need a more fundamental shift.

Re:SELinux is unmanageable; just turn it off if it gets in y... by zozbot234 on Wednesday April 27, 2022 @02:51AM (#31177057)
> I am still waiting for an abstraction that uses all the low level features and wraps them in a high-level interface that puts usability front and center.

Bubblewrap? FlatPak's sandboxing features are built on it already.

Re:SELinux is unmanageable; just turn it off if it gets in y... by tinco on Wednesday April 27, 2022 @07:47AM (#31178733)
In my opinion, if an application requires more access than a docker container gives by default, then that application should probably just run in a VM. If the application needs more access because it needs to manage or control some hardware, then it should be tailored to the O/S and have a small core service that runs naked under systemd or whatever. If fancy management of that core service is needed, it can expose a port that an application can talk to, that's safely isolated in a docker container.

Maybe that's just daydreaming about a perfect world, but I agree that it should be easy to reason about the access levels.

Re:SELinux is unmanageable; just turn it off if it gets in y... by ximm on Wednesday April 27, 2022 @11:48AM (#31181493)
What about an application like vim? It should be able to access any file I pass that is explicitly opened, but not much more. That is hard to express with current tooling.
Re:SELinux is unmanageable; just turn it off if it gets in y... by tadfisher on Wednesday April 27, 2022 @11:06PM (#31188338)
You are describing the Flatpak security model. Flatpak was invented for interactive applications like this.
Re:SELinux is unmanageable; just turn it off if it gets in y... by tinco on Wednesday April 27, 2022 @03:24PM (#31184587)
You shouldn't run an application like vim in Docker. Unless your server is running Vim as some sort of service, in which case it should only open files in a volume you bound to it.

Vim is exactly the kind of application you would run in a virtual machine.

Re:SELinux is unmanageable; just turn it off if it gets in y... by legalcorrection on Wednesday April 27, 2022 @01:17PM (#31182841)
You could do it with a file picker API that opened an out-of-process file picker. I'm pretty sure this is how WinRT works. Would be tricky for a purely command line workflow, but very doable with a GUI.
Re:SELinux is unmanageable; just turn it off if it gets in y... by iggldiggl on Thursday April 28, 2022 @09:28AM (#31192188)
Even file picker APIs are severely lacking with regards to any multi-file filetypes, where opening one file means having to subsequently access further additional files, too (but which files exactly cannot necessarily defined in advance because it depends on the contents of the initially opened file).
Re:SELinux is unmanageable; just turn it off if it gets in y... by seodisparate on Wednesday April 27, 2022 @02:28AM (#31176952)
As a lightweight alternative to Docker-based (or any container-based) solutions: Try firejail. You can set up a directory that will be the "home" of the sandboxed application you're running, then you can do something like `firejail --private="${HOME}/my_firefox_jail" firefox`. There are built-in profiles for many applications already, and you can customize them (by adding `.local` files, not editing the existing `.profile` files). See the following link for details.

https://wiki.archlinux.org/title/Firejail

Re:SELinux is unmanageable; just turn it off if it gets in y... by kaba0 on Wednesday April 27, 2022 @04:47AM (#31177747)
Convenience matter. Without it being automatically on everywhere, it doesn’t protect from much. Sure it can be good for the occasional random software you trust the least, but how many exploitable bugs were found in any of your completely trustable tools?

Also, afaik firejail runs as suid, making any possible escape much more serious.

Re:SELinux is unmanageable; just turn it off if it gets in y... by seodisparate on Wednesday April 27, 2022 @05:31AM (#31178003)
[1] discusses firejail running as root:

> For a server, the process exposed to the outside world runs as an unprivileged user (unbound or nobody). The process is started by a separate process running as root (as explained by @Ferroin above). The starting process is never exposed to outside.

> The same is true for Firejail. By the time the unprivileged server process starts, Firejail is already sleeping.

And I think Docker has a similar problem as mentioned in the "warning" section in [2]:

> Warning: Anyone added to the docker group is root equivalent because they can use the docker run --privileged command to start containers with root privileges. For more information see [3] and [4].

[1]: https://github.com/netblue30/firejail/issues/1720

[2]: https://wiki.archlinux.org/title/Docker#Installation

Re:SELinux is unmanageable; just turn it off if it gets in y... by goodpoint on Wednesday April 27, 2022 @06:37AM (#31178325)
Actually docker is much worse due to the large attack surface.
Re:SELinux is unmanageable; just turn it off if it gets in y... by raesene9 on Wednesday April 27, 2022 @02:56AM (#31177081)
I'd generally agree with this, but for production use (where it'll be CRI-O or ContainerD in all likelihood) it's worth noting that using containers does increase your attack surface.

We've had container breakout CVEs in the Kernel+ContainerD+CRI-O this year, and the ContainerD/CRI-O ones were not complex at all, so you do need to stay on top of patching as well as the other good practices mentioned.

Re:SELinux is unmanageable; just turn it off if it gets in y... by bonzini on Wednesday April 27, 2022 @01:41PM (#31183232)
A lot the container breakout CVEs do not affect a system that uses SELinux properly.
Re:SELinux is unmanageable; just turn it off if it gets in y... by raesene9 on Thursday April 28, 2022 @03:21AM (#31189648)
have you seen an analysis of SELinux against the recent set of breakouts? That'd be interesting to see.

Definitely the CRI-O one (which is most likely to affect Red Hat based systems) was able to exploit a default OpenShift cluster in my testing.

Re:SELinux is unmanageable; just turn it off if it gets in y... by patrck on Wednesday April 27, 2022 @02:11AM (#31176866)
A couple sysadm red flags:

1) The article author is Testing in PROD

2) selinux debugging relies on auditd, so sanity checks required.

  df -P /var/log/audit # has space?
  tail -1 /var/log/audit/audit.log # is recent?
  semodule -DB  # disable dontaudit
  setenforce 0
  # run the failing test
  audit2allow -l
After which the selinux debugging experience boils down to:

    mk_semod() {
        module_name=$1; shift
        audit2allow -l -m ${module_name} -a > ${module_name}.te
        $EDITOR ${module_name}.te || return
        checkmodule -M -m -o ${module_name}.mod ${module_name}.te
        semodule_package -o ${module_name}.pp -m ${module_name}.mod
        semodule -i ${module_name}.pp
    }
Re:SELinux is unmanageable; just turn it off if it gets in y... by kelnos on Wednesday April 27, 2022 @05:25AM (#31177970)
I think you just proved the author's point. That looks entirely inscrutable.
Re:SELinux is unmanageable; just turn it off if it gets in y... by devman0 on Wednesday April 27, 2022 @12:46AM (#31176415)
I was about to argue with you until I read to your last point. Totally agree one of the great things about containers is indeed they integrate very well with various Mandatory Access Control implementations SELinux included and don't generally require specialized policies for each app.
Re:SELinux is unmanageable; just turn it off if it gets in y... by zozbot234 on Wednesday April 27, 2022 @02:49AM (#31177048)
AppArmor is great. It can do much of what SELinux does, but it uses plain configuration files as opposed to incredibly obscure and clunky filesystem-level hacks.
Re:SELinux is unmanageable; just turn it off if it gets in y... by chr15p on Wednesday April 27, 2022 @05:54AM (#31178112)
AppArmour assumes everything is allowed unless it is explicitly denied by policy, SELinux assumes everything is banned unless it is allowed by policy. This makes SELinux fundamentally more secure because unlike apparmour you cant forget to deny some access that leaves you wide open, instead you forget to allow things and your app breaks. It also makes SELinux more complicated to implement because you have to allow everything you need or your app breaks whereas apparmour lets you deny the things you're worried about and ignore everything else.

SELinux also supports interesting things like applying security levels and contexts to data, so you can have data that is only accessible to appropriatly cleared users in one department but not to people with similar clearances in other departments. Very few people use this stuff though.

Selinux uses extended attributes to store its labels which is a pretty standard way of associating metadata with objects, and is supported by most standard unix commands (via the -Z flag) so I'm not sure what you mean by "filesystem hacks". Fundamentally they are both implemented as security modules in the kernel and do pretty much the same thing, which is best depends on whether the added security of SELinux is worth it to you.

Re:SELinux is unmanageable; just turn it off if it gets in y... by zozbot234 on Wednesday April 27, 2022 @06:10AM (#31178191)
> AppArmour assumes everything is allowed unless it is explicitly denied by policy

No, AppArmor uses a whitelist approach as well for its profiles. "Deny" rules are used in exceptional cases.

> SELinux also supports interesting things like applying security levels and contexts to data, so you can have data that is only accessible to appropriatly cleared users in one department but not to people with similar clearances in other departments.

AppArmor has subprofiles and variables that can be used for this approach.

Re:SELinux is unmanageable; just turn it off if it gets in y... by porker on Wednesday April 27, 2022 @03:49AM (#31177417)
It still has the same gotchas as a user though.

I was daemonizing a uvicorn (Python) process using systemd and could not get the Python script to write its log file anywhere. Not the current directory owned by the user, not elsewhere, and no errors showing up in the system logs.

After a few hours banging my head against the wall I discovered systemd's ReadWritePaths. Once I set that, it would log to any directory I specified.

It's the only service I've created where this has been necessary, and others write logs, so I have no idea why this one caused errors. If I did something wrong, let me know how this should be handled.

Re:SELinux is unmanageable; just turn it off if it gets in y... by db48x on Wednesday April 27, 2022 @04:14AM (#31177567)
Most systemd services log to stdout and let systemd put it in the journal, or they log to syslog and let systemd put it in the journal. Most don’t write their own log files any more. I really recommend going that route because it is nice to be able to search the journal, especially if you provide extra metadata for each log message.

It sounds like you were using the DynamicUser=, ProtectSystem=, or ProtectHome= settings which can greatly limit where a service is allowed to read from and write to and thus require you to open specific directories back up. Instead of using ReadWritePaths=, you might prefer to set LogsDirectory=.

Re:SELinux is unmanageable; just turn it off if it gets in y... by porker on Wednesday April 27, 2022 @06:23AM (#31178253)
> It sounds like you were using the DynamicUser=, ProtectSystem=, or ProtectHome= settings which can greatly limit where a service is allowed to read from and write to

Thank you! I have DynamicUser set - I can't think why I added it here, perhaps no reason at all - and that is the difference to previous systemd services I've written. I did not know it had such an effect on behavior.

Re:SELinux is unmanageable; just turn it off if it gets in y... by db48x on Wednesday April 27, 2022 @08:19AM (#31178982)
It is a nice security measure; it means that no other service can accidentally read or write to the same files. An older form of the security measure was to create new system users like “ftp” and “mail” so that the ftp daemon couldn’t be tricked into overwriting someone’s mail queue and so on. The downside is that this takes a certain amount of effort on the part of the system administrators and distros to arrange; the bookkeeping becomes a significant source of manual effort.

The DynamicUser= setting tells systemd to invent a new user on the spot, with an id that is not in use by any other service. You can add as many such services as you like¹ without having to do any extra work to keep /etc/passwd updated.

¹ as many as you like as long is it isn’t more than several thousand, unless you recompile systemd with larger limits.

Re:SELinux is unmanageable; just turn it off if it gets in y... by kelnos on Wednesday April 27, 2022 @05:28AM (#31177984)
How does this work when you want to log different things? Like if I had a web server, I wouldn't want the server log and access log to go to the same place. Sure, I guess I could send one to stdout and the other to stderr, but what if I have three things?

Maybe systemd/journald supports this use case by forcing you to adopt some sort of structured log format that you emit to stdout, but I don't think I want to have to conform to whatever journald wants me to do, unless it's standardized and well-supported among various logging tools.

Re:SELinux is unmanageable; just turn it off if it gets in y... by dale_glass on Wednesday April 27, 2022 @06:34AM (#31178300)
Journald indeed supports structured logging.

Try `journalctl -o json` to see all the fields that get logged. Applications can add more.

So it very much means that a webserver logging to journald can already provide it all with fields for the vhost, status, URL, referer, and whatnot, and you can just search the log by that and don't need to do your own parsing.

Re:SELinux is unmanageable; just turn it off if it gets in y... by kelnos on Thursday April 28, 2022 @05:51PM (#31198650)
Fair, but still annoying. The simple solution, that always works, is to write separate streams to separate files. At least journald supports JSON, and not some proprietary format, though I imagine the particular fields it supports might not be supported by other logging systems.

I'm just tired of all this added complexity, when I don't really see much of the benefit.

Re:SELinux is unmanageable; just turn it off if it gets in y... by db48x on Friday April 29, 2022 @07:29AM (#31203817)
The point is that you can include arbitrary metadata of your choosing, in addition to the standard fields that journald keeps track of for you. For example, if you include the id of the logged–in user with every message, then when they complain about a bug you can query the journal to find exactly what they did without any noise from all your other users. And you don’t even have to pay a SaaS company for the privilege.

> I'm just tired of all this added complexity, when I don't really see much of the benefit.

There is a lot less for each application to implement on its own, such as log levels, timestamp format, log rotation or even just the paths where logs should go. Instead those details can be configured by the system administrator using a uniform interface across all applications.

Re:SELinux is unmanageable; just turn it off if it gets in y... by egberts1 on Wednesday April 27, 2022 @04:44AM (#31177718)
Yet another rabbit hole has emerge. And it is called “systemd”.

What a great time to be a Linux system administrator.

Re:SELinux is unmanageable; just turn it off if it gets in y... by NoGravitas on Wednesday April 27, 2022 @08:53AM (#31179238)
Compared to selinux, though, the systemd documentation is excellent, and the tools for observing the state of the system are very good.
Re:SELinux is unmanageable; just turn it off if it gets in y... by egberts1 on Wednesday April 27, 2022 @09:59AM (#31179965)
Excellent? Whew. You must be privy to some private systemd dictionary somewhere.

Meanwhile, I am holding my own just fine, latest systemd-wise.

https://GitHub.com/egberts/easy-admin/blob/main/500-dns/512-...

It is all about reading the friggin’ source code … of systemd.

Re:SELinux is unmanageable; just turn it off if it gets in y... by froh on Wednesday April 27, 2022 @04:21AM (#31177607)
This is a selinux gotcha, not an apparmor one, right?
Re:SELinux is unmanageable; just turn it off if it gets in y... by porker on Wednesday April 27, 2022 @06:19AM (#31178237)
No, this is happening with apparmor on an Ubuntu 20.04 server.
Re:SELinux is unmanageable; just turn it off if it gets in y... by froh on Wednesday April 27, 2022 @11:24AM (#31181086)
I feel stupid --- ReadWritePaths= is a systemd feature, not an apparmor one, so how exactly is it an apparmor problem?
Re:SELinux is unmanageable; just turn it off if it gets in y... by bitcharmer on Wednesday April 27, 2022 @01:49AM (#31176755)
Container approach is not always feasible, for example when you need to stay on bare metal. There are Linux applications where selinux definitely gets in your way and there are legitimate reasons to turn it off completely.

edit: I like how I'm getting down-voted for sharing factual information. No-one in high frequency trading employs containers because it doesn't help soft-realtime, low-latency goals. There are other performance-sensitive domains where containers aren't an option. Sometimes I feel like this place is turning into Reddit.

Re:SELinux is unmanageable; just turn it off if it gets in y... by TheDong on Wednesday April 27, 2022 @02:19AM (#31176902)
> when you need to stay on bare metal

What cases can linux containers not handle? Containers can access GPUs, /dev/kvm, block devices... I'm having trouble thinking of anything they can't do. After all, they're just processes in a glorified chroot, not that different from processes on the linux host.

Re:SELinux is unmanageable; just turn it off if it gets in y... by bitcharmer on Wednesday April 27, 2022 @03:03AM (#31177125)
Ultra-low latency applications on Linux are definitely one domain were containers are a big no-no for performance reasons. In my field (HFT) you won't find any serious performance-sensitive deployments using containers. So that's one example.
Re:SELinux is unmanageable; just turn it off if it gets in y... by megous on Wednesday April 27, 2022 @03:40AM (#31177353)
Why would a container increase latency? It's just a pointer on a process. It's there on all processes.

https://elixir.bootlin.com/linux/latest/source/include/linux...

Re:SELinux is unmanageable; just turn it off if it gets in y... by geraldwhen on Wednesday April 27, 2022 @06:20AM (#31178245)
https://www.diva-portal.org/smash/get/diva2:1252694/FULLTEXT...

Also docker NAT will add significant latency if you don’t use host network mode.

When microseconds matter, everything matters. Any intermediate program would be suspect.

Re:SELinux is unmanageable; just turn it off if it gets in y... by megous on Wednesday April 27, 2022 @08:06AM (#31178874)
Then that's not about containers, but about NAT. So maybe don't use NAT. You can have NAT on the host, too, and it would slow down things also.

"Container" (namespace to be precise) is not really an intermediate program, it's a state associated with any Linux process.

Re:SELinux is unmanageable; just turn it off if it gets in y... by CraigJPerry on Wednesday April 27, 2022 @04:28AM (#31177646)
Are you referring to kube rather than containers?

A container is just namespaces and cgroups. You can still have your mellanox or solarflare zero-copy network stack for a containerised process.

That is, a containerised user space process can directly access the hardware, bypassing the kernel but isolated from other processes.

There are plenty of footguns for sure though but my experience working in HFT has been everyone is pretty elite skill-wise so sharp edges are not an issue in practice.

Re:SELinux is unmanageable; just turn it off if it gets in y... by Gigachad on Wednesday April 27, 2022 @02:33AM (#31176982)
Not sure about need but I do remember it being a pain in the ass to run anything that expects to be managing docker inside docker. Things like self hosted gitlab ci where its trying to start up containers itself.
Re:SELinux is unmanageable; just turn it off if it gets in y... by KronisLV on Wednesday April 27, 2022 @04:00AM (#31177487)
> ...anything that expects to be managing docker inside docker.

Now that's an interesting problem to have!

If you trust those tools and don't have untrusted users or untrusted code, you can sometimes just mount /var/run/docker.sock and use the VM/VPS/server's Docker directly. It is actually the approach that was used by excellent tools like Portainer, though it's also really risky as well.

Alternatively, you can try to just run Docker in Docker (DinD), which is a bit more tricky and the opinions there are split about whether to do it and when to do it: https://github.com/jpetazzo/dind

Of course, someone might also jump in and suggest that Docker is architecturally problematic (i don't care much, just want my containers to run, then again; i don't deal with untrusted code or any sort of multitenancy) and you should use Podman or another set of technologies, which is interesting advice but would necessitate other approaches.

In short, like with most technologies: Docker and OCI container in general get more messy as your requirements become more advanced. For the problems that they do solve easily (app packaging), they are pretty good, though!

Re:SELinux is unmanageable; just turn it off if it gets in y... by Koffiepoeder on Wednesday April 27, 2022 @10:57AM (#31180686)
One project in this space that looked quite promising to me is sysbox[0]. I've used them once for a gitlab runner set-up similar to what is described in their blog[1].

It's currently working great and I have not had any major crashes/incidents for at least the past 8 months.

[0]: https://github.com/nestybox/sysbox

[1]: https://blog.nestybox.com/2020/10/21/gitlab-dind.html

Re:SELinux is unmanageable; just turn it off if it gets in y... by johannes1234321 on Wednesday April 27, 2022 @04:15AM (#31177572)
Mounting the docker socket into a container works.

If it's advisable is another question, as that gives full control over all other containers (and likely more)

Re:SELinux is unmanageable; just turn it off if it gets in y... by staticassertion on Wednesday April 27, 2022 @09:03AM (#31179332)
Mounting the docker socket makes it trivial to escape to the host since you can just launch a privileged container or mount arbitrary files. Plus the daemon generally runs as root.

At that point you may want to just run it on the host, but basically you'd better trust whatever it is.

Re:SELinux is unmanageable; just turn it off if it gets in y... by gjulianm on Wednesday April 27, 2022 @06:00AM (#31178141)
I've had quite some problems setting up DPDK and other device drivers inside of containers. It looks like it should be easy, yes, but then reality hits you in the face.
Re:SELinux is unmanageable; just turn it off if it gets in y... by tpetry on Wednesday April 27, 2022 @01:44AM (#31176741)
And when everything is in docker you can use SELinux again: A docker container is not allowed to access the host system or access the filesystem of other containers. That‘s the default. SELinux protection without any weird problems.
Re:SELinux is unmanageable; just turn it off if it gets in y... by nigma1337 on Wednesday April 27, 2022 @05:16AM (#31177923)
As a completely new admin, could you elaborate on "be very careful with volume mounts"?

In the k8s env I run, the filesystem is backed by ceph, which creates persistent volumes that the different pods can claim. Is it just "be careful not to mount docker.sock"?

Re:SELinux is unmanageable; just turn it off if it gets in y... by goodpoint on Wednesday April 27, 2022 @06:37AM (#31178323)
> but containers aim to provide many of the same benefits that SELinux does

Absolutely not. They are not designed as security tools in the first place. Especially docker, with its huge attack surface.

You are confusing containers with sandboxes.

Furthermore they don't implement anything resembling RBAC.

Re:SELinux is unmanageable; just turn it off if it gets in y... by fsflover on Wednesday April 27, 2022 @03:47AM (#31177401)
> Put everything in a container, and learn how to run Docker or Podman (or k8s) in a secure way

Or just use Qubes OS: https://qubes-os.org.

Re:SELinux is unmanageable; just turn it off if it gets in y... by kkfx on Wednesday April 27, 2022 @02:35AM (#31176991)
Hum, as another admin... No thanks.

With IllumOS I can agree on zones, I can partially agree on lpar on AiX, I can accept GNU/Linux limits with cgroups. Enlarging the attack surface to follow the current wannabe Gurgle mania... No. Like no in the recent past to full-stack virtualization on x86 to enrich VMWare, buy big desktops sold as powerful servers just to play matryoshka doll for someone else business...

Of course, it's hard to satisfy hw "subdivision" vs sw subdivision, in the past we have tried the hw path with blades for the small side, infiniband and co for the large side and both proved to be not very scalable but the issue is in actual OS design and can only be solved changed that: An OS mush be a single application, with internal namespacing, networking. We have seen it in various past OSes. It's about time to make them again accepting that the IBM model is good only for IBM, witch means for selling stuff to people having no choice but buy or ignoring something better can be done.

Re:SELinux is unmanageable; just turn it off if it gets in y... by anonymousDan on Wednesday April 27, 2022 @03:16AM (#31177186)
Can you elaborate on the scalability problems with infiniband?
Re:SELinux is unmanageable; just turn it off if it gets in y... by touisteur on Wednesday April 27, 2022 @04:26AM (#31177641)
I'm guessing part of the problem infiniband switches get expensive AF when you're going for 32x100 or rack-level anything. And you're still bound to up to 200Gbit per link (and the cpu load that entails) or lower bandwidth bonded links, why is not as interesting as QPI.

Aside from purely guessing I'm interested in scalability pains war stories with infiniband too :-) as I'm looking into a 400GbE-everywhere datacenter build...

Re:SELinux is unmanageable; just turn it off if it gets in y... by kkfx on Wednesday April 27, 2022 @04:10AM (#31177551)
It's not a problem with infiniband but a problem of sw mutating needs vs actual hw assets: matching is hard. Hw cost money so anyone try to be moderately tight, looking at life expectancy and supposed sw changes in that timeframe, but hw and sw have different lifecycle. At a certain point in time sw infra change while hw is still the same, at another point in time available/current iron change but software on it remain the same.

In classic times that's just a matter of balancing both, carefully designing both, but in modern time developers just "produce code", operation is pushed aside, communications are constrained often by the policies and the result it's a mess => companies choose "the cloud" witch means outsource the issue to third parties. Those third parties count on the fact that even if anything change in the end a computer is always a computer so they can live on a changing world because if single companies have irregularly changing needs on average the rate of change is similar. Also on scale redundancy needs lower the costs and that's why we switch from classic big iron to desktop crap packed in racks. Now we start seeing more and more the limit of such model, and no solution is here.

Big iron is long lost, now way to expensive not much in absolute terms but in demand terms: try to sell a Power system, the customer look at specs and say "hu?! a couple of PCs from nearby grocery store are equally powerful!". Such iron modularity coming from classic mainframes (infiniband in the end is crylink changed a bit by SGI and others) is considered too expensive, on the other side of the spectrum small-board ARM super-blades tentative still results in fails.

Until we accept that hw and sw can't really be two separate world and both must be open to being able to interoperate on scale we will not find any really scalable solution.

Sw side it's not different: these days is the containers mania days because after many have suffered burn with full-stack virtualization on x86 they look for something with less overhead and equal design: hw-sw decoupled, possibility of run an infra you do not know buy pre-made images/containers from third parties who maintain them without needing to know your infra. The result again is an enormous amount of layers and giant attack surface no one really know how extended it is. Since coms are needed we punch holes here and there, and on the other side "safety features" arrive to compensate, making more complicatedness layers on complicatedness instead of admitting the basic issue: in sw terms our OSes are badly designed for current needs, they are a relic form a long lost past where they aren't even good but just cheaper alternatives to something better.

If we ever admit those errors probably we will be able to design modular iron and modern OSes marginalizing those issue, but so far no one want such a nightmarish adventure...

Re:SELinux is unmanageable; just turn it off if it gets in y... by rbanffy on Wednesday April 27, 2022 @11:00AM (#31180728)
> much easier to manage

I would say it's not necessarily easier to manage, but it's much easier to understand, because containers create natural borders between the different software running on the machine.

Re:SELinux is unmanageable; just turn it off if it gets in y... by mmis1000 on Wednesday April 27, 2022 @07:46AM (#31178721)
Docker actually comes with an apparmor config that disallows you to interact with any files outside of the container. It's not a so strong guarantee compares to inode based approach (selinix), but is still much better than don't have one.

And if you enables uid mapping, your permission in the host system is just as high as nobody if there isn't a kernel exploit happened somewhere.

But the fact it is nobody is also problematic, because dir mount will be almost alwyas read-only now.

Re:SELinux is unmanageable; just turn it off if it gets in y... by cpuguy83 on Wednesday April 27, 2022 @11:11AM (#31180876)
It comes with both an apparmor profile and an SELinux profile. What gets used depends on what's on the system... and I guess you need to actually set the flag on dockerd to enable SELinux.
Re:SELinux is unmanageable; just turn it off if it gets in y... by someguydave on Wednesday April 27, 2022 @01:41PM (#31183240)
By using containers you can multiply your security problems!

That is, it does nothing to address security problems latent to each container binary.