News for hackers. Stuff that matters.
Re:Podman Desktop: A Free OSS Alternative to Docker Desktop by doublepg23 on Wednesday November 09, 2022 @11:41PM (#33542296)
Running into edge issues and always trying to figure out if it was my container, Podman, or SELinux is making me very close to installing regular docker.
Re:Podman Desktop: A Free OSS Alternative to Docker Desktop by bongobingo1 on Thursday November 10, 2022 @03:55AM (#33543915)
I want to love SELinux, sounds great, I can see the real value in it. Tried to deploy some containers on an SE system and it would block everything. Ok expected, it actually has great tools for discovering, suggesting and creating rules to poke holes where needed, but it only suggests those things post-facto.

So basically you're left deploying a container and waiting for something to break, then inspecting SE logs and patching rules in (and folding all that back into your ansible or whatever).

Maybe this is OK if its your application and you can dump it on a staging environment and push it through your 100% coverage end to end test suite to capture all requirements, but if its a third party - or maybe your test coverage isn't quite where you want it to be - you're basically walking out on the rope bridge blind.

Not sure there is really a way to solve that. Perhaps it there was a `pledge`/`unveil` like system where all requirements can be discovered up front... Otherwise it felt like yours stuck running in SEDisable or SEPermissive for months collecting data (after every deploy).

Maybe I just missed an obvious route to disable swaths of SELinux for rootless containers - where it probably doesn't have as much of an application.

Sorry Dan Walsh :(

Re:Podman Desktop: A Free OSS Alternative to Docker Desktop by yrro on Thursday November 10, 2022 @04:37AM (#33544206)
> Maybe I just missed an obvious route to disable swaths of SELinux for rootless containers

Yeah you can put container_t into permissive mode:

# semanage permissive -a container_t

AVC denials will still be logged but the operations won't be denied.

Re:Podman Desktop: A Free OSS Alternative to Docker Desktop by bongobingo1 on Thursday November 10, 2022 @04:45AM (#33544275)
It sounds like podman containers should automatically get that label so I'll give it another look, thanks!
Re:Podman Desktop: A Free OSS Alternative to Docker Desktop by yrro on Thursday November 10, 2022 @04:53AM (#33544343)
Yeah, use ps -Z PID (from outside of a container) to check its label.

Some other useful sources of info - the container_selinux man page tells you about container_t. And an index of Dan Walsh's blog posts about containers & SELinux can be found in the README of <https://github.com/containers/container-selinux>.

And of course the RHEL documentation for creatign custom SELinux policies that inherit from container_t (for instance, I use it to allow processes within a container to read their certificates out of /etc/pki/tls which is normally forbidden. It's documented here: https://access.redhat.com/documentation/en-us/red_hat_enterp...

Re:Podman Desktop: A Free OSS Alternative to Docker Desktop by spinachsalad on Monday November 14, 2022 @12:24PM (#33597513)
> Maybe I just missed an obvious route to disable swaths of SELinux for rootless containers - where it probably doesn't have as much of an application.

  podman run --security-opt label=disable
https://github.com/containers/podman/blob/main/troubleshooti...

  Note: Labeling can be disabled for all containers by setting label=false in the containers.conf(5) file.
https://docs.podman.io/en/latest/markdown/podman-run.1.html#...

But more secure way would be to add ":z" or ":Z" to volume and podman will auto-relabel source dir. Finally you can use nuclear option: "--privileged". It's still more secure than docker's one because you are limited by your user's capabilities.