You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'--rootless' flag lets a non-root user execute 'runsc do'.
The drawback is that the sandbox and gofer processes will
run as root inside a user namespace that is mapped to the
caller's user, intead of nobody. And network is defaulted
to '--network=host' inside the root network namespace. On
the bright side, it's very convenient for testing:
runsc --rootless do ls
runsc --rootless do curl www.google.com
PiperOrigin-RevId: 252840970
Copy file name to clipboardExpand all lines: runsc/main.go
+34-29
Original file line number
Diff line number
Diff line change
@@ -61,16 +61,19 @@ var (
61
61
straceLogSize=flag.Uint("strace-log-size", 1024, "default size (in bytes) to log data argument blobs")
62
62
63
63
// Flags that control sandbox runtime behavior.
64
-
platform=flag.String("platform", "ptrace", "specifies which platform to use: ptrace (default), kvm")
65
-
network=flag.String("network", "sandbox", "specifies which network to use: sandbox (default), host, none. Using network inside the sandbox is more secure because it's isolated from the host network.")
fileAccess=flag.String("file-access", "exclusive", "specifies which filesystem to use for the root mount: exclusive (default), shared. Volume mounts are always shared.")
68
-
overlay=flag.Bool("overlay", false, "wrap filesystem mounts with writable overlay. All modifications are stored in memory inside the sandbox.")
69
-
watchdogAction=flag.String("watchdog-action", "log", "sets what action the watchdog takes when triggered: log (default), panic.")
70
-
panicSignal=flag.Int("panic-signal", -1, "register signal handling that panics. Usually set to SIGUSR2(12) to troubleshoot hangs. -1 disables it.")
71
-
profile=flag.Bool("profile", false, "prepares the sandbox to use Golang profiler. Note that enabling profiler loosens the seccomp protection added to the sandbox (DO NOT USE IN PRODUCTION).")
72
-
netRaw=flag.Bool("net-raw", false, "enable raw sockets. When false, raw sockets are disabled by removing CAP_NET_RAW from containers (`runsc exec` will still be able to utilize raw sockets). Raw sockets allow malicious containers to craft packets and potentially attack the network.")
73
-
numNetworkChannels=flag.Int("num-network-channels", 1, "number of underlying channels(FDs) to use for network link endpoints.")
64
+
platform=flag.String("platform", "ptrace", "specifies which platform to use: ptrace (default), kvm")
65
+
network=flag.String("network", "sandbox", "specifies which network to use: sandbox (default), host, none. Using network inside the sandbox is more secure because it's isolated from the host network.")
fileAccess=flag.String("file-access", "exclusive", "specifies which filesystem to use for the root mount: exclusive (default), shared. Volume mounts are always shared.")
68
+
overlay=flag.Bool("overlay", false, "wrap filesystem mounts with writable overlay. All modifications are stored in memory inside the sandbox.")
69
+
watchdogAction=flag.String("watchdog-action", "log", "sets what action the watchdog takes when triggered: log (default), panic.")
70
+
panicSignal=flag.Int("panic-signal", -1, "register signal handling that panics. Usually set to SIGUSR2(12) to troubleshoot hangs. -1 disables it.")
71
+
profile=flag.Bool("profile", false, "prepares the sandbox to use Golang profiler. Note that enabling profiler loosens the seccomp protection added to the sandbox (DO NOT USE IN PRODUCTION).")
72
+
netRaw=flag.Bool("net-raw", false, "enable raw sockets. When false, raw sockets are disabled by removing CAP_NET_RAW from containers (`runsc exec` will still be able to utilize raw sockets). Raw sockets allow malicious containers to craft packets and potentially attack the network.")
73
+
numNetworkChannels=flag.Int("num-network-channels", 1, "number of underlying channels(FDs) to use for network link endpoints.")
74
+
rootless=flag.Bool("rootless", false, "it allows the sandbox to be started with a user that is not root. Sandbox and Gofer processes may run with same privileges as current user.")
75
+
76
+
// Test flags, not to be used outside tests, ever.
74
77
testOnlyAllowRunAsCurrentUserWithoutChroot=flag.Bool("TESTONLY-unsafe-nonroot", false, "TEST ONLY; do not ever use! This skips many security measures that isolate the host from the sandbox.")
0 commit comments