question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support a password function for the client configuration

See original GitHub issue

If you use e.g. AWS Aurora Postgres with IAM authentication it is hard to deal with it in the code.

It would be nice that I can use a function to return the password, like this:

const signer: RDS.Signer = ...
const params: RDS.Signer.SignerOptions = ...

return new pg.Pool({
  max: 1,
  host: databaseConnection.clusterEndpoint,
  port: databaseConnection.port,
  database: databaseConnection.database,
  user: databaseConnection.username,
  password: async () => signer.getAuthToken(params),
  ssl: true,
});

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mikichocommented, Dec 9, 2020

set the rejectUnauthorized to true

I guess you mean false (it’s working! thanks!) I’ll check what we need to do to validate the certificate for better security.

0reactions
sehropecommented, Dec 9, 2020

psql defaults to enabling SSL but not checking the server’s certificate: https://www.postgresql.org/docs/current/libpq-ssl.html (“prefer” mode)

This driver was changed a few versions back to be more secure by default so the default is to reject untrusted certificates. To mimic the “prefer” behavior, set the rejectUnauthorized to true. Or, even better, specify the CA certificates for your database so the server’s certificate is validated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

User Security Configuration Guide, Cisco IOS Release 15SY
The No Service Password-Recovery feature is a security enhancement that prevents anyone with console access from accessing the router ...
Read more >
Enable Azure Active Directory password writeback
In this tutorial, you learn how to enable Azure AD self-service password reset writeback using Azure AD Connect to synchronize changes back ...
Read more >
Configure passwords for automatically created user accounts
Enter a unique password to use as a default. Use strong password complexity to help ensure the security of your instance.
Read more >
3 Configuring Authentication - Oracle Help Center
Run the secconf.sql script to apply the default password settings from Oracle Database 11g or later. You can customize this script to have...
Read more >
Guidelines for Password Management - Computing Services
Guidelines · Change default account passwords · Implement strict controls for system-level and shared service account passwords · Do not use the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found