From 1ccd9f13f8233f7a926e9754574ebd81ae186268 Mon Sep 17 00:00:00 2001 From: criyle Date: Sat, 24 Aug 2019 20:32:56 -0700 Subject: [PATCH] change name from 'go-judger' to 'go-sandbox' --- README.md | 14 +++++++------- cmd/run_program/main.go | 16 ++++++++-------- deamon/container_init.go | 6 +++--- deamon/deamon.go | 4 ++-- deamon/default.go | 2 +- deamon/master.go | 6 +++--- deamon/master_cmd.go | 2 +- deamon/master_cmd_execve.go | 6 +++--- forkexec/bench_test.go | 2 +- forkexec/fork_util.go | 2 +- forkexec/runner.go | 4 ++-- go.mod | 2 +- runconfig/handle.go | 2 +- runprogram/handle.go | 4 ++-- runprogram/runprogram.go | 4 ++-- runprogram/runprogram_run.go | 8 ++++---- rununshared/default.go | 2 +- rununshared/run.go | 6 +++--- rununshared/rununshared.go | 6 +++--- tracer/tracer_track.go | 2 +- 20 files changed, 50 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 98d7980..19736d9 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# go-judger +# go-sandbox -Original goal is to reimplement [uoj-judger/run_program](https://github.com/vfleaking/uoj) in GO language using [libseccomp](https://github.com/seccomp/libseccomp-golang). As technology grows, it also implements new technologies such as Linux namespace & cgroup. +Original goal is to reimplement [uoj-judger/run_program](https://github.com/vfleaking/uoj) in GO language using [libseccomp](https://github.com/seccomp/libseccomp-golang). As technology grows, it also implements new technologies including Linux namespace & cgroup. ## Install - install go compiler: `apt install golang-go` - install libseccomp-dev: `apt install libseccomp-dev` -- install: `go install github.com/criyle/go-judger/...` +- install: `go install github.com/criyle/go-sandbox/...` ## Technologies @@ -18,7 +18,7 @@ Original goal is to reimplement [uoj-judger/run_program](https://github.com/vfle Improvements: -1. Percise resource limits (s -> ms, mb -> kb) +1. Precise resource limits (s -> ms, mb -> kb) 2. More architectures (arm32, arm64, x86) 3. Allow multiple traced programs in different threads 4. Allow pipes as input / output files @@ -63,7 +63,7 @@ Default file access syscall check: - run_program: safely run program by unshare / ptrace / pre-forked containers -## Configuations +## Configurations - run_program/config.go: all configs toward running specs @@ -84,7 +84,7 @@ Pre-forked container also saves time for container creation / cleanup. $ go test -bench . -benchtime 10s goos: linux goarch: amd64 -pkg: github.com/criyle/go-judger/forkexec +pkg: github.com/criyle/go-sandbox/forkexec BenchmarkSimpleFork-4 10000 1106064 ns/op BenchmarkUnsharePid-4 10000 1367824 ns/op BenchmarkUnshareUser-4 10000 1311523 ns/op @@ -97,7 +97,7 @@ BenchmarkFastUnshareMountPivot-4 100 114364585 ns/op BenchmarkUnshareAll-4 100 851014031 ns/op BenchmarkUnshareMountPivot-4 20 901204445 ns/op PASS -ok github.com/criyle/go-judger/forkexec 262.112s +ok github.com/criyle/go-sandbox/forkexec 262.112s ``` ## TODO diff --git a/cmd/run_program/main.go b/cmd/run_program/main.go index d9a9397..c40992f 100644 --- a/cmd/run_program/main.go +++ b/cmd/run_program/main.go @@ -8,14 +8,14 @@ import ( "os/signal" "time" - "github.com/criyle/go-judger/cgroup" - "github.com/criyle/go-judger/deamon" - "github.com/criyle/go-judger/memfd" - "github.com/criyle/go-judger/runconfig" - "github.com/criyle/go-judger/runprogram" - "github.com/criyle/go-judger/rununshared" - "github.com/criyle/go-judger/types/rlimit" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/cgroup" + "github.com/criyle/go-sandbox/deamon" + "github.com/criyle/go-sandbox/memfd" + "github.com/criyle/go-sandbox/runconfig" + "github.com/criyle/go-sandbox/runprogram" + "github.com/criyle/go-sandbox/rununshared" + "github.com/criyle/go-sandbox/types/rlimit" + "github.com/criyle/go-sandbox/types/specs" ) const ( diff --git a/deamon/container_init.go b/deamon/container_init.go index b4faff0..346749f 100644 --- a/deamon/container_init.go +++ b/deamon/container_init.go @@ -8,9 +8,9 @@ import ( "os" "syscall" - "github.com/criyle/go-judger/forkexec" - "github.com/criyle/go-judger/types/specs" - "github.com/criyle/go-judger/unixsocket" + "github.com/criyle/go-sandbox/forkexec" + "github.com/criyle/go-sandbox/types/specs" + "github.com/criyle/go-sandbox/unixsocket" ) // ContainerInit is called for container init process diff --git a/deamon/deamon.go b/deamon/deamon.go index d14364f..b21af39 100644 --- a/deamon/deamon.go +++ b/deamon/deamon.go @@ -34,8 +34,8 @@ Any socket related error will cause the deamon exit (with all process inside con */ import ( - "github.com/criyle/go-judger/types/rlimit" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/types/rlimit" + "github.com/criyle/go-sandbox/types/specs" ) // Cmd is the control message send into deamon diff --git a/deamon/default.go b/deamon/default.go index aecd7ed..80607b4 100644 --- a/deamon/default.go +++ b/deamon/default.go @@ -3,7 +3,7 @@ package deamon import ( "os" - "github.com/criyle/go-judger/types/mount" + "github.com/criyle/go-sandbox/types/mount" "golang.org/x/sys/unix" ) diff --git a/deamon/master.go b/deamon/master.go index 88cb732..e165e23 100644 --- a/deamon/master.go +++ b/deamon/master.go @@ -4,9 +4,9 @@ import ( "fmt" "os" - "github.com/criyle/go-judger/forkexec" - "github.com/criyle/go-judger/memfd" - "github.com/criyle/go-judger/unixsocket" + "github.com/criyle/go-sandbox/forkexec" + "github.com/criyle/go-sandbox/memfd" + "github.com/criyle/go-sandbox/unixsocket" "golang.org/x/sys/unix" ) diff --git a/deamon/master_cmd.go b/deamon/master_cmd.go index ea88628..9ba5785 100644 --- a/deamon/master_cmd.go +++ b/deamon/master_cmd.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/criyle/go-judger/unixsocket" + "github.com/criyle/go-sandbox/unixsocket" ) // Ping send ping message to container diff --git a/deamon/master_cmd_execve.go b/deamon/master_cmd_execve.go index 9f3ada8..ca1d736 100644 --- a/deamon/master_cmd_execve.go +++ b/deamon/master_cmd_execve.go @@ -3,9 +3,9 @@ package deamon import ( "fmt" - "github.com/criyle/go-judger/types/rlimit" - "github.com/criyle/go-judger/types/specs" - "github.com/criyle/go-judger/unixsocket" + "github.com/criyle/go-sandbox/types/rlimit" + "github.com/criyle/go-sandbox/types/specs" + "github.com/criyle/go-sandbox/unixsocket" ) // ExecveParam is parameters to run process inside container diff --git a/forkexec/bench_test.go b/forkexec/bench_test.go index d57b6f2..d4d923b 100644 --- a/forkexec/bench_test.go +++ b/forkexec/bench_test.go @@ -6,7 +6,7 @@ import ( "syscall" "testing" - "github.com/criyle/go-judger/types/mount" + "github.com/criyle/go-sandbox/types/mount" "golang.org/x/sys/unix" ) diff --git a/forkexec/fork_util.go b/forkexec/fork_util.go index 4d1a4f0..8001651 100644 --- a/forkexec/fork_util.go +++ b/forkexec/fork_util.go @@ -3,7 +3,7 @@ package forkexec import ( "syscall" - "github.com/criyle/go-judger/types/mount" + "github.com/criyle/go-sandbox/types/mount" ) // prepareExec prepares execve parameters diff --git a/forkexec/runner.go b/forkexec/runner.go index 266425e..4491e36 100644 --- a/forkexec/runner.go +++ b/forkexec/runner.go @@ -5,8 +5,8 @@ package forkexec import ( "syscall" - "github.com/criyle/go-judger/types/mount" - "github.com/criyle/go-judger/types/rlimit" + "github.com/criyle/go-sandbox/types/mount" + "github.com/criyle/go-sandbox/types/rlimit" ) // Runner is the RunProgramConfig including the exec path, argv diff --git a/go.mod b/go.mod index 073217c..82e0c0b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/criyle/go-judger +module github.com/criyle/go-sandbox go 1.12 diff --git a/runconfig/handle.go b/runconfig/handle.go index a287e3b..b505cc3 100644 --- a/runconfig/handle.go +++ b/runconfig/handle.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/criyle/go-judger/runprogram" + "github.com/criyle/go-sandbox/runprogram" ) // Handler defines file access restricted handler to call the runprogram diff --git a/runprogram/handle.go b/runprogram/handle.go index 510982b..e54deb2 100644 --- a/runprogram/handle.go +++ b/runprogram/handle.go @@ -8,8 +8,8 @@ import ( libseccomp "github.com/seccomp/libseccomp-golang" - "github.com/criyle/go-judger/tracer" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/tracer" + "github.com/criyle/go-sandbox/types/specs" ) type tracerHandler struct { diff --git a/runprogram/runprogram.go b/runprogram/runprogram.go index caf196e..f509e2f 100644 --- a/runprogram/runprogram.go +++ b/runprogram/runprogram.go @@ -3,8 +3,8 @@ package runprogram import ( "syscall" - "github.com/criyle/go-judger/types/rlimit" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/types/rlimit" + "github.com/criyle/go-sandbox/types/specs" ) // RunProgram defines the spec to run a program safely diff --git a/runprogram/runprogram_run.go b/runprogram/runprogram_run.go index 0fefd39..d2cf8af 100644 --- a/runprogram/runprogram_run.go +++ b/runprogram/runprogram_run.go @@ -3,10 +3,10 @@ package runprogram import ( libseccomp "github.com/seccomp/libseccomp-golang" - "github.com/criyle/go-judger/forkexec" - "github.com/criyle/go-judger/seccomp" - "github.com/criyle/go-judger/tracer" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/forkexec" + "github.com/criyle/go-sandbox/seccomp" + "github.com/criyle/go-sandbox/tracer" + "github.com/criyle/go-sandbox/types/specs" ) // Start starts the tracing process diff --git a/rununshared/default.go b/rununshared/default.go index 2a358ba..b59f386 100644 --- a/rununshared/default.go +++ b/rununshared/default.go @@ -3,7 +3,7 @@ package rununshared import ( "os" - "github.com/criyle/go-judger/types/mount" + "github.com/criyle/go-sandbox/types/mount" "golang.org/x/sys/unix" ) diff --git a/rununshared/run.go b/rununshared/run.go index d763e63..d12bbd8 100644 --- a/rununshared/run.go +++ b/rununshared/run.go @@ -5,9 +5,9 @@ import ( "os" "time" - "github.com/criyle/go-judger/forkexec" - "github.com/criyle/go-judger/seccomp" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/forkexec" + "github.com/criyle/go-sandbox/seccomp" + "github.com/criyle/go-sandbox/types/specs" libseccomp "github.com/seccomp/libseccomp-golang" "golang.org/x/sys/unix" ) diff --git a/rununshared/rununshared.go b/rununshared/rununshared.go index b29a8ed..ebf58bc 100644 --- a/rununshared/rununshared.go +++ b/rununshared/rununshared.go @@ -1,9 +1,9 @@ package rununshared import ( - "github.com/criyle/go-judger/types/mount" - "github.com/criyle/go-judger/types/rlimit" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/types/mount" + "github.com/criyle/go-sandbox/types/rlimit" + "github.com/criyle/go-sandbox/types/specs" ) // RunUnshared runs program in unshared namespaces diff --git a/tracer/tracer_track.go b/tracer/tracer_track.go index 72d9394..ea87d35 100644 --- a/tracer/tracer_track.go +++ b/tracer/tracer_track.go @@ -4,7 +4,7 @@ import ( "runtime" "time" - "github.com/criyle/go-judger/types/specs" + "github.com/criyle/go-sandbox/types/specs" unix "golang.org/x/sys/unix" )