From 862349f72155c876b50fe96dcbe34df2efc63d2a Mon Sep 17 00:00:00 2001 From: "xin.li" Date: Thu, 25 Aug 2022 22:23:15 +0800 Subject: [PATCH] [util/dex] Add security logging Signed-off-by: xin.li --- util/dex/dex.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/dex/dex.go b/util/dex/dex.go index 4b9cfbfc5ac72..4c71c87af2652 100644 --- a/util/dex/dex.go +++ b/util/dex/dex.go @@ -15,6 +15,7 @@ import ( log "github.com/sirupsen/logrus" + "github.com/argoproj/argo-cd/v2/common" "github.com/argoproj/argo-cd/v2/util/errors" ) @@ -83,7 +84,9 @@ func NewDexHTTPReverseProxy(serverAddr string, baseHRef string, tlsConfig *DexTL if err != nil { return err } - log.Errorf("received error from dex: %s", string(b)) + log.WithFields(log.Fields{ + common.SecurityField: common.SecurityMedium, + }).Errorf("received error from dex: %s", string(b)) resp.ContentLength = 0 resp.Header.Set("Content-Length", strconv.Itoa(0)) resp.Header.Set("Location", fmt.Sprintf("%s?has_sso_error=true", path.Join(baseHRef, "login")))