|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +version: 1 |
| 5 | + |
| 6 | +# --- Sandbox setup configuration (queried once at startup) --- |
| 7 | + |
| 8 | +filesystem_policy: |
| 9 | + include_workdir: true |
| 10 | + read_only: |
| 11 | + - /usr |
| 12 | + - /lib |
| 13 | + - /proc |
| 14 | + - /dev/urandom |
| 15 | + - /app |
| 16 | + - /etc |
| 17 | + - /var/log |
| 18 | + read_write: |
| 19 | + - /sandbox |
| 20 | + - /tmp |
| 21 | + - /dev/null |
| 22 | + |
| 23 | +landlock: |
| 24 | + compatibility: best_effort |
| 25 | + |
| 26 | +process: |
| 27 | + run_as_user: sandbox |
| 28 | + run_as_group: sandbox |
| 29 | + |
| 30 | +# --- Network policies (queried per-CONNECT request) --- |
| 31 | +# |
| 32 | +# Each named policy maps a set of allowed (binary, endpoint) pairs. |
| 33 | +# Binary identity is resolved via /proc/net/tcp inode lookup + /proc/{pid}/exe. |
| 34 | +# Ancestors (/proc/{pid}/status PPid walk) and cmdline paths are also matched. |
| 35 | +# SHA256 integrity is enforced in Rust via trust-on-first-use, not here. |
| 36 | + |
| 37 | +network_policies: |
| 38 | + claude_code: |
| 39 | + name: claude-code |
| 40 | + endpoints: |
| 41 | + - { |
| 42 | + host: api.anthropic.com, |
| 43 | + port: 443, |
| 44 | + protocol: rest, |
| 45 | + enforcement: enforce, |
| 46 | + access: full, |
| 47 | + tls: terminate, |
| 48 | + } |
| 49 | + - { host: statsig.anthropic.com, port: 443 } |
| 50 | + - { host: sentry.io, port: 443 } |
| 51 | + - { host: raw.githubusercontent.com, port: 443 } |
| 52 | + - { host: platform.claude.com, port: 443 } |
| 53 | + binaries: |
| 54 | + - { path: /usr/local/bin/claude } |
| 55 | + - { path: /usr/bin/node } |
| 56 | + |
| 57 | + github_ssh_over_https: |
| 58 | + name: github-ssh-over-https |
| 59 | + endpoints: |
| 60 | + - host: github.com |
| 61 | + port: 443 |
| 62 | + protocol: rest |
| 63 | + tls: terminate |
| 64 | + enforcement: enforce |
| 65 | + rules: |
| 66 | + # Git Smart HTTP read-only: allow clone, fetch, pull |
| 67 | + # Discovery (query string is included in path matching) |
| 68 | + - allow: |
| 69 | + method: GET |
| 70 | + path: "/**/info/refs*" |
| 71 | + # Data transfer for reads (all repos) |
| 72 | + - allow: |
| 73 | + method: POST |
| 74 | + path: "/**/git-upload-pack" |
| 75 | + # Data transfer for writes |
| 76 | + # - allow: |
| 77 | + # method: POST |
| 78 | + # path: "/**/git-receive-pack" |
| 79 | + binaries: |
| 80 | + - { path: /usr/bin/git } |
| 81 | + |
| 82 | + nvidia_inference: |
| 83 | + name: nvidia-inference |
| 84 | + endpoints: |
| 85 | + - { host: integrate.api.nvidia.com, port: 443 } |
| 86 | + binaries: |
| 87 | + - { path: /usr/bin/curl } |
| 88 | + - { path: /bin/bash } |
| 89 | + - { path: /usr/local/bin/opencode } |
| 90 | + |
| 91 | + # --- GitHub REST API (read-only) --- |
| 92 | + github_rest_api: |
| 93 | + name: github-rest-api |
| 94 | + endpoints: |
| 95 | + - host: api.github.com |
| 96 | + port: 443 |
| 97 | + protocol: rest |
| 98 | + tls: terminate |
| 99 | + enforcement: enforce |
| 100 | + access: read-only |
| 101 | + binaries: |
| 102 | + - { path: /usr/local/bin/claude } |
| 103 | + - { path: /usr/bin/gh } |
| 104 | + |
| 105 | + pypi: |
| 106 | + name: pypi |
| 107 | + endpoints: |
| 108 | + - { host: pypi.org, port: 443 } |
| 109 | + - { host: files.pythonhosted.org, port: 443 } |
| 110 | + # uv python install downloads from python-build-standalone on GitHub |
| 111 | + - { host: github.com, port: 443 } |
| 112 | + - { host: objects.githubusercontent.com, port: 443 } |
| 113 | + # uv resolves python-build-standalone release metadata via the GitHub API |
| 114 | + - { host: api.github.com, port: 443 } |
| 115 | + - { host: downloads.python.org, port: 443 } |
| 116 | + binaries: |
| 117 | + - { path: /sandbox/.venv/bin/python } |
| 118 | + - { path: /sandbox/.venv/bin/python3 } |
| 119 | + - { path: /sandbox/.venv/bin/pip } |
| 120 | + - { path: /app/.venv/bin/python } |
| 121 | + - { path: /app/.venv/bin/python3 } |
| 122 | + - { path: /app/.venv/bin/pip } |
| 123 | + - { path: /usr/local/bin/uv } |
| 124 | + # Managed Python installations from uv python install |
| 125 | + - { path: "/sandbox/.uv/python/**" } |
| 126 | + |
| 127 | + vscode: |
| 128 | + name: vscode |
| 129 | + endpoints: |
| 130 | + - { host: update.code.visualstudio.com, port: 443 } |
| 131 | + # NOTE: OPA host matching uses exact equality, not glob — list hosts explicitly. |
| 132 | + - { host: az764295.vo.msecnd.net, port: 443 } |
| 133 | + - { host: vscode.download.prss.microsoft.com, port: 443 } |
| 134 | + - { host: marketplace.visualstudio.com, port: 443 } |
| 135 | + - { host: gallerycdn.vsassets.io, port: 443 } |
| 136 | + binaries: |
| 137 | + - { path: /usr/bin/curl } |
| 138 | + - { path: /usr/bin/wget } |
| 139 | + - { path: "/sandbox/.vscode-server/**" } |
| 140 | + - { path: "/sandbox/.vscode-remote-containers/**" } |
| 141 | + |
| 142 | + cursor: |
| 143 | + name: cursor |
| 144 | + endpoints: |
| 145 | + - { host: cursor.blob.core.windows.net, port: 443 } |
| 146 | + # NOTE: OPA host matching uses exact equality, not glob — list hosts explicitly. |
| 147 | + - { host: api2.cursor.sh, port: 443 } |
| 148 | + - { host: repo.cursor.sh, port: 443 } |
| 149 | + - { host: download.cursor.sh, port: 443 } |
| 150 | + - { host: cursor.download.prss.microsoft.com, port: 443 } |
| 151 | + binaries: |
| 152 | + - { path: /usr/bin/curl } |
| 153 | + - { path: /usr/bin/wget } |
| 154 | + - { path: "/sandbox/.cursor-server/**" } |
| 155 | + |
| 156 | + opencode: |
| 157 | + name: opencode |
| 158 | + endpoints: |
| 159 | + - host: registry.npmjs.org |
| 160 | + port: 443 |
| 161 | + - host: opencode.ai |
| 162 | + port: 443 |
| 163 | + - host: integrate.api.nvidia.com |
| 164 | + port: 443 |
| 165 | + binaries: |
| 166 | + - path: /usr/lib/node_modules/opencode-ai/bin/.opencode |
| 167 | + - path: /usr/bin/node |
| 168 | + - path: /usr/local/bin/opencode |
| 169 | + |
| 170 | + copilot: |
| 171 | + name: copilot |
| 172 | + endpoints: |
| 173 | + - { host: github.com, port: 443 } |
| 174 | + - { host: api.github.com, port: 443 } |
| 175 | + - { host: api.githubcopilot.com, port: 443 } |
| 176 | + - { host: api.enterprise.githubcopilot.com, port: 443 } |
| 177 | + - { host: release-assets.githubusercontent.com, port: 443 } |
| 178 | + - { host: copilot-proxy.githubusercontent.com, port: 443 } |
| 179 | + - { host: default.exp-tas.com, port: 443 } |
| 180 | + binaries: |
| 181 | + - { |
| 182 | + path: /usr/lib/node_modules/@github/copilot/node_modules/@github/**/copilot, |
| 183 | + } |
| 184 | + |
| 185 | + gemini: |
| 186 | + name: gemini |
| 187 | + endpoints: |
| 188 | + - { host: generativelanguage.googleapis.com, port: 443 } |
| 189 | + - { host: "*-aiplatform.googleapis.com", port: 443 } |
| 190 | + - { host: cloudcode-pa.googleapis.com, port: 443 } |
| 191 | + - { host: accounts.google.com, port: 443 } |
| 192 | + - { host: oauth2.googleapis.com, port: 443 } |
| 193 | + - { host: www.googleapis.com, port: 443 } |
| 194 | + - { host: iamcredentials.googleapis.com, port: 443 } |
| 195 | + binaries: |
| 196 | + - { path: /usr/bin/gemini } |
| 197 | + - { path: /usr/lib/node_modules/@google/gemini-cli/dist/index.js } |
| 198 | + - { path: /usr/bin/node } |
0 commit comments