feat: Add configurable password policy for PostgresUser #290
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.
This PR introduces a comprehensive and configurable password generation policy for the
PostgresUserresource as proposed at #289. It addresses the need for stricter security compliance (e.g., minimum complexity requirements) and compatibility with legacy applications (e.g., ensuring passwords start with a letter).Key Features:
1. Global Operator Configuration:
Introduces new environment variables to set default password policies for all users managed by an operator instance.
New Env Vars:
POSTGRES_DEFAULT_PASSWORD_LENGTH(Default: 15)POSTGRES_DEFAULT_PASSWORD_MIN_LOWERPOSTGRES_DEFAULT_PASSWORD_MIN_UPPERPOSTGRES_DEFAULT_PASSWORD_MIN_NUMERICPOSTGRES_DEFAULT_PASSWORD_MIN_SPECIALPOSTGRES_DEFAULT_PASSWORD_EXCLUDE_CHARSPOSTGRES_DEFAULT_PASSWORD_ENSURE_FIRST_LETTER2. Per-CRD Override:
PostgresUserCRD to allow overriding the default 15 character alphanumeric password generator via a newspec.passwordPolicyfield.3. Enhanced Generator Logic:
4. Helm Chart Updates:
3.1.0and app version to2.5.0.postgres.passwordPolicy.Testing:
make fmt,make vet, andmake generateto ensure code quality and up-to-date generated files.This PR will close #289