()
| 1386 | } |
| 1387 | |
| 1388 | fn test_proto() -> ProtoSandboxPolicy { |
| 1389 | let mut network_policies = std::collections::HashMap::new(); |
| 1390 | network_policies.insert( |
| 1391 | "claude_code".to_string(), |
| 1392 | NetworkPolicyRule { |
| 1393 | name: "claude_code".to_string(), |
| 1394 | endpoints: vec![ |
| 1395 | NetworkEndpoint { |
| 1396 | host: "api.anthropic.com".to_string(), |
| 1397 | port: 443, |
| 1398 | ..Default::default() |
| 1399 | }, |
| 1400 | NetworkEndpoint { |
| 1401 | host: "statsig.anthropic.com".to_string(), |
| 1402 | port: 443, |
| 1403 | ..Default::default() |
| 1404 | }, |
| 1405 | ], |
| 1406 | binaries: vec![NetworkBinary { |
| 1407 | path: "/usr/local/bin/claude".to_string(), |
| 1408 | ..Default::default() |
| 1409 | }], |
| 1410 | }, |
| 1411 | ); |
| 1412 | network_policies.insert( |
| 1413 | "gitlab".to_string(), |
| 1414 | NetworkPolicyRule { |
| 1415 | name: "gitlab".to_string(), |
| 1416 | endpoints: vec![NetworkEndpoint { |
| 1417 | host: "gitlab.com".to_string(), |
| 1418 | port: 443, |
| 1419 | ..Default::default() |
| 1420 | }], |
| 1421 | binaries: vec![NetworkBinary { |
| 1422 | path: "/usr/bin/glab".to_string(), |
| 1423 | ..Default::default() |
| 1424 | }], |
| 1425 | }, |
| 1426 | ); |
| 1427 | ProtoSandboxPolicy { |
| 1428 | version: 1, |
| 1429 | filesystem: Some(ProtoFs { |
| 1430 | include_workdir: true, |
| 1431 | read_only: vec!["/usr".to_string(), "/lib".to_string()], |
| 1432 | read_write: vec!["/sandbox".to_string(), "/tmp".to_string()], |
| 1433 | }), |
| 1434 | landlock: Some(openshell_core::proto::LandlockPolicy { |
| 1435 | compatibility: "best_effort".to_string(), |
| 1436 | }), |
| 1437 | process: Some(ProtoProc { |
| 1438 | run_as_user: "sandbox".to_string(), |
| 1439 | run_as_group: "sandbox".to_string(), |
| 1440 | }), |
| 1441 | network_policies, |
| 1442 | } |
| 1443 | } |
| 1444 | |
| 1445 | #[test] |
no outgoing calls
no test coverage detected