gunk-dev/the-valley

bd-d853d9c-bus-unauthenticated.md

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