简体   繁体   中英

Security of postgresql pg.Pool connection pool credentials

How to securely store postgresql pg.Pool connection pool credentials in a node.js implementation? After setting config object to pass to pg.Pool it is stored unencrypted in the Pool object, which means it is visible in memory at all times.

Does pg.Pool have a callback mechanism whereby it could call your function to decrypt on the fly only when it needs the credentials, or somehow secure it somewhere else other than storing it in the pool object, with the goal of keeping it out of memory for extended amounts of time in an unencrypted state?

Please advise.

Does pg.Pool have a callback mechanism whereby it could call your function to decrypt on the fly only when it needs the credentials

No such thing, because the connection details are meant strictly for the server-side.

You can only decrypt the connection just before creating the Pool object. After that it will be kept internally by the object.

In a corporate environment, your database server should simply reside within DMZ.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM