feat(auth): add Authelia for OIDC

Use Authelia in an attempt to replace Keycloak. Kanidm is another alternative we're going to try later.
This commit is contained in:
Vegard Hagen
2024-09-07 21:14:33 +02:00
parent 6ac8652e24
commit ba69146b4b
6 changed files with 84 additions and 1 deletions

View File

@@ -18,4 +18,4 @@ spec:
value: /
backendRefs:
- name: hugo
port: 80
port: 80

View File

@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: authelia
resources:
- ns.yaml
helmCharts:
- name: authelia
repo: https://charts.authelia.com
releaseName: authelia
namespace: authelia
version: 0.9.5
valuesFile: values.yaml

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: authelia

View File

@@ -0,0 +1,60 @@
image:
registry: ghcr.io
repository: authelia/authelia
tag: 4.38.10 # renovate: docker=ghcr.io/authelia/authelia
pullPolicy: IfNotPresent
configMap:
theme: 'dark'
access_control:
# upgrade to 'two_factor' later
default_policy: 'one_factor'
rules:
- domain_regex: '^.*\.stonegarden.dev$'
policy: 'one_factor'
authentication_backend:
ldap:
enabled: true
implementation: 'lldap'
address: 'ldap://lldap.lldap.svc.cluster.local'
base_dn: 'DC=stonegarden,DC=dev'
additional_users_dn: 'OU=people'
# To allow sign in both with username and email, one can use a filter like
# (&(|({username_attribute}={input})({mail_attribute}={input}))(objectClass=person))
users_filter: '(&({username_attribute}={input})(objectClass=person))'
additional_groups_dn: 'OU=groups'
groups_filter: '(member={dn})'
user: 'UID=admin,OU=people,DC=stonegarden,DC=dev'
password:
secret_name: 'lldap-auth'
value: 'password'
# file:
# enabled: true
session:
cookies:
- subdomain: auth
domain: stonegarden.dev
storage:
postgres:
enabled: false
address: 'tcp://postgres.databases.svc.cluster.local:5432'
# Switch to Postgres later
local:
enabled: true
notifier:
filesystem:
enabled: true
secret:
additionalSecrets:
lldap-auth:
items:
- key: 'password'
path: 'authentication.ldap.password.txt'

View File

@@ -11,3 +11,6 @@ spec:
- name: web
port: 80
targetPort: web
- name: ldap
port: 389
targetPort: ldap

View File

@@ -9,6 +9,8 @@ spec:
destinations:
- namespace: 'argocd'
server: '*'
- namespace: 'authelia'
server: '*'
- namespace: 'keycloak'
server: '*'
- namespace: 'lldap'