grafana-operator icon indicating copy to clipboard operation
grafana-operator copied to clipboard

[Dashboards] Support authentication for DashboardsFromUrl using secrets

Open Cellebyte opened this issue 3 years ago • 12 comments

Is your feature request related to a problem? Please describe.

When you want to pull in dashboards from a https source which needs authentication it is currently not possible to do that. I think for the most parts basicAuth is sufficient enough.

(If applicable)If your feature request solves a bug please provide a link to the community issue

Describe the solution you'd like A way to configure authentication parameters for my dashboard sources by a secretRef.

Describe alternatives you've considered Handling it with a kind of proxy. Using the embedded json or a configmapRef. Those two options only work when the dashboard is not bigger than the etcd max size which is normally 1MB for the whole manifest.

Cellebyte avatar Mar 11 '21 11:03 Cellebyte

This sounds reasonable and we should enable a similar feature (secretRefs for credentials) for data sources.

pb82 avatar Mar 16 '21 12:03 pb82

I also think this would require adding support to get dashboards from other locations the grafanCom or does grafana have dashboards that is only accessible through auth?

NissesSenap avatar Nov 07 '21 21:11 NissesSenap

@NissesSenap you can host dashboards on an s3 bucket and reference them so that they get pulled in from the operator. Some of them could be hosted behind authentication. Or is it not possible to use a different URi then grafana.com

Cellebyte avatar Nov 07 '21 23:11 Cellebyte

Currently it's not supported to download any dashboards outside of grafana.com if i remember correctly

NissesSenap avatar Nov 08 '21 06:11 NissesSenap

I rememberd wrong, it's possible to get dashboards from a url. So "all" we need to do is to add a basic auth solution.

NissesSenap avatar Nov 28 '21 12:11 NissesSenap

A configuration to access dashboard on a private github/gitlab would be nice. There is already a Grafana.spec.config.auth.github and gitlab in the operator API. Can i setup this config and use a private github url with the Dashboard url ?

aheritier-csgroup avatar Dec 13 '21 10:12 aheritier-csgroup

I think a generic approach would be nice.

Cellebyte avatar Dec 13 '21 11:12 Cellebyte

I just reply to myself but for github, one can use the following format with an oauth token:

https://oauth2:[email protected]/user/repo/main/dash.json?token=xxxxxxxxxx

aheritier-csgroup avatar Dec 13 '21 13:12 aheritier-csgroup

Adding support to set Authorization headers pulling config from secrets should be the way to go.

sastorsl avatar Jan 03 '23 07:01 sastorsl

One of the use cases is to store the dashbords in an authentication protected object store that could be carried to a secure environment such as Nexus.

jimpete avatar Jan 03 '23 13:01 jimpete

I don't think the problem is to come up with use cases. As maintainers we just don't have time to solve every feature request.

We are happy to receive PR around this issue.

NissesSenap avatar Jan 03 '23 16:01 NissesSenap

There are use cases surrounding accessing dashboards from third party repositories which are basic auth protected in a secure environment which by its nature I cant discuss.

On Tue, Jan 3, 2023, 11:42 AM Edvin N @.***> wrote:

I don't think the problem is to come up with use cases. As maintainers we just don't have time to solve every feature request.

We are happy to receive PR around this issue.

— Reply to this email directly, view it on GitHub https://github.com/grafana-operator/grafana-operator/issues/365#issuecomment-1369986874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEVHZELNSZU2VX35NR74OLWQRJG7ANCNFSM4ZADETRA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jimpete avatar Jan 03 '23 19:01 jimpete