System Architecture

Back to Monitor

Security Monitor

How the Platform Works

A deep dive into the 100% private, local-first security pipeline โ€” 50+ CIS Benchmark controls, zero cloud storage, local AI via Ollama, and CVE matching via OSV.dev.

System Architecture

Security Tools Hardener โ€” Cloud Security Pipeline

Agent (.sh/.bat/.ps1)
API Routes
Browser
Supabase
IndexedDB Cache
AI / PhishGuard
Validate / Remediate
CVE / OSV
USER & AGENT SCRIPTSNEXT.JS API ROUTES (VERCEL ยท STATELESS)STORAGE, AI & EXTERNAL SERVICES๐Ÿ–ฅ๏ธDashboard Browsersession_id ยท IndexedDB ยท UIโš™๏ธMac / Linux / Windowscurl | python3 ยท .bat ยท .ps1 ยท 50+ CIS๐Ÿ›ก๏ธPhishGuard ExtensionGmail ยท OAuth ยท BEC ยท Claude AI๐Ÿ“ฅ/agent/uploadPOST ยท agent submits findings๐Ÿ”/scan/stream (SSE)POST ยท re-analyze ยท checklistโœ…/validate + /remediatePOST ยท run-check ยท apply-fix๐Ÿ”ฌ/cve/checkPOST ยท OSV.dev ยท batch packages๐Ÿ—„๏ธSupabasemachines ยท scans ยท findings persist๐Ÿ’พBrowser IndexedDBlocal findings cache ยท browserDb๐Ÿค–AI EngineClaude (Anthropic) ยท Ollama (optional)๐ŸŒOSV.dev APIfree ยท no key ยท Homebrew/Debian/npm

Data Flow โ€” Step by Step

1
Dashboardโ†’/agent/downloadBrowser copies curl command with session_id โ€” user runs it in Terminal / CMD
2
curl โ€ฆ | python3โ†’Python / PS agent50+ CIS checks run locally โ€” macOS, Linux & Windows (.bat + .ps1) supported
3
Python / PS agentโ†’/agent/uploadAgent POSTs findings JSON to server with session_id + agent_mode=cis-deterministic
4
/agent/uploadโ†’Supabase + IndexedDBFindings persisted to Supabase; view_url #data= fragment ingested into IndexedDB
5
Re-Analyze buttonโ†’/scan/stream (SSE)Fresh CIS pass + AI multi-pass enrichment, streams back findings + checklist
6
/scan/streamโ†’Hardening ChecklistAll 50+ CIS checks returned with pass/fail/manual_review for every control
7
AI Engineโ†’Claude (Anthropic)Claude API (server-side) for deep analysis โ€” local Ollama optional in dev
8
Run Check buttonโ†’/validateRead-only shell command run on machine โ€” real output shown inline in UI
9
Apply Fix buttonโ†’/remediateAI-generated fix command executed on machine with dry-run safety gate
10
CVE Scan buttonโ†’/cve/check โ†’ OSV.devInstalled packages batch-checked against OSV.dev vulnerability database
11
PhishGuardโ†’/phishguard-scanGmail auto-scanned; OAuth consent + BEC signals analyzed server-side via Claude

API Routes Reference

GET

/api/monitor/agent/download

Returns Python agent script (macOS / Linux) or .bat / .ps1 (Windows) with session_id baked in

POST

/api/monitor/agent/upload

Receives CIS findings from agent (agent_mode=cis-deterministic), persists to Supabase, returns view_url

GET

/api/monitor/agent/pending

Browser polls this to retrieve latest scan payload for the current session_id (Supabase relay)

POST

/api/monitor/agent/collect

Collects raw snapshot data from agent โ€” pre-processes before CIS analysis

POST

/api/monitor/scan/stream

SSE โ€” re-runs 50+ CIS rules + AI multi-pass via Claude, streams findings + hardening checklist

POST

/api/monitor/validate

Runs read-only verification command on machine โ€” whitelisted safe commands only

POST

/api/monitor/remediate

Executes AI-generated fix command with dry-run mode and rollback command recorded

POST

/api/monitor/cve/check

Batch CVE lookup via OSV.dev for installed packages (Homebrew / Debian / npm)

POST

/api/phishguard-scan

PhishGuard email scanner โ€” checks links, OAuth scopes, BEC signals via Claude (server-side)

POST

/api/monitor/chat

AI security assistant (Claude) โ€” answers questions about the machine's security posture

GET

/api/monitor/settings

Loads / saves persisted scanner settings (AI preferences, thresholds, notifications)

๐Ÿ“‹

50+ CIS Benchmark Controls

