summaryrefslogtreecommitdiff
path: root/libmat2
diff options
context:
space:
mode:
authormadaidan2019-09-21 06:33:49 -0700
committerjvoisin2019-10-05 15:21:40 +0200
commit58773088ac1ee1fff8a2f1913442d68b2726daf6 (patch)
tree0021946482095ab454fa99692ec7f0c0cd9d7559 /libmat2
parent37145531854879081fddd6019bdb9ba693210cf2 (diff)
Mount a new tmpfs on /tmp and drop all capabilities
This mounts a new tmpfs on /tmp so any files residing there would be hidden from the sandbox. Many programs store some files in there that might be useful to an attacker. It also drops all capabilities incase it is ever run with extra capabilities for whatever reason.
Diffstat (limited to 'libmat2')
-rw-r--r--libmat2/subprocess.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmat2/subprocess.py b/libmat2/subprocess.py
index f1142be..fb6fc9d 100644
--- a/libmat2/subprocess.py
+++ b/libmat2/subprocess.py
@@ -51,6 +51,7 @@ def _get_bwrap_args(tempdir: str,
51 ['--dev', '/dev', 51 ['--dev', '/dev',
52 '--proc', '/proc', 52 '--proc', '/proc',
53 '--chdir', cwd, 53 '--chdir', cwd,
54 '--tmpfs', '/tmp',
54 '--unshare-user-try', 55 '--unshare-user-try',
55 '--unshare-ipc', 56 '--unshare-ipc',
56 '--unshare-pid', 57 '--unshare-pid',
@@ -58,6 +59,7 @@ def _get_bwrap_args(tempdir: str,
58 '--unshare-uts', 59 '--unshare-uts',
59 '--unshare-cgroup-try', 60 '--unshare-cgroup-try',
60 '--new-session', 61 '--new-session',
62 '--cap-drop', 'all',
61 # XXX: enable --die-with-parent once all supported platforms have 63 # XXX: enable --die-with-parent once all supported platforms have
62 # a bubblewrap recent enough to support it. 64 # a bubblewrap recent enough to support it.
63 # '--die-with-parent', 65 # '--die-with-parent',