Commit Graph

237 Commits

Author SHA1 Message Date
4e5d5275f9 refactor: Merge secubox-app-crowdsec-bouncer into cs-firewall-bouncer
- Move UCI defaults script for auto-registration to cs-firewall-bouncer
- Remove redundant secubox-app-crowdsec-bouncer wrapper package
- Update luci-app-crowdsec-dashboard reference to new package name
- Increment PKG_RELEASE to 3

The defaults script handles:
- Automatic bouncer registration with CrowdSec LAPI
- Interface detection for LAN/WAN
- API key generation and UCI config update

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 06:46:09 +01:00
c1860b4aea chore: Remove duplicate luci-app-secubox-crowdsec package
luci-app-crowdsec-dashboard is more complete with:
- Overview, Setup Wizard, WAF/AppSec, Metrics views
- Proper location in SecuBox > Security menu
- Bouncers management

luci-app-secubox-crowdsec was a simpler duplicate in Services menu.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 06:44:04 +01:00
c99d49739e feat(secubox-app-mitmproxy): Add LXC container support for mitmproxy
- Create mitmproxyctl script with LXC container management
- Alpine Linux rootfs with Python and mitmproxy via pip
- Support for regular, transparent, upstream, and reverse proxy modes
- UCI configuration for proxy_port, web_port, memory_limit, etc.
- procd init script for service management
- Update luci-app-mitmproxy RPCD backend for LXC container status

Ports:
- 8080: Proxy port
- 8081: Web interface (mitmweb)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 06:40:08 +01:00
c02c3d2a3a fix(secubox-app-lyrion): Add missing perl modules and fix logs path
- Add perl-template-toolkit and perl-file-slurp dependencies
- Remove bundled Template.pm (conflicts with system version 3.101)
- Add Devel::Peek stub module for runtime inspection
- Fix lxc_logs() to read logs from container via lxc-attach

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:42:14 +01:00
0799b97c6b fix(secubox-app-lyrion): Fix LXC container installation issues
- Update Lyrion download URLs to downloads.lms-community.org
- Switch from noCPAN to full tarball (noCPAN missing modules)
- Replace perl-image-scale with perl-gd + imagemagick (Alpine)
- Remove conflicting bundled CPAN modules (DBD::SQLite, XML::Parser, YAML, DBI)
- Add Image::Scale stub module for artwork resizing
- Fix permissions for nobody user on /config and /var/log/lyrion
- Add missing perl-digest-sha1 and perl-sub-name dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:17:17 +01:00
b9b0be1b9f feat(secubox-portal): Update devstatus page and increment release
- Fixed changelog dates (2025 -> 2026)
- Added v0.15.0-rc2 entry for firewall bouncer fix
- Updated roadmap to match campaign.html planning:
  - Phase 4: Beta Testing (Q1 2026)
  - Phase 5: Crowdfunding (Q2 2026)
  - Phase 6: Production (Q3-Q4 2026)
  - Final Delivery (Q4 2027)
- Incremented PKG_RELEASE to 2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:50:11 +01:00
2d2231471b fix(secubox-portal): Update roadmap from campaign.html planning
Aligned roadmap with official project phases from campaign page:
- Phase 4: Beta Testing (Q1 2026) - 100 beta testers recruitment
- Phase 5: Crowdfunding (Q2 2026) - €50,000 target
- Phase 6: Production (Q3-Q4 2026) - Manufacturing & QA
- Final Delivery (Q4 2027)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:48:35 +01:00
9738123d91 fix(secubox-portal): Update roadmap to match website development status
Removed unrealistic items (AI Threat Detection, Mobile App, Cloud) and
replaced with practical goals based on current module progress:
- Network Modes 1.0 (currently at 35%)
- SecuBox Hub 1.0 (currently at 31%)
- Multi-WAN Failover
- Documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:47:05 +01:00
c1249fde7a fix(secubox-portal): Update changelog dates to 2026 and add rc2 entry
- Fixed incorrect year (2025 -> 2026) in changelog dates
- Added v0.15.0-rc2 changelog entry for CrowdSec firewall bouncer fix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:44:00 +01:00
f72ea0da32 fix(cs-firewall-bouncer): Add missing DROP rules for blacklisted IPs
The init script created nftables sets and chains but never added the
actual DROP rules to block traffic from blacklisted IPs. This caused
the bouncer to populate sets correctly but traffic was never blocked.

Added DROP rules for:
- IPv4 input chain (crowdsec-blacklists)
- IPv4 forward chain (crowdsec-blacklists)
- IPv6 input chain (crowdsec6-blacklists)
- IPv6 forward chain (crowdsec6-blacklists)

Each rule respects the deny_log and deny_action configuration options.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:27:46 +01:00
e62919eec7 refactor(packages): Rename and reorganize SecuBox packages
- Rename crowdsec-firewall-bouncer to secubox-app-cs-firewall-bouncer
- Rename secubox-auth-logger to secubox-app-auth-logger
- Delete secubox-crowdsec-setup (merged into other packages)
- Fix circular dependencies in luci-app-secubox-crowdsec
- Fix dependency chain in secubox-app-crowdsec-bouncer
- Add consolidated get_overview API to crowdsec-dashboard
- Improve crowdsec-dashboard overview performance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 10:42:52 +01:00
fd7caeb8c3 fix(crowdsec-dashboard): Fix typo in ACL (seccubox_logs -> secubox_logs)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:20:12 +01:00
239a68f9de fix(crowdsec-dashboard): Add get_overview to ACL permissions
The new get_overview RPC method was missing from the ACL file,
causing "Access denied" errors in the frontend.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:19:58 +01:00
b60ceba2a6 perf(crowdsec-dashboard): Add consolidated get_overview API call
Consolidate multiple dashboard API calls into a single get_overview RPC
method to reduce network overhead and improve page load performance.
The frontend now transforms the consolidated response to maintain
compatibility with existing view logic. Also increases poll interval
from 30s to 60s.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 10:18:41 +01:00
fb22a9146e fix(crowdsec-dashboard): Fix logs display and country data
- Fix typo seccubox_logs -> secubox_logs
- Get country data from alerts (source.cn) instead of decisions
- Display CrowdSec logs instead of non-existent secubox.log
- Rename "SecuBox Log Tail" to "CrowdSec Logs"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 10:07:39 +01:00
024a768243 fix(crowdsec-dashboard): Get country data from alerts instead of decisions
CrowdSec decisions don't contain country data. GeoIP enricher adds
country info to alerts (source.cn or source.country field).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 10:04:24 +01:00
de424bac68 feat(secubox-portal): Add login link to public menu
Adds "Connexion" link at the end of the public menu to redirect
to the admin authentication page.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 09:59:34 +01:00
ce543762cc chore: Update GitHub repo URL to CyberMind-FR organization
Replace github.com/gkerma/secubox-openwrt with
github.com/CyberMind-FR/secubox-openwrt across all files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 09:44:01 +01:00
8ea06e77b7 chore: Replace secubox.io with secubox.cybermood.eu
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 09:42:47 +01:00
5ea1b2ad63 feat(secubox-portal): Add Development Status page and reorder menu
- Add devstatus.js with modules list, roadmap, and changelog
- Reorder public pages: Crowdfunding (10), Bug Bounty (20), Dev Status (30)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 09:40:19 +01:00
66cbd00ceb fix(secubox-portal): Add missing ACL file for dashboard access
The 403 error was caused by missing ACL file. Added
luci-app-secubox-portal.json with read permissions for
luci.secubox and luci.system-hub ubus methods.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 09:36:20 +01:00
5b55ab3ef9 feat: Dashboard reorganization and auth security fixes
- Move Debug Console from Client Guardian to System Hub
- Add Auto-Zoning Rules dedicated view in Client Guardian
- Add public pages for Bug Bounty and Crowdfunding (no ACL)
- Fix auth-logger to only detect real login attempts
- Add private IP whitelist for CrowdSec (RFC1918 ranges)
- Update navigation menus across all apps
- Bump secubox-auth-logger to v1.2.2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 09:32:14 +01:00
e75d0f3741 feat(secubox-app-lyrion): Add hybrid Docker/LXC runtime support
- v2.0.0: Multi-runtime support with auto-detection
- LXC preferred when available (150MB RAM vs 300MB for Docker)
- New lyrionctl commands: runtime, shell
- Alpine Linux rootfs creation for LXC
- UCI config: runtime option (auto/docker/lxc)
- Memory limit configuration via cgroups
- Updated plugin manifest with runtime info

Runtime selection:
  option runtime 'auto'   - Auto-detect (LXC preferred)
  option runtime 'docker' - Force Docker
  option runtime 'lxc'    - Force LXC

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:51:04 +01:00
30ff7578ba fix(luci-app-network-tweaks): Set correct file permissions for JS/CSS
- Add explicit 644 permissions for overview.js and dashboard.css
- Fixes HTTP 403 error when accessing the view

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:42:59 +01:00
e6835828af feat(local-build): Add sync command and clean local-feed
- Add sync command to synchronize packages from package/secubox to local-feed
- Add local-feed deletion to clean-all command
- Add missing packages to package/secubox:
  - luci-app-secubox-crowdsec
  - secubox-crowdsec-setup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:50:53 +01:00
