Repository navigation
Dashboard Activity page: search the audit log by time, service, agent and path (152) - #153
Merged
Merged
Conversation
… and path (152) Owner-only, read-only. A UTC minute window (default the last hour), with optional service, agent and path-contains filters; newest first, at most 500 rows. The never-rotated log is streamed and a line's time compared as text before decoding; overlong or non-JSON lines are skipped; everything is HTML-escaped.
Contributor
Author
Decision: Findings
Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
jerryfane
added a commit
that referenced
this pull request
Nov 15, 2026
…post-merge review P2) A record is written when its call ends but stamped with its start, so a slow older call written last displaced a newer one. Keep a min-heap by time.
jerryfane
added a commit
that referenced
this pull request
Nov 15, 2026
…eyring/audit (154) (#155) * Owner can allow an agent to search the audit log: audit_read, GET /_keyring/audit (154) Owner decision 2026-11-15: per agent, off by default. The agent's page has Allow audit search / Stop audit access (password; audited as agent_audit_read; saved as "audit_read": true on the role). An allowed role calls GET /_keyring/audit with its token (through a relay: /<role>/_keyring/audit) and the same filters as the Activity page, and gets JSON. Others get 403. One search at a time (429); each search is audited. The search moves from the dashboard to server.SearchAudit, shared by both. * Audit search keeps the newest 500 by time, not the last written (#153 post-merge review P2) A record is written when its call ends but stamped with its start, so a slow older call written last displaced a newer one. Keep a min-heap by time. * Audit search: fractional RFC 3339 windows match exactly (#155 review F1) Records are stamped to the second, so round both bounds up to whole seconds: for whole-second t, t >= x and t < y iff t >= ceil(x) and t < ceil(y). The response reports the rounded window. * Audit search: keep the caller's window exact; round only when comparing (#155 review f1/f2) AuditWindow returns the bounds as given, fractions included, and the JSON answer echoes them with RFC3339Nano, so a returned window can be replayed. SearchAudit rounds up to whole seconds only for its text comparison.
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.
Closes 152. Jarvis 488255: to find which agent cancelled macserve job j_ce4ce15b at 16:39:53Z the owner needs sudo to read the audit log on the Studio.
Change
GET /activity(owner session, read-only, new nav item): UTC window by the minute (datetime-local; default the last hour; end minute included), optional exact service, exact agent, path-contains."time"is compared as text before JSON decoding. Non-JSON lines skipped. Missing log → "There is no audit log yet."Not in this PR: any agent/coordinator access to the audit (permission change, needs the owner).
Evidence
TestActivityFindsTheCallerByMinuteAndPath: an audit file with the target cancel, a same-minute call on another job, a later cancel by another role, a dashboard event, a<script>role, a 70 KiB line, a non-JSON line, and an older hour: the query (16:39–16:39, macserve-builds, path j_ce4ce15b) lists only the target and the escaped row, newest first; without filters the dashboard event shows; a bad time is a 400 with the format hint.