this post was submitted on 15 Mar 2025
5 points (100.0% liked)

Selfhosted

61189 readers
276 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

From what I have seen, rootless podman seems to take more effort (even if marginal) than rootful one. I want to make a more informed decision for the containers, so I would like to ask.

  1. What is a rootless podman good for? How much does it help in terms of security, and does it have other benefits?
  2. One of the benefits commonly mentioned is for when container is breached. Then, running container on sudo-capable user would give no security benefits. Does it mean I should run podman services on a non-privileged user?

Thank you!

you are viewing a single comment's thread
view the rest of the comments
[–] cmgvd3lw@discuss.tchncs.de 2 points 1 year ago (10 children)

One of the main advantage of podman is that, it respects the firewall rules. Docker don't do that. Also having rootless podman means if somehow the container went rogue, it cannot have access to your root directory and perform malicious actions.

Also podman is a drop in replacement for docker. It does not need much configurations to setup. If you need compose, you might need to install podman-compose as well.

[–] someonesmall@lemmy.ml 0 points 1 year ago (2 children)

How would a rogue container be able to access the root directory of the host? Wouldn't it just be able to access the data on the docker volumes? Thank you.

In an ideal world, sure, but all software has bugs (example vulnerabilities here). Proper security design doesn't ask "how can X happen?" but "what if X happens?" If you break out of a docker container, you have root access to the system because the docker daemon runs as root.

With podman, there is no root docker daemon, so you'd also need privilege escalation in addition to breaking out of the container.

[–] cmgvd3lw@discuss.tchncs.de 0 points 1 year ago* (last edited 1 year ago) (1 children)

~~With root permission you can do chroot.~~

Edit, I did some digging and found that its not the normal files that they can access but can modify kernel parameters and can mount devices and access their files etc. If you want to learn more check https://stackoverflow.com/questions/36425230/privileged-containers-and-capabilities

[–] someonesmall@lemmy.ml 0 points 1 year ago (1 children)

Can you provide the required arguments for chroot? I've just opened the bash shell of a running container (docker exec -it mycontainer bash) and tried to "break out" using "chroot /". I can't access any files of the host.

[–] cmgvd3lw@discuss.tchncs.de 0 points 1 year ago (1 children)
[–] someonesmall@lemmy.ml 1 points 1 year ago

Thank you, but this only applies to priviledged containers (which are normally not used and should not be used)

load more comments (7 replies)