Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where should I store PEM file for my web app

Currently, I am working on a web app. The backend would frequently communicate with the Docker Engine API and I am using certificate signing (client/server key) to authenticate. However, where should I store the certificate PEM file? Should I store it in the database, or should I store it as a file then store the file path in the database?

Storing into a database would mean that I have to access the database every time there is a command being sent. Am I correct?

like image 868
Ivan Avatar asked Oct 29 '25 14:10

Ivan


1 Answers

I feel storing the PEM files on disk would be less resource-intensive. As you have stated, if it is stored in the database, you will need to make a request any time you wish to access it.

If you do store the PEM file on disk, ensure it is not within a web-accessible directory e.g. nobody should be able to goto https://yourapp/your.pem file

like image 162
stackoverflow-n00b Avatar answered Nov 01 '25 14:11

stackoverflow-n00b



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!