Change-Id: If3e3c4e01b19443714d880ae669aaa8b39edfff7 |
4 years ago | |
|---|---|---|
| .. | ||
| examples | 4 years ago | |
| linux-x86 | 4 years ago | |
| test | 4 years ago | |
| tools | 4 years ago | |
| .clang-format | 4 years ago | |
| Android.bp | 4 years ago | |
| CPPLINT.cfg | 4 years ago | |
| Cargo.toml | 4 years ago | |
| CleanSpec.mk | 4 years ago | |
| HACKING.md | 4 years ago | |
| LICENSE | 4 years ago | |
| MODULE_LICENSE_BSD | 4 years ago | |
| Makefile | 4 years ago | |
| NOTICE | 4 years ago | |
| OWNERS | 4 years ago | |
| OWNERS.rust | 4 years ago | |
| PRESUBMIT.cfg | 4 years ago | |
| PREUPLOAD.cfg | 4 years ago | |
| README.md | 4 years ago | |
| RELEASE.md | 4 years ago | |
| TEST_MAPPING | 4 years ago | |
| arch.h | 4 years ago | |
| bpf.c | 4 years ago | |
| bpf.h | 4 years ago | |
| build.rs | 4 years ago | |
| common.mk | 4 years ago | |
| dump_constants.cc | 4 years ago | |
| elfparse.c | 4 years ago | |
| elfparse.h | 4 years ago | |
| gen_constants-inl.h | 4 years ago | |
| gen_constants.c | 4 years ago | |
| gen_constants.sh | 4 years ago | |
| gen_syscalls.c | 4 years ago | |
| gen_syscalls.sh | 4 years ago | |
| get_googletest.sh | 4 years ago | |
| lib.rs | 4 years ago | |
| libconstants.h | 4 years ago | |
| libminijail-private.h | 4 years ago | |
| libminijail.c | 4 years ago | |
| libminijail.h | 4 years ago | |
| libminijail.pc.in | 4 years ago | |
| libminijail.rs | 4 years ago | |
| libminijail_unittest.cc | 4 years ago | |
| libminijailpreload.c | 4 years ago | |
| libsyscalls.h | 4 years ago | |
| minijail0.1 | 4 years ago | |
| minijail0.5 | 4 years ago | |
| minijail0.c | 4 years ago | |
| minijail0_cli.c | 4 years ago | |
| minijail0_cli.h | 4 years ago | |
| minijail0_cli_unittest.cc | 4 years ago | |
| navbar.md | 4 years ago | |
| parse_seccomp_policy.cc | 4 years ago | |
| platform2_preinstall.sh | 4 years ago | |
| scoped_minijail.h | 4 years ago | |
| setup.py | 4 years ago | |
| signal_handler.c | 4 years ago | |
| signal_handler.h | 4 years ago | |
| syscall_filter.c | 4 years ago | |
| syscall_filter.h | 4 years ago | |
| syscall_filter_unittest.cc | 4 years ago | |
| syscall_filter_unittest_macros.h | 4 years ago | |
| syscall_wrapper.c | 4 years ago | |
| syscall_wrapper.h | 4 years ago | |
| system.c | 4 years ago | |
| system.h | 4 years ago | |
| system_unittest.cc | 4 years ago | |
| testrunner.cc | 4 years ago | |
| util.c | 4 years ago | |
| util.h | 4 years ago | |
| util_unittest.cc | 4 years ago | |
README.md
Minijail
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!
[TOC]
What is it?
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.
Getting the code
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
Building
See the HACKING.md document for more details.
Release process
See the RELEASE.md document for more details.
Additional tools
See the tools/README.md document for more details.
Contact
We've got a couple of contact points.
- minijail@chromium.org: Public user & developer mailing list.
- minijail-users@google.com: Internal Google user mailing list.
- minijail-dev@google.com: Internal Google developer mailing list.
- crbug.com/list: Existing bug reports & feature requests.
- crbug.com/new: File new bug reports & feature requests.
- AOSP Gerrit: Code reviews.
Talks and presentations
The following talk serves as a good introduction to Minijail and how it can be used.
Example usage
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.
Change root to any user
# 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)
Drop root while keeping some capabilities
# minijail0 -u jorgelo -c 3000 -- /bin/cat /proc/self/status
Name: cat
...
CapInh: 0000000000003000
CapPrm: 0000000000003000
CapEff: 0000000000003000
CapBnd: 0000000000003000