Preventing Abuse: Cloud Functions for Firebase

有些话、适合烂在心里 提交于 2020-01-01 16:09:11

问题


What is the best way to stop an attacker from triggering a Cloud Function repeatedly, causing a huge bill or causing the project to run into quota limits?

Some ideas:

  • Use RTDB or Cloud Storage triggers as much as possible, since writes to those are protected by those products' security rules
  • Put functions behind a service like Cloudflare
  • Set up billing alerts, so a notification is sent if the monthly bill is unusually large

回答1:


Check my answer here.

Short breakdown of items from my answer :

  1. Limit the type of requests
  2. Authenticate if you can
  3. Check for origin
  4. Use a load balancer in between
  5. Use something like Cloudflare Page Rules

Hope it helps :)



来源:https://stackoverflow.com/questions/46333886/preventing-abuse-cloud-functions-for-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!