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

Defaulting password encryption for version above 14 #1406

Merged
merged 2 commits into from
Jul 31, 2023
Merged

Defaulting password encryption for version above 14 #1406

merged 2 commits into from
Jul 31, 2023

Conversation

cruelsmith
Copy link
Contributor

@cruelsmith cruelsmith commented Feb 27, 2023

  • Fix missing handling of allowed undef value of parameter hash of postgresql::postgresql_password
  • Fix edgecase where passwords starting with md5 but are not followed by 32 base64 chars will not be hashed by postgresql::postgresql_password
  • Fix case of postgresql::postgresql_password where sensitive hashes are wrongly handled
    • Extend spec tests for 'postgresql_password function' to cover this
  • Add respecting password_encryption for all internal postgresql::postgresql_password calls
  • Add respecting password_encryption for postgresql::backup::pg_dump
  • Add spec tests for new hash type handling of postgresql::server::role
  • Update REFERENCE.md
    • Fixing lint 140chars inside REFERENCE.md

See https://www.postgresql.org/docs/14/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION

Note: That this change is will upgrade the password hashes to use scram-sha-256 if a postgres version 14 or higher is used, update_password is set to true and cleartext passwords are used.
It will not change pre-hashed passwords.
If you want to force a default password_encryption you can set postgresql::server::password_encryption to the wanted one.

Note: The function postgresql::postgresql_password still has a hard default of md5 as hash type. Use postgresql::server::password_encryption as fourth parameter when using it on your own to ensure you use the version based default one.

@cruelsmith cruelsmith requested a review from a team as a code owner February 27, 2023 09:26
@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@SimonHoenscheid
Copy link
Collaborator

@cruelsmith can you please rebase?

* Fix missing handling of allowed undef value of parameter hash of
  postgresql::postgresql_password
* Fix edgecase where passwords starting with md5 but are not followed by
  32 base64 chars will not be hashed by postgresql::postgresql_password
* Fix case of postgresql::postgresql_password where sensitive hashes are
  wrongly handled
  * Extend spec tests for 'postgresql_password function' to cover this
* Add respecting password_encryption for all internal
  postgresql::postgresql_password calls
* Add respecting password_encryption for postgresql::backup::pg_dump
* Add spec tests for new hash type handling of postgresql::server::role

See https://www.postgresql.org/docs/14/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION
* Fixing lint 140chars inside REFERENCE.md
@bastelfreak bastelfreak merged commit b69ace0 into puppetlabs:main Jul 31, 2023
@Neustradamus
Copy link

@cruelsmith: Good job!

Linked to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants