DEV Community

Discussion on: Stop Using .env Files Now!

Collapse
 
teamradhq profile image
teamradhq

Can you explain why? If you're configuring secrets in your environment at the build step, they would still be accessible in the deployed system, thus no less vulnerable than if they're in a .env file aren't they?

I mean, if I have enough privilege to access a private file on a server, then theoretically, I can inspect the server's environment anyway.

I just feel like I'm missing something here...

Collapse
 
dbroadhurst profile image
David Broadhurst

Using secrets in CI/CD adds an additional level of protection for secret values through additional access controls but it isn't the only security needed. Assume you have a public repo but want to keep the secrets safe from people who have access to the source code, or you are a company with contractors who need to access the source code but should not have access to secrets.

If someone is able to access the server then other security should be considered such as using a VPC for private API's. Security should have lots of layers, protecting secrets by moving them outside the source code is just one layer.