Skip to content
Snippets Groups Projects
Commit 58773088 authored by madaidan's avatar madaidan Committed by jvoisin
Browse files

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.
parent 37145531
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ linting:bandit: ...@@ -16,7 +16,7 @@ linting:bandit:
script: # TODO: remove B405 and B314 script: # TODO: remove B405 and B314
- bandit ./mat2 --format txt --skip B101 - bandit ./mat2 --format txt --skip B101
- bandit -r ./nautilus/ --format txt --skip B101 - bandit -r ./nautilus/ --format txt --skip B101
- bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314 - bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314,B108
linting:codespell: linting:codespell:
image: $CONTAINER_REGISTRY:linting image: $CONTAINER_REGISTRY:linting
......
...@@ -51,6 +51,7 @@ def _get_bwrap_args(tempdir: str, ...@@ -51,6 +51,7 @@ def _get_bwrap_args(tempdir: str,
['--dev', '/dev', ['--dev', '/dev',
'--proc', '/proc', '--proc', '/proc',
'--chdir', cwd, '--chdir', cwd,
'--tmpfs', '/tmp',
'--unshare-user-try', '--unshare-user-try',
'--unshare-ipc', '--unshare-ipc',
'--unshare-pid', '--unshare-pid',
...@@ -58,6 +59,7 @@ def _get_bwrap_args(tempdir: str, ...@@ -58,6 +59,7 @@ def _get_bwrap_args(tempdir: str,
'--unshare-uts', '--unshare-uts',
'--unshare-cgroup-try', '--unshare-cgroup-try',
'--new-session', '--new-session',
'--cap-drop', 'all',
# XXX: enable --die-with-parent once all supported platforms have # XXX: enable --die-with-parent once all supported platforms have
# a bubblewrap recent enough to support it. # a bubblewrap recent enough to support it.
# '--die-with-parent', # '--die-with-parent',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment