loghunt finds attackers in a log you already have. The next releases make it fit a real server (your own monitoring, your own log format, your own firewall), then let it watch a log as it grows. The rule stays the same in every release: rules decide, and every decision is explained.
0.1.0 was never published, so 0.2.0 is the first version on PyPI.
- Release workflow: a published GitHub release builds, checks and uploads to PyPI
- Add loghunt as a Trusted Publisher on PyPI (environment
pypi, workflowrelease.yml) - Publish GitHub release
v0.2.0, which uploads to PyPI
Things every operator needs before trusting the output enough to block anyone.
-
--allow IP|CIDR|@FILE: IPs that are never reported or blocked (uptime checks, office NAT, your own scanners). They still count toward traffic totals. - Threshold flags (
--login-posts,--burst,--flood,--probes): a busy shop and a personal blog need different numbers. -
--since/--until: look at one incident window inside a long log. -
--blocklist-format plain|nginx|apache|ipset|nftables: write something you can load directly instead of hand-converting a list. (fail2ban was dropped: it has no file to load, only commands to run, and nftables covers current Linux firewalls.)
-
--formattaking an nginxlog_formatstring, so custom formats (request time, upstream,$http_x_forwarded_forin the middle) parse without regex editing. - JSON-lines logs (nginx
escape=json, Caddy, Traefik). - Report the parse rate per file, and warn when most lines are skipped (wrong format).
- Campaigns that rotate User-Agents: group by request set alone when the set is unusual enough (attacker-only paths or login endpoints), not by User-Agent.
- Network view: many IPs in one /24 (IPv4) or /48 (IPv6) that together cross a threshold.
- Collapse a blocklist into CIDR ranges when a whole range is flagged.
-
--follow: tail a growing log and print new suspects as they cross the threshold, with a sliding window so memory stays bounded. - Systemd unit and cron examples in the README.
- Blocking by itself. loghunt writes the list; you decide to load it.
- Reverse DNS or any network lookup during analysis. A log analysis should not contact the attacker's infrastructure, and results must not depend on the network.
- Machine-learned scores. They cannot explain themselves.