mkseccomp.sample 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. /* This sample file is an example for mkseccomp.pl to produce a seccomp file
  2. * which restricts syscalls that are only useful for an admin but allows the
  3. * vast majority of normal userspace programs to run normally.
  4. *
  5. * The format of this file is one line per syscall. This is then processed
  6. * and passed to 'cpp' to convert the names to numbers using whatever is
  7. * correct for your platform. As such C-style comments are permitted. Note
  8. * this also means that C preprocessor macros are also allowed. So it is
  9. * possible to create groups surrounded by #ifdef/#endif and control their
  10. * inclusion via #define (not #include).
  11. *
  12. * Syscalls that don't exist on your architecture are silently filtered out.
  13. * Syscalls marked with (*) are required for a container to spawn a bash
  14. * shell successfully (not necessarily full featured). Listing the same
  15. * syscall multiple times is no problem.
  16. *
  17. * If you want to make a list specifically for one application the easiest
  18. * way is to run the application under strace, like so:
  19. *
  20. * $ strace -f -q -c -o strace.out application args...
  21. *
  22. * Once you have a reasonable sample of the execution of the program, exit
  23. * it. The file strace.out will have a summary of the syscalls used. Copy
  24. * that list into this file, comment out everything else except the starred
  25. * syscalls (which you need for the container to start) and you're done.
  26. *
  27. * To get the list of syscalls from the strace output this works well for
  28. * me
  29. *
  30. * $ cut -c52 < strace.out
  31. *
  32. * This sample list was compiled as a combination of all the syscalls
  33. * available on i386 and amd64 on Ubuntu Precise, as such it may not contain
  34. * everything and not everything may be relevent for your system. This
  35. * shouldn't be a problem.
  36. */
  37. // Filesystem/File descriptor related
  38. access // (*)
  39. chdir // (*)
  40. chmod
  41. chown
  42. chown32
  43. close // (*)
  44. creat
  45. dup // (*)
  46. dup2 // (*)
  47. dup3
  48. epoll_create
  49. epoll_create1
  50. epoll_ctl
  51. epoll_ctl_old
  52. epoll_pwait
  53. epoll_wait
  54. epoll_wait_old
  55. eventfd
  56. eventfd2
  57. faccessat // (*)
  58. fadvise64
  59. fadvise64_64
  60. fallocate
  61. fanotify_init
  62. fanotify_mark
  63. ioctl // (*)
  64. fchdir
  65. fchmod
  66. fchmodat
  67. fchown
  68. fchown32
  69. fchownat
  70. fcntl // (*)
  71. fcntl64
  72. fdatasync
  73. fgetxattr
  74. flistxattr
  75. flock
  76. fremovexattr
  77. fsetxattr
  78. fstat // (*)
  79. fstat64
  80. fstatat64
  81. fstatfs
  82. fstatfs64
  83. fsync
  84. ftruncate
  85. ftruncate64
  86. getcwd // (*)
  87. getdents // (*)
  88. getdents64
  89. getxattr
  90. inotify_add_watch
  91. inotify_init
  92. inotify_init1
  93. inotify_rm_watch
  94. io_cancel
  95. io_destroy
  96. io_getevents
  97. io_setup
  98. io_submit
  99. lchown
  100. lchown32
  101. lgetxattr
  102. link
  103. linkat
  104. listxattr
  105. llistxattr
  106. llseek
  107. _llseek
  108. lremovexattr
  109. lseek // (*)
  110. lsetxattr
  111. lstat
  112. lstat64
  113. mkdir
  114. mkdirat
  115. mknod
  116. mknodat
  117. newfstatat
  118. _newselect
  119. oldfstat
  120. oldlstat
  121. oldolduname
  122. oldstat
  123. olduname
  124. oldwait4
  125. open // (*)
  126. openat // (*)
  127. pipe // (*)
  128. pipe2
  129. poll
  130. ppoll
  131. pread64
  132. preadv
  133. futimesat
  134. pselect6
  135. pwrite64
  136. pwritev
  137. read // (*)
  138. readahead
  139. readdir
  140. readlink
  141. readlinkat
  142. readv
  143. removexattr
  144. rename
  145. renameat
  146. rmdir
  147. select
  148. sendfile
  149. sendfile64
  150. setxattr
  151. splice
  152. stat // (*)
  153. stat64
  154. statfs // (*)
  155. statfs64
  156. symlink
  157. symlinkat
  158. sync
  159. sync_file_range
  160. sync_file_range2
  161. syncfs
  162. tee
  163. truncate
  164. truncate64
  165. umask
  166. unlink
  167. unlinkat
  168. ustat
  169. utime
  170. utimensat
  171. utimes
  172. write // (*)
  173. writev
  174. // Network related
  175. accept
  176. accept4
  177. bind // (*)
  178. connect // (*)
  179. getpeername
  180. getsockname // (*)
  181. getsockopt
  182. listen
  183. recv
  184. recvfrom // (*)
  185. recvmmsg
  186. recvmsg
  187. send
  188. sendmmsg
  189. sendmsg
  190. sendto // (*)
  191. setsockopt
  192. shutdown
  193. socket // (*)
  194. socketcall
  195. socketpair
  196. sethostname // (*)
  197. // Signal related
  198. pause
  199. rt_sigaction // (*)
  200. rt_sigpending
  201. rt_sigprocmask // (*)
  202. rt_sigqueueinfo
  203. rt_sigreturn // (*)
  204. rt_sigsuspend
  205. rt_sigtimedwait
  206. rt_tgsigqueueinfo
  207. sigaction
  208. sigaltstack // (*)
  209. signal
  210. signalfd
  211. signalfd4
  212. sigpending
  213. sigprocmask
  214. sigreturn
  215. sigsuspend
  216. // Other needed POSIX
  217. alarm
  218. brk // (*)
  219. clock_adjtime
  220. clock_getres
  221. clock_gettime
  222. clock_nanosleep
  223. //clock_settime
  224. gettimeofday
  225. nanosleep
  226. nice
  227. sysinfo
  228. syslog
  229. time
  230. timer_create
  231. timer_delete
  232. timerfd_create
  233. timerfd_gettime
  234. timerfd_settime
  235. timer_getoverrun
  236. timer_gettime
  237. timer_settime
  238. times
  239. uname // (*)
  240. // Memory control
  241. madvise
  242. mbind
  243. mincore
  244. mlock
  245. mlockall
  246. mmap // (*)
  247. mmap2
  248. mprotect // (*)
  249. mremap
  250. msync
  251. munlock
  252. munlockall
  253. munmap // (*)
  254. remap_file_pages
  255. set_mempolicy
  256. vmsplice
  257. // Process control
  258. capget
  259. capset // (*)
  260. clone // (*)
  261. execve // (*)
  262. exit // (*)
  263. exit_group // (*)
  264. fork
  265. getcpu
  266. getpgid
  267. getpgrp // (*)
  268. getpid // (*)
  269. getppid // (*)
  270. getpriority
  271. getresgid
  272. getresgid32
  273. getresuid
  274. getresuid32
  275. getrlimit // (*)
  276. getrusage
  277. getsid
  278. getuid // (*)
  279. getuid32
  280. getegid // (*)
  281. getegid32
  282. geteuid // (*)
  283. geteuid32
  284. getgid // (*)
  285. getgid32
  286. getgroups
  287. getgroups32
  288. getitimer
  289. get_mempolicy
  290. kill
  291. //personality
  292. prctl
  293. prlimit64
  294. sched_getaffinity
  295. sched_getparam
  296. sched_get_priority_max
  297. sched_get_priority_min
  298. sched_getscheduler
  299. sched_rr_get_interval
  300. //sched_setaffinity
  301. //sched_setparam
  302. //sched_setscheduler
  303. sched_yield
  304. setfsgid
  305. setfsgid32
  306. setfsuid
  307. setfsuid32
  308. setgid
  309. setgid32
  310. setgroups
  311. setgroups32
  312. setitimer
  313. setpgid // (*)
  314. setpriority
  315. setregid
  316. setregid32
  317. setresgid
  318. setresgid32
  319. setresuid
  320. setresuid32
  321. setreuid
  322. setreuid32
  323. setrlimit
  324. setsid
  325. setuid
  326. setuid32
  327. ugetrlimit
  328. vfork
  329. wait4 // (*)
  330. waitid
  331. waitpid
  332. // IPC
  333. ipc
  334. mq_getsetattr
  335. mq_notify
  336. mq_open
  337. mq_timedreceive
  338. mq_timedsend
  339. mq_unlink
  340. msgctl
  341. msgget
  342. msgrcv
  343. msgsnd
  344. semctl
  345. semget
  346. semop
  347. semtimedop
  348. shmat
  349. shmctl
  350. shmdt
  351. shmget
  352. // Linux specific, mostly needed for thread-related stuff
  353. arch_prctl // (*)
  354. get_robust_list
  355. get_thread_area
  356. gettid
  357. futex // (*)
  358. restart_syscall // (*)
  359. set_robust_list // (*)
  360. set_thread_area
  361. set_tid_address // (*)
  362. tgkill
  363. tkill
  364. // Admin syscalls, these are blocked
  365. //acct
  366. //adjtimex
  367. //bdflush
  368. //chroot
  369. //create_module
  370. //delete_module
  371. //get_kernel_syms // Obsolete
  372. //idle // Obsolete
  373. //init_module
  374. //ioperm
  375. //iopl
  376. //ioprio_get
  377. //ioprio_set
  378. //kexec_load
  379. //lookup_dcookie // oprofile only?
  380. //migrate_pages // NUMA
  381. //modify_ldt
  382. //mount
  383. //move_pages // NUMA
  384. //name_to_handle_at // NFS server
  385. //nfsservctl // NFS server
  386. //open_by_handle_at // NFS server
  387. //perf_event_open
  388. //pivot_root
  389. //process_vm_readv // For debugger
  390. //process_vm_writev // For debugger
  391. //ptrace // For debugger
  392. //query_module
  393. //quotactl
  394. //reboot
  395. //setdomainname
  396. //setns
  397. //settimeofday
  398. //sgetmask // Obsolete
  399. //ssetmask // Obsolete
  400. //stime
  401. //swapoff
  402. //swapon
  403. //_sysctl
  404. //sysfs
  405. //sys_setaltroot
  406. //umount
  407. //umount2
  408. //unshare
  409. //uselib
  410. //vhangup
  411. //vm86
  412. //vm86old
  413. // Kernel key management
  414. //add_key
  415. //keyctl
  416. //request_key
  417. // Unimplemented
  418. //afs_syscall
  419. //break
  420. //ftime
  421. //getpmsg
  422. //gtty
  423. //lock
  424. //madvise1
  425. //mpx
  426. //prof
  427. //profil
  428. //putpmsg
  429. //security
  430. //stty
  431. //tuxcall
  432. //ulimit
  433. //vserver