From VNC to reverse shell
blog.benjojo.co.uk
blog.benjojo.co.uk
This. And for me, as an application developer, who is now (willingly) ushered into being a DevOps engineer on the side, it is scary that the tools in the DevOps world are so easily exposing me to security risks, whereas a seemingly much smaller set of best practices on the application side seemed to have been fine when that was all there was to my world.
So, as a developer with an application with a simple internal security model, yeah. There's going to be a couple of guidelines, and those will setup a pretty hard surface for that application. For our internal application, well. That security model is hell - I don't understand it and try to avoid it. And we got some picky enterprise customers, that's where the simple guidelines don't work anymore. :)
On the operations side, you can impact each application less, but you have so much more stuff to individually deal with in a quantitative sense. For our SaaS clusters we have to secure 15 - 20 different applications. And for a lot of these applications, we're the one and only line of security - you just have to operate a mysql/postgresql database properly, these systems are pretty secure on their own.
And that's just data security. How many developers do think about backups or disaster recovery for all of this mess. Not saying this is bad - this isn't a job for developers, because it's a lot of work. It's mostly a point against the notion of NoOps.
So, a database service instead of a locally managed database and a reliance on the service vendor to back things up, keep the code up to date and manage reliability. That's not a bad choice but you still want someone with the judgement to evaluate vendor claims, performance, exceptions and the like.
It is hard. I recommend looking into the ~newly named concept of SecDevOps - at its core it is about applying the engineering mentality into securing, hardening and enhancing the entire development-operations cycle. Lot of it is obvious. Even more of it is flat out boring. Practically none of it is new.
In resilient systems, the gold standard people seem to aim for is chaos engineering: systems that behave correctly in the face of random failures, with the resilience exercised frequently. Well done security adds an additional aspect - that systems also behave correctly in the face of maliciously introduced inputs and/or failures.
That way even if the machine does get rooted, it's very unlikely that any damage can be done (it would have to then try and compromise the proxy - all over VNC because you can't even get a reverse shell yet - just to be able to gain unrestricted outbound network access).
It would be much less fun if the server didn't have network access.