Journal events to local ban requests

Read references/specification.md and references/engineering-contract.md. For the blocking project’s action client, require the locally pinned bmforge-zmq skill and its existing REQ/REP envelope; select ZMQ explicitly if absent. Do not require ZMQ, Fail2ban or nftables in a producing application: it should independently select bmforge-security-events and simply call emit("abuse").

  • Read only native systemd journal records from the actual producing service, with backend = systemd and journalmatch = _SYSTEMD_UNIT=<real-service>.service. No file log path, file rotation, log watcher, second delivery channel or new daemon. The host Fail2ban interpreter needs python3-systemd (or distribution equivalent); this is not an application venv dependency.
  • Match the producer’s timestamp-free SECURITY event=<name> ip=<numeric address> journal MESSAGE. Fail2ban reconstructs a prefix from journal hostname, identifier and PID metadata; include native common.conf, select logtype = journal, and anchor the filter at ^%(__prefix_line)sSECURITY.... The journal owns event time. Verify real IPv4/IPv6 using fail2ban-regex ... systemd-journal and unit-scoped journalmatch, not a synthetic unprefixed log.
  • Keep event meaning explicit. If one event means confirmed abuse, use maxretry = 1; if each event is a countable action, let Fail2ban apply the policy’s findtime/maxretry threshold across workers. The producer has no retries, counters, queues, IP state or knowledge of enforcement. Use native ignoreip and finite bantime for jail tickets only; the blocking service chooses the real kernel ban duration.
  • Create only the current, application-owned Fail2ban filter.d/*.conf, disabled-by-default jail.d/*.conf, and action.d/*.conf ban-only action in the blocking project. Operator .local overrides remain separately owned, but must not change required backend, journalmatch or action hooks. Reject conflicting effective configuration before activating. No automatic legacy file migration, configparser translator, or compatibility support. Refactor older applications explicitly when adopting the new contract. Pass the validated matched IP and fixed jail/source name, never raw log lines. Keep actionunban, actionstop and actionflush empty.
  • Reuse existing BMForge ZMQ for a bounded acknowledged REQ/REP call; an error, lost reply, unavailable listener or rejection produces a nonzero result. No hidden retry, claimed success, or firewall fallback. No new transport/client in the event producer.
  • Leave the nftables enforcement contract unchanged. The local service selects the duration; the kernel owns active timed bans. A restored ticket may issue an ordinary request without duplicate or expiry tracking. Never implement a ban map, source ledger, replay worker, new database, generic Fail2ban wrapper, second firewall backend or centralized controller.
  • Use separate native checks for configuration (fail2ban-client -t/-d), the host daemon interpreter (import systemd.journal), journal unit access (journalctl -u ... -o cat/-o verbose), and actual matching (fail2ban-regex ... systemd-journal). Then exercise the boundary with real application requests and two independent countable event types (bad_request: 3/60s; auth_failure: 5/300s in disposable test only). Show each jail counts its own events and overlapping jails can send independent ban requests for the same IP, without app-side state. A logfile fixture cannot prove delivery. Do not revalidate the existing nftables core-blocking contract.
  • Mark the owning action-client module with BMFORGE_COMPONENT = {"id": "bmforge.fail2ban", "spec_version": "0.3.1"}. Do not enable a production jail or mutate consumer repositories merely by selecting/updating this pinned skill.