b5567ff747 fix(secubox-auth-logger): Simplify log format for CrowdSec parsing
- v1.2.1: Remove timestamp generation (ucode time functions unavailable)
- Use simple format: secubox-auth[1]: authentication failure for...
- Update parser to use raw line parsing with custom label type
- Change acquisition from type:syslog to type:secubox-auth

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:55:30 +01:00
2053cfb614 fix(crowdsec): Patch dispatcher for auth logging and fix firewall interfaces
- secubox-auth-logger v1.2.0: Patch LuCI ucode dispatcher.uc to log
  authentication failures server-side instead of relying on JS hooks
- crowdsec-firewall-bouncer: Add helper function for UCI list reading
  and default to eth1, br-lan, br-wan interfaces to ensure WAN traffic
  is checked against the blocklist
- Update postrm to properly restore dispatcher backup on uninstall

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:50:55 +01:00
22b344225c feat(secubox-auth-logger): Add LuCI auth failure detection
- Add CGI hook to capture client IP during failed auth attempts
- Add JavaScript hook to intercept ubus session.login failures
- Add rpcd plugin for ubus-based auth logging
- Update CrowdSec parser for case-insensitive matching
- Inject JS hook into LuCI theme headers on install

This enables CrowdSec to detect and block brute-force attacks
on the LuCI web interface, which previously only logged
successful authentications.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:07:40 +01:00
da5b88110a feat(crowdsec-dashboard): Add LAPI-only mode, enrollment key storage, improved contrast
- Add Local Protection Mode banner when CAPI unavailable (LAPI still works)
- Save enrollment key to UCI config for future repairs
- Improve text contrast in wizard (better readability)
- Simplify LAPI repair function based on official OpenWrt approach
- Never delete CAPI credentials to avoid rate-limiting
- Add get_settings/save_settings RPC methods
- Bump version to 0.7.0-r27

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:30:17 +01:00
ca562f69cd fix(crowdsec): Restart CrowdSec after console enrollment
- Add automatic restart after successful console enrollment
- Update wizard UI to inform user about validation on app.crowdsec.net
- Service must restart after enrollment is validated on CrowdSec Console

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 13:49:59 +01:00
daacca2c3d fix(crowdsec-wizard): Handle XHR abort in bouncer and services steps
Service restarts during bouncer registration and service start can
cause XHR connections to abort. Treat these as success since the
operation likely completed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 13:44:57 +01:00
fa5662604d feat(crowdsec-wizard): Complete rewrite with single-page health check
New wizard approach:
- Automatic health check on load (LAPI, CAPI, Bouncer, nftables, collections)
- Single configuration page with all options visible
- Only repairs what's broken
- No hub update without CAPI connection
- Single "Apply Configuration" button at the end
- Progress bar during apply
- Summary of what was done at completion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 13:18:01 +01:00
328c48b4e6 fix(luci-app-secubox): Add get_public_ips to ACL permissions
The RPC method was returning "Access denied" because it was missing
from the rpcd ACL configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 13:07:37 +01:00
3666be8284 chore: exclude luci-app-secubox-bonus/root/www from git
Large package feed files exceed GitHub's 100MB limit.
These are build artifacts that should be generated locally.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 13:03:44 +01:00
584df96958 feat(dashboard): Add public IPv4/IPv6 display
- Add get_public_ips method to secubox-core rpcd backend
- Fetch public IPs from multiple services with fallback
- Display in new "Public IP Addresses" panel on dashboard
- Auto-update IPs on poll refresh
- Bump luci-app-secubox to 0.7.1-r2
- Bump secubox-core to 0.10.0-r4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 12:21:10 +01:00
e47ff793f5 fix(crowdsec-wizard): Don't abort XHR during acquisition config
- Treat XHR abort as success when CrowdSec restarts after acquisition config
- Auto-advance to Step 5 after brief delay
- Bump to 0.7.0-r21

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 11:54:16 +01:00
c2ea22bcab fix: CAPI registration with stale credentials cleanup
- repair_lapi() now removes stale online_api_credentials.yaml and retries
- New repair_capi() function for dedicated CAPI repair
- console_enroll() handles CAPI credential cleanup before retry
- Added repairCapi API method in frontend
- Bump luci-app-crowdsec-dashboard to 0.7.0-r20
- Add openwrt-luci-bf.yaml scenario for LuCI brute force detection
- Add secubox-auth-acquis.yaml acquisition config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 11:16:58 +01:00
19f903c0c9 fix(crowdsec-dashboard): Remove "null" text when service is running
The serviceWarning variable was null when CrowdSec is running, and
LuCI's E() function rendered it as literal "null" text. Fixed by
using empty fragment when no warning needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 09:46:51 +01:00
578d59f454 fix(crowdsec-wizard): Don't abort XHR during acquisition config
The refreshView() call was aborting the pending configureAcquisition
XHR request by triggering new API calls. Now only updates the button
state without a full view refresh.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 09:40:31 +01:00
12728da193 fix(crowdsec): Use file-based acquisition instead of command source
CrowdSec on OpenWrt doesn't support "source: command" acquisition.
Changed to file-based acquisition reading /var/log/messages.
Also configures busybox syslog to write to file automatically.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 09:37:18 +01:00
3b84c8a047 feat(secubox-auth-logger): Add auth failure monitoring for CrowdSec
- Create secubox-auth-logger package to monitor SSH/LuCI auth failures
- auth-monitor.sh watches logread for failed password attempts
- Supports OpenSSH, Dropbear, and uhttpd/LuCI authentication
- Logs failures to syslog with secubox-auth tag for CrowdSec parsing
- Fix wizard.js syntax error with computed property names
- Remove broken Dropbear verbose config (2024.86 doesn't support -v)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 09:35:20 +01:00
f917b5412c fix(crowdsec): Auto-enable Dropbear verbose logging for SSH detection
When SSH logging is enabled in the wizard, automatically:
- Set dropbear.@dropbear[0].verbose=1 to log auth failures
- Restart dropbear to apply changes

This ensures CrowdSec can detect SSH brute force attempts.
Without verbose mode, Dropbear doesn't log failed auth to syslog.

Also enable uhttpd syslog when HTTP logging is enabled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 08:53:18 +01:00
921db872ed feat(crowdsec-dashboard): Add dropbear-logs parser and Hub Stats card
Wizard Step 5 improvements:
- Add OpenWrt Parsers section (dropbear-logs, syslog-logs)
- Auto-select dropbear-logs when SSH logging is enabled
- Install parsers via installHubItem API alongside collections

Overview Dashboard:
- Add Hub Components stats card showing:
  - Installed Parsers count (green)
  - Installed Scenarios count (blue)
  - Installed Collections count (purple)
  - List of installed parser names
- Load hub data in dashboard for component counts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 08:51:24 +01:00
2cfeb682d8 fix(media-flow): Fix Active Streams detection from ndpid-apps.json
- Parse ndpid-apps.json array format [{name: "TLS.YouTube", ...}]
- Use jq contains() instead of test() regex (ONIGURUMA not available on OpenWrt)
- Filter streaming services: YouTube, Netflix, Spotify, AppleiTunes, etc.
- Aggregate streams by app name (combine TLS.YouTube + QUIC.YouTube)
- Estimate quality based on data volume (SD/HD/FHD)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 07:50:58 +01:00
f86b67ce13 fix(media-flow): Fix dashboard theming and flow count display
- Add SecuBox dark theme initialization to all views (dashboard, alerts,
  clients, services, history)
- Fix flow count detection by using jsonfilter instead of jq (OpenWrt native)
- Prioritize /var/run/netifyd/status.json for ndpid-compat flow data
- Remove filtering expect{} from API.getActiveStreams() RPC declaration
- Update CLAUDE.md with jsonfilter usage guidelines for OpenWrt

The dashboard now correctly displays:
- Total Flows count from nDPId via ndpid-compat
- nDPId/Netifyd status indicators
- SecuBox dark theme with portal header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 07:31:21 +01:00
88d60cc7f4 fix(ndpid): Correct UCI config section types for init scripts
- Change 'config main' to 'config ndpid main' for proper section naming
- Change 'config compat' to 'config ndpid compat'
- Enable ndpid by default (enabled='1')
- Init scripts expect named sections, not typed sections

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 06:46:42 +01:00
ddae65d0fc feat(crowdsec-dashboard): Add Firewall Blocks section with nftables visualization
- Scan ALL nftables sets (CAPI, cscli, etc.) instead of just base set
- Display blocked IPs count by origin (Community vs Local)
- Show sample of blocked IPs with Unban button
- Add ipv4_capi_count, ipv4_cscli_count, ipv4_total_count to API response
- Support for 14,000+ community blocklist IPs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 17:35:37 +01:00
d1bc9a9b63 feat(crowdsec-dashboard): Add system health check and CAPI metrics
- Add health_check API with LAPI/CAPI/Console status verification
- Add capi_metrics API for community blocklist statistics
- Add hub_available, install_hub_item, remove_hub_item APIs
- Add System Health panel to overview with visual status indicators
- Add CAPI Blocklist section showing community vs local decisions
- Add Installed Collections card with version display
- Fix settings.js syntax error (missing comma)
- Fix metrics.js null display in acquisition statistics
- Update ACL file with new RPC method permissions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 17:08:29 +01:00
290eed2ba1 feat: Rebuild local feed with 25 SDK-built packages
- Rebuilt all luci-app-* and secubox-app-* packages for aarch64-cortex-a72
- Updated local-build.sh with FORCE=1 to bypass rsync prereq check
- Removed packages that failed SDK build (require full buildroot)
- Updated Packages index and apps-local.json manifest

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 09:10:43 +01:00
a677f8cf49 feat: Media-flow UI + security updates
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 07:57:39 +01:00