- is there a reason you don't use podman instead of rootless docker?
- can you run patchmon inside of docker and mount the socket to the original path inside of the container?
- 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)
- as long as you don't change any permissions on
/var/runor on thedocker.sockto be more permissive than they are now, there is functionally no difference in security - If you or someone else on the system tries to run docker with a different user/root, the symlink will likely cause issues
Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam.
-
Posts here are to be centered around self-hosting. Please ensure it is clear in your post how it relates to self-hosting.
-
Don't duplicate the full text of your blog or git here. Just post the link for folks to click.
-
Submission headline should match the article title.
-
No trolling.
-
Promotion posts require your active participation in selfhosting or related communities, or the post will be removed. No more than 10% of your posts or comments may be self-promotional, or your post will be removed. F/LOSS Exception: If your post is about a project that is completely open source & can be self-hosted in full without payment, and your account is at least 30 days old, your post is exempt from this rule as long as you continue to engage in comments.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
I'm not fully understanding here, are you saying that the symlink is root because root is required to access /var/run or that its root because its required by patchmon.
If its root because the rest of the /var/run is root, is it not on the table to just chown the /var/run/docker.sock symlink to be the userid? since I would assume that patchmon would be running as the docker user anyway since you are running in a rootless environment? I might be misunderstanding.
As long as your permissions to the symlink are in line with the permissions on the original sock, I wouldn't expect there would be too much risk there. Of course a malicious vector /could/ see that a /var/run/docker.sock exists and try to manipulate it, but, since docker itself isn't root which means that user executing the symlink isn't root, I don't think it would allow for escalation.
Does Patchmon not have a setting to look for the Docker socket in a different location?
I could be wrong but I don't think there's any security issues making a symlink to a socket, since permissions/ACLs on the socket would still apply.
No unfortunately they haven't implemented the option to point to a different docker.sock.