This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Repository navigation
Commit 7158b3d
committed
feat(sandbox): add Platform network mode for restricted K8s platforms
Add NetworkMode::Platform that enables the OpenShell supervisor to run
without any elevated capabilities on Kubernetes platforms enforcing the
restricted Pod Security Standard (e.g. OpenShift restricted-v2 SCC).
Platform Mode keeps Landlock filesystem isolation, seccomp syscall
filtering, OPA policy evaluation, credential injection, and L7
inspection via a loopback CONNECT proxy. It replaces the network
namespace (which requires CAP_SYS_ADMIN + CAP_NET_ADMIN) with
Kubernetes NetworkPolicy for L3/L4 egress control.
Changes:
- proto: add NetworkEnforcementMode enum to SandboxPolicy (field 6)
and DriverSandboxSpec (field 12), backward-compatible
- sandbox: add Platform variant to NetworkMode, wire TryFrom conversion
- sandbox: skip netns, bind proxy to loopback (127.0.0.1:3128)
- sandbox: allow AF_INET sockets in seccomp for Platform mode
- driver-k8s: zero capabilities (drop ALL), typed enum comparison
- server: propagate network_enforcement to DriverSandboxSpec
- docker/policy: add network_enforcement to all proto constructors
Ref: NVIDIA#899
Signed-off-by: Ladislav Smola <[email protected]>1 parent 69d9e06 commit 7158b3d
11 files changed
Lines changed: 221 additions & 119 deletions
File tree
- crates
- openshell-driver-docker/src
- openshell-driver-kubernetes/src
- openshell-policy/src
- openshell-sandbox/src
- sandbox/linux
- openshell-server/src/compute
- proto
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| |||
823 | 827 | | |
824 | 828 | | |
825 | 829 | | |
| 830 | + | |
826 | 831 | | |
827 | 832 | | |
828 | 833 | | |
| |||
882 | 887 | | |
883 | 888 | | |
884 | 889 | | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
895 | 900 | | |
896 | 901 | | |
897 | 902 | | |
| |||
1044 | 1049 | | |
1045 | 1050 | | |
1046 | 1051 | | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1047 | 1056 | | |
1048 | 1057 | | |
1049 | 1058 | | |
| |||
1065 | 1074 | | |
1066 | 1075 | | |
1067 | 1076 | | |
| 1077 | + | |
1068 | 1078 | | |
1069 | 1079 | | |
1070 | 1080 | | |
| |||
1265 | 1275 | | |
1266 | 1276 | | |
1267 | 1277 | | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1275 | 1303 | | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | 1304 | | |
1285 | 1305 | | |
1286 | 1306 | | |
| |||
1363 | 1383 | | |
1364 | 1384 | | |
1365 | 1385 | | |
| 1386 | + | |
1366 | 1387 | | |
1367 | 1388 | | |
1368 | 1389 | | |
| |||
1750 | 1771 | | |
1751 | 1772 | | |
1752 | 1773 | | |
| 1774 | + | |
1753 | 1775 | | |
1754 | 1776 | | |
1755 | 1777 | | |
| |||
1779 | 1801 | | |
1780 | 1802 | | |
1781 | 1803 | | |
| 1804 | + | |
1782 | 1805 | | |
1783 | 1806 | | |
1784 | 1807 | | |
| |||
1804 | 1827 | | |
1805 | 1828 | | |
1806 | 1829 | | |
| 1830 | + | |
1807 | 1831 | | |
1808 | 1832 | | |
1809 | 1833 | | |
| |||
1878 | 1902 | | |
1879 | 1903 | | |
1880 | 1904 | | |
| 1905 | + | |
1881 | 1906 | | |
1882 | 1907 | | |
1883 | 1908 | | |
| |||
1932 | 1957 | | |
1933 | 1958 | | |
1934 | 1959 | | |
| 1960 | + | |
1935 | 1961 | | |
1936 | 1962 | | |
1937 | 1963 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| |||
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
| 653 | + | |
652 | 654 | | |
653 | 655 | | |
654 | 656 | | |
| |||
1262 | 1264 | | |
1263 | 1265 | | |
1264 | 1266 | | |
| 1267 | + | |
1265 | 1268 | | |
1266 | 1269 | | |
1267 | 1270 | | |
| |||
0 commit comments