首页 > 解决方案 > How To Connect Specific URL of Api With Only 1 Mobile App

问题描述

I have an API and it has user register system.

The api is used by a mobile app. ( Most of URL's are not allowed for anonymous. Token key is used for all. Excluding register URL. )

And the register url has to be open. I mean that the url has no token key to be authorized. Because there is no authorized user. It is register level.

Of course, the register url open to attack. How can we prevent this situation ?

标签: javascriptnode.jsapi

解决方案


您有很多选择,具体取决于您的威胁模型以及您试图保护端点免受的威胁。这里是其中的一些:

  • 速率限制技术,以防止端点受到异常数量的查询的冲击。例如,您可以计算某个时间窗口内来自某个 IP地址的请求数,如果超过某个阈值,则阻止该 IP
  • reCAPTCHA也可能有用。您可以要求所有请求都具有在解决验证/register后获得的令牌。非常常见的垃圾邮件技术
  • IP黑名单。例如,来自TOR 网络的 IP可以被阻止,因为所有节点都是公共的。您还可以包含根据您的上下文可能看起来可疑的任意 IP
  • 用户代理黑名单。如果您想限制Web 抓取活动,这可能会有所帮助。例如,您可以选择只允许来自主流 Web 浏览器的特定用户代理集

推荐阅读