Build a sandbox policy with standard filesystem/process/landlock settings.
()
| 43 | |
| 44 | |
| 45 | def _default_policy() -> sandbox_pb2.SandboxPolicy: |
| 46 | """Build a sandbox policy with standard filesystem/process/landlock settings.""" |
| 47 | return sandbox_pb2.SandboxPolicy( |
| 48 | version=1, |
| 49 | filesystem=sandbox_pb2.FilesystemPolicy( |
| 50 | include_workdir=True, |
| 51 | read_only=["/usr", "/lib", "/etc", "/app", "/dev/urandom"], |
| 52 | read_write=["/sandbox", "/tmp"], |
| 53 | ), |
| 54 | landlock=sandbox_pb2.LandlockPolicy(compatibility="best_effort"), |
| 55 | process=sandbox_pb2.ProcessPolicy( |
| 56 | run_as_user="sandbox", run_as_group="sandbox" |
| 57 | ), |
| 58 | ) |
| 59 | |
| 60 | |
| 61 | # --------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected