WAF ip_blocklist with on_demand_tls #96
|
I'm trying to do a very simple blocklist on a dynamic list. We have an application enabled which uses caddy file {query.domain} to verify that it's allowed to talk to the box: Which in turn has the section: And finally through to the actual host entry with the waf: I have a single IP in testing in the ip_blacklist file, and I can see it loads it, and has 1 valid entry, but I just see this in the logs: And no blocking of the IP in the blacklist. I've hunted around, am I missing something I should have added somewhere? |
Replies: 1 comment
|
Hi @doogienz — you were right, and I am sorry this sat unanswered for two months. Your report was accurate and the log you attached was exactly the evidence needed: the WAF printed 1. The IP blacklist never blocked anything, for anyone. 2. A forged 3. Hot-reloading a blacklist or rule file deadlocked the server. Not what you hit, but found alongside: the reload path blocked forever while holding a lock every request needs, so the process silently stopped answering. Fixed in v0.3.9: To confirm it works, add an IP to One note on your config, unrelated to the bugs: your Thank you for the report and for the detail in it. It should not have taken this long. |
Hi @doogienz — you were right, and I am sorry this sat unanswered for two months.
Your report was accurate and the log you attached was exactly the evidence needed: the WAF printed
IP blacklist loadedwith a valid entry and then did not block. That was not a configuration mistake on your side. I investigated it properly today and it turned out to be three separate bugs, now published as GHSA-w6gv-76q4-prqg. You are credited as the reporter.1. The IP blacklist never blocked anything, for anyone.
loadIPBlacklisttook the trie by value while both callers passed a dereferenced pointer, so every entry was inserted into a copy that was thrown away on return. The trie the WAF actually consults …