From 66d5bf238d9292c053ff31a780374cdeaad8d74e Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:55:27 -0400 Subject: [PATCH] feat(authelia): Add Password Policy (#11109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** The HELM/configmap part should be ok, just the SCALE questions I'm not sure ⚒️ Fixes #10298 **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/enterprise/authelia/Chart.yaml | 2 +- charts/enterprise/authelia/questions.yaml | 89 +++++++++++++++++++ .../authelia/templates/_configmap.tpl | 14 +++ charts/enterprise/authelia/values.yaml | 19 ++++ 4 files changed, 123 insertions(+), 1 deletion(-) diff --git a/charts/enterprise/authelia/Chart.yaml b/charts/enterprise/authelia/Chart.yaml index edc2f7769d0..5531d0e5541 100644 --- a/charts/enterprise/authelia/Chart.yaml +++ b/charts/enterprise/authelia/Chart.yaml @@ -35,7 +35,7 @@ sources: - https://github.com/authelia/chartrepo - https://github.com/authelia/authelia type: application -version: 18.0.0 +version: 18.1.0 annotations: truecharts.org/catagories: | - security diff --git a/charts/enterprise/authelia/questions.yaml b/charts/enterprise/authelia/questions.yaml index ce13acb4760..9bbc055f5ef 100644 --- a/charts/enterprise/authelia/questions.yaml +++ b/charts/enterprise/authelia/questions.yaml @@ -98,6 +98,95 @@ questions: schema: type: int default: 1 + - variable: password_policy + group: "App Configuration" + label: "Password Policy Configuration" + description: "Authelia allows administrators to configure an enforced password policy." + schema: + additional_attrs: true + type: dict + attrs: + - variable: enabled + label: "Enable" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: standard + label: Standard + schema: + additional_attrs: true + type: dict + attrs: + - variable: enabled + label: Enabled + schema: + type: boolean + default: false + - variable: min_length + label: "Minimum Password Length" + description: "Minimum Password Length" + schema: + type: int + required: true + show_if: [["enabled", "=", true]] + default: 8 + - variable: max_length + label: "Max Passsword Length" + description: "Max Password Length" + schema: + type: int + required: true + show_if: [["enabled", "=", true]] + default: 0 + - variable: require_uppercase + label: "Require Upppercase" + schema: + type: boolean + default: false + show_if: [["enabled", "=", true]] + required: true + - variable: require_lowercase + label: "Require Lowercase" + schema: + type: boolean + default: false + show_if: [["enabled", "=", true]] + required: true + - variable: require_number + label: "Require Numbers" + description: "Require Numbers in the password" + schema: + type: boolean + default: false + show_if: [["enabled", "=", true]] + required: true + - variable: require_special + label: "Require Special Characters" + schema: + type: boolean + default: false + show_if: [["enabled", "=", true]] + - variable: zxcvbn + label: zxcvbn + schema: + additional_attrs: true + type: dict + attrs: + - variable: enabled + label: Enabled + schema: + type: boolean + default: false + required: true + - variable: min_score + label: "Min Score" + schema: + type: int + required: true + show_if: [["enabled", "=", true]] + default: 3 - variable: duo_api group: "App Configuration" label: "DUO API Configuration" diff --git a/charts/enterprise/authelia/templates/_configmap.tpl b/charts/enterprise/authelia/templates/_configmap.tpl index eb6f8b19ac3..5c3ee755997 100644 --- a/charts/enterprise/authelia/templates/_configmap.tpl +++ b/charts/enterprise/authelia/templates/_configmap.tpl @@ -62,6 +62,20 @@ data: issuer: {{ .Values.totp.issuer | default .Values.domain }} period: {{ .Values.totp.period | default 30 }} skew: {{ .Values.totp.skew | default 1 }} + {{- if .Values.password_policy.enabled }} + password_policy: + standard: + enabled: {{ .Values.password_policy.standard.enabled | default false }} + min_length: {{ .Values.password_policy.standard.min_length | default 8 }} + max_length: {{ .Values.password_policy.standard.max_length | default 0 }} + require_uppercase: {{ .Values.password_policy.standard.require_uppercase | default false }} + require_lowercase: {{ .Values.password_policy.standard.require_lowercase | default false }} + require_number: {{ .Values.password_policy.standard.require_number | default false }} + require_special: {{ .Values.password_policy.standard.require_special | default false }} + zxcvbn: + enabled: {{ .Values.password_policy.zxcvbn.enabled | default false }} + min_score: {{ .Values.password_policy.zxcvbn.min_score | default 3 }} + {{- end -}} {{- if .Values.duo_api.enabled }} duo_api: hostname: {{ .Values.duo_api.hostname }} diff --git a/charts/enterprise/authelia/values.yaml b/charts/enterprise/authelia/values.yaml index 11f98471bad..e27c2e05ede 100644 --- a/charts/enterprise/authelia/values.yaml +++ b/charts/enterprise/authelia/values.yaml @@ -117,6 +117,25 @@ totp: ## See: https://www.authelia.com/docs/configuration/one-time-password.html#period-and-skew to read the documentation. skew: 1 +## +## Password Policy Config +## +## Parameters used for Password Policies +password_policy: + ## See: https://www.authelia.com/configuration/security/password-policy/ + standard: + enabled: false + min_length: 8 + max_length: 0 + require_uppercase: false + require_lowercase: false + require_number: false + require_special: false + zxcvbn: + ## See https://www.authelia.com/configuration/security/password-policy/#zxcvbn for more info + enabled: false + min_score: 3 + ## ## Duo Push API Configuration ##