Skip to content

feat(ui): Show the events behind a blocked IP#83

Merged
nfebe merged 1 commit into
mainfrom
feat/security-ip-event-trace
Jul 16, 2026
Merged

feat(ui): Show the events behind a blocked IP#83
nfebe merged 1 commit into
mainfrom
feat/security-ip-event-trace

Conversation

@nfebe

@nfebe nfebe commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

An operator could see that an IP was blocked and a one-line reason, but not the requests that led there: the blocked-IP list had no drill-down, the per-IP events endpoint went unused, and the events table hid each event's message and user agent. So a false positive was indistinguishable from a real attacker.

Every blocked IP, and every row in the events table, now opens a trace of that IP's recorded events, each showing path, status, user agent, and message.

Pairs with the agent-side fix that stops blocking legitimate clients and records why each block happened: flatrun/agent#176.

The blocked-IP list showed only that an address was blocked and a one-line
reason, with no way to see the requests that led there, and the security events
table hid each event's message and user agent even though the backend recorded
them. An operator could not tell a false positive from a real attacker.

Any blocked IP, and any row in the events table, now opens a per-IP trace of its
recorded events, each showing the path, status, user agent, and message. The
events that drove an auto-block are visible where the block is.
@sourceant

sourceant Bot commented Jul 16, 2026

Copy link
Copy Markdown

Code Review Summary

This PR implements a trace view for security events, allowing operators to audit the specific requests that led to an IP being blocked. This feature significantly enhances the observability of the security layer and helps in identifying false positives.

🚀 Key Improvements

  • Introduced fetchEventsByIP in the security store to drill down into specific IP history.
  • Added an interactive IP Trace dialog to SecurityView.vue with detailed event metadata.
  • Integrated trace actions into both the general events table and the blocked IPs list for better workflow.

💡 Minor Suggestions

  • Improve accessibility by adding aria-label to icon buttons.
  • Enhance robustness with better null safety in API response handling.
  • Refine error states in the UI to distinguish between empty data and fetch failures.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

</td>
<td>{{ event.status_code || "-" }}</td>
<td class="actions-cell">
<button

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon-only buttons should include an aria-label attribute to provide a clear description for screen reader users, as the title attribute is not always sufficient for accessibility.

Suggested change
<button
<button
class="btn btn-icon btn-sm"
title="View this IP's events"
aria-label="View events for this IP"
@click="showIPTrace(event.source_ip)"
>
<i class="pi pi-history" />
</button>

loadingTrace.value = true;
try {
traceEvents.value = await securityStore.fetchEventsByIP(ip);
} catch (e: any) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When an API error occurs, closing the trace dialog or explicitly handling the error state in the UI prevents the user from seeing a misleading 'Empty' state.

Suggested change
} catch (e: any) {
} catch (e: any) {
showTraceDialog.value = false;
notifications.error("Failed", e.response?.data?.error || "Failed to load events for this IP");

@nfebe
nfebe merged commit 693ce25 into main Jul 16, 2026
5 checks passed
@nfebe
nfebe deleted the feat/security-ip-event-trace branch July 16, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant