@@ -61,10 +61,6 @@ pub struct HostProxyConfig {
6161 pub bind_addr : SocketAddr ,
6262 /// Network-only policy produced by the compute driver's policy split.
6363 pub policy : ProtoSandboxPolicy ,
64- /// Static process identity used when the platform cannot recover the
65- /// socket-owning sandbox process. Policy binaries must match this path for
66- /// L4/L7 allow rules to pass.
67- pub binary_path : PathBuf ,
6864 /// Per-sandbox client authentication. Host-side MXC proxies must set this
6965 /// so another sandbox cannot borrow this proxy's identity and policy.
7066 pub client_auth : HostProxyClientAuth ,
@@ -215,10 +211,9 @@ pub async fn start_host_proxy(config: HostProxyConfig) -> Result<HostProxyHandle
215211 ( None , None , None )
216212 }
217213 } ;
218- let identity_mode = ProxyIdentityMode :: static_binary_with_client_auth (
219- config. binary_path ,
220- Some ( config. client_auth . expected_proxy_authorization ) ,
221- ) ?;
214+ let identity_mode = ProxyIdentityMode :: windows_with_client_auth ( Some (
215+ config. client_auth . expected_proxy_authorization ,
216+ ) ) ;
222217 let proxy = ProxyHandle :: start_with_bind_addr (
223218 & proxy_policy,
224219 Some ( config. bind_addr ) ,
@@ -256,14 +251,13 @@ mod tests {
256251
257252 use super :: * ;
258253
259- fn test_config ( bind_addr : SocketAddr , binary_path : PathBuf ) -> HostProxyConfig {
254+ fn test_config ( bind_addr : SocketAddr ) -> HostProxyConfig {
260255 HostProxyConfig {
261256 bind_addr,
262257 policy : ProtoSandboxPolicy {
263258 version : 1 ,
264259 ..Default :: default ( )
265260 } ,
266- binary_path,
267261 client_auth : HostProxyClientAuth :: basic ( "openshell" , "test-secret" ) ,
268262 sandbox_id : Some ( "sandbox-123" . to_string ( ) ) ,
269263 sandbox_name : Some ( "agent-box" . to_string ( ) ) ,
@@ -307,7 +301,9 @@ mod tests {
307301 let mut client = TcpStream :: connect ( addr) . await . unwrap ( ) ;
308302 client. write_all ( request. as_bytes ( ) ) . await . unwrap ( ) ;
309303 let mut response = Vec :: new ( ) ;
310- tokio:: time:: timeout ( Duration :: from_secs ( 2 ) , client. read_to_end ( & mut response) )
304+ // The first authenticated CONNECT performs a full executable hash for
305+ // TOFU identity binding; debug test binaries can be hundreds of MB.
306+ tokio:: time:: timeout ( Duration :: from_secs ( 10 ) , client. read_to_end ( & mut response) )
311307 . await
312308 . unwrap ( )
313309 . unwrap ( ) ;
@@ -316,11 +312,7 @@ mod tests {
316312
317313 #[ tokio:: test]
318314 async fn rejects_non_loopback_bind_addr ( ) {
319- let result = start_host_proxy ( test_config (
320- ( [ 192 , 0 , 2 , 1 ] , 0 ) . into ( ) ,
321- PathBuf :: from ( "missing-agent.exe" ) ,
322- ) )
323- . await ;
315+ let result = start_host_proxy ( test_config ( ( [ 192 , 0 , 2 , 1 ] , 0 ) . into ( ) ) ) . await ;
324316
325317 let Err ( err) = result else {
326318 panic ! ( "host proxy should reject non-loopback bind addresses" ) ;
@@ -333,10 +325,7 @@ mod tests {
333325
334326 #[ tokio:: test]
335327 async fn rejects_middleware_policy_without_registry ( ) {
336- let mut config = test_config (
337- ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) ,
338- PathBuf :: from ( "missing-agent.exe" ) ,
339- ) ;
328+ let mut config = test_config ( ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) ) ;
340329 config. policy . network_middlewares . insert (
341330 "redactor" . into ( ) ,
342331 NetworkMiddlewareConfig {
@@ -365,15 +354,9 @@ mod tests {
365354 #[ tokio:: test]
366355 async fn starts_loopback_proxy_and_serves_policy_local ( ) {
367356 let _ = rustls:: crypto:: aws_lc_rs:: default_provider ( ) . install_default ( ) ;
368- let binary = tempfile:: NamedTempFile :: new ( ) . unwrap ( ) ;
369- std:: fs:: write ( binary. path ( ) , b"agent" ) . unwrap ( ) ;
370-
371- let handle = start_host_proxy ( test_config (
372- ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) ,
373- binary. path ( ) . to_path_buf ( ) ,
374- ) )
375- . await
376- . unwrap ( ) ;
357+ let handle = start_host_proxy ( test_config ( ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) ) )
358+ . await
359+ . unwrap ( ) ;
377360
378361 let addr = handle. http_addr ( ) . expect ( "proxy should report bound addr" ) ;
379362 assert ! ( addr. ip( ) . is_loopback( ) ) ;
@@ -413,9 +396,6 @@ mod tests {
413396
414397 #[ tokio:: test]
415398 async fn per_sandbox_credentials_reject_missing_wrong_cross_and_duplicate_auth ( ) {
416- let binary = tempfile:: NamedTempFile :: new ( ) . unwrap ( ) ;
417- std:: fs:: write ( binary. path ( ) , b"agent" ) . unwrap ( ) ;
418-
419399 let auth_a = HostProxyClientAuth :: basic ( "openshell" , "sandbox-a-secret" ) ;
420400 let auth_b = HostProxyClientAuth :: basic ( "openshell" , "sandbox-b-secret" ) ;
421401 // Node's EnvHttpProxyAgent currently emits the field name in lower
@@ -429,11 +409,11 @@ mod tests {
429409 auth_b. expected_proxy_authorization
430410 ) ;
431411
432- let mut config_a = test_config ( ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) , binary . path ( ) . to_path_buf ( ) ) ;
412+ let mut config_a = test_config ( ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) ) ;
433413 config_a. client_auth = auth_a;
434414 let proxy_a = start_host_proxy ( config_a) . await . unwrap ( ) ;
435415
436- let mut config_b = test_config ( ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) , binary . path ( ) . to_path_buf ( ) ) ;
416+ let mut config_b = test_config ( ( [ 127 , 0 , 0 , 1 ] , 0 ) . into ( ) ) ;
437417 config_b. client_auth = auth_b;
438418 let proxy_b = start_host_proxy ( config_b) . await . unwrap ( ) ;
439419
0 commit comments