Skip to content

Commit bba0885

Browse files
committed
Enable SECCOMP_FILTER_FLAG_LOG and SECCOMP_FILTER_FLAG_SPEC_ALLOW per default
We now enable both flags for the default seccomp profile. Signed-off-by: Sascha Grunert <[email protected]>
1 parent 468d7e6 commit bba0885

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

pkg/seccomp/default_linux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func DefaultProfile() *Seccomp {
4747
enosys := uint(unix.ENOSYS)
4848
eperm := uint(unix.EPERM)
4949

50+
flags := []string{SeccompFilterFlagSpecALlow}
51+
5052
syscalls := []*Syscall{
5153
{
5254
Names: []string{
@@ -882,5 +884,6 @@ func DefaultProfile() *Seccomp {
882884
DefaultErrnoRet: &enosys,
883885
ArchMap: arches(),
884886
Syscalls: syscalls,
887+
Flags: flags,
885888
}
886889
}

pkg/seccomp/seccomp.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,5 +1037,8 @@
10371037
},
10381038
"excludes": {}
10391039
}
1040+
],
1041+
"flags": [
1042+
"SECCOMP_FILTER_FLAG_SPEC_ALLOW"
10401043
]
10411044
}

pkg/seccomp/types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ type Seccomp struct {
2020
Flags []string `json:"flags,omitempty"`
2121
}
2222

23+
const (
24+
// SeccompFilterFlagLog is the filter to return actions except
25+
// SECCOMP_RET_ALLOW should be logged. An administrator may override this
26+
// filter flag by preventing specific actions from being logged via the
27+
// /proc/sys/kernel/seccomp/actions_logged file. (since Linux 4.14)
28+
SeccompFilterFlagLog = "SECCOMP_FILTER_FLAG_LOG"
29+
30+
// SeccompFilterFlagSpecALlow can be used to disable Speculative Store
31+
// Bypass mitigation. (since Linux 4.17)
32+
SeccompFilterFlagSpecALlow = "SECCOMP_FILTER_FLAG_SPEC_ALLOW"
33+
)
34+
2335
// Architecture is used to represent a specific architecture
2436
// and its sub-architectures
2537
type Architecture struct {

0 commit comments

Comments
 (0)