Commit Graph

11 Commits

Author SHA1 Message Date
b732ffe698 feat(macro): auto-detect firewall table (secubox_filter|filter) via /etc/secubox/macro.conf — tor-exit works on gk2's inet filter too (closes #772) (ref #771) 2026-07-01 13:40:25 +02:00
73f391d083 fix(macro): macro state dirs root-owned — macroctl writes as root, AppArmor grants no dac_override (live #771) 2026-07-01 13:33:35 +02:00
16aab9b72c fix(macro): AppArmor allow /usr/sbin + /etc/iproute2 (nft) + pre-create audit.log for append-only (live #771) 2026-07-01 13:16:56 +02:00
4dd06b8c2b fix(macro): AppArmor grant capability net_admin — nft needs it to modify the ruleset (live-demo #771) 2026-07-01 13:14:07 +02:00
c96b8ddef2 fix(macro): drop redundant debian/compat (conflicts with debhelper-compat build-dep) (ref #771) 2026-07-01 13:08:43 +02:00
fff139ac39 fix(macro): mawk-portable prerm handle extraction + apparmor append-only audit + tor-exit euid env-pin (review #771) 2026-07-01 08:28:12 +02:00
a37661d101 feat(macro): sudoers + AppArmor + postinst (Tor SocksPort, nft base set) (ref #771)
- sudoers.d/secubox-macro: exact NOPASSWD line, default env_reset only (no
  SETENV/env_keep), validated by visudo
- apparmor/secubox-macroctl: enforce profile — python3/macros.d/nft/ip rix,
  /etc/tor/torrc.d/ r, /var/lib/secubox/macro/** rw, audit.log w,
  inet stream + netlink raw; DEFAULT-DENY all else
- conf/secubox-macro-tor-exit.conf.example: __MESH_IP__ token + comment
- debian/postinst: create /var/lib/secubox/macro/{active,grants} 0750
  secubox, nft base set + input rule (guarded on inet secubox_filter),
  sed-render Tor SocksPort torrc.d file with wg-mesh IP, apparmor_parser -r
- debian/prerm: remove torrc.d file, drop nft input rule by handle (best-effort)
- debian/rules: drop unused /etc/tor/torrc.d dir; add install -d for
  usr/share/secubox/macro before conf.example install

Verification: visudo parsed OK, sh -n OK for both scripts, apparmor --preprocess
OK, 14/14 tests pass, all rules-referenced files confirmed present.
2026-07-01 08:20:38 +02:00
94631f22f3 fix(macro): tor-exit — sanitize service_id (root path-traversal), bound socks_port, warn on revoke nft error (review #771) 2026-07-01 08:15:57 +02:00
594b83b552 feat(macro): tor-exit plugin (nft SOCKS-over-mesh grant/revoke/activate) (ref #771) 2026-07-01 08:08:32 +02:00
70a18b2d51 fix(macro): macroctl root-ownership tamper guard + ignore env under root + require src-ip for grant/revoke (review #771) 2026-07-01 08:05:44 +02:00
49da4093f7 feat(macro): scaffold secubox-macro + secubox-macroctl dispatcher (ref #771)
- New Debian package secubox-macro (0.1.0-1~bookworm1, Architecture:all)
- secubox-macroctl: root dispatcher that validates kind against macros.d
  allowlist, tamper-guards plugins (world-writable check + realpath escape),
  validates --src-ip within mesh CIDR, execs plugin verb via subprocess
  without shell, appends audit JSON line; env overrides for tests
- TDD: 5 tests written first (rejects unknown kind, path-traversal kind,
  src-ip outside mesh, dispatches+audits, world-writable refused) — all pass
- debian/control, compat=13, changelog, rules skeleton (tor-exit/sudoers/
  apparmor/conf referenced but not yet created — Tasks 4-5)
2026-07-01 07:58:54 +02:00