From 528a61b86b29f8fa9f38901dcda4b52967948611 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Fri, 17 Jul 2020 20:56:06 +0900 Subject: [PATCH] Alerting: Store sensitive settings encrypted for alertmanager notifier (#26318) Ref #25967 --- .../alerting/notifiers/alertmanager.go | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pkg/services/alerting/notifiers/alertmanager.go b/pkg/services/alerting/notifiers/alertmanager.go index 8bedce02deb..fea254e3159 100644 --- a/pkg/services/alerting/notifiers/alertmanager.go +++ b/pkg/services/alerting/notifiers/alertmanager.go @@ -33,10 +33,21 @@ func init() { Basic Auth User -
- Basic Auth Password - -
+
+ Basic Auth Password +
+ + +
+
+ + reset +
+
`, Options: []alerting.NotifierOption{ @@ -80,7 +91,7 @@ func NewAlertmanagerNotifier(model *models.AlertNotification) (alerting.Notifier } } basicAuthUser := model.Settings.Get("basicAuthUser").MustString() - basicAuthPassword := model.Settings.Get("basicAuthPassword").MustString() + basicAuthPassword := model.DecryptedValue("basicAuthPassword", model.Settings.Get("basicAuthPassword").MustString()) return &AlertmanagerNotifier{ NotifierBase: NewNotifierBase(model),