Skip to content

Cap new-IP scans in paradox watch and file the threat model's gaps - #26

Merged
Castor-o7 merged 1 commit into
mainfrom
pdx-33-34-watch-and-webhook
Oct 31, 2026
Merged

Castor-o7 merged 1 commit into
mainfrom
pdx-33-34-watch-and-webhook

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

Story: PDX-33

paradox watch scanned each new public IP it saw, so forged source addresses in a log could spend the day's VirusTotal lookups. It now scans at most 15 new IPs an hour (--max-new-per-hour, 0 for no limit). Rescans aren't counted. An IP over the limit is scanned when it's seen again after the hour.

Also files the threat model's other gaps as PDX-34 to PDX-37, as the watchman asked. Those aren't built here.

Behaviour change

A busy log that sees more than 15 new IPs an hour now scans fewer of them. Use --max-new-per-hour to change that.

Downsides

  • A flood can delay a real attacker, and one that appears only once may never be scanned.
  • The count resets when the watcher restarts.
  • 15 hasn't been measured against a real log and may be too low for a busy one. The watcher warns on stderr when it hits the limit.
  • Rescans of tracked IPs aren't capped, so a long tracked list can still reach VirusTotal's daily limit. VirusTotal's pacing then skips those lookups and says so.

Tested

  • 168 tests pass locally. See CI for other versions.
  • A flood of 100 IPs with a cap of 3 queues 3 and warns once. An IP over the cap is still refused at 3,599 seconds and queued at 3,600.
  • Removing the cap makes the watcher tests fail.
  • Real Watcher.feed from piped lines with a stubbed scanner: capped as expected.

Not tested

A real log, a long run, or the live beacons.

🤖 Generated with Claude Code

A log can name endless forged addresses, and each scan spends quota, so the
watcher now scans at most 15 new IPs an hour. PDX-34 to PDX-37 file the other
gaps found while writing SECURITY.md.

Story: PDX-33

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit 5154a9f into main Oct 31, 2026
5 checks passed
@Castor-o7
Castor-o7 deleted the pdx-33-34-watch-and-webhook branch October 31, 2026 20:21
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.

1 participant