Commit Graph

10 Commits

Author SHA1 Message Date
Dan Milne
e2b6db2f48 Fix geo rule re-enablement bug
When rules expire and are disabled by ExpiredRulesCleanupJob, the system
was unable to re-enable them due to unique index constraints. This caused
geo-based blocking to stop working in production.

Implemented find-or-update-or-create pattern in WafPolicy#create_rule_for_network_range:
- Re-enables disabled rules and sets new expiration (7 days)
- Extends expiration for enabled rules
- Creates new rules with 7-day TTL
- Handles race conditions gracefully

Added test coverage for all three scenarios.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 23:06:25 +11:00
Dan Milne
032243ba6a Smarter backfil 2025-12-02 14:01:45 +11:00
Dan Milne
1aa77066a1 Catch exceptions in the process waf job, use symbols for actions, Don't create a rule which matches a supernet rule. 2025-12-01 21:23:23 +11:00
Dan Milne
f0ad3b2c90 Two bug fixes 2025-12-01 19:54:47 +11:00
Dan Milne
179563022e Drop add_headers - headers can now be added to meta[] to be applied for any action. Consilidate Tagging in a service 2025-11-30 13:18:17 +11:00
Dan Milne
3f274c842c Fix some blocked/allow laggards after migrating. Add DuckDB for outstanding analyitcs performance. Start adding an import for all bot networks 2025-11-18 16:40:05 +11:00
Dan Milne
90823a1389 Yeh 2025-11-15 10:51:58 +11:00
Dan Milne
6433f6c5bb Updates 2025-11-14 16:35:49 +11:00
Dan Milne
26216da9ca Add 'tags' to event model. Add a dataimport system - currently for MaxMind zip files 2025-11-11 10:31:36 +11:00
Dan Milne
772fae7e8b Add WafPolicies 2025-11-10 14:10:37 +11:00