Block IP Address

789 views
Skip to first unread message

vivpuri

unread,
Dec 13, 2009, 8:30:01 AM12/13/09
to Google App Engine
Is there a way to block all calls from an IP address or Domain. Some
days, my app tends to get thousands of hits from one particular
domain, and i know that site is pretty much a spam site. As you can
guess this is eating up lot of my CPU and skewing my stats. I really
wish i could block that domain

Barry Hunter

unread,
Dec 13, 2009, 9:36:16 AM12/13/09
to google-a...@googlegroups.com
I guess its not exactly what you looking for but see:
http://code.google.com/appengine/kb/billing.html#dos
If the calls are costing you quota, they might help.

Otherwise for dynamic (python/java) requests, you can block them at
your application level. It wont totally negate quota usage, but should
take it to minimal levels. Also it should have minimal impact on real
traffic, as the IP check would be negligible overhead.


2009/12/13 vivpuri <v...@vivekpuri.com>:
> --
>
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>

judotenslab

unread,
Dec 13, 2009, 9:05:44 AM12/13/09
to google-a...@googlegroups.com
i used this for disallow some ip from my web:

def get(self):
  spammer_list = ("123.123.123.123","122.122.122.122")
  visitor_ip = self.request.remote_addr
  if visitor_ip is in spammer_list:
     self.response.redirect("/blocked")

Greg

unread,
Dec 14, 2009, 4:18:09 AM12/14/09
to Google App Engine
On Dec 14, 3:05 am, judotenslab <judot...@gmail.com> wrote:
> i used this for disallow some ip from my web:
>
> def get(self):
>   spammer_list = ("123.123.123.123","122.122.122.122")
>   visitor_ip = self.request.remote_addr
>   if visitor_ip is in spammer_list:
>      self.response.redirect("/blocked")

Or even better:

self.error(404)

Instead of the redirect line. Saves you serving the spammer one more
page (blocked), and if their system is at all smart it will stop
pinging you when it gets the 404..

Stephen

unread,
Dec 14, 2009, 8:46:54 AM12/14/09
to Google App Engine
Reply all
Reply to author
Forward
0 new messages