Repository navigation
ProBAN 0.1.4 — reliable firewall-log ingestion from boot
Fixed — reliable firewall-log ingestion from boot
The engine could go blind (ingested fw=0) for up to an hour after a reboot, and briefly after each daily log rotation.
Root cause: ProBAN's default firewall-log path, /var/log/filter/latest.log, is a symlink OPNsense only (re)creates from its hourly syslog archive cron job. So right after boot — and briefly after a rotation — that symlink doesn't exist even though the filter log is actively being written. The engine's plain open() hit FileNotFoundError and ingested nothing the whole window: no detections, no bans, no escalation.
Fix: the reader now falls back to the newest filter_*.log in the same directory — the exact file latest.log would point at, matching OPNsense's own log_archive and firewall-log viewer (read_log.py, which uses tail -F). The dated file and the symlink share an inode, so offset/rotation tracking stays seamless when the symlink later appears: no missed bytes, no double-counting. The engine's file watcher follows the resolved file too, so responsiveness is unchanged.
Reproduced and fixed on a live OPNsense 26.7 box: a freshly rebooted appliance with no latest.log now detects and escalates attack traffic immediately, with no manual intervention.
Resolves #7, and is the root cause behind the "only updates when I change a setting" reports in #4 and #8. Adds resolve_log unit tests.
Note: if you were on 0.1.3 and saw ProBAN sitting at ingested fw=0 / offenders not updating, this is the fix — no config change needed.