Skip to content

OpenLBACLabel-Based Access Control

Enforce per-group query policies on Prometheus, Loki, Thanos, and Cortex. No plugins. No datasource changes.

OpenLBAC architecture diagram

How it works in 60 seconds ​

Using Keycloak, Okta, Auth0, or any OIDC provider? lbac-proxy validates the JWT and extracts groups from the token directly:

Keycloak / Okta / Auth0
  │  issues JWT with groups: ["platform-team", "sre"]
  │
  ▼
Any client  →  lbac-proxy:8080/my-datasource/...
                    │
                    ├── Validates JWT Bearer token
                    │     └── extracts groups: ["platform-team", "sre"]
                    ├── Looks up group policies from lbac-core
                    │     └── platform-team → namespace=production
                    ├── Rewrites query: up{} → up{namespace="production"}
                    │
                    └── Forwards to Prometheus / Loki / Thanos / Cortex

Already using Grafana? No IdP setup needed — lbac-proxy reads identity directly from Grafana Teams:

Grafana (Teams: platform-team, sre)
  │  user opens a dashboard
  │
  ▼
Grafana  →  lbac-proxy:8080/my-datasource/...
                    │
                    ├── Reads X-Grafana-User header
                    │     └── looks up teams via Grafana API → ["platform-team", "sre"]
                    ├── Looks up group policies from lbac-core
                    │     └── platform-team → namespace=production
                    ├── Rewrites query: up{} → up{namespace="production"}
                    │
                    └── Forwards to Prometheus / Loki / Thanos / Cortex

Configure a policy once:

json
{
  "group": "platform-team",
  "rules": [
    { "label": "namespace", "operator": "=~", "values": ["production", "staging"] },
    { "label": "env",       "operator": "!=", "values": ["dev"] }
  ]
}

Every query is automatically scoped — no client changes needed.

Community & Support ​

OpenLBAC is built in the open. Contributions, bug reports, and feature requests are welcome on GitLab.

Released under the Apache 2.0 License.