๐ก๏ธ Dagster AuthKit
Community authentication wrapper for self-hosted Dagster OSS.
Authentication, RBAC, and Audit logs for Dagster without touching internal code.
๐ฏ What is this?
Dagster OSS has no auth. If you run it in a VPC or locally, anyone with the URL has full admin access.
AuthKit solves this by wrapping the dagster-webserver command to add:
- โ Login Interface: Simple username/password flow.
- โ RBAC (4 Levels): Granular control over who can do what.
- โ Audit Logs: JSON logs for monitoring who is doing what.
- โ Multi-Backend: Works with SQLite, Postgres, MySQL (via Peewee ORM) and Redis.
No code changes required. You don't touch your repository.py or dagster.yaml.
โจ What's New in v0.4.0
๐ Security Hardening (Breaking Changes)
SECRET_KEYis now required in production. The server will refuse to start ifDAGSTER_AUTH_SECRET_KEYis not set andDAGSTER_AUTH_ENV=production. Auto-generated keys caused silent session breakage in multi-pod deployments.- Proxy mode now requires trusted IPs. Set
DAGSTER_AUTH_PROXY_TRUSTED_IPS(comma-separated) or explicitly opt into the insecure default withDAGSTER_AUTH_PROXY_TRUST_ALL=true. - RBAC is now deny-by-default for unknown mutations. New GraphQL mutations added by future Dagster releases require
ADMINrole until explicitly audited. Configure viaDAGSTER_AUTH_UNKNOWN_MUTATION_ROLE.
๐ Cross-Pod Session Revocation
- DB-backed
session_versioncolumn.change_password,change_role, anddelete_usernow invalidate sessions across ALL pods without Redis. A newsession_versioncolumn is automatically added to existing databases on upgrade. - Dual rate-limiting (username + IP). Prevents both credential stuffing and brute-force on a single account.
๐ก๏ธ Attack Surface Reduction
- CSRF protection on the login form (double-submit signed cookie).
- WebSocket authentication โ GraphQL subscriptions at
/graphqlare now authenticated (pure ASGI middleware). - XSS prevention in login and 403 pages via HTML escaping.
- Open redirect hardening โ protocol-relative URLs (
//evil.com) are blocked. - Empty password rejection across all backends (prevents unauthenticated LDAP binds).
๐๏ธ Core Improvements
operationNamesupport in GraphQL RBAC. Clients sending multiple operations in one document no longer trigger false-positive blocks.- Backend instance caching. Backend connections are reused across requests instead of being recreated per call.
- Unified role serialization.
to_dict()now usesrole.value(int) for cross-backend consistency.
โ ๏ธ Upgrading from v0.3.x
- Set
DAGSTER_AUTH_SECRET_KEYin your environment. Generate one with:python -c 'import secrets; print(secrets.token_urlsafe(32))'
- If using proxy mode, set
DAGSTER_AUTH_PROXY_TRUSTED_IPSto your proxy's IP address. - Database migration happens automatically on first boot โ no manual steps needed for SQLite/Postgres/MySQL. A
session_versioncolumn is added to theuserstable. - Role serialization changed from string (
"ADMIN") to int (40) in session cookies. Existing sessions continue to work (backward-compatiblefrom_dict).
๐ Ready-to-Run Examples
We provide ready-to-use stacks for different scenarios in the examples/ directory:
examples
โโโ authelia # NEW! Authelia + Caddy + LDAP SSO (Docker)
โ โโโ Makefile
โ โโโ docker-compose.yml
โ โโโ Caddyfile
โ โโโ authelia/
โโโ kubernetes # NEW! Minikube deployment
โ โโโ Makefile
โ โโโ k8s/
โโโ ldap # Active Directory integration (**Experimental**)
โ โโโ Makefile
โ โโโ docker-compose.yml
โ โโโ ldap-bootstrap.ldif
โโโ postgresql_redis # Recommended production setup
โ โโโ Makefile
โ โโโ docker-compose.yml
โโโ quickstart-sqlite # Simple local testing
โโโ Makefile
โโโ docker-compose.yml
How to run
Pick a scenario, go into the folder, and check the Makefile.
1. Authelia SSO (Docker) Complete SSO with Authelia, Caddy, and OpenLDAP:
cd examples/authelia
make up
# Access: https://auth.company.com (admin/password123)
# Then: https://dagster.company.com
2. Kubernetes (Minikube) Same stack running on Kubernetes:
cd examples/kubernetes
make build # Build the Docker image inside Minikube
make up # Deploy everything
# In another terminal: make connect (runs minikube tunnel)
# Add to /etc/hosts: $(minikube ip) auth.company.com dagster.company.com
3. Standard Setup (Postgres + Redis)
cd examples/postgresql_redis
make up
4. Local Quickstart (SQLite)
cd examples/quickstart-sqlite
make up
5. LDAP/AD Testing โ ๏ธ EXPERIMENTAL
cd examples/ldap
make up
๐ Manual Installation (Python)
If you aren't using Docker, you can install via pip.
# For local testing (SQLite)
pip install dagster-authkit[sqlite]
# For server usage (Postgres + Redis recommended)
pip install dagster-authkit[postgresql,redis]
# For LDAP/Active Directory integration (**Experimental**)
pip install dagster-authkit[ldap]
Usage:
# Initialize the database and create the first admin
dagster-authkit init-db --with-admin
# Run Dagster (replaces the standard 'dagster-webserver' command)
dagster-authkit -f your_pipeline.py -h 0.0.0.0 -p 3000
# For proxy mode (Authelia/OAuth2 Proxy)
export DAGSTER_AUTH_BACKEND=proxy
export DAGSTER_AUTH_PROXY_LOGIN_URL=https://auth.yourcompany.com
dagster-authkit -f your_pipeline.py -h 0.0.0.0 -p 3000
๐ Roles (RBAC)
We provide 4 levels of access. Permissions are enforced via GraphQL query analysis.
| Role | Description |
|---|---|
| Admin | Full access. Can manage users, settings, and all pipelines. |
| Editor | Can modify assets and codebase (if allowed) and manage runs. |
| Launcher | Can launch runs and re-execute jobs, but cannot modify code/assets. |
| Viewer | Read-only. Can view runs and assets. GraphQL mutations are blocked. |
How it works: AuthKit analyzes GraphQL queries using the official GraphQL parser to accurately identify mutations and block unauthorized actions.
๐ฆ Backends
| Backend | Implementation | Status | Use Case |
|---|---|---|---|
| SQLite | Peewee ORM | Stable | Local / Simple. Single instance only. |
| PostgreSQL | Peewee + psycopg2 |
Stable | Production. Recommended for Docker/K8s. |
| MySQL/MariaDB | Peewee + mysql-connector |
Stable | Production. |
| Redis | Native redis |
Stable | Session Storage + Distributed Rate Limiting. |
| LDAP | ldap3 library |
Experimental | Active Directory / OpenLDAP. Community maintained. |
| Proxy | Header-based | Stable | Authelia, OAuth2 Proxy, Traefik, Caddy. |
| OpenID Connect | Header-based | Experimental | AuthKit supports OIDC providers (Google, GitHub, Okta, Keycloak) via Authelia |
๐ ๏ธ CLI Management
Manage users directly from the shell. Useful for CI/CD or admin tasks.
# Create a new launcher
dagster-authkit add-user bob --role launcher
# Reset password
dagster-authkit change-password bob
# List everyone
dagster-authkit list-users
# View RBAC permissions matrix
dagster-authkit list-permissions
๐ฎ Roadmap
Current (v0.4.0)
- โ Username/password auth (bcrypt)
- โ 4-level RBAC (ADMIN/EDITOR/LAUNCHER/VIEWER)
- โ SQLite, PostgreSQL, MySQL, Redis support
- โ GraphQL mutation blocking with official AST parser
- โ LDAP backend (experimental)
- โ Proxy authentication (Authelia, Caddy, Traefik)
- โ Kubernetes example with full SSO stack
- โ Redis session revocation and rate limiting
- โ Centralized UI templates
- โ CSRF protection
- โ
Cross-pod session revocation (DB-backed
session_version) - โ WebSocket authentication (GraphQL subscriptions)
- โ Dual rate-limiting (username + IP)
- โ Proxy trusted IP allowlist
Next
- ๐ Helm chart for Kubernetes deployments
- ๐ OIDC backend (beyond proxy mode)
What we will NOT do:
- โ Inject React code into Dagster UI (too brittle)
- โ Complex enterprise features (that's what Dagster+ is for)
๐ค Contributing
Found a bug? Want to add a feature? Open a PR. If it works and keeps things simple, we'll merge it.
Especially needed:
- People with Active Directory experience to validate the LDAP backend
- Testing on different Dagster versions
- Helm chart contributions
๐ License
Apache 2.0 - see LICENSE
๐ Credits
Built by Demetrius Albuquerque because self-hosting Dagster shouldn't mean no auth.
Inspired by the community's need for a middle ground between "no auth" and "pay for Dagster+".
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dagster_authkit-0.4.2.tar.gz.
File metadata
- Download URL: dagster_authkit-0.4.2.tar.gz
- Upload date:
- Size: 92.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8052d9cce0422f90a70986b94bcb0dd5af9854a4ee67e9eb8f5edb6542098656
|
|
| MD5 |
c01c0ffdaf51bf3b040ff6b11cddc4b6
|
|
| BLAKE2b-256 |
fe0bc57b272360b55b49eabe15653306350846a05a2f5c4786bc75b580837359
|
Provenance
The following attestation bundles were made for dagster_authkit-0.4.2.tar.gz:
Publisher:
publish.yml on maltzsama/dagster-authkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dagster_authkit-0.4.2.tar.gz -
Subject digest:
8052d9cce0422f90a70986b94bcb0dd5af9854a4ee67e9eb8f5edb6542098656 - Sigstore transparency entry: 2191158177
- Sigstore integration time:
-
Permalink:
maltzsama/dagster-authkit@e17699bace2e313612b010af2ce6bb0942b0c4af -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/maltzsama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e17699bace2e313612b010af2ce6bb0942b0c4af -
Trigger Event:
release
-
Statement type:
File details
Details for the file dagster_authkit-0.4.2-py3-none-any.whl.
File metadata
- Download URL: dagster_authkit-0.4.2-py3-none-any.whl
- Upload date:
- Size: 79.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cee7bb4015c320078e208fccf3f9da694ea60082155e527adca928b6f2bd780
|
|
| MD5 |
a638e1835a01bb942e3c988df71e3256
|
|
| BLAKE2b-256 |
1c2cb2429577154f8b5b42e001421ebc4b3fd5788592447b28e1bd78f5bd1320
|
Provenance
The following attestation bundles were made for dagster_authkit-0.4.2-py3-none-any.whl:
Publisher:
publish.yml on maltzsama/dagster-authkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dagster_authkit-0.4.2-py3-none-any.whl -
Subject digest:
2cee7bb4015c320078e208fccf3f9da694ea60082155e527adca928b6f2bd780 - Sigstore transparency entry: 2191158250
- Sigstore integration time:
-
Permalink:
maltzsama/dagster-authkit@e17699bace2e313612b010af2ce6bb0942b0c4af -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/maltzsama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e17699bace2e313612b010af2ce6bb0942b0c4af -
Trigger Event:
release
-
Statement type: