Add Architecture field to Seccomp configuration in Linux runtime
By default, Seccomp filters will only permit syscalls to be made using the native architecture of the kernel. This is fine for most use cases, but breaks others (such as running 32-bit code in a container on a host with a 64-bit kernel). This patch adds a field to specify additional architectures which may make syscalls. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
parent
96bcd043aa
commit
508743563d
|
@ -319,11 +319,14 @@ For more information about Apparmor, see [Apparmor documentation](https://wiki.u
|
|||
Seccomp provides application sandboxing mechanism in the Linux kernel.
|
||||
Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls.
|
||||
For more information about Seccomp, see [Seccomp kernel documentation](https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt)
|
||||
The actions and operators are strings that match the definitions in seccomp.h from [libseccomp](https://github.com/seccomp/libseccomp) and are translated to corresponding values.
|
||||
The actions, architectures, and operators are strings that match the definitions in seccomp.h from [libseccomp](https://github.com/seccomp/libseccomp) and are translated to corresponding values.
|
||||
|
||||
```json
|
||||
"seccomp": {
|
||||
"defaultAction": "SCMP_ACT_ALLOW",
|
||||
"architectures": [
|
||||
"SCMP_ARCH_X86"
|
||||
],
|
||||
"syscalls": [
|
||||
{
|
||||
"name": "getcwd",
|
||||
|
|
|
@ -235,9 +235,14 @@ type Device struct {
|
|||
// Seccomp represents syscall restrictions
|
||||
type Seccomp struct {
|
||||
DefaultAction Action `json:"defaultAction"`
|
||||
Architectures []Arch `json:"architectures"`
|
||||
Syscalls []*Syscall `json:"syscalls"`
|
||||
}
|
||||
|
||||
// Additional architectures permitted to be used for system calls
|
||||
// By default only the native architecture of the kernel is permitted
|
||||
type Arch string
|
||||
|
||||
// Action taken upon Seccomp rule match
|
||||
type Action string
|
||||
|
||||
|
|
Loading…
Reference in New Issue