Skip to content

Add Under Attack Mode#2

Merged
sergeyfast merged 1 commit into
masterfrom
sync/under-attack-mode
May 1, 2026
Merged

Add Under Attack Mode#2
sergeyfast merged 1 commit into
masterfrom
sync/under-attack-mode

Conversation

@sergeyfast
Copy link
Copy Markdown
Contributor

Summary

  • Add Under Attack Mode: Decision.AttackScoreBoost boosts request score and TrafficRule.AttackOnly gates rules via waf.AttackState; hot-path cost tightened with atomic snapshot reads
  • Surface AttackOnly and AdaptiveSection.ScoreBoost in the dashboard config view and config builder UI with TOML round-tripping
  • Add e2e test for AttackOnly rule gating, metrics unit tests, and replace concrete hostnames with example.com across code, templates and samples

Test plan

  • make fmt lint clean
  • go test ./... green
  • e2e attack-mode gating test passes
  • Builder TOML round-trip preserves AttackOnly + ScoreBoost

- Add Decision.AttackScoreBoost in internal/waf/decide for Under
  Attack Mode: boosts request score when waf.AttackState is on
- Gate TrafficRule (filter) with AttackOnly via waf.AttackState in
  internal/waf/filter; rule fires only while attack mode is active
- Tighten hot-path cost of attack-mode reads (atomic snapshot)
- Surface AttackOnly and AdaptiveSection.ScoreBoost in dashboard
  (internal/dashboard/attack.go, config.go, dashboard_zenrpc.go)
  and config builder UI with TOML round-tripping
- Add e2e test for AttackOnly rule gating
  (e2e/management_test.go, e2e/cfg/e2e.toml)
- Add metrics tests in internal/app/metrics_test.go
- Replace concrete hostnames with example.com in code, templates
  and config samples
@sergeyfast sergeyfast changed the title Add Under Attack Mode and clean example hosts Add Under Attack Mode May 1, 2026
@sergeyfast sergeyfast merged commit bfaa68b into master May 1, 2026
2 checks passed
@sergeyfast sergeyfast deleted the sync/under-attack-mode branch May 1, 2026 08:28
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