Every control shown with pass/fail/manual_review โ€” macOS, Linux & Windows supported

โœ…

Real Verification

Run Check executes actual shell commands and shows real output inline

๐Ÿค–

Claude AI Engine

Claude (Anthropic) powers deep analysis, remediation, and PhishGuard email scanning

๐Ÿ›ก๏ธ

CVE matching via OSV.dev

Free, no API key, Homebrew + Debian + npm package support

Tech Stack

Next.js 15TypeScriptTailwind CSS 4Framer MotionSupabaseClaude (Anthropic)Ollama (optional)CIS Benchmarks L1/L2SOC 2 TSCNIST SP 800-53OSV.dev CVE DatabaseRechartsIndexedDBJSZipPDF (window.print)

Data Sovereignty

Sensitive system data is stored only in Supabase (your own project) and browser IndexedDB. The agent script runs locally โ€” findings are POSTed directly to your session. Nothing is processed by third-party cloud services.

Local AI Intelligence

Ollama runs entirely on your machine. The /api/ai/proxy route forwards requests to localhost:11434, so AI enrichment, remediation scripts, and chat all happen without a single byte of config leaving your network.

CVE Matching

macOS: outdated Homebrew packages detected via the formulae.brew.sh API โ€” shows installed vs. latest version. Linux: packages batch-checked against OSV.dev (Debian ecosystem) for real CVE IDs and CVSS scores. No API key required for either.

PhishGuard

Phishing Detection Pipeline

Multi-layer email analysis โ€” client-side heuristics, DNS-over-HTTPS SPF/DMARC validation, RDAP domain age, AI deep-analysis (BYOK), and screenshot vision scanning โ€” all without storing your email content.

Browser / Client
PhishGuard API
AI Analysis (BYOK)
DNS / RDAP
Supabase
Risk Score

Analysis Pipeline โ€” Step by Step

1
Email inputโ†’Paste or Gmail OAuthUser pastes raw email source or connects Gmail โ€” content stays client-side
2
cyber-sense-rulesโ†’Client heuristics50+ pattern rules check subject, headers, URLs, spoofing signals โ€” runs in browser
3
Extracted domainsโ†’/phishguard-scanDomains, links, and sender extracted โ€” SPF/DMARC checked via Cloudflare DoH (1.1.1.1)
4
/phishguard-enrichโ†’RDAP (rdap.org)Domain registration age checked โ€” newly registered domains (<30d) are strong phish signal
5
SPF / DMARCโ†’DNS TXT recordsSPF alignment (pass/softfail/none) + DMARC policy (reject/quarantine/missing) via DoH
6
AI deep analysisโ†’/phishguard-analyzeBYOK proxy โ€” Anthropic Claude or OpenAI GPT โ€” key passed per-request, never stored
7
Screenshot visionโ†’/phishguard-visionOptional: screenshot uploaded to AI vision model to detect spoofed login pages
8
Risk engineโ†’Weighted score 0-100Heuristics + DNS + RDAP age + AI verdict weighted โ†’ final phishing risk score + badge
9
Result persistโ†’SupabaseScan result saved (score, indicators, verdict) โ€” no raw email body stored server-side
10
Export / Reportโ†’/phishguard-reportFull analysis exported as PDF โ€” indicator breakdown, AI explanation, header dump

PhishGuard API Routes

POST

/api/phishguard-scan

SPF/DMARC lookup via Cloudflare DoH, domain extraction, saves scan result to Supabase

POST

/api/phishguard-enrich

RDAP domain age check via rdap.org โ€” flags newly registered domains (free, no key)

POST

/api/phishguard-analyze

BYOK AI proxy โ€” routes to Anthropic or OpenAI with user-provided key, key never stored

POST

/api/phishguard-vision

Screenshot analysis via AI vision model โ€” detects spoofed login pages and brand impersonation

GET

/api/phishguard-report

Retrieves saved scan result for report rendering and PDF export

POST

/api/phishguard-generate-report

Generates full structured report with indicator breakdown and AI explanation

๐Ÿ”‘

BYOK โ€” No Key Stored

Your Anthropic/OpenAI key is passed per-request over HTTPS and used immediately โ€” never persisted

๐ŸŒ

DNS-over-HTTPS

SPF & DMARC checked via Cloudflare 1.1.1.1 DoH โ€” no plaintext DNS leakage

๐Ÿ“…

RDAP Domain Age

Newly registered domains (<30 days) flagged as high-risk using free rdap.org API

๐Ÿ”’

No Email Body Stored

Raw email content is never sent to the server โ€” analysis runs client-side or via proxied AI key