Commit b32bbbd1 by Torkel Ödegaard

fix(influxdb): enforce database restriction, fixes #6352

parent 401c67d1
...@@ -95,6 +95,13 @@ func ProxyDataSourceRequest(c *middleware.Context) { ...@@ -95,6 +95,13 @@ func ProxyDataSourceRequest(c *middleware.Context) {
return return
} }
if ds.Type == m.DS_INFLUXDB {
if c.Query("db") != ds.Database {
c.JsonApiErr(403, "Datasource is not configured to allow this database", nil)
return
}
}
targetUrl, _ := url.Parse(ds.Url) targetUrl, _ := url.Parse(ds.Url)
if len(setting.DataProxyWhiteList) > 0 { if len(setting.DataProxyWhiteList) > 0 {
if _, exists := setting.DataProxyWhiteList[targetUrl.Host]; !exists { if _, exists := setting.DataProxyWhiteList[targetUrl.Host]; !exists {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment