Ban Spamhaus DROP networks through CrowdSec
Bans the DROP networks you name, or with allUnbannedDays every DROP network that sent traffic in that many days and has no active decision, busiest first and at most 1000. A network with an active decision of any type, a captcha included, keeps it and gets no ban, and a named one comes back ok with alreadyBanned, so a retry is safe. After 3 unreachable LAPI answers in a row or 120 seconds, the rest come back with an error that starts with not attempted. Answers 403 when the server has no CrowdSec machine credentials, CROWDSEC_MACHINE_ID and CROWDSEC_MACHINE_PASSWORD. Needs a Read/write API key or a browser session.
session<token>Session cookie authentication.
application/json- body
The DROP networks to ban, by name or as every unbanned network with traffic.
Set exactly one of networks and allUnbannedDays, or the request gets a 400.
allUnbannedDays?|Ban every DROP network that sent traffic in this many days and has no active decision of any type, 7, 30 or 90.
73090nullduration*stringHow long each ban lasts, such as 4h, 30m, 7d or 1d12h.
networks?array<string>|The networks to ban, as CIDRs from the DROP list, at most 1000. A network named twice gets one result.
items <= 1000Request fulfilled, document follows
application/json- response
The outcome for each network.
leftOut*integerWith allUnbannedDays, the networks without a decision past the first 1000, which this run did not try. 0 otherwise.
results*array<>curl -X POST 'https://geometrikks.example.com/api/v1/crowdsec/ban-networks' \ -H 'Content-Type: application/json' \ -d '{ "duration": "string"}'{ "leftOut": 0, "results": [ { "alreadyBanned": true, "error": "string", "network": "string", "ok": true } ]}Ban an IP or range through CrowdSec POST
Creates a `ban` or `captcha` decision with origin `geometrikks` on one IP or CIDR, and answers 204 with no body. The bouncers attached to the LAPI enforce it. A CIDR that covers every address gets a 400. Answers 403 when the server has no CrowdSec machine credentials, CROWDSEC_MACHINE_ID and CROWDSEC_MACHINE_PASSWORD. Needs a Read/write API key or a browser session.
List every IP under an active decision GET
Returns each IP that holds an `Ip` decision from any origin, once, with the strongest decision type on it. `ban` beats `captcha`, which beats the rest. `/banned-ranges` lists the Range decisions.