Securing docker deployment of Larevel apps in production from internal compromise
In the docker-compose file, database creds are stored in the clear. So also all the Laravel related creds in the .env file
This is perfectly fine when I’m hosting the solution and in control of the servers. My use case however is to deploy the solution within the customer’s infrastructure and there is the risk someone uses these to compromise or start reverse engineering the system. I know there are always ways to hack but that doesn’t mean it should be made easy.
So my question: is there a solution to encrypt these 2 details? For the docker side specifically, once all images are downloaded and passwords changed, is it safe to delete the yaml files that contain the database creds (closing the risk at that end)?
Foremost, explain good security to your customer and how to secure their infrastructure.
You already know about pointing to public as the document root. However a more secure install is having main laravel out of web altogether, just a suggestion.
But unless you are hired to also secure their infrastructure, you probably have little control on what they do to it.
Edit: If you really need to worry about internal compromise, meaning someone working there, well that should be the customers worry, you have no say so on who they hired.
Frankly I would not even deal with that if there was doubt. I'd try to only deal with honest reputable people. But just suggestions here.
Well imagine a banking app developed in laravel. It means an IT staff can casually access the db, add a couple of zeroes to his account balance etc etc.
Obviously there would be physical (and other controls) in a corporate setting, but I just feel there should be a basic way to encrypt credentials and not leave them raw in the file system. Probably isn’t a challenge limited to Laravel.