I can’t seem to work out how to query a range or CIDR via the API. Works with cscli ok:
# cscli decision list --range 88.87.84.0/24 --contained
╭─────────┬──────────┬─────────────────┬────────────────────────────┬────────┬─────────┬──────────────────────────────┬────────┬────────────┬──────────╮
│ ID │ Source │ Scope:Value │ Reason │ Action │ Country │ AS │ Events │ expiration │ Alert ID │
├─────────┼──────────┼─────────────────┼────────────────────────────┼────────┼─────────┼──────────────────────────────┼────────┼────────────┼──────────┤
│ 2586050 │ crowdsec │ Ip:88.87.84.104 │ crowdsecurity/postfix-spam │ ban │ RU │ 39435 JSC ER-Telecom Holding │ 7 │ 2h41m25s │ 21265 │
╰─────────┴──────────┴─────────────────┴────────────────────────────┴────────┴─────────┴──────────────────────────────┴────────┴────────────┴──────────╯
Single IP works fine:
$ curl -H “X-Api-Key: KEY” “http://localhost:8080/v1/decisions?range=88.87.84.104”
[{“duration”:“2h56m44s”,“id”:2586050,“origin”:“crowdsec”,“scenario”:“crowdsecurity/postfix-spam”,“scope”:“Ip”,“type”:“ban”,“value”:“88.87.84.104”}]
These give no result (URLs removed due to new user posting links issue)
“v1/decisions?range=88.87.84.0/24”
“v1/decisions?range=88.87.84.0/24&contains=1”
“v1/decisions?scope=range&value=88.87.84.0/24”
“v1/decisions?scope=range&value=88.87.84.0/24&contains=1”
Any ideas?