RBAC How-to: Traefik Configuration
This page describes the steps to grant a user access to the Grafana UI and permission to ingest data to a specific table. These permissions are enforced by Traefik when the enable_traefik_authorization tunable is true.
Prerequisites⚓︎
This example assumes you have set the $HDX_HOSTNAME to the hostname of your Hydrolix cluster, for example: hostname.hydrolix.live.
Log in to the API⚓︎
Get the bearer token, which is good for the next 24 hours, to authenticate future API calls. This command assumes you've set the $HDX_HOSTNAME, $HDX_USER, and $HDX_PASSWORD environment variables:
List orgs and projects from the API⚓︎
List the Hydrolix installation's organizations with the following command:
From the output, find the organization's UUID you want to use and assign that to an environment variable $HDX_ORG.
Similarly, use this command to list the projects available to the organization:
From the output, find the project you want to use and assign its UUID to an environment variable called $HDX_PROJECT.
List tables in project⚓︎
From the previous steps, the $HDX_HOSTNAME, $HDX_TOKEN, $HDX_ORG, and $HDX_PROJECT environment variables should be set.
You will also need the UUID of the target table. List the tables in your project with the following command:
From the output, find the table you want to grant ingest access to and assign its UUID to an environment variable called $HDX_TABLE.
Create the role⚓︎
This example creates a role called grafana_and_ingest with two policies. The first policy grants global access to the Grafana UI using the view_grafana permission. The second policy grants the ingest_table permission scoped to the table.
Get a user's UUID⚓︎
List the users in your cluster to find the UUID of the user you want to assign the role to:
From the output, find the user you want and assign their UUID to an environment variable called $HDX_USER.
Assign the role to a user⚓︎
Assign the grafana_and_ingest role to the user:
Enable Traefik route authorization⚓︎
Set the enable_traefik_authorization tunable to true in the Hydrolix configuration spec:
Once active, Traefik enforces permission checks on ingest and service endpoints for all authenticated users.
What this user can and can't do⚓︎
With the grafana_and_ingest role and Traefik authorization enabled, the user can:
view_grafana: Access to the Grafana UI athttps://$HDX_HOSTNAME/grafana.ingest_table: Ingest data to the specified table using the HTTP Stream API.
The same user can't:
- Access Kibana, Prometheus, Superset, or the version endpoint. These require the corresponding
view_kibana,view_prometheus,view_superset, andview_versionpermissions. Traefik returns403 Forbidden. - Ingest data to any other table. The
ingest_tablepermission is scoped to a single table. Requests targeting other tables return403 Forbidden.
Verify a user's permissions⚓︎
To confirm which permissions are assigned to an authenticated user, send a request to the /config/v1/users/current/ endpoint: