feat: Add aap_password_rotate role for DB and admin password rotation - #384
Open
amasolov wants to merge 4 commits into
Open
feat: Add aap_password_rotate role for DB and admin password rotation#384amasolov wants to merge 4 commits into
amasolov wants to merge 4 commits into
Conversation
Adds a new role to rotate PostgreSQL database passwords and admin user passwords across all AAP 2.7 components (controller, gateway, hub, EDA) for both Podman and Operator deployments. For Podman, the role follows the KCS 7145426 procedure: ALTER ROLE the postgres superuser, update the installer inventory, and re-run the containerized installer. For Operator, it patches K8s secrets and triggers rollout restarts. Supports internal and external databases, selective component/scope rotation, custom hook tasks for external DB password changes, and comprehensive pre/post verification. Tested on OCP 4.17 (Operator) and RHEL 9.7 Podman deployments. Signed-off-by: Alexey Masolov <amasolov@redhat.com> Assisted-by: Claude Opus 4.6 (via Cursor) Co-authored-by: Cursor <cursoragent@cursor.com>
Move Jinja2 expressions to end of task names (15 occurrences) and add set -o pipefail to shell commands that use pipes (2 occurrences). Co-authored-by: Cursor <cursoragent@cursor.com>
Add spaces around table separator pipes to satisfy markdownlint-cli2. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Review: KCS 7145426 Alignment CheckReviewed implementation against KCS 7145426 (How to rotate PostgreSQL database passwords in AAP 2.7 Containerized). Overall: ✅ LGTMKCS Alignment: Fully Compliant
Strengths
Minor SuggestionREADME vs code mismatch (cosmetic only): README states:
Actual code uses Django shell (which is correct since User.objects.get(username='admin').set_password('...')Consider updating README to reflect the Django shell approach, or add a note explaining why. Security
Review performed by comparing PR implementation against KCS 7145426 resolution steps. |
Collaborator
|
@amasolov This PR needs a changelog fragment as well. |
Add major_changes changelog fragment for the new aap_password_rotate role. Update README to reflect that Gateway and Controller use the Django ORM (set_password) instead of the interactive changepassword command, which does not work in non-TTY exec contexts. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
@branic I added the changelog fragment. thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aap_password_rotaterole to rotate PostgreSQL database passwords and admin user passwords across all AAP 2.7 components (controller, gateway, hub, EDA)aap_password_rotate_external_db_tasks) for user-provided custom password change logic on external DBsFeatures
aap_password_rotate_scope)aap_password_rotate_components)aap_password_rotate_include_postgres_adminDeployment type details
Podman (containerized installer)
Following the procedure from KCS 7145426:
*_pg_passwordvaluesOperator (OpenShift)
oc execinto the postgres podoc execinto component podsTest plan
Related
aap_secret_rotaterole (PR Add aap_secret_rotate role for SECRET_KEY rotation across AAP 2.7 components #380) which handles SECRET_KEY rotationMade with Cursor