Skip to content

Commit

Permalink
Merge pull request #44562 from thaJeztah/seccomp_block_af_vsock
Browse files Browse the repository at this point in the history
seccomp: block socket calls to AF_VSOCK in default profile
  • Loading branch information
thaJeztah committed Dec 1, 2022
2 parents 5d88037 + 57b2290 commit 40408d1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion profiles/seccomp/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@
"signalfd4",
"sigprocmask",
"sigreturn",
"socket",
"socketcall",
"socketpair",
"splice",
Expand Down Expand Up @@ -420,6 +419,19 @@
"minKernel": "4.8"
}
},
{
"names": [
"socket"
],
"action": "SCMP_ACT_ALLOW",
"args": [
{
"index": 0,
"value": 40,
"op": "SCMP_CMP_NE"
}
]
},
{
"names": [
"personality"
Expand Down
14 changes: 13 additions & 1 deletion profiles/seccomp/default_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ func DefaultProfile() *Seccomp {
"signalfd4",
"sigprocmask",
"sigreturn",
"socket",
"socketcall",
"socketpair",
"splice",
Expand Down Expand Up @@ -415,6 +414,19 @@ func DefaultProfile() *Seccomp {
MinKernel: &KernelVersion{4, 8},
},
},
{
LinuxSyscall: specs.LinuxSyscall{
Names: []string{"socket"},
Action: specs.ActAllow,
Args: []specs.LinuxSeccompArg{
{
Index: 0,
Value: unix.AF_VSOCK,
Op: specs.OpNotEqual,
},
},
},
},
{
LinuxSyscall: specs.LinuxSyscall{
Names: []string{"personality"},
Expand Down

0 comments on commit 40408d1

Please sign in to comment.