Repository navigation
feat(sockforward): support private guest-owned UDS listeners - #316
Conversation
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
There was a problem hiding this comment.
🟡 Changes recommended
Reserved UID/GID values can silently leave ownership unchanged while the permission-aware RPC reports success.
1 open issue
2 files not reviewed
api/services/socketforward/v1/socketforward.pb.go: Generated fileapi/services/socketforward/v1/socketforward_ttrpc.pb.go: Generated file
What changed in this PR
Adds private, guest-owned UNIX socket forwarding across the shim and VM boundary.
Changes:
- Adds UID/GID mount options and a permission-aware RPC.
- Creates private listeners with ownership, rollback, and cleanup handling.
- Fixes relay watcher leaks and adds regression tests.
| File | Description |
|---|---|
| internal/vminit/socketforward/socketforward.go | Implements private listeners and cleanup. |
| internal/vminit/socketforward/socketforward_test.go | Tests permissions, compatibility, and rollback. |
| internal/shim/task/socketforward.go | Parses ownership options, selects RPC, and fixes watcher cleanup. |
| internal/shim/task/socketforward_test.go | Tests ownership options and relay completion. |
| api/services/socketforward/v1/socketforward.pb.go | Updates generated ownership fields. |
| api/services/socketforward/v1/socketforward_ttrpc.pb.go | Adds generated permission-aware RPC bindings. |
| api/proto/nerdbox/services/socketforward/v1/socketforward.proto | Defines ownership fields and RPC. |
| api/next.txtpb | Updates the API descriptor snapshot. |
Review effort: Balanced
4475e43 to
fe6d43e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Aliased RPC socket paths can bypass duplicate protection and disrupt an existing forward.
1 open issue
1 resolved since last review
2 files not reviewed
api/services/socketforward/v1/socketforward.pb.go: Generated fileapi/services/socketforward/v1/socketforward_ttrpc.pb.go: Generated file
Review effort: Balanced
fe6d43e to
0b08d28
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The capability test exceeds macOS Unix-socket path limits, breaking the macOS unit-test job.
1 open issue
1 resolved since last review
2 files not reviewed
api/services/socketforward/v1/socketforward.pb.go: Generated fileapi/services/system/v1/info.pb.go: Generated file
Review effort: Balanced
0b08d28 to
2640dd4
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Privileged socket publication warrants human security review, and the protobuf-copy issue remains unresolved.
1 open issue
1 resolved since last review
2 files not reviewed
api/services/socketforward/v1/socketforward.pb.go: Generated fileapi/services/system/v1/info.pb.go: Generated file
Review effort: Balanced
2640dd4 to
ff9bd8f
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in ownership handling, compatibility checks, or listener cleanup.
No open issues 🎉
1 resolved since last review
2 files not reviewed
api/services/socketforward/v1/socketforward.pb.go: Generated fileapi/services/system/v1/info.pb.go: Generated file
Review effort: Balanced
ff9bd8f to
6ffa472
Compare
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
6ffa472 to
fcc4de1
Compare


Why
A container can forward a host Unix socket into a Nerdbox VM, but a non-root process may not be able to connect to the listener created inside the VM. This prevents workloads such as SSH-agent clients from using the forward without privileged startup steps.
What this changes
udsmount, callers can opt in with numericuidandgidoptions. The shim requests mode0600and the guest sets the socket's owner and permissions before publishing the listener and starting the container. The guest rejects unsupported modes or reserved ownership values before binding any sockets.0and retain the existing listener behavior. The shim and guest versions are coupled; this does not add aSystem.Infocapability probe for older guests.rename. Duplicate-listener preflight, rollback, and identity-aware cleanup protect active or replaced socket paths.Validation