News for hackers. Stuff that matters.
Re:Phpfog "Down for maintenance" by jarin on Sunday March 20, 2011 @04:31AM (#2345831)
This is a pretty good lesson: when you have that little niggling feeling in the back of your head about something security-related, take care of it. Otherwise, someone WILL exploit it.

Seems like they were using the load balancer as a way to obfuscate the existence of the individual EC2 instances. Also, that has gotta be really expensive to have an EC2 instance-per-customer.

Re:Phpfog "Down for maintenance" by X-Istence on Sunday March 20, 2011 @04:40AM (#2345847)
Depends on the type of instance they spin up, but I would definitely tend to agree with you!

Security in shared hosting is extremely hard (I used to be a sys admin for a hosting company in a prior life), especially since there is no good way to separate everyone from each other without making performance suck completely, FreeBSD jails alleviate some of it, but you start having scalability issues, PHP running in php-fpm works, but uses up a lot of resources keeping spare instances around, there are a whole bunch of other ones as well.

Individual virtual machines per user isn't such a crazy idea but it is really expensive. What I would really like to know is how Google has accomplished it, at scale, with AppEngine. How are they able to do their security separation so well that at this point I am not even aware of any security breaches.

There has to be a better way to do it, and securely, but it may require rethinking how the entire architecture fits together, PHP, a web server, and the database engine.

Re:Phpfog "Down for maintenance" by tomjen3 on Sunday March 20, 2011 @07:55AM (#2346067)
>What I would really like to know is how Google has accomplished it, at scale, with AppEngine. How are they able to do their security separation so well that at this point I am not even aware of any security breaches.

Easy (well it takes a lot of work, but it isn't difficult): they only allow languages that run on VMs, they then rewrite the VMs to remove/limit the file system access, network access and whatever else they don't want you to access, prevent access to unknown C code (since you can always fudge with the stack and other fun stuff at that point) and count the memory used and instructions run (so they can bill you and so denial of service gets too expensive).

This kind of thing is easy to do if you throw 100 good developers on it. My guess is that phpfrog didn't have that kind of manpower.

Re:Phpfog "Down for maintenance" by sriramk on Sunday March 20, 2011 @04:43AM (#2345855)
Heroku has done it reasonably well too and they seem to do it only with POSIX permissions for the most part.
Re:Phpfog "Down for maintenance" by moe on Sunday March 20, 2011 @07:45AM (#2346053)
Ahem. There have been multiple exploits for heroku, some of which enabled access to code and data of other heroku customers (google for "heroku vulnerability").

From what I read about their virtualization (which may not be up-to-date) they seem to rely on the security of chroot(). If that is still the case then there is a big problem in their future.

Re:Phpfog "Down for maintenance" by sriramk on Sunday March 20, 2011 @08:32AM (#2346112)
Could you expand on the last sentence? Why is relying on chroot+file permissions inherently bad?
Re:Phpfog "Down for maintenance" by baq on Sunday March 20, 2011 @08:59AM (#2346155)
chroot has not been designed as a security feature but as a system testing tool. you only need a local root exploit to get out of chroot. you need additional protection to have a proper jail; freebsd does this, openbsd used to, not sure how it is now.
Re:Phpfog "Down for maintenance" by X-Istence on Sunday March 20, 2011 @04:49AM (#2345867)
That is definitely interesting, although for Ruby that is slightly simpler because there is no real way like PHP to have a single instance of Ruby deal with all of the requests (talking about mod_php and PHP-fastcgi, not php-cgi which spawns a process per request).
Re:Phpfog "Down for maintenance" by jpetazzo on Sunday March 20, 2011 @05:18AM (#2345912)
I don't think they are obfuscating it. If I remember correctly, their pricing page made perfectly clear that they used dedicated EC2 instances.

Just for the record - the cheapest EC2 instance type is t1.micro, and amounts to ~15 USD/month (+EBS and IP costs). I didn't see their business plan so I can't tell what is their big picture about that :-)

Re:Phpfog "Down for maintenance" by ridruejo on Sunday March 20, 2011 @07:33AM (#2346040)
If they use reserved instances, it should be even less than that. They still need to control abuse in terms of bandwidth, etc. and that is the difficult part.
Re:Phpfog "Down for maintenance" by ceejayoz on Sunday March 20, 2011 @12:48PM (#2346663)
It should be easy enough to throttle bandwidth on the instances.
Re:Phpfog "Down for maintenance" by ridruejo on Sunday March 20, 2011 @03:21PM (#2347078)
As far as I know that cannot be done with standard Amazon tools
Re:Phpfog "Down for maintenance" by ceejayoz on Monday March 21, 2011 @09:50AM (#2349612)
You don't need it on Amazon's side - plenty of solutions exist that can be installed on the instances themselves. Apache throttling, for example.
Re:Phpfog "Down for maintenance" by jarin on Sunday March 20, 2011 @05:25AM (#2345923)
Oh that's not bad at all, maybe they added that since the last time I looked or maybe I just missed it.