Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use seccomp filter with ebpf?

Tags:

c

bpf

ebpf

seccomp

I'm looking for an example of eBPF to write a seccomp filter, but I can't find none. Could someone tell me if is possible to use eBPF to write seccomp filter?

like image 946
Maicake Avatar asked Aug 29 '19 14:08

Maicake


People also ask

Which of the following can be intercepted using Seccomp BPF?

With seccomp/BPF, MBOX can intercept just the system calls that it needs to examine, and skip system calls such as read() and write() that take a file descriptor as an argument.

What is Seccomp BPF?

seccomp-bpf is an extension to seccomp that allows filtering of system calls using a configurable policy implemented using Berkeley Packet Filter rules. It is used by OpenSSH and vsftpd as well as the Google Chrome/Chromium web browsers on Chrome OS and Linux.

What is Seccomp in Linux?

Secure computing mode ( seccomp ) is a Linux kernel feature. You can use it to restrict the actions available within the container. The seccomp() system call operates on the seccomp state of the calling process. You can use this feature to restrict your application's access.


1 Answers

Seccomp does not work with eBPF at the moment (only cBPF).

There was a discussion not long ago on that topic on the Linux networking mailing list. The eBPF maintainer is against adding eBPF support to seccomp.

like image 115
Qeole Avatar answered Nov 01 '22 15:11

Qeole