Does "containerized socket activation" improve security? #13390
-
The live video streaming and chat server software owncast makes use of two listening TCP sockets (one for the web server and one for RTMP). Using socket activation for multiple different sockets requires the use of the environment variable Unfortunately the feature request was closed with the motivation that there is no need for the requested feature. This was one of the rationale arguments I provided in the feature request: If you have a containerized server that takes requests from the network via a listening TCP port, adding socket activation support opens up the possibility to run the container with the --network=none command-line option. This will restrict the container from accessing the network except via the TCP socket it has been passed by systemd via Podman. Outgoing connections would not be allowed. Running the container with --network=none improves security. I'm not sure if this is relevant in the case of owncast though. (I hope that was a correct description of how it works) Has anyone given any thoughts to how "containerized socket activation" relates to security? Any pros and cons? A side-note regarding SELinux: By the way, what is a suitable name for the functionality? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 25 replies
-
I like the way you talk about this from a security point of view. The --network=none with socket activation seems like a great idea. I could see this being useful with a display only webserver for example. Where you could allow incoming connections not not allow connections back out. But this would only work with TCP connections. |
Beta Was this translation helpful? Give feedback.
-
If you could just give a few examples of each use case, we could write a cool blog on it. |
Beta Was this translation helpful? Give feedback.
-
If you have examples of each, I will write up the Blog. |
Beta Was this translation helpful? Give feedback.
-
Yes a demo showing a leaked socket working and then exec into the container and showing that you can not connect out using curl or point ... |
Beta Was this translation helpful? Give feedback.
-
Excellent, now time to throw together a blog on running containers more securely by turning off network access, but using systemd socket activation to allow limited network connectivity. |
Beta Was this translation helpful? Give feedback.
-
I created another example Yes, I agree, time for a blog. Tell me if you would like help. |
Beta Was this translation helpful? Give feedback.
-
Edit 1
I opened up a new discussion thread about the network performance Edit 2: fixed link 2 September 2024Does "containerized socket activation" improve network performance? |
Beta Was this translation helpful? Give feedback.
I like the way you talk about this from a security point of view. The --network=none with socket activation seems like a great idea.
I could see this being useful with a display only webserver for example. Where you could allow incoming connections not not allow connections back out. But this would only work with TCP connections.