Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hepto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hepto
Commits
f2ac2ac8
Commit
f2ac2ac8
authored
2 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
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
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/selfcontain/defaults.go
+78
-3
78 additions, 3 deletions
pkg/selfcontain/defaults.go
with
78 additions
and
3 deletions
pkg/selfcontain/defaults.go
+
78
−
3
View file @
f2ac2ac8
...
@@ -29,6 +29,34 @@ var allowedDevices = []*devices.Device{
...
@@ -29,6 +29,34 @@ var allowedDevices = []*devices.Device{
Allow
:
true
,
Allow
:
true
,
},
},
},
},
{
Path
:
"/dev/zero"
,
FileMode
:
0
o666
,
Uid
:
0
,
Gid
:
0
,
Rule
:
devices
.
Rule
{
Type
:
devices
.
CharDevice
,
Major
:
1
,
Minor
:
5
,
Permissions
:
"rwm"
,
Allow
:
true
,
},
},
{
Path
:
"/dev/urandom"
,
FileMode
:
0
o666
,
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
:
0
o666
,
FileMode
:
0
o666
,
...
@@ -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
:
0
o666
,
FileMode
:
0
o666
,
...
@@ -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
:
0
o666
,
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
:
0
o666
,
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment