Skip to content

Allow login on Reader Instance #297

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Allow login on Reader Instance #297

wants to merge 4 commits into from

Conversation

bdealey
Copy link

@bdealey bdealey commented Mar 20, 2025

Issue 296

Description of changes:
I added a READER instance to my Aurora PostgreSQL v15 cluster, but users received an error logging into the READER instance. This update catches the exception and logs a special message to CloudWatch to allow alarms to be triggered if a brute force password attempt was made against a READER instance.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Bill Dealey and others added 2 commits March 20, 2025 09:44
@adamguo0
Copy link
Contributor

Thanks for your contribution! Do you mind creating an upgrade script as well, client_lockout--1.1--1.2.sql

Bill Dealey and others added 2 commits March 20, 2025 12:16
@bdealey
Copy link
Author

bdealey commented Mar 20, 2025

Created the client_lockout--1.1--1.2.sql script with the entire function which contains updates.

INSERT INTO client_lockout.failed_attempts (user_name, num_failed_attempts)
VALUES (port.user_name, 1)
ON CONFLICT (user_name) DO UPDATE SET num_failed_attempts = client_lockout.failed_attempts.num_failed_attempts + 1;
EXCEPTION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested briefly on PG17 and this part threw a syntax error, I think plpgsql doesn't support exception handling like this? the exception handling should be after the BEGIN block

https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

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 this pull request may close these issues.

2 participants