Skip to content

[Feature suggestion] xsocket protocol support (dealing with network namespaces, fwmarks and VRFs without elevated privileges). #559

@przemyslaw0

Description

@przemyslaw0

Remember, it's just a suggestion.

@folbricht

Dealing with network namespaces using setns() requires CAP_SYS_ADMIN, it could be dangerous if the program has unknown bugs and vulnerabilities, that's why an alternative approach is needed.

There is a socket library called xsocket, it is a socket library that can use a cross-netns fashion to avoid requiring elevated privileges such as CAP_SYS_ADMIN, the only need of a root access is running the library server itself, which is by far more secure and trusty as it a very small program and have a minimal attack surface area:

ip netns exec foo sudo -u bar -- xsocket-server /tmp/xs-socket

nsenter -t 1234 -n -- sudo -u bar -- xsocket-server /tmp/xs-socket

I know that is a little known project, but it's promising. The only security notes on using this protocol is adjusting the user/group/chmod permissions and ACLs on the xsocket-server Unix sockets.

I'm sending an attachment that contains two reference implementations of how to implement xsocket protocol in Go (don't laugh, it's AI):

xsocket_pf.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions