Skip to content

Commit

Permalink
Enable SECCOMP_FILTER_FLAG_LOG and SECCOMP_FILTER_FLAG_SPEC_ALLOW
Browse files Browse the repository at this point in the history
… per default

We now enable both flags for the default seccomp profile.

Signed-off-by: Sascha Grunert <[email protected]>
  • Loading branch information
saschagrunert committed Feb 23, 2022
1 parent 468d7e6 commit 84a0a51
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/seccomp/default_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func DefaultProfile() *Seccomp {
enosys := uint(unix.ENOSYS)
eperm := uint(unix.EPERM)

flags := []string{
SeccompFilterFlagLog,
SeccompFilterFlagSpecALlow,
}

syscalls := []*Syscall{
{
Names: []string{
Expand Down Expand Up @@ -882,5 +887,6 @@ func DefaultProfile() *Seccomp {
DefaultErrnoRet: &enosys,
ArchMap: arches(),
Syscalls: syscalls,
Flags: flags,
}
}
4 changes: 4 additions & 0 deletions pkg/seccomp/seccomp.json
Original file line number Diff line number Diff line change
Expand Up @@ -1037,5 +1037,9 @@
},
"excludes": {}
}
],
"flags": [
"SECCOMP_FILTER_FLAG_LOG",
"SECCOMP_FILTER_FLAG_SPEC_ALLOW"
]
}
12 changes: 12 additions & 0 deletions pkg/seccomp/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ type Seccomp struct {
Flags []string `json:"flags,omitempty"`
}

const (
// SeccompFilterFlagLog is the filter to return actions except
// SECCOMP_RET_ALLOW should be logged. An administrator may override this
// filter flag by preventing specific actions from being logged via the
// /proc/sys/kernel/seccomp/actions_logged file. (since Linux 4.14)
SeccompFilterFlagLog = "SECCOMP_FILTER_FLAG_LOG"

// SeccompFilterFlagSpecALlow can be used to disable Speculative Store
// Bypass mitigation. (since Linux 4.17)
SeccompFilterFlagSpecALlow = "SECCOMP_FILTER_FLAG_SPEC_ALLOW"
)

// Architecture is used to represent a specific architecture
// and its sub-architectures
type Architecture struct {
Expand Down

0 comments on commit 84a0a51

Please sign in to comment.