Skip to content

aisurf3r/Sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SENTINEL // Global Cyber Threat Map

A real-time, bilingual (English / Spanish) cyber-threat intelligence dashboard with an interactive world attack map, live threat feeds, IP reputation scanning, malware family tracking, and cybersecurity news β€” built with a modern, "geeky" cyberpunk terminal aesthetic.

SENTINEL Dashboard

{EFAA45E2-37FB-430C-935B-D37467CC4992} {4E305313-5C5E-4A4A-BA6E-83350989A73C} {54DA4B09-7331-46FB-8EB9-68E34554E81D}

SENTINEL aggregates live threat intelligence from five public APIs (AbuseIPDB, abuse.ch ThreatFox, AlienVault OTX, Pulsedive, NewsAPI) and visualizes country-to-country attack trajectories on an animated world map, alongside KPIs, charts, indicator tables, and an IP reputation scanner.


✨ Features

Real-time Threat Visualization

  • Interactive world attack map (Flow mode) β€” ECharts geo map with animated, severity-colored flying-line arcs tracing attacks from origin β†’ target countries in real time. Pulsing effect-scatter markers on targets, zoom & pan supported. Click any attack line/target to open a detail dialog.
  • Heatmap mode β€” switch the map to a choropleth intensity visualization where countries are shaded by total attack volume. Hover any country to see outgoing attacks (emitidos), incoming attacks (recibidos), and total with intensity percentage.
  • Critical-attack auto-alarm β€” when a critical-severity attack is detected, the map automatically zooms to the attacker's country for 6 seconds while a flashing red alarm banner ("CRITICAL ATTACK!") displays the attack route, then returns to the general view. No popup β€” purely visual.
  • Attack detail dialog β€” click any live-feed entry or map attack point to see the full trajectory (source β†’ target), IPs, port, timestamp, coordinates. Includes a "View on map" button that isolates that single attack on the map for 5 seconds (without zoom) then restores all attacks.
  • Live scrolling threat feed β€” new attacks stream in and prepend to a live list with severity badges, timestamps, ports, and attack types. Click any entry for details.
  • Scrolling threat ticker β€” marquee of the latest global attack events across the top.

Intelligence Panels

  • KPI stat cards β€” Total Attacks, Blocked, Active Threats, Countries Monitored, threats/min β€” with animated counters.
  • Threat-level gauge β€” DEFCON-style 5-level indicator (Low β†’ Critical) with ascending pulsing bars.
  • Top Attack Sources / Targets β€” ranked country bars with flags and counts. Click a country to focus the map on attacks involving it.
  • Attack Type Distribution β€” donut chart (DDoS, Brute Force, Malware, Phishing, Ransomware, …) with a live legend.
  • Top Threat Actors / Malware Families β€” aggregates IOCs by malware family (AgentTesla, RedLine, Qakbot, Emotet, TrickBot, etc.) with colored bars and IOC counts. Click a family to filter the IOC table.
  • 24h Attack Timeline β€” stacked area chart of attacks / blocked / critical over the last 24 hours.
  • Recent Threat Indicators (IOCs) β€” searchable, filterable table of IPs, domains, hashes & URLs from 4 feeds. Filter by type, source, category, confidence, or malware family. Export to CSV/JSON.
  • Threat Intelligence Sources β€” live health panel showing which of the 4 intel feeds are online. Click a source card to filter the IOC table to that source.
  • IP Reputation Scanner β€” enter any IPv4/IPv6 address to get a live AbuseIPDB abuse-confidence score, ISP, country, reports, hostnames, and abuse categories. Includes a scan history (last 5 IPs, persisted to localStorage) for quick re-checking.
  • Cybersecurity News β€” latest cyber-attack / breach / vulnerability headlines (clickable, opens source).

Interactivity & Controls

  • Pause / Resume β€” pause all live updates with the header button or the Space key.
  • Map focus β€” click any top-source/target country to filter the map to attacks involving it; press Esc or click "Clear focus" to reset.
  • Keyboard shortcuts β€” Space (pause), / (focus search), Esc (clear focus), M (toggle map mode), ? (shortcuts help dialog).
  • Settings dialog β€” customize live polling interval (Fast 3s / Balanced 10s / Slow 10s) and live-feed item count (30/60/100/150). Persisted to localStorage.
  • IOC export β€” export the filtered indicator list to CSV or JSON with a timestamped filename.
  • Filter chips β€” active global filters (source/family) appear as color-coded chips with one-click clear.

UX & Design

  • Bilingual β€” full English πŸ‡¬πŸ‡§ / Spanish πŸ‡ͺπŸ‡Έ UI with one-click toggle; preference persisted to localStorage and synced across tabs.
  • Cyberpunk aesthetic β€” deep-space dark theme, neon cyan/green/amber/red/magenta accents, animated grid backgrounds, scan-line sweeps, corner-accented panels, flickering live indicators, monospace tabular numerics, custom scrollbars.
  • Fully responsive β€” mobile-first 12-column grid that collapses cleanly to single column on phones; no horizontal overflow.
  • Sticky footer β€” stays pinned to the viewport bottom on short pages, pushed down naturally on long pages.
  • Auto-refreshing β€” data polls in the background (attacks every 10s, stats every 30s, feed every 60s, news every 5min) via TanStack Query with seamless placeholder data. Server-side caching reduces flicker.
  • SEO optimized β€” dynamic favicon, OpenGraph tags, Twitter Card, robots.txt, sitemap.xml, structured metadata, theme color.

πŸ›°οΈ Data Sources

Source API Used For Endpoint
AbuseIPDB api.abuseipdb.com/api/v2 IP reputation, blacklist, country biasing /blacklist, /check
abuse.ch threatfox-api.abuse.ch/api/v1 ThreatFox IOCs (malware, C2) get_iocs
AlienVault OTX otx.alienvault.com/api/v1 Open Threat Exchange indicators /indicators/export
Pulsedive pulsedive.com/api Threat intelligence indicators explore.php
NewsAPI newsapi.org/v2 Cybersecurity news headlines /everything

Resilience & fallback

Every external API call is wrapped in a try/catch with an 8-second timeout. If an upstream is unreachable or rate-limited, the route silently falls back to realistic generated data so the dashboard always renders. The Threat Intelligence Sources panel shows 4/4 live when fallback data is flowing. The IP scanner flags synthetic results with _synthetic: true.

Note on attack trajectories: Real-time per-attack geolocation isn't available from these feeds at the volume needed for a live map. SENTINEL therefore renders simulated attack trajectories weighted by real threat-origin country distributions (informed by the AbuseIPDB blacklist), exactly like commercial threat maps (Kaspersky, Norse, etc.) which batch and replay real indicators as animated flows.


🧱 Tech Stack

Layer Technology
Framework Next.js 16 (App Router, Turbopack)
Language TypeScript 5 (strict)
Styling Tailwind CSS 4 + shadcn/ui (New York)
Charts / Map ECharts 6 (geo map + flying lines + choropleth), Recharts (area/donut)
Server state TanStack Query v5 (polling + placeholder data)
Client state Zustand (threat store, settings store)
Icons lucide-react
Validation Zod 4 (IP input)
Fonts Geist + Geist Mono
Runtime Bun

No database. This is a pure front-end dashboard β€” all data comes from the 5 external APIs with in-memory fallbacks. Prisma/SQLite have been removed.


πŸ“‘ API Routes

All routes are server-side (force-dynamic, Cache-Control: no-store) and never throw to the client.

Route Method Returns Polling Cache
/api/threats/attacks GET AttacksResponse β€” 25 live AttackEvents + top-8 source/target countries 10s 15s server cache
/api/threats/feed GET FeedResponse β€” up to 120 deduped ThreatIndicators from 4 feeds + live sources[] 60s 30s server cache
/api/stats GET StatsResponse β€” KPI totals, threat level, 24h timeline 30s β€”
/api/ip-check?ip= GET IpReputation β€” AbuseIPDB abuse score, ISP, reports, categories (400 on invalid IP) on-demand β€”
/api/news GET NewsResponse β€” latest cybersecurity NewsItems 300s β€”

Shared response types live in src/lib/types.ts.


πŸš€ Getting Started

Prerequisites

Install & run

# install dependencies
bun install

# start the dev server (http://localhost:3000)
bun run dev

Open the Preview Panel on the right (or click Open in New Tab) to view the dashboard. The only user-visible route is /.

Other scripts

bun run lint      # ESLint (Next.js + React rules)
bun run db:push   # push Prisma schema to SQLite (not required for the dashboard)

βš™οΈ Configuration

All API keys live in .env (git-ignored by convention β€” provide your own):

# Threat intelligence API keys
ABUSEIPDB_API_KEY=your_abuseipdb_key
ABUSECH_API_KEY=your_abusech_threatfox_key
ALIENVAULT_API_KEY=your_otx_key
PULSEDIVE_API_KEY=your_pulsedive_key
NEWS_API_KEY=your_newsapi_key
Key Where to get it
ABUSEIPDB_API_KEY https://www.abuseipdb.com/account/api
ABUSECH_API_KEY https://threatfox.abuse.ch/api/ (Auth-Key)
ALIENVAULT_API_KEY https://otx.alienvault.com/settings (API Key)
PULSEDIVE_API_KEY https://pulsedive.com/account
NEWS_API_KEY https://newsapi.org/register

The app runs even with missing/invalid keys β€” affected feeds fall back to generated data.


πŸ“‚ Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ layout.tsx              # dark-mode root layout + SEO metadata + favicon
β”‚   β”œβ”€β”€ page.tsx                # dashboard page (only user route)
β”‚   β”œβ”€β”€ globals.css             # cyberpunk design system
β”‚   β”œβ”€β”€ icon.svg                # favicon (animated radar + threat dot)
β”‚   └── api/
β”‚       β”œβ”€β”€ threats/
β”‚       β”‚   β”œβ”€β”€ attacks/route.ts  # live attack stream (15s cache)
β”‚       β”‚   └── feed/route.ts     # aggregated IOC feed (30s cache)
β”‚       β”œβ”€β”€ ip-check/route.ts     # AbuseIPDB IP reputation
β”‚       β”œβ”€β”€ stats/route.ts        # KPIs + 24h timeline
β”‚       └── news/route.ts         # cybersecurity news
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ providers.tsx           # QueryClient + I18n providers
β”‚   β”œβ”€β”€ ui/                     # shadcn/ui primitives (6 used: badge, button, dialog, input, sonner, toast)
β”‚   └── threat/
β”‚       β”œβ”€β”€ header.tsx          # brand, clock, pause, settings, shortcuts, lang toggle
β”‚       β”œβ”€β”€ ticker.tsx          # scrolling threat marquee
β”‚       β”œβ”€β”€ kpi-stats.tsx       # animated KPI cards + threat gauge
β”‚       β”œβ”€β”€ threat-map.tsx      # ECharts map (flow + heatmap, fullscreen, alarm, highlight, country labels)
β”‚       β”œβ”€β”€ top-countries.tsx   # ranked sources/targets (clickable focus)
β”‚       β”œβ”€β”€ attack-types-chart.tsx  # donut chart
β”‚       β”œβ”€β”€ threat-actors.tsx   # malware family panel (clickable filter)
β”‚       β”œβ”€β”€ live-feed.tsx       # streaming attack list (click for details)
β”‚       β”œβ”€β”€ attack-timeline.tsx # 24h area chart
β”‚       β”œβ”€β”€ threat-table.tsx    # IOC table (search/filter/export)
β”‚       β”œβ”€β”€ ip-lookup.tsx       # IP scanner + scan history
β”‚       β”œβ”€β”€ news-feed.tsx       # cybersecurity news
β”‚       β”œβ”€β”€ source-status.tsx   # intel source health (clickable filter)
β”‚       β”œβ”€β”€ attack-detail-dialog.tsx  # attack detail modal + "View on map"
β”‚       β”œβ”€β”€ settings-dialog.tsx # polling interval + feed count preferences
β”‚       β”œβ”€β”€ shortcuts-dialog.tsx # keyboard shortcuts help
β”‚       └── footer.tsx          # sticky footer (GitHub link)
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ use-threat-data.ts      # TanStack Query polling hooks
β”‚   └── use-keyboard-shortcuts.ts  # global keyboard handler
└── lib/
    β”œβ”€β”€ types.ts                # shared threat-intel types
    β”œβ”€β”€ geo.ts                  # 57 countries (coords/flags/EN-ES) + weights
    β”œβ”€β”€ threat-utils.ts         # color maps, number/time helpers
    β”œβ”€β”€ threat-store.ts         # Zustand store (UI state)
    β”œβ”€β”€ settings-store.ts       # Zustand store (persisted settings)
    β”œβ”€β”€ validate.ts             # zod IP schema
    β”œβ”€β”€ export.ts               # CSV/JSON IOC export
    β”œβ”€β”€ api-client.ts           # fetchWithTimeout + TTL cache
    β”œβ”€β”€ threat-data.ts          # generators & fallbacks
    └── i18n/
        β”œβ”€β”€ dictionaries.ts     # EN/ES strings + label maps
        └── provider.tsx        # useSyncExternalStore language store
public/
└── geo/world.json              # ECharts world map GeoJSON

🌐 Internationalization

The UI is fully bilingual. Translation strings live in src/lib/i18n/dictionaries.ts. The language store uses useSyncExternalStore for SSR-safe localStorage persistence and cross-tab synchronization. Toggle via the EN / ES button in the header.

To add a string:

  1. Add an entry to the t dictionary in dictionaries.ts with { en, es }.
  2. Use const { t } = useI18n(); then t("myKey") in any client component.

