0

I have an AWS machine Linux instance t2.micro, with 2 milion I/Os.

If I understood correctly (let me know if I didn't), 2 million I/Os means that free service allows you to serve 2 million index.php.

My question is how can I secure my server in order to avoid massive accesses and requests?

1
  • 2
    No, 2 million I/O does not mean 2 million page hits. It's 2 million disk operations, so that could mean much less or much more, since the page itself will often be present in the os cache, but the web server log and other processes will also consume disk operations. Jan 26, 2015 at 1:51

1 Answer 1

0

First let's look at AWS's explanation to what you are referencing here:

https://aws.amazon.com/ec2/pricing/

30 GB of Amazon Elastic Block Storage in any combination of General Purpose (SSD) or Magnetic, plus 2 million I/Os (with Magnetic) and 1 GB of snapshot storage

Those I/Os are for direct accesses to disk and since your index.php file will be cached and loaded into memory, depending on what your index.php file is doing it is unlikely to have an impact on your I/O.

One way to test and monitor your concern about a sudden surge of accesses and requests is to run the popular Bees with Machine Guns utility (https://github.com/newsapps/beeswithmachineguns) on your web application and monitor the impact in CloudWatch. CloudWatch by default monitors in 5 minute increments so be patient; if you change CloudWatch to monitor in 1 minute intervals you will be charged extra so be careful. Do note that since you will basically be running a denial of service attack on your instance you need to get permission from AWS to run the test in advance or risk having your AWS account suspended. (https://aws.amazon.com/security/penetration-testing)

I think the easiest and probably cheapest way to secure your server from unwanted spikes in traffic or a full blown DDoS (Distributed Denial of Service) attack would be to use a managed service like CloudFlare.com. You can of course use a security appliance like a Sophos UTM 9 or Imperva but you will need to know how to configure and maintain it in addition to extra hourly and licensing costs.

AWS recently announced the AWS WAF (Web Application Firewall) but it looks like you have to associate it to CloudFront. (https://aws.amazon.com/blogs/aws/new-aws-waf)

If you don't want to use any other tools then you will have to consistently monitor your web application and block unwanted requests when they come using Virtual Private Network (VPC) and Network Access Controls (NACLs) on your VPC subnets. While this will work, you might find yourself playing whack-a-mole if your site comes under frequent attack.

Finally, the best way to protect your website is to use multiple layers of security (AKA Defense in Depth) so if you are not sure how to do that I recommend grabbing a cup of coffee (or two) and start learning at OWASP (The Open Web Application Security Project). (www.owasp.org)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .