Skip to content

Commit 52e2591

Browse files
authored
Merge pull request #1018 from giuseppe/seccomp-flags
config-linux: support seccomp flags
2 parents 4f2ab15 + d1ef109 commit 52e2591

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

config-linux.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,14 @@ The following parameters can be specified to set up seccomp:
586586
* `SCMP_ARCH_PARISC`
587587
* `SCMP_ARCH_PARISC64`
588588

589+
* **`flags`** *(array of strings, OPTIONAL)* - list of flags to use with seccomp(2).
590+
591+
A valid list of constants is shown below.
592+
593+
* `SECCOMP_FILTER_FLAG_TSYNC`
594+
* `SECCOMP_FILTER_FLAG_LOG`
595+
* `SECCOMP_FILTER_FLAG_SPEC_ALLOW`
596+
589597
* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp.
590598

591599
While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries.

schema/config-linux.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@
197197
"defaultAction": {
198198
"$ref": "defs-linux.json#/definitions/SeccompAction"
199199
},
200+
"flags": {
201+
"type": "array",
202+
"items": {
203+
"$ref": "defs-linux.json#/definitions/SeccompFlag"
204+
}
205+
},
200206
"architectures": {
201207
"type": "array",
202208
"items": {

schema/defs-linux.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
"SCMP_ACT_ALLOW"
4343
]
4444
},
45+
"SeccompFlag": {
46+
"type": "string",
47+
"enum": [
48+
"SECCOMP_FILTER_FLAG_TSYNC",
49+
"SECCOMP_FILTER_FLAG_LOG",
50+
"SECCOMP_FILTER_FLAG_SPEC_ALLOW"
51+
]
52+
},
4553
"SeccompOperators": {
4654
"type": "string",
4755
"enum": [

specs-go/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,16 @@ type VMImage struct {
556556
type LinuxSeccomp struct {
557557
DefaultAction LinuxSeccompAction `json:"defaultAction"`
558558
Architectures []Arch `json:"architectures,omitempty"`
559+
Flags []LinuxSeccompFlag `json:"flags,omitempty"`
559560
Syscalls []LinuxSyscall `json:"syscalls,omitempty"`
560561
}
561562

562563
// Arch used for additional architectures
563564
type Arch string
564565

566+
// LinuxSeccompFlag is a flag to pass to seccomp(2).
567+
type LinuxSeccompFlag string
568+
565569
// Additional architectures permitted to be used for system calls
566570
// By default only the native architecture of the kernel is permitted
567571
const (

0 commit comments

Comments
 (0)