test(sandbox): allow launcher checks in independent VMs
This commit is contained in:
@@ -122,6 +122,11 @@ FD、栈和其他信号仍按原退出状态记录,缺少专门证据时不猜
|
||||
协议回归验证边界与失败锁定。这些测试没有运行用户代码或安全攻击,不是 Linux 隔离验收。
|
||||
目标进程的阻塞/放行、完整 FD 白名单、进程树监督、阶段回滚及独立 VM 安全验收仍待完成。
|
||||
|
||||
移入独立 Linux 测试 VM 时,可为已构建的 `launcher_control` 测试二进制设置
|
||||
`KF_SANDBOX_TEST_BIN=/kf/bin/kf-sandbox`,指定 VM 内同次构建的可信启动器路径;
|
||||
默认仍使用 Cargo 构建的路径。此变量只由测试读取,启动器子进程仍清空环境。
|
||||
在 VM 内直接验证 GNU 工具链或这些控制测试,只能证明测试载荷可用,不能作为沙箱隔离验收。
|
||||
|
||||
## 可信运行配置与启动前检查
|
||||
|
||||
```bash
|
||||
|
||||
@@ -34,7 +34,11 @@ impl Attempt {
|
||||
let listener = UnixListener::bind(&socket).unwrap();
|
||||
listener.set_nonblocking(true).unwrap();
|
||||
let deadline = Instant::now() + Duration::from_secs(5);
|
||||
let child = Command::new(env!("CARGO_BIN_EXE_kf-sandbox"))
|
||||
// A trusted test operator can relocate the executable into an independent VM.
|
||||
// The launched entry still receives an empty environment.
|
||||
let binary = std::env::var_os("KF_SANDBOX_TEST_BIN")
|
||||
.unwrap_or_else(|| env!("CARGO_BIN_EXE_kf-sandbox").into());
|
||||
let child = Command::new(binary)
|
||||
.arg("launcher")
|
||||
.arg("--control-socket")
|
||||
.arg(&socket)
|
||||
|
||||
Reference in New Issue
Block a user