From 96307f39da721ef45dce52f3aafeb5c8142b476b Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 13 Nov 2026 23:55:27 +0000 Subject: [PATCH 1/3] test(adapter): cover browser dials when audit is required Add a regression test asserting that browser dials, which carry no audit correlation, are still authorized, consumed and validated when the host requires audit. Without this, every browser navigation was refused with "required audit needs bound permission". Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .../tinysecurity-module/src/adapter_tests.rs | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/crates/tinysecurity-module/src/adapter_tests.rs b/crates/tinysecurity-module/src/adapter_tests.rs index 4a6fa3f5..be2a5b53 100644 --- a/crates/tinysecurity-module/src/adapter_tests.rs +++ b/crates/tinysecurity-module/src/adapter_tests.rs @@ -1622,6 +1622,73 @@ async fn native_open_public_policy_and_credentials_only_redaction_dispatch() Ok(()) } +/// A host that runs TinySecurity as its secret authority makes audit required, +/// and the browser dial members carry no audit correlation. They must still +/// authorize, consume and validate: refusing them refused every browser +/// navigation ("required audit needs bound permission", seen as Chrome's +/// ERR_TUNNEL_CONNECTION_FAILED on every page). +#[tokio::test] +async fn browser_dials_are_authorized_when_audit_is_required() +-> std::result::Result<(), Box> { + let bus = MemoryBus::new(); + let task = Broker::new().spawn(bus.clone()); + let host = Connection::connect(bus.connect().await?).await?; + let module = Connection::connect(bus.connect().await?).await?; + let audit = crate::callbacks::AuditClient::new_for_test( + module, + crate::callbacks::PeerBinding::new( + host.unique_name().as_ref().map(tinybus::BusName::as_str), + )?, + AuditConfig2 { + scope: SubjectScope { + user: "user".into(), + workspace: "workspace".into(), + agent: "agent".into(), + }, + stream_id: "a".repeat(32), + timeout_ms: 100, + required: true, + native_path: None, + max_bytes: 10000, + max_archives: 3, + journal_max_bytes: 100_000, + journal_max_events: 1000, + }, + tinysecurity::Redactor::new(&RedactorConfig::default())?, + )?; + let server = Connection::connect(bus.connect().await?).await?; + let service = service_for( + Arc::new(RwLock::new(Policy::new(ModuleConfig::default())?)), + Some(Arc::new(audit)), + ); + assert!(service.audit_required()); + server.serve_at(names::OBJECT_PATH.try_into()?, service).await?; + server.request_name(names::INTERFACE).await?; + let client = Connection::connect(bus.connect().await?).await?; + let proxy = client.proxy(names::INTERFACE, names::OBJECT_PATH, names::INTERFACE)?; + let policy = EgressPolicy { + owner: SubjectScope { + user: "user".into(), + workspace: "workspace".into(), + agent: "agent".into(), + }, + ceiling: AccessTier::Full, + privacy: PrivacyMode::Standard, + destinations: vec![], + data_categories: vec![DataCategory::OpaqueBrowserTraffic], + local_capabilities: vec![], + validity_ms: 30000, + open_public: true, + preflight_transports: vec![EgressTransport::Browser], + }; + let id: EgressPolicyId = proxy + .call(names::methods::REGISTER_EGRESS_POLICY, (policy,)) + .await?; + assert_browser_dial_contract(&proxy, id).await?; + task.abort(); + Ok(()) +} + /// Exercise existing scoped egress dispatch against a live native module fixture. async fn assert_scoped_egress_contract( proxy: &tinybus::Proxy, From 83cd941d264273bac188b06621b6549bd3bf0c04 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 13 Nov 2026 23:56:04 +0000 Subject: [PATCH 2/3] fix(tinysecurity-module): allow browser dials when audit is required The three browser dial members no longer call require_unbound_permission, so they answer even when audit is required. A dial carries no payload or host audit correlation and only applies destination rules of a policy the authenticated host registered, so refusing it broke every page of a host using this module as its secret authority. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- crates/tinysecurity-module/src/adapter.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/tinysecurity-module/src/adapter.rs b/crates/tinysecurity-module/src/adapter.rs index d9cee565..220de3db 100644 --- a/crates/tinysecurity-module/src/adapter.rs +++ b/crates/tinysecurity-module/src/adapter.rs @@ -1014,11 +1014,17 @@ impl PolicyService { .await } /// Authorize one browser proxy destination using its registered egress policy. + /// + /// The three browser dial members answer even when audit is required. A dial + /// carries no payload and no host audit correlation (the proxy opens one per + /// connection, with no turn behind it to bind an event to), and it only ever + /// applies the destination rules of a policy the authenticated host + /// registered. Refusing them under required audit refused every page of a + /// host that runs this module as its secret authority. async fn authorize_browser_dial( &self, request: tinysecurity_bus::BrowserDialRequest, ) -> BusResult { - self.require_unbound_permission()?; let scope = self .egress .lock() @@ -1037,7 +1043,6 @@ impl PolicyService { &self, request: tinysecurity_bus::ConsumeBrowserDialRequest, ) -> BusResult { - self.require_unbound_permission()?; let scope = self .egress .lock() @@ -1054,7 +1059,6 @@ impl PolicyService { &self, request: tinysecurity_bus::ValidateBrowserDialRequest, ) -> BusResult { - self.require_unbound_permission()?; let scope = self .egress .lock() From 4c174257e0879a79ddf1556ed177e48117995614 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Sat, 14 Nov 2026 00:00:16 +0000 Subject: [PATCH 3/3] docs(egress): say browser dials answer under required audit Co-authored-by: Medulla --- docs/specs/browser-dial-contract-1.28.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/specs/browser-dial-contract-1.28.md b/docs/specs/browser-dial-contract-1.28.md index 55ed8358..5f29828d 100644 --- a/docs/specs/browser-dial-contract-1.28.md +++ b/docs/specs/browser-dial-contract-1.28.md @@ -38,3 +38,11 @@ oversized answer sets, private or otherwise non-global candidates, expired grants, stale generations, mismatched scope or destination, and replayed consumption all deny. The host must call this member only through its private authenticated adapter; JSON identity fields never authenticate themselves. + +Required audit does not refuse these three members. A host that makes +TinySecurity its secret authority runs with audit required, which refuses +every permission member that carries no audit correlation. A browser dial has +none to carry: the proxy opens one per connection, with no agent turn behind +it to bind a durable event to, and the member only applies the destination +rules of a policy the authenticated host registered. Refusing them refused +every page such a host's browser opened.