I have Rasa-X set up on a server using the Quick Install and can send messages through the REST API to Rasa (which land in Rasa-X as being in the “rest” channel). However, this channel is not protected, and anyone is able to post to it.
It got me scratching my head that authentication via the token only applies to HTTP APIs that grab the model, such as api/projects/default/models/tags/production but not ones like /webhooks/<channel>/webhook. This means that my rest channel is exposed.
I’ve looked a lot into ways to authenticate this channel but have found nothing that works. I attempted to implement a custom channel as implemented in this thread: RASA Custom Connector keep giving custom response - #5 by athenasaurav since the implementation in the docs was throwing errors.
However, adding an access token to the credentials did not work, and I can still access both /webhooks/rest/webhook and /webhooks/myio/webhook from anywhere.
I also don’t quite understand how to implement Token-Based Auth (as explained here: Rasa Open Source HTTP API) in the docker-compose file from the Quick Install.
Can anyone give me some pointers here? I’m pretty sure there is something I’m missing.
perhaps nginx JWT authentication can secure your REST endpoint.
In reality your rest endpoint will never be exposed, you would have an API GW and since this is M2M authentication as it is supposed to, you can secure it at the GW itself
Thank you, and sorry if this is a silly question, but how come I can post requests to the rest channel in Rasa using cURL if it’s not exposed? If it were authenticated, I would expect to get a different status code telling me I’m not authenticated.
What i meant is that your Rasa REST endpoint wont be exposed directly to the web but should stay behind a proxy such as nginx where you can control authentication.
Hi @souvikg10 - thanks for the guide - very helpful!
I’m trying to implement your suggestion of editing the nginx config that already fronts the Rasa X deployment to protect the ReST channel. I have a running helm chart deployment, do you know how I can pass in / edit a running deployment to provide the extra location config to nginx?
Is there a way to secure the socketio channel with custom authentication like from cookies? I am facing issues reading cookies , seems like HTTP session is not able to share the cookie with socketio session.