What is the (most?) Secure way to handle database connections in a web application?

I have a web application written in Perl using PostgreSQL.

When accessing the PostgreSQL database, I need to specify both the username and password. To have access to a password to automatically start the system, I need this password built into my application or into a configuration file or as an environment variable configured in Apache.

In any case, I should have a password in text format somewhere.

How is this done on real websites?

+3
source share
5 answers

The safest way to do this is to create a configuration file and place it outside of the public folders.

+6
  • , -, - . , webroot; ,
  • , , , , -, -
  • , , - .
  • , , , . , Wordpress Wordpress , .
  • -, , node .
+4

"" IP- - ( , node) PostgreSQL pg_hba.conf . , , , - -.

, - . , -, Perl.

+3

Firewall IP: PostgreSQL IP- -.

0

Source: https://habr.com/ru/post/1727586/


All Articles