Skip to content

Commit f76ee0f

Browse files
Mossakaclaude
andauthored
feat(docker): switch seccomp profile to deny-by-default (#1286)
* feat(security): switch seccomp profile to deny-by-default Change defaultAction from SCMP_ACT_ALLOW to SCMP_ACT_ERRNO with an explicit allowlist of ~340 syscalls needed by development tools (git, npm, curl, node, python, java, rust, etc.). Dangerous syscalls like ptrace, kexec_load, reboot, init_module, pivot_root, and umount remain explicitly blocked as defense-in-depth. Add seccomp-profile.test.ts with 12 validation tests ensuring the profile structure, deny-by-default action, essential syscall coverage, and no duplicate entries. Fixes #311 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(test): use curl -sS instead of -f in log-commands test Removes -f flag to avoid exit code 22 on GitHub API 403 rate limits. The test only needs to generate Squid logs, not verify HTTP 200. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9c69ea6 commit f76ee0f

File tree

3 files changed

+523
-4
lines changed

3 files changed

+523
-4
lines changed

containers/agent/seccomp-profile.json

Lines changed: 359 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,366 @@
11
{
2-
"defaultAction": "SCMP_ACT_ALLOW",
2+
"defaultAction": "SCMP_ACT_ERRNO",
33
"architectures": [
44
"SCMP_ARCH_X86_64",
55
"SCMP_ARCH_X86",
66
"SCMP_ARCH_AARCH64"
77
],
88
"syscalls": [
9+
{
10+
"names": [
11+
"accept",
12+
"accept4",
13+
"access",
14+
"adjtimex",
15+
"alarm",
16+
"arch_prctl",
17+
"bind",
18+
"brk",
19+
"cacheflush",
20+
"capget",
21+
"capset",
22+
"chdir",
23+
"chmod",
24+
"chown",
25+
"chown32",
26+
"chroot",
27+
"clock_adjtime",
28+
"clock_getres",
29+
"clock_gettime",
30+
"clock_nanosleep",
31+
"clone",
32+
"clone3",
33+
"close",
34+
"close_range",
35+
"connect",
36+
"copy_file_range",
37+
"creat",
38+
"dup",
39+
"dup2",
40+
"dup3",
41+
"epoll_create",
42+
"epoll_create1",
43+
"epoll_ctl",
44+
"epoll_ctl_old",
45+
"epoll_pwait",
46+
"epoll_pwait2",
47+
"epoll_wait",
48+
"epoll_wait_old",
49+
"eventfd",
50+
"eventfd2",
51+
"execve",
52+
"execveat",
53+
"exit",
54+
"exit_group",
55+
"faccessat",
56+
"faccessat2",
57+
"fadvise64",
58+
"fadvise64_64",
59+
"fallocate",
60+
"fanotify_init",
61+
"fanotify_mark",
62+
"fchdir",
63+
"fchmod",
64+
"fchmodat",
65+
"fchmodat2",
66+
"fchown",
67+
"fchown32",
68+
"fchownat",
69+
"fcntl",
70+
"fcntl64",
71+
"fdatasync",
72+
"fgetxattr",
73+
"flistxattr",
74+
"flock",
75+
"fork",
76+
"fremovexattr",
77+
"fsetxattr",
78+
"fstat",
79+
"fstat64",
80+
"fstatat64",
81+
"fstatfs",
82+
"fstatfs64",
83+
"fsync",
84+
"ftruncate",
85+
"ftruncate64",
86+
"futex",
87+
"futex_waitv",
88+
"futimesat",
89+
"get_mempolicy",
90+
"get_robust_list",
91+
"get_thread_area",
92+
"getcpu",
93+
"getcwd",
94+
"getdents",
95+
"getdents64",
96+
"getegid",
97+
"getegid32",
98+
"geteuid",
99+
"geteuid32",
100+
"getgid",
101+
"getgid32",
102+
"getgroups",
103+
"getgroups32",
104+
"getitimer",
105+
"getpeername",
106+
"getpgid",
107+
"getpgrp",
108+
"getpid",
109+
"getppid",
110+
"getpriority",
111+
"getrandom",
112+
"getresgid",
113+
"getresgid32",
114+
"getresuid",
115+
"getresuid32",
116+
"getrlimit",
117+
"getrusage",
118+
"getsid",
119+
"getsockname",
120+
"getsockopt",
121+
"gettid",
122+
"gettimeofday",
123+
"getuid",
124+
"getuid32",
125+
"getxattr",
126+
"inotify_add_watch",
127+
"inotify_init",
128+
"inotify_init1",
129+
"inotify_rm_watch",
130+
"io_cancel",
131+
"io_destroy",
132+
"io_getevents",
133+
"io_pgetevents",
134+
"io_setup",
135+
"io_submit",
136+
"io_uring_enter",
137+
"io_uring_register",
138+
"io_uring_setup",
139+
"ioctl",
140+
"ioprio_get",
141+
"ioprio_set",
142+
"ipc",
143+
"kill",
144+
"landlock_add_rule",
145+
"landlock_create_ruleset",
146+
"landlock_restrict_self",
147+
"lchown",
148+
"lchown32",
149+
"lgetxattr",
150+
"link",
151+
"linkat",
152+
"listen",
153+
"listxattr",
154+
"llistxattr",
155+
"lremovexattr",
156+
"lseek",
157+
"lsetxattr",
158+
"lstat",
159+
"lstat64",
160+
"madvise",
161+
"mbind",
162+
"membarrier",
163+
"memfd_create",
164+
"memfd_secret",
165+
"mincore",
166+
"mkdir",
167+
"mkdirat",
168+
"mknod",
169+
"mknodat",
170+
"mlock",
171+
"mlock2",
172+
"mlockall",
173+
"mmap",
174+
"mmap2",
175+
"mount",
176+
"mprotect",
177+
"mq_getsetattr",
178+
"mq_notify",
179+
"mq_open",
180+
"mq_timedreceive",
181+
"mq_timedsend",
182+
"mq_unlink",
183+
"mremap",
184+
"msgctl",
185+
"msgget",
186+
"msgrcv",
187+
"msgsnd",
188+
"msync",
189+
"munlock",
190+
"munlockall",
191+
"munmap",
192+
"name_to_handle_at",
193+
"nanosleep",
194+
"newfstatat",
195+
"open",
196+
"open_by_handle_at",
197+
"openat",
198+
"openat2",
199+
"pause",
200+
"pidfd_open",
201+
"pidfd_send_signal",
202+
"pipe",
203+
"pipe2",
204+
"poll",
205+
"ppoll",
206+
"prctl",
207+
"pread64",
208+
"preadv",
209+
"preadv2",
210+
"prlimit64",
211+
"process_mrelease",
212+
"pselect6",
213+
"pselect6_time64",
214+
"pwrite64",
215+
"pwritev",
216+
"pwritev2",
217+
"read",
218+
"readahead",
219+
"readlink",
220+
"readlinkat",
221+
"readv",
222+
"recvfrom",
223+
"recvmmsg",
224+
"recvmsg",
225+
"remap_file_pages",
226+
"removexattr",
227+
"rename",
228+
"renameat",
229+
"renameat2",
230+
"restart_syscall",
231+
"rmdir",
232+
"rseq",
233+
"rt_sigaction",
234+
"rt_sigpending",
235+
"rt_sigprocmask",
236+
"rt_sigqueueinfo",
237+
"rt_sigreturn",
238+
"rt_sigsuspend",
239+
"rt_sigtimedwait",
240+
"rt_tgsigqueueinfo",
241+
"sched_get_priority_max",
242+
"sched_get_priority_min",
243+
"sched_getaffinity",
244+
"sched_getattr",
245+
"sched_getparam",
246+
"sched_getscheduler",
247+
"sched_setaffinity",
248+
"sched_setattr",
249+
"sched_setparam",
250+
"sched_setscheduler",
251+
"sched_yield",
252+
"seccomp",
253+
"select",
254+
"semctl",
255+
"semget",
256+
"semop",
257+
"semtimedop",
258+
"sendfile",
259+
"sendfile64",
260+
"sendmmsg",
261+
"sendmsg",
262+
"sendto",
263+
"set_mempolicy",
264+
"set_robust_list",
265+
"set_thread_area",
266+
"set_tid_address",
267+
"setfsgid",
268+
"setfsgid32",
269+
"setfsuid",
270+
"setfsuid32",
271+
"setgid",
272+
"setgid32",
273+
"setgroups",
274+
"setgroups32",
275+
"setitimer",
276+
"setns",
277+
"setpgid",
278+
"setpriority",
279+
"setregid",
280+
"setregid32",
281+
"setresgid",
282+
"setresgid32",
283+
"setresuid",
284+
"setresuid32",
285+
"setreuid",
286+
"setreuid32",
287+
"setrlimit",
288+
"setsid",
289+
"setsockopt",
290+
"setuid",
291+
"setuid32",
292+
"setxattr",
293+
"shmat",
294+
"shmctl",
295+
"shmdt",
296+
"shmget",
297+
"shutdown",
298+
"sigaction",
299+
"sigaltstack",
300+
"signal",
301+
"signalfd",
302+
"signalfd4",
303+
"sigprocmask",
304+
"sigreturn",
305+
"socket",
306+
"socketcall",
307+
"socketpair",
308+
"splice",
309+
"stat",
310+
"stat64",
311+
"statfs",
312+
"statfs64",
313+
"statx",
314+
"symlink",
315+
"symlinkat",
316+
"sync",
317+
"sync_file_range",
318+
"syncfs",
319+
"sysinfo",
320+
"tee",
321+
"tgkill",
322+
"time",
323+
"timer_create",
324+
"timer_delete",
325+
"timer_getoverrun",
326+
"timer_gettime",
327+
"timer_settime",
328+
"timerfd_create",
329+
"timerfd_gettime",
330+
"timerfd_settime",
331+
"times",
332+
"tkill",
333+
"truncate",
334+
"truncate64",
335+
"ugetrlimit",
336+
"umask",
337+
"uname",
338+
"unlink",
339+
"unlinkat",
340+
"unshare",
341+
"utime",
342+
"utimensat",
343+
"utimes",
344+
"vfork",
345+
"vmsplice",
346+
"wait4",
347+
"waitid",
348+
"waitpid",
349+
"write",
350+
"writev"
351+
],
352+
"action": "SCMP_ACT_ALLOW",
353+
"comment": "Allow standard syscalls needed by development tools (git, npm, curl, node, python, java, rust, etc.)"
354+
},
355+
{
356+
"names": [
357+
"kcmp",
358+
"pidfd_getfd",
359+
"process_madvise"
360+
],
361+
"action": "SCMP_ACT_ALLOW",
362+
"comment": "Additional syscalls for JVM, .NET CLR, and multi-threaded runtimes"
363+
},
9364
{
10365
"names": [
11366
"ptrace",
@@ -14,7 +369,7 @@
14369
],
15370
"action": "SCMP_ACT_ERRNO",
16371
"errnoRet": 1,
17-
"comment": "Block process inspection/modification"
372+
"comment": "Explicitly block process inspection/modification (defense-in-depth, also blocked by default deny)"
18373
},
19374
{
20375
"names": [
@@ -43,7 +398,8 @@
43398
"nfsservctl"
44399
],
45400
"action": "SCMP_ACT_ERRNO",
46-
"errnoRet": 1
401+
"errnoRet": 1,
402+
"comment": "Explicitly block dangerous syscalls (defense-in-depth, also blocked by default deny)"
47403
},
48404
{
49405
"names": [

0 commit comments

Comments
 (0)