Commit Graph

1091 Commits

Author SHA1 Message Date
6d2ee8ae8f fix(repo-sync): Fix shell syntax error in for loop
Remove invalid 2>/dev/null redirection from for loop header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-18 12:33:06 +01:00
86d6889285 fix(repo): Add usign package signing and fix ACL conflict
- Add usign dependency for package signing
- Sign Packages files after generation in repo-sync
- Generate signing keys automatically if not present
- Remove duplicate ACL file (now only in luci-app-repo)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-18 12:29:48 +01:00
088b6e749f fix(luci-app-repo): Add proper Package definition with TITLE field
- Add Package/luci-app-repo section with required fields
- Add Build/Compile empty target
- Add package description
- Fix build failure in SDK

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-18 10:41:36 +01:00
c152934bf1 fix(repo): Add postinst script to configure opkg feeds automatically
- Auto-create repo directories on install
- Detect device architecture and configure customfeeds.conf
- Add prerm script to cleanup on uninstall
- Points opkg to local repo at 192.168.255.1:8888

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-18 10:33:50 +01:00
9cd59b77ba feat(repo): Add secubox-app-repo and luci-app-repo packages
Backend package (secubox-app-repo):
- repoctl CLI for managing local package repository
- repo-sync script to download packages from GitHub releases
- uhttpd-based server on port 8888
- UCI configuration at /etc/config/repo
- RPCD handler for LuCI integration
- Auto-sync cron support (configurable interval)

Frontend package (luci-app-repo):
- Dashboard showing repository status and package counts
- Sync button to trigger package downloads
- Log viewer for sync operations
- Usage instructions for opkg configuration

Supported architectures:
- x86_64, aarch64_cortex-a72, aarch64_generic
- mips_24kc, mipsel_24kc

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-18 10:21:23 +01:00
a53d2b1d63 fix(metrics): Get WAF blocked count from CrowdSec mitmproxy decisions
- WAF blocked now counts mitmproxy scenario decisions (1031 blocks)
- Removed waf_threats field (redundant with waf_blocked)
- Fixed dashboard to show 3 WAF stats: Bans, Alerts, Blocked

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 12:41:14 +01:00
9263fd7e4b feat(metrics): KISS-styled dashboard with double-buffer caching
UI:
- Clean card grid with colored stat values
- Services status bar (HAProxy, WAF, CrowdSec) with glowing dots
- Two-panel layout for WAF/Security and Connections
- Live clock with pulsing indicator
- Proper KissTheme.wrap() integration

Performance:
- Double-buffer cache at /tmp/secubox/metrics-cache.json
- 30s TTL with async background refresh
- Cron job for periodic cache updates
- Instant RPCD response (no computation on request)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 12:37:57 +01:00
f25854b08b fix(metablogizer): Use mitmproxy hot-reload instead of restart
mitmproxy's haproxy_router.py addon already implements hot-reload:
- Checks routes file mtime on every request
- Auto-reloads when file changes

Removed unnecessary mitmproxy restart after adding routes.
Just ensure file permissions are correct (644) for hot-reload to work.

This makes publishing faster and avoids service disruption.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 11:56:11 +01:00
678e5a5921 feat(luci): Add Metrics Dashboard + fix WAF filters layout
New luci-app-metrics-dashboard with real-time system overview:
- System uptime, memory, load stats
- Core services status (HAProxy, mitmproxy, CrowdSec)
- vHosts, MetaBlog sites, Streamlit apps counts
- WAF alerts, bans, threats statistics
- Active connections (HTTP, HTTPS, SSH, TCP total)
- SSL certificates list
- Auto-refresh every 5 seconds

WAF Filters page:
- Changed stats display to single-line compact format
- Shows "17 Categories · 17 Active · 150 Rules" inline

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 11:54:37 +01:00
8e55757dee fix(metablogizer): Auto-restart mitmproxy after adding routes
- Add mitmproxy restart after _add_mitmproxy_route() to load new routes
- mitmproxy loads routes at startup only, so restart is required
- Run restart in background to avoid blocking publish command

Also fixed on router:
- Disabled health check for mitmproxy_inspector backend
- HAProxy health check fails because mitmproxy returns 404 for
  requests without valid Host header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 11:46:53 +01:00
c8a5e1c19a fix(metablogizer): Route new sites through mitmproxy for WAF inspection
- Changed vhost backend from direct metablog_* to mitmproxy_inspector
- Added original_backend tracking for mitmproxy route resolution
- Changed server address from 192.168.255.1 to 127.0.0.1
- Added _add_mitmproxy_route helper for route registration
- Fixed both cmd_publish() and _emancipate_haproxy() functions

This ensures all newly published sites go through WAF inspection
rather than bypassing security checks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 10:35:26 +01:00
e1f2a0e885 feat(droplet): Implement async publish to prevent UI timeout
- RPCD handler returns immediately with job_id (~0.04s)
- Background script uses file output to avoid pipe inheritance issues
- LuCI JS polls job_status every 2s until completion
- Uses setsid for proper process detachment
- jsonfilter for reliable parameter parsing

Fixes "Failed to publish" error caused by ubus timeout during
40+ second publish operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 09:43:19 +01:00
ddf480e6ed fix(droplet,dpi): Resolve publish hang and broken pipe errors
- dropletctl: Remove pipe to grep that blocked on background children
- metablogizerctl: Background HAProxy generate/reload (~90s with 95 certs)
- dpi-lan-collector: Pre-compute flow counts in single pass instead of
  spawning grep per client (eliminates broken pipe errors)

Publish time reduced from ~2 min to ~35 seconds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 07:39:09 +01:00
ece237d194 feat(mitmproxy): Add headless mode to reduce RAM from 3.4GB to 96MB
- Add headless UCI option to use mitmdump instead of mitmweb
- Enable headless by default for WAF (mitmproxy-in) instance
- Increase default memory limit from 256MB to 2GB
- Fix LXC config generation to always recreate on service start
- Fix rootfs check path (/usr/local/bin not /usr/bin)
- Use exec in startup script for proper foreground execution

Headless mode runs mitmdump (CLI) instead of mitmweb (web UI),
saving ~3.3GB RAM while maintaining full WAF functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 07:14:05 +01:00
3fcad8e626 fix(waf): Prevent false positive bot detection on legitimate browsers
- Add LEGITIMATE_BROWSERS whitelist (Chrome, Firefox, Safari, Edge, etc.)
- Check for legitimate browser signatures BEFORE bot signature matching
- Fix CriOS (Chrome iOS) false positive: 'mozi' substring matched Mozi botnet
- Make botnet signatures more specific: 'mozi' → 'mozi/', 'mozi '
- Prevents banning real users loading pages with multiple JS requests

Fixes false positive on IP 82.65.224.119 (French ISP, Chrome iOS user)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 19:30:02 +01:00
a0825c73c1 feat(waf): Add honeypot detection categories and fix JSON escapes
- Fix invalid \x00 JSON escapes to valid \u0000 Unicode escapes
- Add 4 new WAF rule categories:
  - waf_fingerprint (12 rules): WAF bypass/fingerprinting detection
  - honeypot (16 rules): Decoy file and admin panel probes
  - recon_crawler (10 rules): Reconnaissance file enumeration
  - credential_harvest (8 rules): Password/token exposure detection
