You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Coder boundary: audit records in the final flush window are dropped from the coderd forward on shutdown (local log keeps them) #1019
Summary: When a boundary-wrapped command exits shortly after a request, that request's audit record reaches the local --log-dir file but is not forwarded to coderd (coderd.agentrpc: boundary_request). The coderd forward is an async periodic (~5s) batch with no flush/drain on shutdown, so any record in the final interval before the wrapped command exits is silently lost centrally. Independent of decision (allow/deny).
Steps to reproduce
Allowlist = domain=www.docker.com only.
Compare the local --log-dir file against the coderd boundary_request logs on all replicas. Variant A — trailing ALLOW lands 40 ms before shutdown (DENY had a ~5s window):
Record
Local log
coderd
DENY kubernetes.io @ 14:23:51.600Z
✅
✅ present
ALLOW www.docker.com @ 14:23:56.664Z
✅
❌ missing (all 3 replicas)
Variant B — both records within ~110 ms of shutdown, no window:
Record
Local log
coderd
DENY kubernetes.io @ 14:42:18.273Z
✅
❌ missing
ALLOW www.docker.com @ 14:42:18.321Z
✅
❌ missing
Impact
Short-lived invocations are the canonical use case for Agent Firewall (boundary -- ). For any such command the trailing audit record — and for very short commands all records — never reach the central coderd audit stream, while the local file log is complete. Centralized audit is therefore silently incomplete for exactly the workloads Agent Firewall is designed to wrap.
Suggested fix: on the wrapped command's exit, flush/drain the pending audit buffer to the log-proxy socket and await ack before boundary exits (optionally with a bounded drain timeout).
Thanks for the detailed report and reproduction! The root cause is in coder/boundary. audit.SetupAuditor starts the socket auditor's loop on the CLI context and nothing waits for it, so the process exits before the last batch is flushed.
I opened a fix in coder/boundary#215. With it, both records from your Variant B reach the agent. Could a maintainer transfer this issue to coder/boundary so it's tracked next to the fix?
Activity
linear-code commentedon Jul 17, 2026
ENG-3060
a-palamarchuk commentedon Oct 3, 2026
Thanks for the detailed report and reproduction! The root cause is in coder/boundary.
audit.SetupAuditorstarts the socket auditor's loop on the CLI context and nothing waits for it, so the process exits before the last batch is flushed.I opened a fix in coder/boundary#215. With it, both records from your Variant B reach the agent. Could a maintainer transfer this issue to coder/boundary so it's tracked next to the fix?