Skip to content

Commit 61c345e

Browse files
fix(monitoring): say removing the last OIDC user does not revoke access
The guide said that removing a user from `spec.oidc.users` revokes their access. That holds only while the list keeps another entry. The users-Job renders only for a non-empty list, so removing the last entry skips the prune pass and the account keeps its org role, and at the same point the chart stops forcing `allow_sign_up=false`. A reader who followed the page would believe access was gone when it was not. Say so next to the revocation sentence, in both v1.6/ and next/ so the two copies stay identical. Assisted-by: LLM Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent e465385 commit 61c345e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎content/en/docs/next/operations/services/monitoring/oidc-authentication.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Give tenant users per-identity Grafana access with per-instance au
55
weight: 5
66
---
77

8-
Cozystack Grafana instances can authenticate users through OIDC instead of the shared `admin_user` / `admin_password` Secret. Each user then has their own identity, per-user audit, and a role that can be revoked by removing them from `spec.oidc.users` on the `Monitoring` CR.
8+
Cozystack Grafana instances can authenticate users through OIDC instead of the shared `admin_user` / `admin_password` Secret. Each user then has their own identity, per-user audit, and a role that can be revoked by removing them from `spec.oidc.users` on the `Monitoring` CR, as long as the list keeps at least one other entry (see [Assigning roles](#assigning-roles)).
99

1010
The identity model is deliberately **per-instance** rather than per-tenant: every Monitoring instance (one inner `monitoring-system` release per namespace — each tenant's own, plus the platform's in `tenant-root`) gets its own OIDC audience, and a token minted for instance A is rejected by instance B's Grafana. Cross-tenant sign-in is additionally blocked by a `allowed_groups` gate on the release's namespace-scoped `<ns>-{view,use,admin,super-admin}` groups (chart-owned in the tenant chart; the platform-managed `groups` scope in the `cozy` realm makes them visible on every token). The full rationale is in the [design proposal](https://github.com/cozystack/community/pull/24). The tenant kube-apiserver's Phase 1 ([cozystack/cozystack#3044](https://github.com/cozystack/cozystack/pull/3044)) uses the same shape; this Grafana integration is the Phase-1 follow-up called out in that PR's body.
1111

@@ -112,7 +112,7 @@ On the `inline config` path, when `users[]` is non-empty the chart-forced users-
112112

113113
## Assigning roles
114114

115-
Roles are driven by **`spec.oidc.users[]`**, not by group membership: each entry has an `email` (matched against the OIDC `email` claim on login) and a `role` (Grafana org-level: `Admin`, `Editor`, or `Viewer`). The users-Job creates or updates the local Grafana account on every reconcile and prunes stale members. Removing a user from the list revokes their access on the next chart apply — the users-Job removes them from the Grafana org (`DELETE /api/orgs/1/users/<id>`), an org-membership change rather than deletion of the underlying Grafana account; adding a user re-provisions them.
115+
Roles are driven by **`spec.oidc.users[]`**, not by group membership: each entry has an `email` (matched against the OIDC `email` claim on login) and a `role` (Grafana org-level: `Admin`, `Editor`, or `Viewer`). The users-Job creates or updates the local Grafana account on every reconcile and prunes stale members. Removing a user from the list revokes their access on the next chart apply — the users-Job removes them from the Grafana org (`DELETE /api/orgs/1/users/<id>`), an org-membership change rather than deletion of the underlying Grafana account; adding a user re-provisions them. This holds only while the list keeps at least one entry. The users-Job renders only for a non-empty `users[]`, so removing the last entry skips the prune pass: the account keeps its org role and has to be removed from the Grafana org by hand. At the same point the chart stops forcing `allow_sign_up=false` and `skip_org_role_sync=true`, so Grafana's default sign-up applies again and a member of the tenant groups can create a Viewer account on first login.
116116

117117
Login authorization is separate: the token owner MUST be a member of one of the release's tenant-scoped `cozy`-realm groups (`<namespace>-view`, `<namespace>-use`, `<namespace>-admin`, `<namespace>-super-admin`) for `allowed_groups` to accept the login. That gate is unconditional in `System` mode, independent of `users[]`.
118118

‎content/en/docs/v1.6/operations/services/monitoring/oidc-authentication.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Give tenant users per-identity Grafana access with per-instance au
55
weight: 5
66
---
77

8-
Cozystack Grafana instances can authenticate users through OIDC instead of the shared `admin_user` / `admin_password` Secret. Each user then has their own identity, per-user audit, and a role that can be revoked by removing them from `spec.oidc.users` on the `Monitoring` CR.
8+
Cozystack Grafana instances can authenticate users through OIDC instead of the shared `admin_user` / `admin_password` Secret. Each user then has their own identity, per-user audit, and a role that can be revoked by removing them from `spec.oidc.users` on the `Monitoring` CR, as long as the list keeps at least one other entry (see [Assigning roles](#assigning-roles)).
99

1010
The identity model is deliberately **per-instance** rather than per-tenant: every Monitoring instance (one inner `monitoring-system` release per namespace — each tenant's own, plus the platform's in `tenant-root`) gets its own OIDC audience, and a token minted for instance A is rejected by instance B's Grafana. Cross-tenant sign-in is additionally blocked by a `allowed_groups` gate on the release's namespace-scoped `<ns>-{view,use,admin,super-admin}` groups (chart-owned in the tenant chart; the platform-managed `groups` scope in the `cozy` realm makes them visible on every token). The full rationale is in the [design proposal](https://github.com/cozystack/community/pull/24). The tenant kube-apiserver's Phase 1 ([cozystack/cozystack#3044](https://github.com/cozystack/cozystack/pull/3044)) uses the same shape; this Grafana integration is the Phase-1 follow-up called out in that PR's body.
1111

@@ -112,7 +112,7 @@ On the `inline config` path, when `users[]` is non-empty the chart-forced users-
112112

113113
## Assigning roles
114114

115-
Roles are driven by **`spec.oidc.users[]`**, not by group membership: each entry has an `email` (matched against the OIDC `email` claim on login) and a `role` (Grafana org-level: `Admin`, `Editor`, or `Viewer`). The users-Job creates or updates the local Grafana account on every reconcile and prunes stale members. Removing a user from the list revokes their access on the next chart apply — the users-Job removes them from the Grafana org (`DELETE /api/orgs/1/users/<id>`), an org-membership change rather than deletion of the underlying Grafana account; adding a user re-provisions them.
115+
Roles are driven by **`spec.oidc.users[]`**, not by group membership: each entry has an `email` (matched against the OIDC `email` claim on login) and a `role` (Grafana org-level: `Admin`, `Editor`, or `Viewer`). The users-Job creates or updates the local Grafana account on every reconcile and prunes stale members. Removing a user from the list revokes their access on the next chart apply — the users-Job removes them from the Grafana org (`DELETE /api/orgs/1/users/<id>`), an org-membership change rather than deletion of the underlying Grafana account; adding a user re-provisions them. This holds only while the list keeps at least one entry. The users-Job renders only for a non-empty `users[]`, so removing the last entry skips the prune pass: the account keeps its org role and has to be removed from the Grafana org by hand. At the same point the chart stops forcing `allow_sign_up=false` and `skip_org_role_sync=true`, so Grafana's default sign-up applies again and a member of the tenant groups can create a Viewer account on first login.
116116

117117
Login authorization is separate: the token owner MUST be a member of one of the release's tenant-scoped `cozy`-realm groups (`<namespace>-view`, `<namespace>-use`, `<namespace>-admin`, `<namespace>-super-admin`) for `allowed_groups` to accept the login. That gate is unconditional in `System` mode, independent of `users[]`.
118118

0 commit comments

Comments
 (0)