Welcome Guest, Not a member yet? Register   Sign In
Serious Security Problem: Flood Control
#1

[eluser]vanquish[/eluser]
I am looking for ways to implement flood control on my website. It is a fairly large website and I don't want the possibility of anyone trying to crash my database or server.

For example, someone could rapidly post many comments or run a search hundreds of times per second. This can really slow down MySQL or cause me a spam nightmare.

Does anyone know of any libraries that can help prevent such things? So far, I cannot find any such support built into the base libraries of CodeIgniter.

I noticed that many forum systems (including this one I think) don't let you post more than 1 message within a specified time limit - 15 seconds, for example. Also, larger sites such as Facebook DO allow you to continue posting, but they require you to enter a captcha to continue.

I am looking for a script that will either:
a) Disable multiple posts/searches within a short timeframe and notify user of the policy.
OR
b) Require the user to enter a captcha to continue.
#2

[eluser]Sbioko[/eluser]
1) You can add to your mysql table, that contains users field like last_activity that will contain timestamp of users's last action and check it every time.
2) You can find numerous implementatios of captcha for ci. I recomend you reCaptcha

My solutions for solving this problem:
1) Use native codeigniter's $this->output->cache()
2) Turn on database cache
3) Use my Cache library(you can find it in Ignited Code). My library supports xCache, APC, memcached, eAccelerator and native cache based on files.
4) In the index.php check for memory usage.
#3

[eluser]vanquish[/eluser]
Why should I use the database to track all the activities? Will this be a lot of load on the server?

Would you recommend this approach over setting and checking cookies?
#4

[eluser]Sbioko[/eluser]
Sure, you can store last activity in cookies, but users(or bots) can clean them. I think one mysql query does not do a big load on server. Cache can save you :-)




Theme © iAndrew 2016 - Forum software by © MyBB