Authentik Identity Provider

Relevant source files

The Authentik Identity Provider serves as the central authentication and authorization engine for the home-ops cluster. It provides Single Sign-On (SSO) via OAuth2/OIDC and protects legacy or simple applications through an External Authentication (ext-auth) pattern integrated with the Envoy Gateway.

Deployment Architecture

Authentik is deployed in the security namespace using the official Helm chart, managed via Flux CD. It utilizes a high-performance external cache and a dedicated PostgreSQL database (managed by CloudNativePG) for state persistence.

Kubernetes Components

Data Flow: Authentication Request

The following diagram illustrates the flow of an authentication request from a user to a protected application.

Request Flow for Protected Routes

[Flowchart Diagram]

Sources: kubernetes/components/ext-auth/securitypolicy.yaml2-17kubernetes/apps/security/authentik/app/helmrelease.yaml57-58infrastructure/terraform/authentik/system.tf90-113

Terraform Configuration

The entire Authentik configuration—including applications, flows, stages, and groups—is managed as Infrastructure-as-Code using the Authentik Terraform provider. The state is stored in a Cloudflare R2 bucket infrastructure/terraform/authentik/main.tf12-27

Group Hierarchy and Directory

Authentik manages users and permissions through a structured group system. Groups are defined in directory.tf and used for policy bindings to applications infrastructure/terraform/authentik/directory.tf2-13

Group NameSlugPurpose
authentik AdminsadminsFull administrative access infrastructure/terraform/authentik/directory.tf26-28
superuserssuperusersCluster-wide superuser permissions infrastructure/terraform/authentik/directory.tf12
usersusersDefault group for all enrolled users infrastructure/terraform/authentik/directory.tf11
PublicpublicAccess to public-facing authenticated proxies infrastructure/terraform/authentik/directory.tf6

Identity Sources

Authentik is configured with Google as a federated identity provider.

Sources: infrastructure/terraform/authentik/directory.tf1-60infrastructure/terraform/authentik/variables.tf178-188

Application Security Patterns

The cluster utilizes two primary patterns for securing applications: Native OIDC and Envoy External Auth.

1. Native OIDC/OAuth2 Applications

Applications that natively support OIDC are configured as authentik_application resources. Examples include Grafana, Forgejo, and Romm infrastructure/terraform/authentik/applications.tf106-167

Example: Romm OIDC Integration
Romm is configured with OIDC enabled, pointing to the Authentik provider URL kubernetes/apps/media/romm/app/helmrelease.yaml50-53 In Terraform, the application is mapped to the users group infrastructure/terraform/authentik/applications.tf134-142

2. Envoy External Authentication (ext-auth)

For applications lacking native auth, the ext-auth Kustomize component is used. This component creates an Envoy SecurityPolicy that intercepts requests and validates them against an Authentik Outpost kubernetes/components/ext-auth/securitypolicy.yaml2-30

SecurityPolicy Mapping

[Class Diagram]

Sources: kubernetes/components/ext-auth/securitypolicy.yaml2-30kubernetes/apps/network/echo-server/ks.yaml14-21

Authentication Flows and MFA

Authentik uses complex flows to handle multi-stage authentication, including Passkeys and MFA.

Sources: infrastructure/terraform/authentik/stages.tf1-165infrastructure/terraform/authentik/system.tf115-119