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

Support scram-sha-256 password_encryption method #400

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

deric
Copy link
Contributor

@deric deric commented Apr 18, 2024

PostgreSQL module uses by default scram-sha-256 password encryption for PostgreSQL databases since 14 - introduced in puppetlabs-postgresql == 10.1.0. At least puppetlabs-postgresql >= 9.2 is needed.

This PR introduces new parameter postgresql_password_encryption, to apply the old (less secure behavior) use:

puppetdb::postgresql_password_encryption: 'md5'

In order to use modern password auth, the hba rules and password function requires passing the password_encryption parameter.

Related issues:

@deric deric requested review from bastelfreak, smortex and a team as code owners April 18, 2024 09:19
@bastelfreak
Copy link
Collaborator

I'm wondering why this is needed. I don't know why scram-sha-256 wasn't working / why the user had to switch to md5.

@deric
Copy link
Contributor Author

deric commented Apr 18, 2024

@bastelfreak Because postgresql::postgresql_password function is not checking postgresql::globals::version whether is at least 14. It hashes passwords as md5, while postgresql::server::role will be configured to use scram-sha-256, this would break connections to puppetdb.

@deric deric changed the title Support changing password_encryption method Support scram-sha-256 password_encryption method Apr 18, 2024
@bastelfreak bastelfreak merged commit 3db204c into puppetlabs:main Apr 30, 2024
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants