Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL driver enhancement for addressing Alternating User Rotation with RDS Proxy #222

Closed
canelzio opened this issue Dec 27, 2023 Discussed in #221 · 0 comments · Fixed by #223
Closed

PostgreSQL driver enhancement for addressing Alternating User Rotation with RDS Proxy #222

canelzio opened this issue Dec 27, 2023 Discussed in #221 · 0 comments · Fixed by #223

Comments

@canelzio
Copy link
Contributor

Discussed in #221

Originally posted by canelzio December 27, 2023
Hi,
I'm facing an issue using AWS SecretsManager JDBC driver with RDS Proxy and Alternating User secret rotation.
It seems that RDS Proxy is not able to handle properly such rotation since it is limited to fetch only the AWSCURRENT secret version stage, and this leads to the following error:

org.postgresql.util.PSQLException: FATAL: This RDS proxy has no credentials for the role <db_user>. Check the credentials for this role and try again.

I've already opened a Feature Request to AWS on this, but in the meantime I'd like to discuss such topic with you.
In my opinion everything should work as expected if the driver could intercept also the above error as an authentication error and refresh the secret cache accordingly.

What do you think?
Could this be feasible?
Any other idea?

Thank you.

canelzio added a commit to canelzio/aws-secretsmanager-jdbc that referenced this issue Jan 18, 2024
PostgreSQL Error Code 2800 is also considered as an authentication error in order to trigger secret refresh (together with 28P01 - invalid_password)

PostgreSQL Error Code 2800 (invalid_authorization_specification) is the error code returned by RDS Proxy when the secret is rotated in alternating user mode: refreshing the secret cache would address the issue aws#222.
@simonmarty simonmarty linked a pull request Jan 29, 2024 that will close this issue
simonmarty added a commit that referenced this issue Jan 29, 2024
* PostgreSQL Error Code 28000 is also considered as an authentication error

PostgreSQL Error Code 28000 is also considered as an authentication error in order to trigger secret refresh (together with 28P01 - invalid_password)

PostgreSQL Error Code 28000 (invalid_authorization_specification) is the error code returned by RDS Proxy when the secret is rotated in alternating user mode: refreshing the secret cache would address the issue #222.

* Fix formatting

---------

Co-authored-by: Simon Marty <simon.marty0@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant