Skip to content

Commit 138ad89

Browse files
authored
Merge pull request #768 from wking/optional-syscalls
config-linux: Make linux.seccomp.syscalls OPTIONAL
2 parents c6bff91 + 42984e8 commit 138ad89

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

config-linux.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,10 @@ The following parameters can be specified to setup seccomp:
610610
* `SCMP_ARCH_PARISC`
611611
* `SCMP_ARCH_PARISC64`
612612

613-
* **`syscalls`** *(array of objects, REQUIRED)* - match a syscall in seccomp.
613+
* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp.
614+
615+
While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries.
616+
For example, if `defaultAction` is `SCMP_ACT_KILL` and `syscalls` is empty or unset, the kernel will kill the container process on its first syscall.
614617

615618
Each entry has the following structure:
616619

schema/config-linux.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@
249249
"$ref": "defs-linux.json#/definitions/Syscall"
250250
}
251251
}
252-
}
252+
},
253+
"required": [
254+
"defaultAction"
255+
]
253256
},
254257
"sysctl": {
255258
"id": "https://opencontainers.org/schema/bundle/linux/sysctl",

specs-go/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ type WindowsNetworkResources struct {
484484
type LinuxSeccomp struct {
485485
DefaultAction LinuxSeccompAction `json:"defaultAction"`
486486
Architectures []Arch `json:"architectures,omitempty"`
487-
Syscalls []LinuxSyscall `json:"syscalls"`
487+
Syscalls []LinuxSyscall `json:"syscalls,omitempty"`
488488
}
489489

490490
// Arch used for additional architectures

0 commit comments

Comments
 (0)