commit | dabc4301f7432c852eec7b5ce0e1ab1af7c4016f | [log] [tgz] |
---|---|---|
author | Luis Hector Chavez <lhchavez@google.com> | Fri Sep 21 09:21:47 2018 -0700 |
committer | Luis Hector Chavez <lhchavez@google.com> | Fri Sep 21 09:40:05 2018 -0700 |
tree | 5abdbe001384a9fd7cd6a3700e6b00453711d9d5 | |
parent | b7803c810f4602319f4ebb73ee7da67543975466 [diff] |
minijail: Allow setting a cap_from_text(3)-compliant string to -c This change allows callers of minijail0 use a human-friendly string as argument to the -c flag. This avoids having to add comments explaining what the cryptic hex constant means. Bug: None Test: # ./minijail0 -T static --ambient \ -c 'cap_dac_read_search,cap_dac_override+e' -- \ /bin/grep Cap /proc/self/status CapInh: 0000000000000006 CapPrm: 0000000000000006 CapEff: 0000000000000006 CapBnd: 0000000000000006 CapAmb: 0000000000000006 Test: # ./minijail0 -T static -- /bin/grep Cap /proc/self/status CapInh: 0000000000000000 CapPrm: 0000003fffffffff CapEff: 0000003fffffffff CapBnd: 0000003fffffffff CapAmb: 0000000000000000 Change-Id: I2e352178ab479859d999d936bbc7eb3ed6f370ff
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.
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