Skip to content
Snippets Groups Projects
Commit f2ac2ac8 authored by kaiyou's avatar kaiyou
Browse files

Add required permissions and capabilities for runc

parent ef463c8f
No related branches found
No related tags found
No related merge requests found
Pipeline #22434 failed
...@@ -29,6 +29,34 @@ var allowedDevices = []*devices.Device{ ...@@ -29,6 +29,34 @@ var allowedDevices = []*devices.Device{
Allow: true, Allow: true,
}, },
}, },
{
Path: "/dev/zero",
FileMode: 0o666,
Uid: 0,
Gid: 0,
Rule: devices.Rule{
Type: devices.CharDevice,
Major: 1,
Minor: 5,
Permissions: "rwm",
Allow: true,
},
},
{
Path: "/dev/urandom",
FileMode: 0o666,
Uid: 0,
Gid: 0,
Rule: devices.Rule{
Type: devices.CharDevice,
Major: 1,
Minor: 9,
Permissions: "rwm",
Allow: true,
},
},
// Required by kubelet and other kubernetes related downstream
// processes
{ {
Path: "/dev/kmsg", Path: "/dev/kmsg",
FileMode: 0o666, FileMode: 0o666,
...@@ -42,6 +70,8 @@ var allowedDevices = []*devices.Device{ ...@@ -42,6 +70,8 @@ var allowedDevices = []*devices.Device{
Allow: true, Allow: true,
}, },
}, },
// Required by many downstream processes, including anything
// like an http client which does tls
{ {
Path: "/dev/random", Path: "/dev/random",
FileMode: 0o666, FileMode: 0o666,
...@@ -55,6 +85,34 @@ var allowedDevices = []*devices.Device{ ...@@ -55,6 +85,34 @@ var allowedDevices = []*devices.Device{
Allow: true, Allow: true,
}, },
}, },
// Required by downstream runc for mounting
{
Path: "/dev/full",
FileMode: 0o666,
Uid: 0,
Gid: 0,
Rule: devices.Rule{
Type: devices.CharDevice,
Major: 1,
Minor: 7,
Permissions: "rw",
Allow: true,
},
},
// Required by downstream containers for mounting a tty
{
Path: "/dev/tty",
FileMode: 0o666,
Uid: 0,
Gid: 0,
Rule: devices.Rule{
Type: devices.CharDevice,
Major: 5,
Minor: 0,
Permissions: "rw",
Allow: true,
},
},
} }
// These path will be mounted as a default base inside the container // These path will be mounted as a default base inside the container
...@@ -114,9 +172,26 @@ var capabilities = []string{ ...@@ -114,9 +172,26 @@ var capabilities = []string{
"CAP_NET_ADMIN", "CAP_NET_ADMIN",
// Required for raw sockets, including ICMP // Required for raw sockets, including ICMP
"CAP_NET_RAW", "CAP_NET_RAW",
// Required for unpacking archives and images // Required for unpacking archives and images
"CAP_CHOWN", "CAP_CHOWN",
"CAP_DAC_OVERRIDE", "CAP_DAC_OVERRIDE",
// Required for adjusting oom score by runc
"CAP_SYS_RESOURCE",
// Required for setting uid and gid by runc
"CAP_SETUID",
"CAP_SETGID",
// Added temporarily to accomodate runc capabilities
"CAP_FOWNER",
"CAP_FSETID",
"CAP_KILL",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_NET_RAW",
"CAP_SYS_CHROOT",
"CAP_MKNOD",
"CAP_AUDIT_WRITE",
"CAP_SETFCAP",
"CAP_FSETID",
} }
// These networks will be setup as a default base inside the container // These networks will be setup as a default base inside the container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment