#How can I add an IP address to the decisions list without using cscli?

1 messages · Page 1 of 1 (latest)

wispy axle
#

I’m using a Docker container and have my own list of IP addresses to block or display captchas on. I need to add them to CrowdSec from another container. I’ve only found a way to grant another container permissions to docker.sock, which I don’t really like. Are there any other options besides this? Thanks.

frozen kindleBOT
#
Important Information

This post has been marked as resolved. If this is a mistake please press the red button below or type /unresolve

abstract solar
#

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)

wispy axle
#

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.

abstract solar
#

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)

wispy axle
#

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.

abstract solar
#

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

GitHub

CrowdSec - the open-source and participative security solution offering crowdsourced protection against malicious IPs and access to the most advanced real-world CTI. - crowdsecurity/crowdsec

wispy axle
frozen kindleBOT
# frozen kindle

Resolving How can I add an IP address to the decisions list without using cscli?