I’ve been thinking about: When I’m using the Chat Trigger node on a website (e.g. via n8n-chat CDN), how can I properly protect my instance from abuse? Like DDoS, unnecessary requests from fools, etc? For now the origin server (if self-hosted) or n8n instance is publicly available and I might want to block specific users based on their behavorial pattern or even their IP-address. Currently that is not possible, right?
Since I have no clue about setting all the security up all by myself, maybe you know about any services that can handle at least all the basic stuff? That would be incredibly helpful for me!
I agree with @BramKn here. If you dont want to worry about security then simply paying for the convenience of n8n cloud is the way to go. If your requirement is infact to host your own instances for privacy or other reason, then we can help you further
Allowed Origins (CORS) option in Chat Trigger node. By default it’s set to ‘*’ - which allows traffic from any website. This can be circumvented by non-browser, so this should be just initial phase.
You can implement specific rate limiting in your n8n process, for example you can pass a metadata flag (and require it in the workflow) to limit some of the malicious traffic.
Or you can implement rate limiting per metadata item/conversation id in your workflow: as simple as keeping requests from last 10 minutes in DB and only allowing X number of requests for this time per conversation/total, up to implementing more complex algos like leaky bucket.