|
| 1 | +# SPDX-License-Identifier: Apache-2.0 |
| 2 | + |
| 3 | +version: 1 |
| 4 | + |
| 5 | +# --- Sandbox setup configuration (queried once at startup) --- |
| 6 | + |
| 7 | +filesystem_policy: |
| 8 | + include_workdir: true |
| 9 | + read_only: |
| 10 | + - /usr |
| 11 | + - /lib |
| 12 | + - /proc |
| 13 | + - /dev/urandom |
| 14 | + - /app |
| 15 | + - /etc |
| 16 | + - /var/log |
| 17 | + read_write: |
| 18 | + - /sandbox |
| 19 | + - /tmp |
| 20 | + - /dev/null |
| 21 | + |
| 22 | +landlock: |
| 23 | + compatibility: best_effort |
| 24 | + |
| 25 | +process: |
| 26 | + run_as_user: sandbox |
| 27 | + run_as_group: sandbox |
| 28 | + |
| 29 | +# --- Network policies (queried per-CONNECT request) --- |
| 30 | +# |
| 31 | +# Each named policy maps a set of allowed (binary, endpoint) pairs. |
| 32 | +# Binary identity is resolved via /proc/net/tcp inode lookup + /proc/{pid}/exe. |
| 33 | +# Ancestors (/proc/{pid}/status PPid walk) and cmdline paths are also matched. |
| 34 | +# SHA256 integrity is enforced in Rust via trust-on-first-use, not here. |
| 35 | + |
| 36 | +network_policies: |
| 37 | + ollama: |
| 38 | + name: ollama |
| 39 | + endpoints: |
| 40 | + - { host: ollama.com, port: 443 } |
| 41 | + - { host: www.ollama.com, port: 443 } |
| 42 | + - { host: registry.ollama.com, port: 443 } |
| 43 | + - { host: registry.ollama.ai, port: 443 } |
| 44 | + - { host: "*.r2.cloudflarestorage.com", port: 443 } |
| 45 | + - { host: github.com, port: 443 } |
| 46 | + - { host: objects.githubusercontent.com, port: 443 } |
| 47 | + - { host: raw.githubusercontent.com, port: 443 } |
| 48 | + binaries: |
| 49 | + - { path: /usr/bin/curl } |
| 50 | + - { path: /bin/bash } |
| 51 | + - { path: /usr/bin/sh } |
| 52 | + - { path: /usr/local/bin/ollama } |
| 53 | + - { path: /usr/bin/ollama } |
| 54 | + |
| 55 | + claude_code: |
| 56 | + name: claude_code |
| 57 | + endpoints: |
| 58 | + - { host: api.anthropic.com, port: 443, protocol: rest, enforcement: enforce, access: full, tls: terminate } |
| 59 | + - { host: statsig.anthropic.com, port: 443 } |
| 60 | + - { host: sentry.io, port: 443 } |
| 61 | + - { host: raw.githubusercontent.com, port: 443 } |
| 62 | + - { host: platform.claude.com, port: 443 } |
| 63 | + binaries: |
| 64 | + - { path: /usr/local/bin/claude } |
| 65 | + - { path: /usr/bin/node } |
| 66 | + |
| 67 | + npm: |
| 68 | + name: npm |
| 69 | + endpoints: |
| 70 | + - { host: registry.npmjs.org, port: 443 } |
| 71 | + - { host: npmjs.org, port: 443 } |
| 72 | + binaries: |
| 73 | + - { path: /usr/bin/npm } |
| 74 | + - { path: /usr/bin/node } |
| 75 | + - { path: /bin/bash } |
| 76 | + - { path: /usr/bin/curl } |
| 77 | + |
| 78 | + github: |
| 79 | + name: github |
| 80 | + endpoints: |
| 81 | + - host: github.com |
| 82 | + port: 443 |
| 83 | + protocol: rest |
| 84 | + tls: terminate |
| 85 | + enforcement: enforce |
| 86 | + rules: |
| 87 | + # Git Smart HTTP read-only: allow clone, fetch, pull |
| 88 | + - allow: |
| 89 | + method: GET |
| 90 | + path: "/**/info/refs*" |
| 91 | + # Data transfer for reads |
| 92 | + - allow: |
| 93 | + method: POST |
| 94 | + path: "/**/git-upload-pack" |
| 95 | + binaries: |
| 96 | + - { path: /usr/bin/git } |
| 97 | + |
| 98 | + github_rest_api: |
| 99 | + name: github-rest-api |
| 100 | + endpoints: |
| 101 | + - host: api.github.com |
| 102 | + port: 443 |
| 103 | + protocol: rest |
| 104 | + tls: terminate |
| 105 | + enforcement: enforce |
| 106 | + rules: |
| 107 | + - allow: |
| 108 | + method: GET |
| 109 | + path: "/**/" |
| 110 | + - allow: |
| 111 | + method: HEAD |
| 112 | + path: "/**/" |
| 113 | + - allow: |
| 114 | + method: OPTIONS |
| 115 | + path: "/**/" |
| 116 | + binaries: |
| 117 | + - { path: /usr/bin/gh } |
| 118 | + |
| 119 | + nvidia: |
| 120 | + name: nvidia |
| 121 | + endpoints: |
| 122 | + - { host: integrate.api.nvidia.com, port: 443 } |
| 123 | + binaries: |
| 124 | + - { path: /usr/bin/curl } |
| 125 | + - { path: /bin/bash } |
| 126 | + - { path: /usr/local/bin/opencode } |
| 127 | + nvidia_web: |
| 128 | + name: nvidia_web |
| 129 | + endpoints: |
| 130 | + - { host: nvidia.com, port: 443 } |
| 131 | + - { host: www.nvidia.com, port: 443 } |
| 132 | + binaries: |
| 133 | + - { path: /usr/bin/curl } |
0 commit comments