Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Data source: Disabling "TLS Client Authentication" for Loki does NOT clear "ServerName" #120

Closed
remram44 opened this issue May 10, 2024 · 8 comments · Fixed by #121
Closed
Assignees
Labels
bug Something isn't working

Comments

@remram44
Copy link

What happened?

My data source stopped working when I changed URL, because it was expecting a different Server Name. I initially filed grafana/grafana#83844 but I know now the actual source.

When I unchecked "TLS Client Authentication" in the data source settings, it correctly cleared the client certificate and key from the configuration. But the ServerName stayed in the configuration, even though it is no longer visible anywhere in the Grafana settings page.

Because of that, when I later change my data source to a new URL, it wouldn't work because of that ServerName left over from long ago.

Screenshot_20240510_101517
Screenshot_20240510_101526

The only way to fix it is to enable "TLS Client Authentication" again (even though you don't need it), clear out the ServerName field that just appeared, and disable "TLS Client Authentication". That way the ServerName actually goes away.

What did you expect to happen?

If I disable an feature, making its configuration fields go away, those configuration fields don't remain set.

Did this work before?

Don't know

How do we reproduce it?

  1. Enable "TLS Client Authentication"
  2. Put in a ServerName, Client Certificate, and Client Key
  3. Observe that client auth is being sent and server certificate validation uses the ServerName
  4. Disable "TLS Client Authentication"
  5. See that the ServerName field is completely gone from the data source config page
  6. Observe that client auth is no longer being sent but server certificate validation still uses the previous ServerName

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 10.4.2
OS: Linux
Browser: Firefox

Grafana platform?

Docker

Datasource(s)?

Loki

@remram44
Copy link
Author

My recommendation would be to move the ServerName field outside of the "TLS Client Authentication" feature. It is unrelated anyway, and this way you only have to change the frontend.

@matyax
Copy link
Contributor

matyax commented Jun 3, 2024

@grafana/plugins-platform-frontend Could you please remind me if you currently maintain the configuration components?

@jackw
Copy link
Contributor

jackw commented Jun 4, 2024

@matyax I could be wrong but I'm under the impression that the Auth and the TLSClientAuth components are owned by @grafana/enterprise-datasources squad. 🤔

@matyax matyax transferred this issue from grafana/grafana Jun 4, 2024
@matyax matyax added the bug Something isn't working label Jun 4, 2024
@matyax
Copy link
Contributor

matyax commented Jun 4, 2024

This is a shared component for data source configuration. Transferring to the appropriate repo.

@cletter7
Copy link
Contributor

cletter7 commented Jun 4, 2024

I will look into it, thanks for reporting.

@cletter7
Copy link
Contributor

cletter7 commented Jun 12, 2024

@grafana/experimental version 1.7.12 has been released with the fix. Now we just need to bump the dependency version in grafana/grafana repo. Could someone do this?

@matyax
Copy link
Contributor

matyax commented Jun 12, 2024

I can do that.

@matyax
Copy link
Contributor

matyax commented Jun 12, 2024

grafana/grafana#89119

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants