sww: build the Core Rule Set from the settings (closes #434) #465

Merged
clawbot merged 1 commits from issue-434-core-rule-set-in-sww into next 2026-11-19 18:15:33 +01:00
Collaborator

Closes #434

  • The body of waf.NewCoreRuleSet moves into newCoreRuleSet in internal/sww/waf.go, beside newAlertQueue and newRuleFiles. Its error is still wrapped with SWW_WAF_CORE_RULE_SET_EXCLUSIONS_FILE, then with "cannot use the Core Rule Set", as before.
  • waf exports no NewCoreRuleSet; the comment on waf.Params.CoreRuleSet no longer names it.
  • The internal/waf test helper builds the Core Rule Set with coreruleset.New in a new addCoreRuleSet, beside addCounters, while the mode is not off. No internal/waf test sets an exclusions file, so the helper does not repeat the check of that file while the mode is off.

The tests of that check were already in internal/sww/sww_test.go, so no test moves and no assertion changes.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/434 - The body of `waf.NewCoreRuleSet` moves into `newCoreRuleSet` in `internal/sww/waf.go`, beside `newAlertQueue` and `newRuleFiles`. Its error is still wrapped with `SWW_WAF_CORE_RULE_SET_EXCLUSIONS_FILE`, then with "cannot use the Core Rule Set", as before. - `waf` exports no `NewCoreRuleSet`; the comment on `waf.Params.CoreRuleSet` no longer names it. - The `internal/waf` test helper builds the Core Rule Set with `coreruleset.New` in a new `addCoreRuleSet`, beside `addCounters`, while the mode is not off. No `internal/waf` test sets an exclusions file, so the helper does not repeat the check of that file while the mode is off. The tests of that check were already in `internal/sww/sww_test.go`, so no test moves and no assertion changes. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 17:51:04 +01:00
clawbot added 1 commit 2026-11-19 17:51:04 +01:00
The body of waf.NewCoreRuleSet moves into newCoreRuleSet in
internal/sww, beside the providers of the other parts; waf no longer
exports it. The waf test helper builds the Core Rule Set with
coreruleset.New while the mode is not off.

Model: opus-5-5
clawbot self-assigned this 2026-11-19 17:51:06 +01:00
Author
Collaborator

Verdict: PASS
Head: 9af2e03008

newCoreRuleSet in internal/sww now builds the Core Rule Set with the same off-mode exclusions check and the same error, internal/waf no longer exports NewCoreRuleSet, and no test assertion changed.

Model: opus-5-5

Verdict: PASS Head: 9af2e03008e3fac42d0276e70cdcddcd7bdf5881 `newCoreRuleSet` in `internal/sww` now builds the Core Rule Set with the same off-mode exclusions check and the same error, `internal/waf` no longer exports `NewCoreRuleSet`, and no test assertion changed. Model: opus-5-5
clawbot merged commit 967ccdf75e into next 2026-11-19 18:15:33 +01:00
Sign in to join this conversation.