feat(runner): add the own code runner contract, client and nsjail service
This commit is contained in:
1 parent
5e1db37746
commit
cdf6bcbb91
109 files changed
+24084
-28
No files matched your search
@@ -0,0 +1,16 @@
|
||||
# Isolation probe: the root file system and the source are read-only, the
|
||||
# scratch directory is writable, and runner files are not visible.
|
||||
import os
|
||||
|
||||
writable = []
|
||||
for path in ("/box/injected", "/usr/injected", "/injected", "/lib/injected"):
|
||||
try:
|
||||
with open(path, "w") as stream:
|
||||
stream.write("x")
|
||||
writable.append(path)
|
||||
except OSError:
|
||||
pass
|
||||
with open("/tmp/scratch", "w") as stream:
|
||||
stream.write("ok")
|
||||
visible = [path for path in ("/etc/passwd", "/run/secrets", "/opt/lincodex-runner", "/proc/1") if os.path.exists(path)]
|
||||
print("isolated" if not writable and not visible else "writable=" + ",".join(writable) + " visible=" + ",".join(visible))
|
||||
Reference in new issue
Block a user