Repository navigation
feat(security): show which platforms feed the audit log and how to connect more - #2724
Conversation
…nnect more A Sources panel above the audit log lists Maple, Vercel and Google Cloud with their state (built in, receiving, no events yet, feed off, failing, not connected), 30 day event counts and the action to connect or turn each on. Events now show each platform's mark. Backed by GET /internal/audit-trail/sources, which reads per-platform counts against the integration inventory.
…gestion-discovery
Maple review🟢 Confidence 10/10 · safe to merge. State derivation, the route and the panel are pinned by tests, and the org filter is on the new query; only two cosmetic UI defects were found. Adds a Sources panel to the audit log that lists each feeding platform with its state and one action, plus a new admin-only
Before merge
Findings🔵 Note · F1 · Sources failure line points at a retry the page does not showcorrectness · "Try again from the list below" only exists when the list itself failed: the sole control sending 🔵 Note · F2 ·
|
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
Devin Review found 2 potential issues.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| if (source.state === "off" || source.state === "failing") | ||
| return linkButton(h, { variant: "outline", size: "sm", href: setupHref(source.provider) }, [ | ||
| source.state === "off" ? "Turn on" : "Open integration", | ||
| ]) |
There was a problem hiding this comment.
🟡 Google Cloud repair actions open onboarding
For connected Google Cloud accounts, setupHref sends “Turn on” and “Open integration” to new-connection onboarding. enterGcp initializes a New target, so neither action edits or repairs the existing connection.
Learn more
Google Cloud uses a dedicated creation flow on the new-source page. Its entry handler initializes a New target, and flowConnector does not resolve existing connections for that target. The flow therefore presents creation fields rather than the existing connection's settings or setup.
Example: An admin has connected project acme-prod with metrics enabled and logs disabled. The audit log shows “Audit feed off.” Clicking “Turn on” asks the admin to create a connection; entering acme-prod again fails because that scope already exists.
Recommended fix: Keep new-source onboarding for disconnected platforms. For connected Google Cloud accounts, link to the existing source's Connection tab, using the existing sourceHref routing pattern. Expose the necessary source identity in the response, or route to a connected-source selector when several scopes exist. Cover both off and failing states with navigation tests.
Was this helpful? React with 👍 or 👎 to provide feedback.
| onFailure: () => | ||
| typography(h, { size: "xs", tone: "muted", as: "p" }, [ | ||
| "Couldn't load which platforms feed the audit log. Try again from the list below.", | ||
| ]), |
There was a problem hiding this comment.
🟡 Sources failures lack a retry control
When sources fail but events load, sourcesPanel directs users to a retry control that does not exist. listBody exposes ClickedRetry only when events fail, leaving sources unavailable until page re-entry or reload.
Learn more
The sources and event list load independently. The retry handler refreshes both, but the event list renders its retry control only on failure. The page's subscription only updates the clock, so it does not recover a failed sources request.
Example: The sources endpoint returns 503 during a transient warehouse failure while the events endpoint returns 200. After the warehouse recovers, the page still displays the sources failure and offers no retry button.
Recommended fix: Render a retry control alongside the sources failure, wired to Message.ClickedRetry(), or add a sources-only retry message and command. Add a scene test with successful events and failed sources that activates the retry and verifies a new sources request.
Was this helpful? React with 👍 or 👎 to provide feedback.
🍁 Maple PR previewNote Preview resources were removed when this pull request closed. Final commit |
|
Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.
|
Why
The audit log gave no hint of what feeds it: which platforms send events, whether each one is sending, or what else can be connected.
What changed
GET /internal/audit-trail/sources, which needsaudit_log:read.auditTrailSourcesQuery, filtered by org) and checks them against the integration inventory.Screenshots
From the lab page (
/lab/security?state=audit-logandaudit-log-empty).Empty org: every platform with its Connect button.
Phone:
Notes
INGEST_AUDIT_TRAIL_ENABLEDis on in production. The API can't see that switch, so until it's on, a correctly set-up feed shows "No events yet".Tests
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.