| 1 | --- |
| 2 | type: bug |
| 3 | id: bd-d853d9c |
| 4 | status: open |
| 5 | title: "Authenticate and authorize access to the event bus" |
| 6 | created: 2026-07-17 |
| 7 | source: security review of phase1/event-log, 2026-07-17 |
| 8 | --- |
| 9 | |
| 10 | # Authenticate and authorize access to the event bus |
| 11 | |
| 12 | The bus accepts unauthenticated local connections. A local process can publish forged events, |
| 13 | subscribe to traffic, or use JetStream administration to purge or delete the stream. |
| 14 | |
| 15 | Localhost binding limits network access but does not separate trusted publishers from other |
| 16 | processes on the host. This matters on a machine that executes agent work. |
| 17 | |
| 18 | ## Required boundary |
| 19 | |
| 20 | Before widening `services.valley.bus.listen` or letting an automated consumer act on bus data, the |
| 21 | bus needs distinct permissions for publishing, subscribing, and administration. |
| 22 | |
| 23 | Hooks and the integrator need permission to publish their event types. A client tailing events needs |
| 24 | subscribe-only access. Stream administration must be restricted separately. |
| 25 | [[dcr-62ecc36]](../decisions/dcr-62ecc36-signal-contracts.md) describes the subject permissions for |
| 26 | domain events and metrics. |
| 27 | |
| 28 | Listener expansion and authentication must be deployed together. If the firewall trusts the tailnet |
| 29 | interface, widening the listener without authorization exposes the bus to other tailnet devices. |
| 30 | |
| 31 | ## Recovery and consumer behavior |
| 32 | |
| 33 | Repository events can be reconstructed from Git, which limits the effect of losing the bus |
| 34 | projection. That does not prevent a forged event from misleading a reader or an automated consumer. |
| 35 | |
| 36 | The current integrator polls repository state; it publishes outcome events rather than depending on |
| 37 | an unauthenticated event as authority to land. New consumers still need the authorization boundary |
| 38 | before acting. |
| 39 | |
| 40 | Consumers must read the schema-validated repository field in the payload. They must not infer the |
| 41 | repository by splitting subject tokens: a project name may itself contain dots. |
| 42 | |
| 43 | [[bd-500adf7]](bd-500adf7-bus-shares-git-user.md) tracks the separate filesystem isolation of the |
| 44 | bus process. |