SSO and Identities (Kanidm)
Kanidm 🡕 is the network’s identity provider: a
single identity unlocks all services (SSO). The idm service runs on
the HCS (and, optionally, as a replica in each zone).
Identities and groups
Section titled “Identities and groups”Accounts and groups are provisioned in Kanidm from etc/config.yaml:
users: alice: profile: "nix-admin" groups: ["idm-admins", "idm-devs", "global"]- Groups control access to services.
- Two special groups:
idm-admins(administration),idm-devs(development).
Connect a service (OIDC)
Section titled “Connect a service (OIDC)”OIDC-compatible services are linked to SSO automatically: Kanidm provisions an OAuth2 client per service, and its secret is managed by sops. Nothing to configure manually.
Protect a service without OIDC
Section titled “Protect a service without OIDC”A service without its own authentication (homepage, static site) can be
protected by placing a Kanidm login page in front of it (oauth2-proxy +
Caddy). For the homepage, two settings on the gateway host
(usr/machines/<gateway>/):
darkone.service.homepage.protect = true; # requires a Kanidm sessiondarkone.service.homepage.protectExternalOnly = true; # internal free, external authenticated| Option | Default | Effect |
|---|---|---|
protect | true | Homepage restricted to Kanidm users (users group) |
protectExternalOnly | false | LAN/VPN without login, login required from outside |
Multi-zone replication
Section titled “Multi-zone replication”The mode is inferred from where idm is declared:
idmon the HCS only → single instance, no replication.idmon a gateway without HCS → standalone instance in the zone.idmon the HCS and gateways → replication: the HCS provides, each gateway is a read-only replica.
Administration
Section titled “Administration”Administration is done via the command line on the HCS:
just enter hcskanidm person credential create-reset-token <login> --name idm_adminSee Create a user account and Reset a password.