Please excuse our look. We're just getting started here.
Want to learn more about Twilio Forums? Check out our FAQ page here.How to prevent abuse of Functions/Runtime?

Hello!
What's the appropriate way to prevent runtime endpoints from abuse when being called by an untrusted source (i.e., an iOS or Android app)? The tutorial (https://www.twilio.com/docs/runtime/tutorials/how-to-call-twilio-functions-ios ) has you expose your function as unprotected - but wouldn't this allow a malicious actor to call that endpoint many thousands of times to run up your bills and/or spam numbers? There's nothing obvious in the docs about rate limiting clients.
Answers
-
You may want to look at making those functions protected which means that the caller is responsible for building a X-Twilio-Signature header to be provided before the function is executed.
It does not mean however that some actor could not sniff network traffic and see a valid request and replay it repeatedly, but it should cut down on an actor finding an endpoint and making discovery/overloading requests.
-
@shelbyz If I'm to sign a X-Twilio-Signature wouldn't that mean building in the AuthToken to the distributed app unless every possible query (including all possible parameters) is known in advance? That seems inadvisable.
Categories
- 83 All Categories
- 19 SIGNAL 2021
- 376 Product Discussions
- 7 Community - Announcements
- 2 Changelog
- 4 Forum UI Updates
- 8 Welcome Guide
- 6 Community - Events
- 2 Twilio Relay Developer Conference 2021 Mega Thread
- 1 External Community Events
- 25 Inspiration
- 17 Community - Other Discussions
- 1 Community- Twilio Startups