Prismatic Hawkeye Web

Prismatic Hawkeye Web

210 files Intelligence

Overview

Prismatic Hawkeye Web provides the LiveView-based dashboard for the HAWKEYE visitor intelligence system. It renders real-time visitor analytics, behavioral pattern visualizations, threat indicator alerts, and entity intelligence gathered from web traffic analysis -- all delivered through server-rendered HTML with WebSocket-driven live updates that require zero client-side JavaScript frameworks.

The dashboard transforms raw visitor data from Prismatic Hawkeye into actionable intelligence views. Operators can drill down from aggregate traffic patterns to individual visitor sessions, examining technology fingerprints, geographic origins, and behavioral classifications. The threat view surfaces bot activity, credential stuffing attempts, and reconnaissance patterns in real time, enabling immediate response to active threats.

Built entirely with TailwindCSS and Flowbite components, the interface follows the platform's design standards for consistency across all dashboard applications. Every component leverages Phoenix LiveView's efficient DOM diffing to minimize bandwidth usage while maintaining sub-second update latency. The architecture ensures that no sensitive visitor intelligence data is exposed in client-side JavaScript state -- the server computes HTML diffs and pushes only changed bytes over the WebSocket connection, maintaining both performance and security.

Architecture

Prismatic Hawkeye (Backend)
        | PubSub Events
Hawkeye Web LiveView Processes
        | WebSocket Push
Browser Dashboard (Server-Rendered HTML)
        |
TailwindCSS + Flowbite Components

Each connected dashboard session runs as an independent LiveView process supervised under OTP. The PubSub system broadcasts visitor events to all connected sessions, ensuring every operator sees identical real-time data without polling overhead.

The LiveView architecture provides several advantages for an intelligence dashboard. Server-side rendering means that no visitor data needs to be serialized to JSON and sent to a client-side framework -- the server computes the HTML diff and pushes only the changed bytes over the WebSocket connection. This reduces both bandwidth consumption and the risk of sensitive intelligence data being exposed in client-side JavaScript state.

Key Modules

ModuleResponsibility
PrismaticHawkeyeWebWeb application entry point and router configuration
PrismaticHawkeyeWeb.DashboardLiveMain intelligence dashboard with summary metrics
PrismaticHawkeyeWeb.VisitorsLiveVisitor detail view with session history and fingerprints
PrismaticHawkeyeWeb.ThreatsLiveActive threat indicators and bot detection display
PrismaticHawkeyeWeb.AnalyticsLiveAnalytics, reporting, and trend analysis views
PrismaticHawkeyeWeb.ComponentsShared LiveView components for charts, tables, and indicators
PrismaticHawkeyeWeb.Components.ThreatIndicatorSeverity-colored threat card component with confidence display
PrismaticHawkeyeWeb.Components.VisitorCardVisitor summary card with fingerprint and geographic data

Key Features

Real-Time Dashboard

  • Live visitor count with geographic distribution maps updated in real time
  • Behavioral pattern visualization with clustering overlays showing visitor segments
  • Threat indicator alerts with severity-based color coding and escalation actions
  • Technology stack fingerprinting display (OS, browser, libraries, frameworks)

Dashboard Mount and Event Handling

The main dashboard subscribes to multiple PubSub channels on mount, receiving real-time updates for visitor events, threat alerts, and analytics changes:

defmodule PrismaticHawkeyeWeb.DashboardLive do
  use PrismaticHawkeyeWeb, :live_view

  @impl true
  def mount(_params, _session, socket) do
    if connected?(socket) do
      PrismaticHawkeye.subscribe(:visitor_events)
      PrismaticHawkeye.subscribe(:threat_alerts)
      PrismaticHawkeye.subscribe(:analytics_updates)
    end

    {:ok, assign(socket,
      visitors: load_recent_visitors(),
      threats: load_active_threats(),
      stats: load_dashboard_stats(),
      visitor_count: PrismaticHawkeye.active_visitor_count()
    )}
  end

  @impl true
  def handle_info({:visitor_event, event}, socket) do
    visitors = update_visitor_list(socket.assigns.visitors, event)
    stats = recalculate_stats(visitors)
    count = socket.assigns.visitor_count + visitor_count_delta(event)
    {:noreply, assign(socket, visitors: visitors, stats: stats, visitor_count: count)}
  end
end

Analytics Views

  • Visitor segmentation by behavior patterns and risk profile with drill-down capability
  • Geographic heatmap of access origins with drill-down by region and country
  • Temporal access pattern analysis with hourly and daily aggregations for trend identification
  • Bot vs. human traffic classification with confidence scores and evidence links

Intelligence Reports

  • Entity-specific intelligence summaries with threat timeline and behavioral history
  • Automated threat briefings generated from detection rules with severity prioritization
  • Periodic analytics reports with configurable delivery schedules and distribution lists
  • Custom dashboard configurations saved per operator for personalized intelligence views

