wire / wire-format / seccomp-filter
A seccomp filter is a BPF program (array of sock_filter instructions) that inspects each syscall via a seccomp_data structure. Each 8-byte sock_filter: code (2 bytes), jt (1 byte), jf (1 byte), k (4 bytes). The filter returns SECCOMP_RET_KILL_PROCESS, SECCOMP_RET_KILL_THREAD, SECCOMP_RET_TRAP, SECCOMP_RET_ERRNO, SECCOMP_RET_TRACE, SECCOMP_RET_LOG, or SECCOMP_RET_ALLOW.
aka: seccomp BPF filter (sock_filter / seccomp_data)
spec: Linux kernel (seccomp)
A seccomp filter is a BPF program (array of sock_filter instructions) that inspects each syscall via a seccomp_data structure. Each 8-byte sock_filter: code (2 bytes), jt (1 byte), jf (1 byte), k (4 bytes). The filter returns SECCOMP_RET_KILL_PROCESS, SECCOMP_RET_KILL_THREAD, SECCOMP_RET_TRAP, SECCOMP_RET_ERRNO, SECCOMP_RET_TRACE, SECCOMP_RET_LOG, or SECCOMP_RET_ALLOW.
| field | size | meaning |
|---|---|---|
| seccomp_data.nr | 4 bytes (__s32) | System call number. |
| seccomp_data.arch | 4 bytes (__u32) | Architecture (AUDIT_ARCH_X86_64, AUDIT_ARCH_AARCH64, ...). |
| seccomp_data.instruction_pointer | 8 bytes (__u64) | IP at the time of the syscall. |
| seccomp_data.args[0..5] | 6 x 8 bytes (__u64) | The six syscall arguments. |
| sock_filter.code | 2 bytes (__u16) | BPF instruction code (BPF_LD, BPF_JMP, BPF_RET, ...). |
| sock_filter.jt | 1 byte (__u8) | Jump if true (offset). |
| sock_filter.jf | 1 byte (__u8) | Jump if false (offset). |
| sock_filter.k | 4 bytes (__u32) | Constant / address offset. |
example:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
seccomp_data (64 bytes) + empty filter
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/seccomp-filter
or /wire-format/seccomp-filter.json