Skip to content

User Provisioning

User provisioning is a GitOps-managed pipeline that creates, updates, and deletes user accounts in Authentik from a single users.json definition. A commit is all it takes to onboard or offboard someone. NetBird groups are synced automatically from Authentik via its IDP manager integration.

FieldValue
Flux pathflux-clusters/stefanzhelev/apps/users-authentik
Base pathflux-apps/users
Sync wave8
KustomizationDepends on
users-authentikauthentik, external-secrets-config, tofu-controller
  • users-authentik: Terraform CR that provisions users, groups, and authentication flows in Authentik

An ExternalSecret pulls the Authentik API token from Vault.

The module reads from flux-apps/users/users.json:

{
"users": {
"stefan": {
"name": "Stefan Zhelev",
"email": "stefan@stefanzhelev.com",
"groups": ["admins"],
"is_admin": true
}
}
}

To add a user, add an entry. To remove a user, delete the entry. Commit and push — Flux reconciles the Terraform CR.

The users-authentik module configures passkey-first authentication:

FlowPurposeStages
Passwordless (default)Passkey / biometricsWebAuthn challenge → session
Password + MFA (fallback)Traditional loginPassword → TOTP / WebAuthn / static → session
EnrollmentNew user onboardingSet password → register passkey → enroll TOTP → session
RecoveryPassword resetEmail identification → recovery email → new password → session

Groups created in Authentik are automatically synced to NetBird via its IDP manager integration (ManagerType: "authentik"). No separate provisioning is needed — when a user authenticates with NetBird, their Authentik group memberships are reflected in NetBird’s access policies.

The break-glass account (akadmin) is managed outside this module and is the recovery path if the users pipeline ever breaks.

  • Authentik: identity provider — user accounts, groups, auth flows
  • NetBird: mesh VPN — groups synced automatically from Authentik via IDP manager
  • Vault + Tofu Controller: API credentials stored in Vault, synced by ExternalSecrets
  • Flux CD: reconciliation loop that applies changes on commit
Terminal window
# Check Terraform CR status
kubectl get terraform -n flux-system users-authentik
# View Terraform plan output
kubectl describe terraform -n flux-system users-authentik
# Force reconciliation
flux reconcile kustomization users-authentik