@@ -34,112 +34,13 @@ type ExportOptions struct {
34
34
func New () Generator {
35
35
spec := rspec.Spec {
36
36
Version : rspec .Version ,
37
- Root : rspec.Root {
38
- Path : "" ,
39
- Readonly : false ,
40
- },
41
37
Process : rspec.Process {
42
- Terminal : false ,
43
- User : rspec.User {},
38
+ User : rspec.User {},
44
39
Args : []string {
45
40
"sh" ,
46
41
},
47
- Env : []string {
48
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ,
49
- "TERM=xterm" ,
50
- },
51
42
Cwd : "/" ,
52
- Capabilities : & rspec.LinuxCapabilities {
53
- Bounding : []string {
54
- "CAP_CHOWN" ,
55
- "CAP_DAC_OVERRIDE" ,
56
- "CAP_FSETID" ,
57
- "CAP_FOWNER" ,
58
- "CAP_MKNOD" ,
59
- "CAP_NET_RAW" ,
60
- "CAP_SETGID" ,
61
- "CAP_SETUID" ,
62
- "CAP_SETFCAP" ,
63
- "CAP_SETPCAP" ,
64
- "CAP_NET_BIND_SERVICE" ,
65
- "CAP_SYS_CHROOT" ,
66
- "CAP_KILL" ,
67
- "CAP_AUDIT_WRITE" ,
68
- },
69
- Permitted : []string {
70
- "CAP_CHOWN" ,
71
- "CAP_DAC_OVERRIDE" ,
72
- "CAP_FSETID" ,
73
- "CAP_FOWNER" ,
74
- "CAP_MKNOD" ,
75
- "CAP_NET_RAW" ,
76
- "CAP_SETGID" ,
77
- "CAP_SETUID" ,
78
- "CAP_SETFCAP" ,
79
- "CAP_SETPCAP" ,
80
- "CAP_NET_BIND_SERVICE" ,
81
- "CAP_SYS_CHROOT" ,
82
- "CAP_KILL" ,
83
- "CAP_AUDIT_WRITE" ,
84
- },
85
- Inheritable : []string {
86
- "CAP_CHOWN" ,
87
- "CAP_DAC_OVERRIDE" ,
88
- "CAP_FSETID" ,
89
- "CAP_FOWNER" ,
90
- "CAP_MKNOD" ,
91
- "CAP_NET_RAW" ,
92
- "CAP_SETGID" ,
93
- "CAP_SETUID" ,
94
- "CAP_SETFCAP" ,
95
- "CAP_SETPCAP" ,
96
- "CAP_NET_BIND_SERVICE" ,
97
- "CAP_SYS_CHROOT" ,
98
- "CAP_KILL" ,
99
- "CAP_AUDIT_WRITE" ,
100
- },
101
- Effective : []string {
102
- "CAP_CHOWN" ,
103
- "CAP_DAC_OVERRIDE" ,
104
- "CAP_FSETID" ,
105
- "CAP_FOWNER" ,
106
- "CAP_MKNOD" ,
107
- "CAP_NET_RAW" ,
108
- "CAP_SETGID" ,
109
- "CAP_SETUID" ,
110
- "CAP_SETFCAP" ,
111
- "CAP_SETPCAP" ,
112
- "CAP_NET_BIND_SERVICE" ,
113
- "CAP_SYS_CHROOT" ,
114
- "CAP_KILL" ,
115
- "CAP_AUDIT_WRITE" ,
116
- },
117
- Ambient : []string {
118
- "CAP_CHOWN" ,
119
- "CAP_DAC_OVERRIDE" ,
120
- "CAP_FSETID" ,
121
- "CAP_FOWNER" ,
122
- "CAP_MKNOD" ,
123
- "CAP_NET_RAW" ,
124
- "CAP_SETGID" ,
125
- "CAP_SETUID" ,
126
- "CAP_SETFCAP" ,
127
- "CAP_SETPCAP" ,
128
- "CAP_NET_BIND_SERVICE" ,
129
- "CAP_SYS_CHROOT" ,
130
- "CAP_KILL" ,
131
- "CAP_AUDIT_WRITE" ,
132
- },
133
- },
134
- Rlimits : []rspec.LinuxRlimit {
135
- {
136
- Type : "RLIMIT_NOFILE" ,
137
- Hard : uint64 (1024 ),
138
- Soft : uint64 (1024 ),
139
- },
140
- },
141
43
},
142
- Hostname : "mrsdalloway" ,
143
44
Mounts : []rspec.Mount {
144
45
{
145
46
Destination : "/proc" ,
@@ -157,57 +58,22 @@ func New() Generator {
157
58
Destination : "/dev/pts" ,
158
59
Type : "devpts" ,
159
60
Source : "devpts" ,
160
- Options : []string {"nosuid" , "noexec" , "newinstance" , "ptmxmode=0666" , "mode=0620" , "gid=5" },
61
+ Options : []string {"nosuid" , "noexec" , "newinstance" , "ptmxmode=0666" , "mode=0620" },
161
62
},
162
63
{
163
64
Destination : "/dev/shm" ,
164
65
Type : "tmpfs" ,
165
66
Source : "shm" ,
166
67
Options : []string {"nosuid" , "noexec" , "nodev" , "mode=1777" , "size=65536k" },
167
68
},
168
- {
169
- Destination : "/dev/mqueue" ,
170
- Type : "mqueue" ,
171
- Source : "mqueue" ,
172
- Options : []string {"nosuid" , "noexec" , "nodev" },
173
- },
174
69
{
175
70
Destination : "/sys" ,
176
71
Type : "sysfs" ,
177
72
Source : "sysfs" ,
178
73
Options : []string {"nosuid" , "noexec" , "nodev" , "ro" },
179
74
},
180
75
},
181
- Linux : & rspec.Linux {
182
- Resources : & rspec.LinuxResources {
183
- Devices : []rspec.LinuxDeviceCgroup {
184
- {
185
- Allow : false ,
186
- Access : "rwm" ,
187
- },
188
- },
189
- },
190
- Namespaces : []rspec.LinuxNamespace {
191
- {
192
- Type : "pid" ,
193
- },
194
- {
195
- Type : "network" ,
196
- },
197
- {
198
- Type : "ipc" ,
199
- },
200
- {
201
- Type : "uts" ,
202
- },
203
- {
204
- Type : "mount" ,
205
- },
206
- },
207
- Devices : []rspec.LinuxDevice {},
208
- },
209
76
}
210
- spec .Linux .Seccomp = seccomp .DefaultProfile (& spec )
211
77
return Generator {
212
78
spec : & spec ,
213
79
}
0 commit comments