mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-11-04 14:49:53 +08:00
Sandbox implemented in GO with container / ptrace / seccomp
| run_program | ||
| secutil | ||
| tracee | ||
| tracer | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
go-judger
Under developing.
Goal is to reimplement uoj-judger/run_program in GO language using libseccomp.
Install:
- install go compiler:
apt install golang-go - install libseccomp-dev:
apt install libseccomp-dev - install:
go install github.com/criyle/go-judger/...
Features (same as uoj-judger/run_program):
- Restricted computing resource: Time & Memory (Stack) & Output
- Restricted syscall access (by libseccomp & ptrace)
- Restricted file access (read & write & access & exec)
Default file access action:
- check file read / write:
open,openat - check file read:
readlink,readlinkat - check file write:
unlink,unlinkat,chmod,rename - check file access:
stat,lstat,access - check file exec:
execve
Packages:
- Secutil: provides common utility function that wrappers libseccomp
- Tracee: ptraced fork-exec with seccomp loaded
- Tracer: ptrace tracee and provides syscall trap context
Executable:
- run_program: under construction
Configuations:
- run_program/config.go: all configs toward running specs
TODO:
- allow multiple traced programs
- allow pipes
- Percise resource limits (s -> ms, mb -> kb)
- More architectures (arm32, x86)
- ...