cfg/templates
Dustin 01d8f7043b loki: Require X-Grafana-User HTTP header
I discovered today that if anonymous Grafana users have Viewer
permission, they can use the Datasource API to make arbitrary queries
to any backend, even if they cannot access the Explore page directly.
This is documented ([issue #48313][0]) as expected behavior.

I don't really mind giving anonymous access to the Victoria Metrics
datasource, but I definitely don't want anonymous users to be able to
make Loki queries and view log data.  Since Grafana Datasource
Permissions is limited to Grafana Enterprise and not available in
the open source version of Grafana, the official recommendation from
upstream is to use a separate Organization for the Loki datasource.
Unfortunately, this would preclude having dashboards that have graphs
from both data sources.  Although I don't have any of those right now, I
like the idea and may build some eventually.

Fortunately, I discovered the `send_user_header` Grafana configuration
option.  With this enabled, Grafana will send an `X-Grafana-User` header
with the username of the user on whose behalf it is making a request to
the backend.  If the user is not logged in, it does not send the header.
Thus, we can detect the presence of this header on the backend and
refuse to serve query requests if it is missing.

[0]: https://github.com/grafana/grafana/issues/48313
2024-02-21 07:47:51 -06:00
..
collectd collectd: Bind-mount journal log socket 2024-01-18 20:35:22 -06:00
common reload-udev-rules: Add delay before copying files 2024-02-15 10:08:52 -06:00
fetchcert fetchcert: Deploy tool to get cert from k8s Secret 2024-02-18 10:48:01 -06:00
loki loki: Require X-Grafana-User HTTP header 2024-02-21 07:47:51 -06:00
nut nut: Enable Podman auto-update for containers 2024-01-19 20:10:11 -06:00
promtail promtail: Increase start timeout 2024-02-20 07:27:11 -06:00
ssh app/ssh: Configure sshd trusted user CA keys 2024-02-03 11:16:52 -06:00
sudo sudo: Configure pam_ssh_agent_auth 2024-01-29 09:10:42 -06:00