feat(daemon): ardur-kernelcaptured Slice 1 — always-on eBPF daemon - #82
Merged
Conversation
Wire existing kernelcapture libraries into a runnable always-on daemon (foreground/dev mode only): - Unix-socket control plane with SO_PEERCRED auth - DaemonSessionRegistry honoring register_session TTL - cgroup→session routing index + ProcessTreeScope per session - Correlator per session; routes eBPF events → SyntheticKernelReceipt - Per-session JSONL evidence log (kernel_receipts.jsonl) - Linux: LoadAndAttachProcessExecEBPF (sched_process_exec+exit) - Non-Linux: stub that logs a warning and returns immediately - Session expiry pruner goroutine New exported surface in kernelcapture: - ProcessExecEBPFHandles / LoadAndAttachProcessExecEBPF - NewRingbufProcessSourceFromRingbufReader Out of scope (stubs): privileged install (Slice 2), enforcement (Slice 4). Refs: Epic A (#63), task #66
| if err != nil { | ||
| return err | ||
| } | ||
| defer f.Close() |
CaptureLoss was accumulated monotonically across the event loop, causing every kernel receipt after the first malformed record to carry an inflated drop count. Reset the struct immediately after each delivered event so the loss field reflects only drops observed since the previous good event. Add TestRouteEvent_SlowPathPIDTreeMatch to cover the PID-tree scan branch (CgroupID=0 scope, event CgroupID misses cgroupIndex) which had no test.
gnanirahulnutakki
marked this pull request as ready for review
July 1, 2026 05:56
This was referenced Jul 1, 2026
Merged
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Epic A Slice 1 — the
ardur-kernelcapturedforeground daemon binary that wires the existingkernelcapturelibrary components into a runnable process.Refs: #63 (Epic A: host-level kernel audit layer), #66 (daemon/launcher task).
What this ships
go/cmd/ardur-kernelcaptured/main.go— daemon struct, routing index (cgroup_id → session_id), JSONL evidence-log writer, flags, signal handlinggo/cmd/ardur-kernelcaptured/daemon_linux.go— eBPF consumer:LoadAndAttachProcessExecEBPF→ tracepoints → ringbuf →processKernelEventgo/cmd/ardur-kernelcaptured/daemon_unsupported.go— non-Linux stub (logs warning, returns error; control plane still runs)go/cmd/ardur-kernelcaptured/daemon_test.go— unit tests for routing, session lifecycle, evidence-log append, sanitize, prunego/pkg/kernelcapture/linux_ebpf_daemon_linux.go— exportsProcessExecEBPFHandles,LoadAndAttachProcessExecEBPF,NewRingbufProcessSourceFromRingbufReaderRuntime flow
The socket path (
/run/ardur/kernelcapture/control.sock) and protocol (kernelcapture.daemon.v1) matchpython/vibap/kernel_correlation.py— theardur runbridge (PR #81) is the counterpart producer.Explicitly NOT in Slice 1
ardur runbridge)Tests
All 16 Go packages green on macOS (non-Linux path). Linux eBPF path verified in the previous session against Colima kernel 6.8 (
--privileged --pid=host).