- Total: 17 categories, 150 rules
- UI: Inline stats header layout for WAF Filters page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 09:52:43 +01:00
f46e145927 feat(crowdsec): Add geo heatmap visualization for threat origins
- New heatmap.js component with SVG world map and country centroids
- Colored dots show threat distribution: orange (local), cyan (CAPI), red (WAF)
- Dot size scales logarithmically with threat count (4-20px)
- Hover tooltips show country code and count
- Added geo_local_raw and geo_capi_raw fields to RPCD backend
- CAPI geo extraction from decisions with GeoIP metadata
- CSS styling for heatmap container, dots, and legend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 09:28:48 +01:00
b02503eac4 fix(crowdsec): Count all mitmproxy scenarios in WAF bans
Changed waf_bans_today to count all mitmproxy-* scenarios instead of
only mitmproxy-waf (which doesn't exist). Now correctly counts
mitmproxy-scanner, mitmproxy-botscan, etc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 09:13:14 +01:00
f424ec72c1 fix(crowdsec): Fix rpcd blocking and show active bans
- Make refresh_cache async to prevent rpcd watchdog kills
- Fix JSON escaping for top_scenarios/countries arrays
- Show decisions as "Active Bans" when alerts_raw is empty
- Display ban expiry time instead of creation time
- Update cron to run cache refresh in background

Fixes LuCI crashes caused by 16s blocking refresh calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 08:35:03 +01:00
b9f789fdb7 fix(crowdsec): Fix alerts/scenarios/countries stats in dashboard
- alerts_24h now uses local_decisions count instead of empty file
- top_scenarios_raw now extracts from decisions JSON (was parsing CAPI metrics)
- top_countries_raw now correctly parses IsoCode from alerts GeoIP metadata
- Double-buffer caching via cron job already in place

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 08:29:59 +01:00
c74ba2e474 feat(luci): KISS theme rework for SMTP Relay and SecuBox Users
- Rewrite smtp-relay/settings.js with proper KISS theme styling
- Rewrite secubox-users/overview.js with proper KISS theme styling
- Use KissTheme.wrap() for consistent dark theme rendering
- Add stat cards with colored values matching mailserver reference
- Add proper form styling with inline CSS variables
- Add NZB tools (SABnzbd, NZBHydra) to KISS menu Downloads
- Add webtorrent to portal tree Downloads category
- Fix portal tree webtorrent pattern

KISS = Keep It Simple Sexy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 08:20:12 +01:00
ee7cd8ef6f fix(lyrion): Fix Rescan button disabled state in updateUI
The updateUI function was incorrectly disabling the Rescan button when
Lyrion was running. Rescan should only be enabled when running.

- Split forEach into separate button handlers
- Start button: disabled when running (correct)
- Rescan button: disabled when NOT running (fixed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 07:56:09 +01:00
d0cd42e2a1 fix(luci): Performance and UX improvements for exposure and portal
- Optimize exposure RPCD: O(n) single-pass awk parsing for vhost_list
  and ssl_list (fixes XHR timeout on 200+ vhosts)
- Fix portal tree URLs: Use get_menu_path() to read actual LuCI menu
  paths from JSON instead of hardcoded paths
- Add Downloads category to portal tree (torrent, droplet patterns)
- Add new apps to System category (config-vault, reporter, smtp-relay,
  rtty, dpi-dual, metacatalog)
- Enhance KISS theme menu: Add Downloads, Monitoring categories
- Fix Lyrion URL: Use HTTPS vhost instead of dynamic port URL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-16 07:35:18 +01:00
79775faa6e fix(luci): Add web UI URL link to Lyrion dashboard
- Move Web Interface section to top for visibility
- Always show Open Lyrion Web UI button with dynamic URL
- Display URL text next to button

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 18:39:03 +01:00
baa07a7521 fix(luci): Device Intel emulators dark theme
- Remove KissTheme dependency, use direct RPC calls
- Dark theme colors (#12121a, #1a1a24, #00d4aa, #00a0ff)
- Update common.css with matching dark styles
- Simplified DOM rendering with inline styles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 17:42:54 +01:00
62f89f0d57 fix(luci): Regenerate MAC Guardian dashboard with dark theme
- Remove KissTheme dependency, use standard LuCI with inline styles
- Dark theme matching SecuBox palette (#12121a, #1a1a24, #00d4aa, #00a0ff)
- Simplified view with direct DOM rendering instead of form.Map
- Cards grid layout for status, WiFi interfaces, DHCP, config
- Inline Trust/Block action buttons with proper styling
- Responsive tables for clients and alerts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 17:37:53 +01:00
3fa33f7872 fix(luci): Threat Analyst menu path and dark theme CSS
- Change menu path from /admin/secubox/security/threat-analyst to
  /admin/services/threat-analyst for proper placement
- Rewrite dashboard.css with dark theme colors matching SecuBox palette
  (#12121a, #1a1a24, #0a0a12 backgrounds; #00d4aa, #00a0ff accents)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 17:20:07 +01:00
e1ee84b3eb fix(dashboards): WAF bans cache and DPI LAN flow display
WAF Dashboard:
- Use cached bans from cron (waf-stats-update) instead of slow cscli
- Fixes "Failed to load bans" timeout issue

DPI Dual-Stream:
- Add LAN Flow Analysis card showing active clients, destinations, protocols
- LAN passive flow analysis was working but not displayed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 17:15:13 +01:00
58ba852564 fix(luci): Fix dpi-dual menu and simplify lyrion UI
- Fix dpi-dual "firstchildview" error (changed to "firstchild")
- Simplify luci-app-lyrion: overview.js 276→150 lines
- Simplify luci-app-lyrion: settings.js 78→32 lines
- Simplify luci-app-lyrion: RPCD 300→90 lines
- Combined status + library stats into single RPC call
- Removed unused methods (update, logs, get_config, save_config)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 17:03:13 +01:00
fd54253f66 chore(ui): Update dev status widget for v1.0.0
- Update lastUpdate to 2026-03-16
- Update layer progress: core 98%, ai 95%, mirrornet 90%, certification 75%
- Mark milestones v0.18, v0.19, v1.0 as completed
- Add v1.1 Extended Mesh as in-progress
- Update stats: 190 packages, 243 vhosts, 174 WAF routes, 1850 commits
- Update feature status: AI security, AI memory, mesh network to production
- Update config-management to production with config-vault

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 16:09:15 +01:00
0809bc69c2 chore: Bump version to 1.0.0
All major roadmap milestones achieved:
- v0.18 MirrorBox Core
- v0.19 AI Expansion + MirrorNet
- v1.0 Full Stack (VoIP, Matrix, Factory provisioning)
- v1.1+ Extended Mesh (Yggdrasil, Meshname DNS)

Updated version strings in:
- Makefile: PKG_VERSION 0.10.0 → 1.0.0, PKG_RELEASE reset to 1
- secubox CLI: SECUBOX_VERSION 0.9.0 → 1.0.0
- secubox-core daemon: SECUBOX_VERSION 0.8.2 → 1.0.0
- RPCD handlers: core.sh, dashboard.sh, luci.secubox
- common.sh: secubox_get_version()
- README.md header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 16:05:39 +01:00
a345c16425 feat(smtp-relay): Add unified SMTP relay configuration
- New secubox-app-smtp-relay package with centralized SMTP config
- Shared library with send_mail(), send_html_mail(), send_text_mail()
- CLI: smtp-relayctl with status/test/send/configure/admin commands
- RPCD: 5 methods for LuCI integration
- LuCI settings page with mode selection and test button
- Modes: external (SMTP server), local (auto-detect mailserver), direct
- Migrated reporter and bandwidth-manager to use shared library
- Backwards-compatible fallback to legacy per-app config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 16:01:12 +01:00
ccccd3d93b feat(dpi-dual): Add WAF auto-ban tuning system
- UCI config: Add scoring section with event weights, sensitivity presets,
  whitelist, and decay options
- dpi-correlator: Load scoring weights from UCI, apply sensitivity
  multipliers, check whitelist before auto-ban, periodic reputation decay
- CLI: New 'tune', 'whitelist', 'decay' commands for runtime configuration
- RPCD: 6 new methods - get_tuning, set_tuning, whitelist_add/remove/list,
  reset_reputation
- ACL: Added permissions for new tuning methods

Sensitivity presets:
- low (0.7x) - fewer false positives
- medium (1.0x) - balanced (default)
- high (1.3x) - aggressive detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 15:37:55 +01:00
c80b10f18d feat(luci): Add provisioning and ttyd deployment UI
Config Vault Dashboard (overview.js):
- "Device Provisioning" card with 3 action buttons
- Provision Remote: Modal to push clone to remote node
- Serve via HTTP: Generate clone for HTTP download
- Restore All: Confirmation modal to restore all modules
- RPC calls: provision, serve_clone, restore_all

RTTY Remote Dashboard (dashboard.js):
- "Deploy ttyd to All" global button in controls
- Per-node "ttyd" button in Connected Nodes table
- Confirmation modal for bulk deployment
- Progress spinner and result display
- RPC calls: deploy_ttyd, install_remote

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 15:30:32 +01:00
e86545bd3a feat(config-vault): Add device provisioning system
Implement full provisioning workflow for SecuBox device replication:

Auto-Restore:
- import-clone <file> --apply: Auto-restore all modules after import
- restore-all: Restore all modules from vault

Remote Provisioning:
- provision <node|all>: Push clone to remote nodes via RPC proxy
- Transfer clone as base64 to remote node
- Trigger import+apply on remote

First-Boot Pull:
- pull-config <master>: Pull config from master node
- HTTP download or RPC fallback
- Auto-reboot after apply, marks /etc/secubox-provisioned

HTTP Serve:
- serve-clone: Generate clone at /www/config-vault/
- Enables HTTP-based config distribution

RPCD Methods (6 new):
- restore_all, import_apply, provision
- pull_config, export_clone_b64, serve_clone

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 15:18:54 +01:00
ac7912e0a1 feat(rtty): Add remote package installation for mesh nodes
Add rttyctl commands for remote package deployment:
- rttyctl install <node|all> <app_id> - Install package on node(s)
- rttyctl install-status <node> [app] - Check package status
- rttyctl deploy-ttyd <node|all> - Deploy ttyd web terminal

RPCD methods added:
- install_remote, install_mesh, deploy_ttyd, install_status

Features:
- Node discovery from master-link, WireGuard, P2P mesh
- Auto-enables and starts ttyd after installation
- Batch install with summary stats (installed/skipped/failed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 15:10:32 +01:00
76754df467 fix(dpi): Detect mitmproxy-in specifically for WAF status
- Changed pgrep to detect mitmproxy-in container only
- mitmproxy-out removed from deployment (not needed for WAF)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 15:00:19 +01:00
69b5dca350 fix(dpi): Fix protocol display showing null suffix in LAN Flows
- Remove unused application field concatenation causing "TCPnull" display
- Sort protocols by flow count instead of non-existent bytes field
- Simplify protocol card to show protocol name and flow count only

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 14:46:09 +01:00
1fd249d19d fix(dpi): Remove local keyword from RPCD handler
BusyBox sh doesn't support 'local' outside of functions.
Remove all 'local' keywords and fix orphaned variable declarations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 14:41:02 +01:00
427987c9f0 fix(dpi): OpenWrt compatibility for LAN collector
- Rewrite client/destination collection using awk instead of pipe/while
  (BusyBox shell subshell limitations with variable scope)
- Use conntrack for flow counting per client
- Use pgrep -f for process detection (truncated process names)
- Compatible with nDPId instead of netifyd

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 14:33:15 +01:00
f39440ab16 feat(dpi): Add LAN passive flow analysis (no MITM, no cache)
Real-time passive flow monitoring on br-lan for network analysis:
- dpi-lan-collector service watches netifyd flows in real-time
- Tracks active clients, external destinations, and protocols
- Per-client bandwidth and flow statistics
- Protocol/application detection via nDPI
- Zero latency impact - pure passive observation

LuCI integration:
- New "LAN Flows" dashboard view with real-time updates
- RPCD methods: get_lan_status, get_lan_clients, get_lan_destinations, get_lan_protocols
- Settings panel for LAN analysis configuration

CLI commands:
- dpi-dualctl lan - show summary
- dpi-dualctl clients - list active LAN clients
- dpi-dualctl destinations - external destinations
- dpi-dualctl protocols - detected protocols/apps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 12:37:57 +01:00
b767f4dc30 feat(dpi): Phase 4 - Integration, documentation and widget
- Add settings.js LuCI view for full UCI configuration
- Add widget.js embeddable component for other dashboards
- Add comprehensive README.md with architecture diagram
- Add luci-app-dpi-dual entry to SecuBox catalog
- Update menu.d to include Settings tab

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 12:31:47 +01:00
7ff9ee3805 feat(dpi): Phase 3 - Correlation engine + timeline view
Correlation Library (correlation-lib.sh):
- IP reputation tracking with configurable decay
- Full context gathering from MITM, DPI, WAF streams
- CrowdSec decision checking and notification
- Correlation entry builder with rich context

Enhanced Correlator (dpi-correlator v2):
- Watches WAF alerts, CrowdSec decisions, DPI flows
- Auto-ban for high-reputation IPs (threshold: 80)
- Notification queue for high-severity threats
- CLI: correlate, reputation, context, search, stats

LuCI Timeline View:
- Correlation timeline with colored event cards
- IP context modal showing MITM requests + WAF alerts
- Quick ban button with CrowdSec integration
- Search by IP functionality
- Stats: total, high-threat, banned, unique IPs

RPCD Methods (8 new):
- get_correlation_stats, get_ip_context, get_ip_reputation
- get_timeline, search_correlations, ban_ip, set_auto_ban

UCI Config: auto_ban, auto_ban_threshold, notifications

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 12:27:20 +01:00
a24beaf316 feat(dpi): Phase 2 - MITM double buffer + LuCI dashboard
MITM Double Buffer (dpi_buffer.py):
- Compiled regex patterns for 6 threat categories
- Scanner detection (sqlmap, nikto, nmap, etc.)
- Optional blocking mode for high-score threats
- Request replay queue for forensic analysis
- Rate limiting detection
- Stats: buffer entries, threat distribution, top hosts

LuCI Dashboard (luci-app-dpi-dual):
- RPCD handler with 10 methods
- KISS-themed overview with stream status cards
- LED indicators for MITM/TAP/Correlation
- Threats table with score and blocked status
- Protocol distribution from netifyd
- Manual IP correlation trigger

Streamlit Control Panel:
- Added DPI Dual card with flows/threats/blocked metrics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 12:21:50 +01:00
58a51eb271 feat(dpi): Implement Phase 1 of Dual-Stream DPI architecture
- secubox-dpi-dual package with parallel MITM + Passive TAP analysis
- TAP stream: tc mirred port mirroring to dummy interface for netifyd
- Flow collector: Stats aggregation from netifyd, cleanup, JSON output
- Correlation engine: Matches MITM WAF events with TAP flow data
- Watches CrowdSec decisions and WAF alerts for threat enrichment
- CLI: dpi-dualctl with start/stop/status/flows/threats/mirror commands
- Procd service: manages flow-collector + correlator instances
- MITM double buffer: dpi_buffer.py mitmproxy addon (Phase 2 prep)
- UCI config: dual/mitm-only/tap-only mode selection

Architecture: package/secubox/DUAL-STREAM-DPI.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 12:15:17 +01:00
fccac11148 docs: Add Dual-Stream DPI Architecture specification
Comprehensive architecture for parallel traffic analysis:

Stream 1 (MITM):
- HAProxy + mitmproxy with SSL termination
- Double buffer for async replay analysis
- WAF rules + CrowdSec integration

Stream 2 (TAP/Passive):
- tc mirred port mirroring
- netifyd/nDPI flow classification
- Zero latency, metadata-only analysis

Correlation Engine:
- Match MITM events with DPI flows
- Unified threat analytics
- Context enrichment for alerts

Includes:
- Package structure for secubox-dpi-dual
- UCI configuration schema
- CLI tool specification
- Integration points (LuCI, Streamlit, API)
- 4-phase implementation plan

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 12:02:15 +01:00
69f0a85057 feat(control): Enhance secubox_control with detailed threat/ban stats
- Added WAF stats: threats_today, autobans_total, autobans_pending
- Added CrowdSec detailed: active_bans, total_decisions
- New LED4 indicator for active bans (red >5, orange >0, green 0)
- WAF/MITM card shows Threats + AutoBans counts
- Reads from waf-stats.json and crowdsec-overview.json caches

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 11:58:29 +01:00
01b48e42ec feat(osint): Add Maltego iTDS and Sherlock security tools
- secubox-app-maltego: Transform Distribution Server in LXC
  - Python-based transform execution engine
  - REST API compatible with Maltego desktop client
  - Custom transform support via /srv/maltego/transforms/

- secubox-app-sherlock: Username hunting across social networks
  - Sherlock + Holehe integration for username/email OSINT
  - maigret, theHarvester, socialscan also installed
  - REST API with async task execution

Both tools exposed via HAProxy at:
- https://maltego.gk2.secubox.in/
- https://sherlock.gk2.secubox.in/

Streamlit OSINT dashboard deployed at:
- https://osint.gk2.secubox.in/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 08:36:56 +01:00
10b3d3a43c feat(torrent): Add LuCI dashboard and fix WebTorrent ESM issue
- Add luci-app-torrent: unified dashboard for qBittorrent + WebTorrent
  - RPCD handler with status/list/start/stop/add methods
  - Dark-themed UI with real-time torrent queue display
  - Start/Stop controls and magnet link add functionality
  - 5-second auto-refresh polling
- Fix webtorrent v2.x ESM incompatibility
  - Pin to v1.9.7 (last CommonJS version)
  - Use npm install with --save-exact to prevent semver drift
- HAProxy exposure configured:
  - qBittorrent: torrent.gk2.secubox.in (192.168.255.42:8090)
  - WebTorrent: stream.gk2.secubox.in (192.168.255.43:8095)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 06:59:07 +01:00
0ec28266c5 feat(torrent): Add qBittorrent and WebTorrent packages
qBittorrent (secubox-app-qbittorrent):
- Full-featured BitTorrent client with web UI
- Container IP: 192.168.255.42:8090
- qbittorrent-nox from Debian repos
- API commands: add, list, status

WebTorrent (secubox-app-webtorrent):
- Browser-based torrent streaming via WebRTC
- Container IP: 192.168.255.43:8095
- Node.js server with webtorrent library
- Stream video files directly in browser
- Beautiful dark theme web UI

Both use Debian LXC containers (no Docker/Podman)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-14 19:03:07 +01:00