Skip to content

Commit

Permalink
Add ptrace as a default seccomp allow to match Docker
Browse files Browse the repository at this point in the history
Also sort all syscalls in alphabetic order.

Fixes: containers/buildah#3833

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
  • Loading branch information
rhatdan committed Mar 22, 2022
1 parent 83015b5 commit 64d0220
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 30 deletions.
27 changes: 15 additions & 12 deletions pkg/seccomp/default_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func DefaultProfile() *Seccomp {
"futex",
"futex_time64",
"futimesat",
"get_mempolicy",
"get_robust_list",
"get_thread_area",
"getcpu",
Expand All @@ -184,7 +185,6 @@ func DefaultProfile() *Seccomp {
"getgroups",
"getgroups32",
"getitimer",
"get_mempolicy",
"getpeername",
"getpgid",
"getpgrp",
Expand Down Expand Up @@ -274,9 +274,9 @@ func DefaultProfile() *Seccomp {
"nanosleep",
"newfstatat",
"open",
"open_tree",
"openat",
"openat2",
"open_tree",
"pause",
"pidfd_getfd",
"pidfd_open",
Expand All @@ -296,8 +296,11 @@ func DefaultProfile() *Seccomp {
"preadv2",
"prlimit64",
"process_mrelease",
"process_vm_readv",
"process_vm_writev",
"pselect6",
"pselect6_time64",
"ptrace",
"pwrite64",
"pwritev",
"pwritev2",
Expand Down Expand Up @@ -356,7 +359,6 @@ func DefaultProfile() *Seccomp {
"sendmmsg",
"sendmsg",
"sendto",
"setns",
"set_mempolicy",
"set_robust_list",
"set_thread_area",
Expand All @@ -370,6 +372,7 @@ func DefaultProfile() *Seccomp {
"setgroups",
"setgroups32",
"setitimer",
"setns",
"setpgid",
"setpriority",
"setregid",
Expand Down Expand Up @@ -527,10 +530,10 @@ func DefaultProfile() *Seccomp {
Names: []string{
"arm_fadvise64_64",
"arm_sync_file_range",
"sync_file_range2",
"breakpoint",
"cacheflush",
"set_tls",
"sync_file_range2",
},
Action: ActAllow,
Args: []*Arg{},
Expand Down Expand Up @@ -653,8 +656,8 @@ func DefaultProfile() *Seccomp {
{
Names: []string{
"delete_module",
"init_module",
"finit_module",
"init_module",
"query_module",
},
Action: ActAllow,
Expand All @@ -666,8 +669,8 @@ func DefaultProfile() *Seccomp {
{
Names: []string{
"delete_module",
"init_module",
"finit_module",
"init_module",
"query_module",
},
Action: ActErrno,
Expand Down Expand Up @@ -732,8 +735,8 @@ func DefaultProfile() *Seccomp {
},
{
Names: []string{
"iopl",
"ioperm",
"iopl",
},
Action: ActAllow,
Args: []*Arg{},
Expand All @@ -743,8 +746,8 @@ func DefaultProfile() *Seccomp {
},
{
Names: []string{
"iopl",
"ioperm",
"iopl",
},
Action: ActErrno,
Errno: "EPERM",
Expand All @@ -756,10 +759,10 @@ func DefaultProfile() *Seccomp {
},
{
Names: []string{
"settimeofday",
"stime",
"clock_settime",
"clock_settime64",
"settimeofday",
"stime",
},
Action: ActAllow,
Args: []*Arg{},
Expand All @@ -769,10 +772,10 @@ func DefaultProfile() *Seccomp {
},
{
Names: []string{
"settimeofday",
"stime",
"clock_settime",
"clock_settime64",
"settimeofday",
"stime",
},
Action: ActErrno,
Errno: "EPERM",
Expand Down
39 changes: 21 additions & 18 deletions pkg/seccomp/seccomp.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
"futex",
"futex_time64",
"futimesat",
"get_mempolicy",
"get_robust_list",
"get_thread_area",
"getcpu",
Expand All @@ -191,7 +192,6 @@
"getgroups",
"getgroups32",
"getitimer",
"get_mempolicy",
"getpeername",
"getpgid",
"getpgrp",
Expand Down Expand Up @@ -281,9 +281,9 @@
"nanosleep",
"newfstatat",
"open",
"open_tree",
"openat",
"openat2",
"open_tree",
"pause",
"pidfd_getfd",
"pidfd_open",
Expand All @@ -303,8 +303,11 @@
"preadv2",
"prlimit64",
"process_mrelease",
"process_vm_readv",
"process_vm_writev",
"pselect6",
"pselect6_time64",
"ptrace",
"pwrite64",
"pwritev",
"pwritev2",
Expand Down Expand Up @@ -363,7 +366,6 @@
"sendmmsg",
"sendmsg",
"sendto",
"setns",
"set_mempolicy",
"set_robust_list",
"set_thread_area",
Expand All @@ -377,6 +379,7 @@
"setgroups",
"setgroups32",
"setitimer",
"setns",
"setpgid",
"setpriority",
"setregid",
Expand Down Expand Up @@ -571,10 +574,10 @@
"names": [
"arm_fadvise64_64",
"arm_sync_file_range",
"sync_file_range2",
"breakpoint",
"cacheflush",
"set_tls"
"set_tls",
"sync_file_range2"
],
"action": "SCMP_ACT_ALLOW",
"args": [],
Expand Down Expand Up @@ -742,8 +745,8 @@
{
"names": [
"delete_module",
"init_module",
"finit_module",
"init_module",
"query_module"
],
"action": "SCMP_ACT_ALLOW",
Expand All @@ -759,8 +762,8 @@
{
"names": [
"delete_module",
"init_module",
"finit_module",
"init_module",
"query_module"
],
"action": "SCMP_ACT_ERRNO",
Expand Down Expand Up @@ -845,8 +848,8 @@
},
{
"names": [
"iopl",
"ioperm"
"ioperm",
"iopl"
],
"action": "SCMP_ACT_ALLOW",
"args": [],
Expand All @@ -860,8 +863,8 @@
},
{
"names": [
"iopl",
"ioperm"
"ioperm",
"iopl"
],
"action": "SCMP_ACT_ERRNO",
"args": [],
Expand All @@ -877,10 +880,10 @@
},
{
"names": [
"settimeofday",
"stime",
"clock_settime",
"clock_settime64"
"clock_settime64",
"settimeofday",
"stime"
],
"action": "SCMP_ACT_ALLOW",
"args": [],
Expand All @@ -894,10 +897,10 @@
},
{
"names": [
"settimeofday",
"stime",
"clock_settime",
"clock_settime64"
"clock_settime64",
"settimeofday",
"stime"
],
"action": "SCMP_ACT_ERRNO",
"args": [],
Expand Down Expand Up @@ -1048,4 +1051,4 @@
"excludes": {}
}
]
}
}

0 comments on commit 64d0220

Please sign in to comment.