Threat Detection Views

The threat detection views provide real-time visibility into malicious activity patterns. Each threat indicator is displayed with its classification, confidence level, source evidence, and recommended response action.

Threat TypeDetection MethodAlert Level
Bot ActivityBehavioral fingerprintingMedium-High
Credential StuffingLogin velocity analysisCritical
ReconnaissancePath traversal patternsHigh
API AbuseRate pattern analysisMedium
Data ScrapingContent access patternsMedium
# LiveView component for threat indicator display
defmodule PrismaticHawkeyeWeb.Components.ThreatIndicator do
  use Phoenix.Component

  attr :threat, :map, required: true
  attr :class, :string, default: ""

  def threat_card(assigns) do
    ~H"""
    <div class={"rounded-lg border p-4 #{severity_class(@threat.severity)} #{@class}"}>
      <div class="flex items-center justify-between">
        <span class="font-semibold"><%= @threat.type %></span>
        <span class="text-sm"><%= @threat.confidence %>% confidence</span>
      </div>
      <p class="mt-2 text-sm text-gray-400"><%= @threat.description %></p>
    </div>
    """
  end
end

Visitor Session Detail

The visitor detail view provides comprehensive session reconstruction, showing every page visited, interaction timing, and behavioral signals that contributed to classification decisions:

Data PointSourceUpdate Frequency
Page navigationServer-side route trackingReal-time
Technology fingerprintUser-agent + JS feature detectionOn session start
Geographic originIP geolocation with ISP dataOn session start
Behavioral classificationML model scoringEvery 30 seconds
Risk assessmentMulti-signal fusionOn each event

Routes

RouteView
/hawkeyeMain intelligence dashboard with summary metrics
/hawkeye/visitorsVisitor details, session history, and fingerprints
/hawkeye/threatsActive threat indicators and bot detection
/hawkeye/analyticsAnalytics, reporting, and trend analysis

Usage

The web interface is served via Phoenix LiveView with real-time WebSocket updates. Access is controlled through the platform's authentication and RBAC system.

# LiveView mount with real-time subscription
def mount(_params, session, socket) do
  if connected?(socket) do
    PrismaticHawkeye.subscribe(:visitor_events)
    PrismaticHawkeye.subscribe(:threat_alerts)
  end

  {:ok, assign(socket, visitors: [], threats: [], stats: load_stats())}
end

# Handle incoming visitor events via PubSub
def handle_info({:visitor_event, event}, socket) do
  visitors = update_visitor_list(socket.assigns.visitors, event)
  stats = recalculate_stats(visitors)
  {:noreply, assign(socket, visitors: visitors, stats: stats)}
end

# Handle threat alerts with severity-based routing
def handle_info({:threat_alert, alert}, socket) do
  threats = [alert | socket.assigns.threats] |> Enum.take(100)
  {:noreply, assign(socket, threats: threats)}
end

NABLA Compliance

NABLA AxiomHawkeye Web EnforcementImplementation
Provenance MandatoryEvery displayed data point traceable to source eventVisitor events carry full provenance chain from collection to display
Signal PluralityMultiple behavioral signals combined for threat classificationBot detection uses fingerprinting, velocity, and pattern signals
Time DecayDashboard timestamps reflect data freshnessStale data indicators on widgets when events stop arriving
Source IndependenceIndependent PubSub channels per data typeVisitor events and threat alerts use separate subscription channels
Contradiction PreservationConflicting classification signals displayed togetherBoth bot and human indicators shown when signals disagree

Testing

LiveView tests verify component rendering, PubSub event handling, and WebSocket state management. Route tests verify authentication and RBAC enforcement on all dashboard paths. Component tests verify correct rendering of threat indicators, visitor cards, and analytics charts with known data fixtures.

Integration tests exercise the full pipeline from backend event emission through PubSub delivery to LiveView DOM updates. Performance tests verify that dashboard mount time stays under 150ms and event processing under 50ms as required by the platform's page load performance standard.

Integration Points

ApplicationRelationship
Prismatic HawkeyeBackend intelligence engine providing all visitor data
Prismatic WebHost Phoenix application and shared layout components
Prismatic Visitor IntelligenceDeep visitor analysis and classification
Prismatic Detection EngineRule-based threat detection driving alert views
Prismatic AuthAuthentication and RBAC for dashboard access control

Performance

OperationLatencyNotes
Dashboard mount< 150msInitial page load with data
Event processing< 50msPubSub to DOM update
WebSocket round-trip< 100msServer push to browser render
Analytics query< 200msAggregated data computation
Threat alert display< 50msFrom detection to visual indicator
Visitor detail load< 120msSession history with fingerprints

Telemetry events: [:prismatic, :hawkeye_web, :page_load], [:prismatic, :hawkeye_web, :event_processed], [:prismatic, :hawkeye_web, :threat_displayed].


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL