#How can I add an IP address to the decisions list without using cscli?
1 messages · Page 1 of 1 (latest)
This post has been marked as resolved. If this is a mistake please press the red button below or type /unresolve
Locally, cscli is the only way.
If you have a paid plan, you can manage the allowlists through the console (either through the UI or by using the console API)
Unfortunately, even if I take the paid option, it won't work for me either.
The list of IP addresses is in the database and must be added dynamically.
Okay, thanks for the answer.
It's a pity that there is no http api for adding IP addresses, but only for receiving them.
oh sorry
i totally misread your question
You are not talking about allowlists, but decisions
you can add decisions through the API exposed by LAPI (this is what cscli decisions add does behind the scenes)
You need to make a request to the /alerts endpoint, and add the IPs in the decisions field.
See the swagger here: https://crowdsecurity.github.io/api_doc/lapi/#/watchers/pushAlerts
This looks like what I was looking for. It's weird that I couldn't find it myself.
Thanks, I'll definitely try that.
I'll close this thread a bit later if all goes well.
I don't have a curl command that would do it, but if you are not against writing some code, you can probably take some inspirations from what cscli does: https://github.com/crowdsecurity/crowdsec/blob/master/cmd/crowdsec-cli/clidecision/import.go (this is the code for cscli decisions import ).
If you do use centralized allowlists, note that LAPI does not perform any check when receiving an alert that already contains decisions, you'd have to make sure any trusted IPs are not included in the request
Thank you. I'll definitely take everything into account.
An example is optional; I think I can figure it out without it.
Thank you.
Resolving How can I add an IP address to the decisions list without using cscli?