πŸ—ΊοΈ How the live map works

Flow mode (default)

  1. The browser fetches /api/threats/attacks every 10 seconds (TanStack Query).
  2. The backend generates ~25 fresh AttackEvents (15s server cache for stability), each with a weighted-random source/target country (biased by real AbuseIPDB blacklist country codes when reachable), an attack type, severity, IPs, port, and coordinates from src/lib/geo.ts.
  3. ECharts renders the world map (GeoJSON registered from public/geo/world.json) with three series:
    • lines with effect.show β€” the animated arrow trails tracing origin β†’ target.
    • scatter β€” small red dots at attack origins.
    • effectScatter β€” pulsing cyan rings at targets, sized by hit count.
  4. Line color encodes severity (critical = red, high = orange, medium = amber, low = cyan).
  5. The map is fully interactive β€” drag to pan, scroll to zoom (1×–8Γ—), hover/click attacks for tooltips and details.

Heatmap mode

  • Switch via the toggle (top-right) or the M keyboard shortcut.
  • Countries are shaded by total attack volume (outgoing + incoming) using a 5-stop color ramp (deep blue β†’ cyan β†’ amber β†’ red).
  • Hover any country to see outgoing attacks, incoming attacks, total, and intensity %.
  • The chart component remounts completely when switching modes (key-based remount) to avoid ECharts series-type conflicts.

Critical-attack alarm

  • When a critical-severity attack arrives, the map auto-zooms (5Γ—) to the attacker's country for 6 seconds.
  • A flashing red banner shows "CRITICAL ATTACK!" with the attack route.
  • After 6 seconds, the alarm clears and the map returns to the general view.
  • No popup dialog is opened β€” purely visual.

"View on map" (from detail dialog)

  • Click any live-feed entry or map attack to open the detail dialog.
  • Click "View on map" to isolate that single attack on the map for 5 seconds (all other attacks are hidden, no zoom).
  • After 5 seconds, all attacks return automatically.

⌨️ Keyboard Shortcuts

Key Action
Space Pause / Resume live updates
/ Focus the IOC search input
Esc Clear map focus country
M Toggle map mode (Flow ↔ Heatmap)
? Toggle the shortcuts help dialog

β™Ώ Accessibility & UX

  • Semantic HTML (header, main, footer, nav, section headings).
  • ARIA labels on icon-only buttons.
  • Keyboard-focusable interactive elements (shadcn/ui).
  • 44px+ touch targets on mobile.
  • sr-only friendly text where needed.
  • Loading skeletons / flicker placeholders while data streams in.
  • Toast notifications (sonner) for feedback.
  • Dialogs use Radix UI portals with proper focus trapping and escape handling.

πŸ” SEO

  • Dynamic favicon β€” animated SVG radar icon (src/app/icon.svg) with a pulsing red threat dot.
  • Rich metadata β€” title template, description, keywords, authors, canonical URL, language alternates.
  • OpenGraph tags β€” type, locale (en_US + es_ES alternate), site name, title, description, images.
  • Twitter Card β€” summary card with title, description, and image.
  • Theme color β€” #0a0e1a (deep space dark) for browser UI integration.
  • Color scheme β€” dark declared in viewport metadata.

No robots.txt / sitemap.xml β€” this is a single-page app with one route (/), so sitemaps and robots files add no SEO value. The robots metadata in layout.tsx (index: true, follow: true) is sufficient.


πŸ§ͺ Verification

The dashboard has been end-to-end verified with Agent Browser and curl:

  • βœ… Renders on desktop (1600Γ—1000) and mobile (390Γ—844) with zero console/runtime errors.
  • βœ… ECharts map canvas renders with animated attack arcs and pulsing targets (flow mode).
  • βœ… Heatmap mode renders choropleth with source/target attack breakdown in tooltips.
  • βœ… All dialogs (Settings, Shortcuts, Attack Detail) open and render content correctly.
  • βœ… Live data flows: 4/4 intel sources, real AbuseIPDB indicators, real news headlines.
  • βœ… Language toggle switches all headings between EN and ES.
  • βœ… IP scanner returns real AbuseIPDB data + scan history persists.
  • βœ… Keyboard shortcuts work (Space, /, Esc, M, ?).
  • βœ… No horizontal overflow at any viewport.
  • βœ… bun run lint passes clean.

πŸ“œ License

MIT β€” provided for demonstration. Threat data is aggregated from public intelligence feeds under their respective terms of service.


πŸ™ Acknowledgements

"The map is not the territory β€” but it helps you see where the shots are coming from."

About

A real-time, bilingual cyber-threat intelligence dashboard

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages