diff --git a/pkg/api/dataproxy.go b/pkg/api/dataproxy.go index 66d654d4d93..97f2529c781 100644 --- a/pkg/api/dataproxy.go +++ b/pkg/api/dataproxy.go @@ -104,6 +104,22 @@ func ProxyDataSourceRequest(c *middleware.Context) { } proxyPath := c.Params("*") + + if ds.Type == m.DS_ES { + if c.Req.Request.Method == "DELETE" { + c.JsonApiErr(403, "Deletes not allowed on proxied Elasticsearch datasource", nil) + return + } + if c.Req.Request.Method == "PUT" { + c.JsonApiErr(403, "Puts not allowed on proxied Elasticsearch datasource", nil) + return + } + if c.Req.Request.Method == "POST" && proxyPath != "_msearch" { + c.JsonApiErr(403, "Posts not allowed on proxied Elasticsearch datasource except on /_msearch", nil) + return + } + } + proxy := NewReverseProxy(ds, proxyPath, targetUrl) proxy.Transport = dataProxyTransport proxy.ServeHTTP(c.Resp, c.Req.Request) diff --git a/public/app/features/alerting/alert_tab_ctrl.ts b/public/app/features/alerting/alert_tab_ctrl.ts index 62ac4c00e46..c3507208975 100644 --- a/public/app/features/alerting/alert_tab_ctrl.ts +++ b/public/app/features/alerting/alert_tab_ctrl.ts @@ -128,7 +128,11 @@ export class AlertTabCtrl { return; } - this.alertNotifications.push({name: model.name, iconClass: this.getNotificationIcon(model.type)}); + this.alertNotifications.push({ + name: model.name, + iconClass: this.getNotificationIcon(model.type), + isDefault: false + }); this.alert.notifications.push({id: model.id}); // reset plus button