I believe my comments confused you, because I wrote about different things. My suggestion to use socat was not to have a better or more secure way to make the Docker socket available in containers.
The above statement is true in general. Accessing the Docker socket on the host from a container is a more special case. In a container you donāt have sudo usually, but even if you have, using that sudo would probably add logs to the auth log file in the container, so it wouldnāt help.
You donāt want to change the owner of the socket on the host, because there can be only one owner, and there is no guarantee that the group id of the ādockerā group in the container doesnāt belong to another group which should not have access to the socket, so when you need the socket in a container, you can have more problems than when you need it outside containers.
To answer the question, yes, you are right. If you have access to the Docker socket, it doesnāt matter if it is a unix socket or TCP socket. Depending on how security features like SELinux or AppArmor is set, you could do harm on the host, but for full root access, you need privileges that you donāt have by default. Of course someone with access to the socket can run a privileged container.
Yes, if you have no policy enforcement and you allow to do everything on the Docker API. Of course, if you can still mount the unix socket and have no problem with using the docker group, at least not all users would have access to the socket in the container. I already mentioned what the problem is with the docker group in containers.
The level of security risk also depends on your software architecture. If there is one process that needs access to the Docker socket, you can run it in a container that runs nothing else just the process that will manage containers and an API server that receives the requests and rejects what you donāt want to allow, donāt forward ports to it from the outside, allow access on a specific Docker network or share network namespace as I did in my examples if you use TCP sockets.
You could implement your way or use Open Policy Agent