Skip to content

Commit 63d3d27

Browse files
committed
Add Apparmor, Selinux and Seccomp
Signed-off-by: Mrunal Patel <[email protected]>
1 parent af36d74 commit 63d3d27

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

spec_linux.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ type Linux struct {
3030
Capabilities []string `json:"capabilities"`
3131
// Devices are a list of device nodes that are created and enabled for the container
3232
Devices []Device `json:"devices"`
33+
// ApparmorProfile specified the apparmor profile for the container.
34+
ApparmorProfile string `json:"apparmorProfile"`
35+
// SelinuxProcessLabel specifies the selinux context that the container process is run as.
36+
SelinuxProcessLabel string `json:"selinuxProcessLabel"`
37+
// Seccomp specifies the seccomp security settings for the container.
38+
Seccomp Seccomp `json:"seccomp"`
3339
// RootfsPropagation is the rootfs mount propagation mode for the container
3440
RootfsPropagation string `json:"rootfsPropagation"`
3541
}
@@ -178,3 +184,30 @@ type Device struct {
178184
// Gid of the device.
179185
GID uint32 `json:"gid"`
180186
}
187+
188+
// Seccomp represents syscall restrictions
189+
type Seccomp struct {
190+
DefaultAction Action `json:"defaultAction"`
191+
Syscalls []*Syscall `json:"syscalls"`
192+
}
193+
194+
// Action taken upon Seccomp rule match
195+
type Action string
196+
197+
// Operator used to match syscall arguments in Seccomp
198+
type Operator string
199+
200+
// Arg used for matching specific syscall arguments in Seccomp
201+
type Arg struct {
202+
Index uint `json:"index"`
203+
Value uint64 `json:"value"`
204+
ValueTwo uint64 `json:"valueTwo"`
205+
Op Operator `json:"op"`
206+
}
207+
208+
// Syscall is used to match a syscall in Seccomp
209+
type Syscall struct {
210+
Name string `json:"name"`
211+
Action Action `json:"action"`
212+
Args []*Arg `json:"args"`
213+
}

0 commit comments

Comments
 (0)