Ban an IP or range through CrowdSec
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.
session<token>Session cookie authentication.
application/json- body
What to ban, for how long and why.
duration?|How long the decision lasts, such as 4h, 30m, 7d or 1d12h. Defaults to CROWDSEC_DEFAULT_BAN_DURATION, 4h by default.
ip*stringAn IP, or a range in CIDR form such as 203.0.113.0/24. A /32 or /128 becomes an IP decision.
reason?|The reason the decision carries. Defaults to manual ban from GeoMetrikks, or manual captcha from GeoMetrikks for a captcha.
type?stringban or captcha. Defaults to ban.
"ban""ban""captcha"Request fulfilled, nothing follows
curl -X POST 'https://geometrikks.example.com/api/v1/crowdsec/ban' \ -H 'Content-Type: application/json' \ -d '{ "ip": "string"}'Get one CrowdSec alert GET
Returns the alert with its context, the events the LAPI kept and its decisions, expired ones included. Answers 403 when the server has no CrowdSec machine credentials, CROWDSEC_MACHINE_ID and CROWDSEC_MACHINE_PASSWORD.
Ban Spamhaus DROP networks through CrowdSec POST
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.