Skip to content

sandbox: support action-local listeners on low ports #55

Open

Description

@fionera

Actions run in private network namespaces but retain the kernel default net.ipv4.ip_unprivileged_port_start=1024. A tool binding an action-local HTTP listener to 127.0.0.1:80 therefore fails with EACCES, even though it cannot conflict with the host or another action.

A minimal Go test inside an action is:

func TestActionLocalHTTPListener(t *testing.T) {
    listener, err := net.Listen("tcp", "127.0.0.1:80")
    if err != nil { t.Fatal(err) }
    defer listener.Close()
}

A native REAPI probe using a static busybox HTTP server reproduced httpd: bind: Permission denied; changing only the action-local sysctl to zero made the same probe pass.

Proposed fix: after mounting /proc in the action's network namespace, before dropping privileges, write 0\n to /proc/sys/net/ipv4/ip_unprivileged_port_start. This avoids giving the action additional capabilities or changing the host setting. It needs guest /proc/sys support, already proposed in #45.

The local implementation and Linux VM probe passed. The default policy and macOS VM path still need upstream review/validation; this issue keeps that executor-specific decision out of downstream build rules.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions