I have recently done security audit of my website coded in php. Security audit report has suggested not save hard-coded credentials in config file on web hosting.
How can i store it at some other place for protecting it
I have recently done security audit of my website coded in php. Security audit report has suggested not save hard-coded credentials in config file on web hosting.
How can i store it at some other place for protecting it
Copyright © 2021 Jogjafile Inc.
Determine what your case. Many way to protect the configurations files, depending of your requirements.
But - NO SYSTEM IS SAFE
When you have custom code (eg: not to use such a full framework) that you created custom config files. You could include outside of your public directory on web hosting panel / public root directory.
Depending on shared hosting use apache (based) as their web server, you could use .htaccess to set important environment, for example:
And the other one is, make your files hidden and disable access / forbid the dot file, eg:
and disable access to all hidden files on htaccess file.
Back to It depends on your needs. Configuration files can be safe as long as you do your best to keep your code as bug-free as possible.