Repository navigation
Conversation
The users role defaulted controller_user_default_password to the literal change_me and sent it for every entry in controller_user_accounts that declared no password. ctrliq.ascender.user defaults update_secrets to true, so the value was also written over the password of accounts that already existed, on every run, including token-only accounts meant to have no usable password. It was the same password on every installation using the role. Leave the variable unset by default, as the role's argument spec already documents, so an entry without a password sends none. Setting it explicitly still applies it. Breaking change: an entry that creates a new account without a password no longer gets change_me. Declare password on new accounts, or set controller_user_default_password to keep the old behavior. Add a unit test that runs the role against a stub user module and checks which entries are sent a password. Closes ctrliq#332 Assisted-by: Claude Opus 5.5 Signed-off-by: Quanah Gibson-Mount <quanah@dropbox.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
Assisted-by: Claude Opus 5.5. Drafted with AI assistance; the commit carries the same trailer.
The
usersrole sentchange_meas the password of every entry incontroller_user_accountswithout one, and becausectrliq.ascender.userdefaultsupdate_secretstotrue, it overwrote existing passwords on every run. This leavescontroller_user_default_passwordunset by default (commented out inroles/users/defaults/main.yml), which matchesdefault: Nonein the role's argument spec. With it unset, the task's existingdefault(omit, true)sends no password. Setting the variable explicitly still applies it.This is the fix merged in redhat-cop/infra.aap_configuration#1457 (for redhat-cop/infra.aap_configuration#1456), which also comments the default out rather than setting it to
""; the same change is open againstinfra.controller_configurationas redhat-cop/infra.controller_configuration#176.Breaking change: an entry that creates a new account without a
passwordused to getchange_me; now no password is sent, and the API decides. On currentctrliq/ascendermainit rejects that withPassword required for new User.(ctrliq/ascender#1089, PR ctrliq/ascender#1090, proposes allowing a local user without a password). To keep the old behavior, declarepasswordon new accounts or setcontroller_user_default_password.Changelog fragment:
changelogs/fragments/users-default-password.yml(security_fixes,breaking_changes).New test
tests/unit/test_role_users.pyruns the real role from the checkout withansible-playbook --checkagainst a stubctrliq.ascender.userthat reports whether a password reached it. It needs no controller and no database. Cases: an entry without a password sends none; a declared password is sent, alongside an entry without one; an explicitcontroller_user_default_passwordis still applied.Closes #332
Type of Change
Component
usersrole (roles/users/defaults/main.yml)Checklist
ansible-test sanity): all sanity tests on the touched files (python 3.13, ansible-core 2.21.5, without--docker); the full collection wasn't runruff,yamllint,ansible-lint):ruff check plugins/and on the new test,yamllinton the role and fragment,ansible-linton the whole repo (productionprofile, 0 failures)Unit tests, run the way CI does (python 3.13, PostgreSQL 15,
ascendermain90de5acfinstalled):