I have a PHP system and I need to store some tokens for operations like:
- Database username and password
- API token
- Keys for encryption
It turns out that for a long time only I manage the source code, but soon other people will need to maintain the source code, with that came the fear of unauthorized access and the need to hide these values ββin the development environment and have them only available in the production environment.
I've seen some methods that work for this, but they don't seem so fast or safe to me, for example:
- HashiCorp Vault: Depending on a service running on the server, opening a cURL request for every code that needs a key (even the database), seems to increase the application's latency a lot.
- .ENV: It seems to be a widely used mode, but I've noticed via logs on Cloudflare that several bots constantly try to access .ENV files at random URLs to steal credentials.
In addition to these methods, is there any other that is secure, practical and fast?