将 AppEngine 黑名单变成白名单
AppEngine 允许定义黑名单,以禁止来自某些 IP 范围的访问 (http://code.google.com/appengine/docs/python/config/dos.html)。
我想做的是相反的:白名单,只允许从某些 IP 范围进行访问。
我不是一个网络专家,所以我希望得到一些帮助: 如果我想限制对 130.100.120.0 到 130.100.123.255 范围内的 IP 的访问,可以使用 AppEngines 黑名单机制来完成,还是应该从我的应用程序内部进行检查?
谢谢。
AppEngine allows the definition of blacklists, to disallow access from certain IP Ranges (http://code.google.com/appengine/docs/python/config/dos.html).
What I would like to do is the inverse: A whitelist, that only allows access from certain IP Ranges.
I am not much of a network specialist, so I would appreciate some help:
If I wanted to limit access to IPs in the Range from 130.100.120.0 to 130.100.123.255, could that be done using AppEngines blacklist mechanism, or should I do the checking from within my application?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,AppEngine 黑名单功能(此处记录了 的作用更多是为了防止拒绝服务攻击等,因此,包含黑名单 IP 的文件最多可以包含 100 个 IP。因此,黑名单
似乎 并不是真正用于工业强度的访问控制。您唯一的选择是在您的应用程序中进行检查。
No, the AppEngine blacklist functionality (which is documented here serves more to prevent denial of service attacks and so on. So, the file containing blacklisted IPs can, at most, contain 100 IPs. Thus, the blacklist isn't really intended for industrial strength access control.
Given this, it seems your only option is to do the checking within your application.
创建 Servlet 过滤器。像这样的东西:
Create a Servlet Filter. Something like this: