this post was submitted on 26 Jun 2026
16 points (100.0% liked)

Selfhosted

60177 readers
544 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.

Resources:

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

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

I changed my docker installation to rootless. I now installed Patchmon on the host and I wanted to monitor and update my Docker images as well. But Patchmon requires docker.sock to be in /var/run. My current docker.sock is of course in /run/user/{userid}. Are there any security risks, and if so what are they, to making a symlink to have the docker.sock in /var/run as well? The /run/user/{userid}/docker.sock is owned by the user running Docker. The symlink is owned by root because of the privileges needed for /var/run.

I don't have enough knowledge to be doing these kind of things, but I just like to tinker and I want to know how insecure this setup could be.

you are viewing a single comment's thread
view the rest of the comments
[–] groet@feddit.org 5 points 15 hours ago* (last edited 15 hours ago) (1 children)
  1. is there a reason you don't use podman instead of rootless docker?
  2. can you run patchmon inside of docker and mount the socket to the original path inside of the container?
  3. the symlink has the file permissions of the file it points to. If the socket is owned by a user, so will the symlink, even if you used root/sudo to create the link. (technically the symlink will be owned by root, but the permissions on a symlink are ignored and the permission of the target are used)
  4. as long as you don't change any permissions on /var/run or on the docker.sock to be more permissive than they are now, there is functionally no difference in security
  5. If you or someone else on the system tries to run docker with a different user/root, the symlink will likely cause issues
[–] Guadin@k.fe.derate.me 1 points 4 hours ago (1 children)

Thanks for the answer.

  1. Not really. I just never looked into podman and knew Docker already (as in, I can create container with docker compose).
  2. Running Patchmon in Docker does not work, it's the patchmon-agent to update the host running docker. So it needs access to apt on the host.
  3. Perfect, it shows as root but the user owns the original .sock.
  4. Will not do.
  5. Didn't think of that. Not a problem now but it could be in the feature.
[–] groet@feddit.org 2 points 4 hours ago

Podman is pretty mutch a drop in replacement for docker but it runs in user context instead if root.

All docker commands work with podman by just replacing the name including podman compose.

(You do have to specify docker.io as a repository if you want to pull images from docker hub but that is literally the only difference In usage I ever noticed)