secubox-deb/packages/secubox-metrics/debian
CyberMind 9a0a9873a7
fix(secubox-metrics): VisitorOrigin entries=[] forever — CAP_NET_ADMIN + DB-IP fallback (closes #194) (#195)
Two latent bugs since #92 that together masked VisitorOrigin:

1. Missing CAP_NET_ADMIN
   The aggregator runs as User=secubox and calls
     nft -j list set inet secubox_metrics seen_src
   which requires CAP_NET_ADMIN. EPERM, subprocess silently returns
   no output, _read_nft_set returns [], entries stays []. Added:
     AmbientCapabilities=CAP_NET_ADMIN
     CapabilityBoundingSet=CAP_NET_ADMIN
   Coexists with NoNewPrivileges=true (systemd sets the ambient set
   before the User= drop).

2. MaxMind license barrier
   secubox-geoipupdate.service had:
     ConditionPathExists=/etc/secubox/secrets/maxmind.conf
   So operators without a MaxMind account couldn't activate VisitorOrigin
   at all. Replaced with a new fetcher /usr/bin/secubox-geoipupdate-fetch
   that:
     - Uses MaxMind geoipupdate if /etc/secubox/secrets/maxmind.conf exists
       AND geoipupdate is installed (Recommends).
     - Falls back to DB-IP free ASN lite (no signup needed). The file is
       a MaxMind-compatible mmdb so maxminddb.open_database reads it
       transparently. Sanity-checked on prod board:
         metadata: DBIP-ASN-Lite (compat=GeoLite2-ASN)
         lookup 1.1.1.1 -> AS13335 Cloudflare, Inc.

Live verification on gk2 board after applying both fixes:
  top visitor ASNs (last 60min):
    AS32934  Facebook              59 hits
    AS8075   Microsoft             34 hits
    AS396982 Google                13 hits
    AS16509  Amazon                 6 hits

Co-authored-by: CyberMind-FR <gandalf@Gk2.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 06:16:43 +02:00
..
changelog fix(secubox-metrics): VisitorOrigin entries=[] forever — CAP_NET_ADMIN + DB-IP fallback (closes #194) (#195) 2026-05-18 06:16:43 +02:00
control Health banner: live panel (visitor-origin + live-hosts + cert-status) (#98) 2026-05-12 16:27:56 +02:00
postinst fix(metrics): CACHE_DIR /tmp/secubox → /var/cache/secubox (closes #149) 2026-05-15 17:28:04 +02:00
prerm Health banner: live panel (visitor-origin + live-hosts + cert-status) (#98) 2026-05-12 16:27:56 +02:00
rules fix(secubox-metrics): VisitorOrigin entries=[] forever — CAP_NET_ADMIN + DB-IP fallback (closes #194) (#195) 2026-05-18 06:16:43 +02:00
secubox-metrics.service fix(secubox-metrics): VisitorOrigin entries=[] forever — CAP_NET_ADMIN + DB-IP fallback (closes #194) (#195) 2026-05-18 06:16:43 +02:00
secubox.yaml feat(secubox): complete meta-script generator Tasks 14-17 2026-05-11 05:32:29 +02:00