Skip to content

--digest: a log review report for a large-context model - #9

Merged
FMXExpress merged 1 commit into
mainfrom
digest
Nov 14, 2026
Merged

FMXExpress merged 1 commit into
mainfrom
digest

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner
jevban --digest /var/log/apache2/access.log.1 -o digest.md

Replays a log through the rules, bans nothing, and writes a Markdown report sized for one request to a large-context model. The size limit is set with --digest-tokens (default 200,000); whatever doesn't fit is counted at the end, never dropped silently.

What's in it

  • Every client the prefilter flagged: user agent, request counts, tags, highest score, ban reason, and its requests in compact form. The requests before its first flagged one are included for context.
    • Flagged but not banned come first, since that is where a missed attacker would be. They're ranked by score, then by how rare their tags are across the report: a file-probe among sixty wordpress logins says more.
    • Banned clients follow, shorter.
    • A long client is trimmed in the middle.
  • 4xx paths no rule flagged that two or more clients asked for: new probes, or the site's own broken links. Paths browsers and crawlers request automatically are left out (favicons, touch icons, robots.txt, sitemaps, /.well-known/).
  • A note that every request line and user agent was written by the client and is data, not instructions.

Measured

  • Size: a real 63,000-line shop log (LogarX) came to about 42,000 tokens; the synthetic test sets came to 11,000–37,000.
  • Where the missed attackers land: on the synthetic test sets, every attacker the rules missed and the prefilter had flagged ranks near the top of its section.
    • WordPress: all 7 in the top 9 of 68. Before the tag-rarity ranking, the 3 stealth scanners were at 50, 63 and 67.
    • Static site: ranks 1–4 of 6.
    • Web app: ranks 1–4 and 8 of 16.
  • The limit: clients the prefilter never flags aren't in the report. On the web app, 3 password guessers whose logins look like its API calls are missing; they can only surface through the 4xx table. The README says so.
  • No side effects: the hooks run only with --digest. Benchmark quality is identical to main.

Unit tests: 188 checks, 0 failed (11 new: ranking, context lines, tags, ban counting, the 4xx filter, the budget).


Generated by Claude Code

Replays a log through the rules (bans nothing) and writes Markdown: the
flagged clients (flagged-not-banned first, by score and then tag rarity, with
the requests before the first flag for context), the 4xx paths no rule
flagged that several clients asked for (auto-requested names left out), and a
note that client-written text is data. A token budget (--digest-tokens,
default 200,000) keeps it to one request; what is cut is counted.

Real shop log, 63,000 lines: about 42,000 tokens. Synthetic test sets: every
missed attacker the prefilter flagged ranks in the top 9 of its section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
@FMXExpress
FMXExpress merged commit 42c5b4a into main Nov 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants