C
CrowdSec7d ago
hhf

quick question- which is correct env variable for CTI - CROWDSEC_CTI_API_KEY or CTI_API_KEY

Error log
root@localhost:~# docker exec crowdsec cscli notifications test discord
level=info msg="Crowdsec CTI helper enabled"
time="2025-11-29T16:52:38Z" level=debug msg="starting plugin" args="[/usr/local/lib/crowdsec/plugins/notification-http]" path=/usr/local/lib/crowdsec/plugins/notification-http
time="2025-11-29T16:52:38Z" level=debug msg="plugin started" path=/usr/local/lib/crowdsec/plugins/notification-http pid=538
time="2025-11-29T16:52:38Z" level=debug msg="waiting for RPC address" plugin=/usr/local/lib/crowdsec/plugins/notification-http
time="2025-11-29T16:52:38Z" level=debug msg="using plugin" version=1
time="2025-11-29T16:52:38Z" level=trace msg="waiting for stdio data"
level=info msg="registered plugin discord"
level=info msg="registered plugin http_default"
level=info msg="pluginTomb dying"
time="2025-11-29T16:52:38Z" level=info msg="cti call for 10.10.10.10" type=crowdsec-cti
time="2025-11-29T16:52:39Z" level=debug msg="request for 10.10.10.10 took 661.664301ms" type=crowdsec-cti
time="2025-11-29T16:52:39Z" level=info msg="received signal for discord config" @module=http-plugin
level=info msg="killing all plugins"
time="2025-11-29T16:52:39Z" level=debug msg="received EOF, stopping recv loop" err="rpc error: code = Unavailable desc = error reading from server: EOF"
time="2025-11-29T16:52:39Z" level=info msg="plugin process exited" id=538 plugin=/usr/local/lib/crowdsec/plugins/notification-http
time="2025-11-29T16:52:39Z" level=debug msg="plugin exited"
root@localhost:~# docker exec crowdsec cscli notifications test discord
level=info msg="Crowdsec CTI helper enabled"
time="2025-11-29T16:52:38Z" level=debug msg="starting plugin" args="[/usr/local/lib/crowdsec/plugins/notification-http]" path=/usr/local/lib/crowdsec/plugins/notification-http
time="2025-11-29T16:52:38Z" level=debug msg="plugin started" path=/usr/local/lib/crowdsec/plugins/notification-http pid=538
time="2025-11-29T16:52:38Z" level=debug msg="waiting for RPC address" plugin=/usr/local/lib/crowdsec/plugins/notification-http
time="2025-11-29T16:52:38Z" level=debug msg="using plugin" version=1
time="2025-11-29T16:52:38Z" level=trace msg="waiting for stdio data"
level=info msg="registered plugin discord"
level=info msg="registered plugin http_default"
level=info msg="pluginTomb dying"
time="2025-11-29T16:52:38Z" level=info msg="cti call for 10.10.10.10" type=crowdsec-cti
time="2025-11-29T16:52:39Z" level=debug msg="request for 10.10.10.10 took 661.664301ms" type=crowdsec-cti
time="2025-11-29T16:52:39Z" level=info msg="received signal for discord config" @module=http-plugin
level=info msg="killing all plugins"
time="2025-11-29T16:52:39Z" level=debug msg="received EOF, stopping recv loop" err="rpc error: code = Unavailable desc = error reading from server: EOF"
time="2025-11-29T16:52:39Z" level=info msg="plugin process exited" id=538 plugin=/usr/local/lib/crowdsec/plugins/notification-http
time="2025-11-29T16:52:39Z" level=debug msg="plugin exited"
31 Replies
CrowdSec
CrowdSec7d ago
Important Information
This post has been marked as resolved. If this is a mistake please press the red button below or type /unresolve
© Created By WhyAydan for CrowdSec ❤️
_KaszpiR_
_KaszpiR_7d ago
https://github.com/search?q=org%3Acrowdsecurity+CTI_API_KEY&type=code in other projects it's CROWDSEC_CTI_API_KEY 😄
GitHub
Build software better, together
GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.
From An unknown user
From An unknown user
From An unknown user
_KaszpiR_
_KaszpiR_7d ago
so generally it depends on the implementation
hhf
hhfOP7d ago
the search results were funny lol tried both,
_KaszpiR_
_KaszpiR_7d ago
cticlient/example/fire.go is just like that - an example, not the actual fully working setup
hhf
hhfOP7d ago
hhf
hhfOP7d ago
for reference i am trying this
_KaszpiR_
_KaszpiR_7d ago
GitHub
crowdsec/pkg/cticlient/client.go at master · crowdsecurity/crowdsec
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
_KaszpiR_
_KaszpiR_7d ago
I don't quite understand what your problem is?
hhf
hhfOP7d ago
I have attached the logs , notification suffers a crash because of cti not configured properly
Loz
Loz6d ago
You sure the notification not working? The test command spins up a temporary plugin to push the notification and kills it. The 10.10.10.10 by default has not data in the CTI so since you don't check for null or empty that could be why You can override which IP by using the json override and it should be {"source": {"value": "10.10.10.10"}}
hhf
hhfOP5d ago
docker exec crowdsec cscli decisions add -i 5.101.111.66 tried this no result in the discord
Loz
Loz5d ago
adding manual decisions does not trigger notifications try
cscli notifications test discord --alert '{"source": {"value": "5.101.111.66"}}'
cscli notifications test discord --alert '{"source": {"value": "5.101.111.66"}}'
hhf
hhfOP5d ago
okay sorry guys found it
hhf
hhfOP5d ago
No description
hhf
hhfOP5d ago
go was adding -discord to the wrong block
hhf
hhfOP5d ago
it should add to name: default_ip_remediation if am correct it was adding to name: default_range_remediation Nope
lists/check/5.101.111.21 HTTP/1.1 200 561.64µs \"crowdsec/v1.7.3-c8aad699-docker\" \""
time="2025-12-01T16:16:15Z" level=info msg="(localhost/cscli) manual 'ban' from 'localhost' by ip 5.101.111.21 : 4h ban on Ip 5.101.111.21"
time="2025-12-01T16:16:15Z" level=info msg="127.0.0.1 - [Mon, 01 Dec 2025 16:16:15 UTC] \"POST /v1/alerts HTTP/1.1 201 10.746193ms \"crowdsec/v1.7.3-c8aad699-docker\" \""
time="2025-12-01T16:16:15Z" level=info msg="cti call for 5.101.111.21" type=crowdsec-cti
time="2025-12-01T16:16:16Z" level=debug msg="request for 5.101.111.21 took 505.76939ms" type=crowdsec-cti
time="2025-12-01T16:16:16Z" level=error msg="Invalid API key provided, disabling CTI API" type=crowdsec-cti
time="2025-12-01T16:16:16Z" level=warning msg="error while calling CrowdsecCTI : unauthorized"
time="2025-12-01T16:16:16Z" level=info msg="received signal for discord config" @module=http-plugin
time="2025-12-01T16:16:16Z" level=warning msg="HTTP server returned non 200 status code: 400" @module=http-plugin
lists/check/5.101.111.21 HTTP/1.1 200 561.64µs \"crowdsec/v1.7.3-c8aad699-docker\" \""
time="2025-12-01T16:16:15Z" level=info msg="(localhost/cscli) manual 'ban' from 'localhost' by ip 5.101.111.21 : 4h ban on Ip 5.101.111.21"
time="2025-12-01T16:16:15Z" level=info msg="127.0.0.1 - [Mon, 01 Dec 2025 16:16:15 UTC] \"POST /v1/alerts HTTP/1.1 201 10.746193ms \"crowdsec/v1.7.3-c8aad699-docker\" \""
time="2025-12-01T16:16:15Z" level=info msg="cti call for 5.101.111.21" type=crowdsec-cti
time="2025-12-01T16:16:16Z" level=debug msg="request for 5.101.111.21 took 505.76939ms" type=crowdsec-cti
time="2025-12-01T16:16:16Z" level=error msg="Invalid API key provided, disabling CTI API" type=crowdsec-cti
time="2025-12-01T16:16:16Z" level=warning msg="error while calling CrowdsecCTI : unauthorized"
time="2025-12-01T16:16:16Z" level=info msg="received signal for discord config" @module=http-plugin
time="2025-12-01T16:16:16Z" level=warning msg="HTTP server returned non 200 status code: 400" @module=http-plugin
Loz
Loz5d ago
time="2025-12-01T16:16:16Z" level=error msg="Invalid API key provided, disabling CTI API" type=crowdsec-cti
your key still the same one provided by the console?
hhf
hhfOP5d ago
yes.
Loz
Loz5d ago
And it still shown in the console, just saying cause we just pruned a bunch of dead keys that havent been used in months. (and it be missing within the interface)
hhf
hhfOP5d ago
yesterday i regenerated one
hhf
hhfOP5d ago
No description
hhf
hhfOP4d ago
@Loz and @KaszpiR thanks guys. Now it works. CROWDSEC_CTI_API_KEY this only sticks. dont know why.
No description
CrowdSec
CrowdSec4d ago
Resolving quick question- which is correct env variable for CTI - CROWDSEC_CTI_API_KEY or CTI_API_KEY This has now been resolved. If you think this is a mistake please run /unresolve
_KaszpiR_
_KaszpiR_4d ago
maybe libraries are automatically assuming env var prefix with the app name, I guess this becomes a standard
hhf
hhfOP4d ago
no idea my code was also a bit of an issue but not related to this but for cti - this will only work CROWDSEC_CTI_API_KEY any ways see you around guys. soory @KaszpiR to ping again, any guidance for unifi bouncer/ log phrase, one of my user/friend keeps on asking me
_KaszpiR_
_KaszpiR_4d ago
no idea, not using anything from unifi, probably you need to search on crowdsec hub or discord
_KaszpiR_
_KaszpiR_4d ago
https://app.crowdsec.net/hub?filters=search%3Dunifi there are some... probbaly needs to set up remote loging via syslog
Collections, AppSec Rules & Configurations | CrowdSec Hub
Manage collections, configurations, remediation components, and AppSec rules with CrowdSec Hub. Streamline security with tools and integrations for enhanced protection.
hhf
hhfOP4d ago
Thanks bro 👍

Did you find this page helpful?