diff --git a/config-linux.md b/config-linux.md index e3f79bdb8..6c5366e7b 100644 --- a/config-linux.md +++ b/config-linux.md @@ -538,12 +538,17 @@ Operator Constants: "seccomp": { "defaultAction": "SCMP_ACT_ALLOW", "architectures": [ - "SCMP_ARCH_X86" + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" ], "syscalls": [ { - "name": "getcwd", - "action": "SCMP_ACT_ERRNO" + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO", + "comment": "stop exploit x" } ] } diff --git a/config.md b/config.md index 8b6bdd314..9f155e043 100644 --- a/config.md +++ b/config.md @@ -710,12 +710,17 @@ Here is a full example `config.json` for reference. "seccomp": { "defaultAction": "SCMP_ACT_ALLOW", "architectures": [ - "SCMP_ARCH_X86" + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" ], "syscalls": [ { - "name": "getcwd", - "action": "SCMP_ACT_ERRNO" + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO", + "comment": "stop exploit x" } ] }, diff --git a/schema/defs-linux.json b/schema/defs-linux.json index 0cecb14a0..75ab2b3b1 100644 --- a/schema/defs-linux.json +++ b/schema/defs-linux.json @@ -63,8 +63,10 @@ "Syscall": { "type": "object", "properties": { - "name": { - "type": "string" + "names": { + "type": [ + "string" + ] }, "action": { "$ref": "#/definitions/SeccompAction" diff --git a/specs-go/config.go b/specs-go/config.go index 1660b776f..0a2600fe0 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -365,13 +365,6 @@ type LinuxDeviceCgroup struct { Access string `json:"access,omitempty"` } -// LinuxSeccomp represents syscall restrictions -type LinuxSeccomp struct { - DefaultAction LinuxSeccompAction `json:"defaultAction"` - Architectures []Arch `json:"architectures"` - Syscalls []LinuxSyscall `json:"syscalls,omitempty"` -} - // Solaris contains platform specific configuration for Solaris application containers. type Solaris struct { // SMF FMRI which should go "online" before we start the container process. @@ -469,6 +462,13 @@ type WindowsNetworkResources struct { EgressBandwidth *uint64 `json:"egressBandwidth,omitempty"` } +// LinuxSeccomp represents syscall restrictions +type LinuxSeccomp struct { + DefaultAction LinuxSeccompAction `json:"defaultAction"` + Architectures []Arch `json:"architectures,omitempty"` + Syscalls []LinuxSyscall `json:"syscalls"` +} + // Arch used for additional architectures type Arch string @@ -529,7 +529,8 @@ type LinuxSeccompArg struct { // LinuxSyscall is used to match a syscall in Seccomp type LinuxSyscall struct { - Name string `json:"name"` - Action LinuxSeccompAction `json:"action"` - Args []LinuxSeccompArg `json:"args,omitempty"` + Names []string `json:"names"` + Action LinuxSeccompAction `json:"action"` + Args []LinuxSeccompArg `json:"args"` + Comment string `json:"comment"` }