Skip to content

Conversation

@nfebe
Copy link
Contributor

@nfebe nfebe commented Dec 24, 2025

Add sub-tab under Traffic & Performance to display requests to domains not matching any deployment, with top domains, source IPs, and ability to block suspicious actors.

@sourceant
Copy link

sourceant bot commented Dec 24, 2025

Code Review Summary

This pull request introduces a valuable new "Unknown Domains" tab to the Traffic Dashboard. This feature provides dedicated insights into traffic originating from unconfigured domains, including top unknown domains and their source IPs. The implementation is well-structured, leveraging existing patterns and introducing new API calls and UI components effectively.

🚀 Key Improvements

  • Added a dedicated "Unknown Domains" tab for enhanced traffic analysis.
  • Improved test determinism in TrafficDashboard.test.ts by using fixed date strings and more robust element existence checks.
  • Introduced new API endpoints and data structures for unknown domain statistics.
  • Integrated IP blocking functionality for suspicious IPs identified in unknown domain traffic.

💡 Minor Suggestions

  • Improve the formatLogTime function to display more precise date and time information for older logs in the 'Last seen' field, enhancing clarity.

Copy link

@sourceant sourceant bot left a comment

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.

@nfebe nfebe force-pushed the feat/configurable-detection-thresholds branch from d45efea to 8cd7b90 Compare December 24, 2025 23:33
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 24, 2025

Deploying flatrun-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 22ed6d7
Status: ✅  Deploy successful!
Preview URL: https://52c8c464.flatrun-ui.pages.dev
Branch Preview URL: https://feat-configurable-detection.flatrun-ui.pages.dev

View logs

Copy link

@sourceant sourceant bot left a comment

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.

<div class="suspicious-info">
<code>{{ entry.ip }}</code>
<div class="unknown-domains-list">
<span v-for="domain in entry.domains.slice(0, 3)" :key="domain" class="tag">
Copy link

Choose a reason for hiding this comment

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

The hardcoded number 3 for entry.domains.slice(0, 3) would be more maintainable if defined as a constant within the THRESHOLDS object. This makes it easier to adjust display limits consistently across similar UI elements without searching through the code.

Suggested change
<span v-for="domain in entry.domains.slice(0, 3)" :key="domain" class="tag">
<span v-for="domain in entry.domains.slice(0, THRESHOLDS.MAX_UNKNOWN_DOMAIN_IPS_DISPLAY)" :key="domain" class="tag">

<span v-for="domain in entry.domains.slice(0, 3)" :key="domain" class="tag">
{{ domain }}
</span>
<span v-if="entry.domains.length > 3" class="tag">+{{ entry.domains.length - 3 }}</span>
Copy link

Choose a reason for hiding this comment

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

Similar to the previous suggestion, referencing a constant from THRESHOLDS for entry.domains.length - 3 would improve maintainability and consistency.

Suggested change
<span v-if="entry.domains.length > 3" class="tag">+{{ entry.domains.length - 3 }}</span>
<span v-if="entry.domains.length > THRESHOLDS.MAX_UNKNOWN_DOMAIN_IPS_DISPLAY" class="tag">+{{ entry.domains.length - THRESHOLDS.MAX_UNKNOWN_DOMAIN_IPS_DISPLAY }}</span>

Comment on lines +990 to +992
} finally {
loadingUnknown.value = false;
}
Copy link

Choose a reason for hiding this comment

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

To maintain a consistent error reporting mechanism across the application, it's recommended to use the notifications store for displaying errors encountered during API calls. This provides a unified user experience for error feedback.

Suggested change
} finally {
loadingUnknown.value = false;
}
notifications.error("Error", `Failed to fetch unknown domain stats: ${e.message}`);

Add sub-tab under Traffic & Performance to display requests to
domains not matching any deployment, with top domains, source IPs,
and ability to block suspicious actors.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
@nfebe nfebe force-pushed the feat/configurable-detection-thresholds branch from 8cd7b90 to 22ed6d7 Compare December 24, 2025 23:40
Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@nfebe nfebe merged commit e5fbd0c into main Dec 24, 2025
5 checks passed
@nfebe nfebe deleted the feat/configurable-detection-thresholds branch December 24, 2025 23:42
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.

2 participants