| 
				
					 | 
			преди 1 година | |
|---|---|---|
| .github | преди 1 година | |
| build | преди 1 година | |
| cmd | преди 1 година | |
| conf | преди 1 година | |
| dependencies | преди 1 година | |
| dev | преди 1 година | |
| docker | преди 1 година | |
| internal | преди 1 година | |
| tests | преди 1 година | |
| .gitignore | преди 1 година | |
| README.md | преди 1 година | |
| go.mod | преди 1 година | |
| go.sum | преди 1 година | |
| install.sh | преди 1 година | 
sudo apt-get install pkg-config libseccomp-dev
Dify-Sandbox offers a simple way to run untrusted code in a secure environment. It is designed to be used in a multi-tenant environment, where multiple users can submit code to be executed. The code is executed in a sandboxed environment, which restricts the resources and system calls that the code can access.
./build/build.sh to build a Linux native binary file which contains the seccomp filterFor now, Dify-Sandbox supports syscalls below:
var allowedSyscalls = []int{
    // file io, only write and close file descriptor
	SYS_WRITE, SYS_CLOSE,
	// thread, used to fasten the execution
	SYS_FUTEX,
	// memory, allocate and free memory
	SYS_MMAP, SYS_BRK, SYS_MPROTECT, SYS_MUNMAP,
	// user/group, used to drop the privileges
	SYS_SETUID, SYS_SETGID,
	// process
	SYS_GETPID, SYS_GETPPID, SYS_GETTID,
	SYS_EXIT, SYS_EXIT_GROUP,
	SYS_TGKILL, SYS_RT_SIGACTION,
	// time
	SYS_CLOCK_GETTIME, SYS_GETTIMEOFDAY, SYS_TIME, SYS_NANOSLEEP,
	SYS_EPOLL_CTL,
}