commit | 8d7174bc2166ac088d3e954c1306e178db028021 | [log] [tgz] |
---|---|---|
author | Stéphane Lesimple <[email protected]> | Fri Feb 07 20:51:08 2020 +0100 |
committer | Treehugger Robot <[email protected]> | Fri Feb 21 16:43:59 2020 +0000 |
tree | ab50f0d1f7180deb9f3c457664918317ebdf8095 | |
parent | a111f545ed9c032cd618f95ee94391e764d57a26 [diff] |
cli: support minijail_set_supplementary_gids() Add the --add-suppl-group command line option to manually control the supplementary groups vector of the jailed program. Can be used multiple times to add several groups. Test: make tests Test: `minijail0 -u 1 -g 2 --add-suppl-group 3 --add-suppl-group irc /usr/bin/id` returns: "uid=1(daemon) gid=2(bin) groups=2(bin),3(sys),39(irc)" Change-Id: I49ce8c095888c743cd7ed55b3ebf4f54f896c9ac
The Minijail homepage and main repo is https://android.googlesource.com/platform/external/minijail/.
There might be other copies floating around, but this is the official one!
Minijail is a sandboxing and containment tool used in Chrome OS and Android. It provides an executable that can be used to launch and sandbox other programs, and a library that can be used by code to sandbox itself.
You're one git clone
away from happiness.
$ git clone https://android.googlesource.com/platform/external/minijail $ cd minijail
Releases are tagged as linux-vXX
: https://android.googlesource.com/platform/external/minijail/+refs
See the HACKING.md document for more details.
See the RELEASE.md document for more details.
See the tools/README.md document for more details.
We've got a couple of contact points.
The following talk serves as a good introduction to Minijail and how it can be used.
The Chromium OS project has a comprehensive sandboxing document that is largely based on Minijail.
After you play with the simple examples below, you should check that out.
# id uid=0(root) gid=0(root) groups=0(root),128(pkcs11) # minijail0 -u jorgelo -g 5000 /usr/bin/id uid=72178(jorgelo) gid=5000(eng) groups=5000(eng)
# minijail0 -u jorgelo -c 3000 -- /bin/cat /proc/self/status Name: cat ... CapInh: 0000000000003000 CapPrm: 0000000000003000 CapEff: 0000000000003000 CapBnd: 0000000000003000