Skip to content

Commit

Permalink
feat(auth): add Authelia for OIDC
Browse files Browse the repository at this point in the history
Use Authelia in an attempt to replace Keycloak. Kanidm is another alternative we're going to try later.
  • Loading branch information
vehagn committed Sep 9, 2024
1 parent c44d39b commit 5a53d28
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion k8s/apps/homepage/blog/hugo/http-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ spec:
value: /
backendRefs:
- name: hugo
port: 80
port: 80
14 changes: 14 additions & 0 deletions k8s/infra/auth/authelia/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions k8s/infra/auth/authelia/ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: authelia
60 changes: 60 additions & 0 deletions k8s/infra/auth/authelia/values.yaml
Original file line number Diff line number Diff line change
@@ -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'

3 changes: 3 additions & 0 deletions k8s/infra/auth/lldap/svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ spec:
- name: web
port: 80
targetPort: web
- name: ldap
port: 389
targetPort: ldap
2 changes: 2 additions & 0 deletions k8s/infra/auth/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ spec:
destinations:
- namespace: 'argocd'
server: '*'
- namespace: 'authelia'
server: '*'
- namespace: 'keycloak'
server: '*'
- namespace: 'lldap'
Expand Down

0 comments on commit 5a53d28

Please sign in to comment.