Skip to content

Commit

Permalink
update network admin perms
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Dec 9, 2024
1 parent 0c06a64 commit fd7a2c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 8 additions & 4 deletions integration/dockertestutil/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ func DockerAllowLocalIPv6(config *docker.HostConfig) {
}

func DockerAllowNetworkAdministration(config *docker.HostConfig) {
// Needed since containerd (1.7.24)
// https://github.com/tailscale/tailscale/issues/14256
// https://github.com/opencontainers/runc/commit/2ce40b6ad72b4bd4391380cafc5ef1bad1fa0b31
config.CapAdd = append(config.CapAdd, "NET_ADMIN")
config.Mounts = append(config.Mounts, docker.HostMount{
Type: "bind",
Source: "/dev/net/tun",
Target: "/dev/net/tun",
config.CapAdd = append(config.CapAdd, "NET_RAW")
config.Devices = append(config.Devices, docker.Device{
PathOnHost: "/dev/net/tun",
PathInContainer: "/dev/net/tun",
CgroupPermissions: "rwm",
})
}
8 changes: 0 additions & 8 deletions integration/tsic/tsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,6 @@ func New(
Entrypoint: tsic.withEntrypoint,
ExtraHosts: tsic.withExtraHosts,
Env: []string{},

// Needed since containerd (1.7.24)
// https://github.com/tailscale/tailscale/issues/14256
// https://github.com/opencontainers/runc/commit/2ce40b6ad72b4bd4391380cafc5ef1bad1fa0b31
CapAdd: []string{"NET_ADMIN", "NET_RAW"},
Mounts: []string{
"/dev/net/tun:/dev/net/tun",
},
}

if tsic.withWebsocketDERP {
Expand Down

0 comments on commit fd7a2c3

Please sign in to comment.