Skip to content

Commit

Permalink
chore: Add security logging for Dex errors (argoproj#10455)
Browse files Browse the repository at this point in the history
Signed-off-by: xin.li <xin.li@daocloud.io>

Signed-off-by: xin.li <xin.li@daocloud.io>
  • Loading branch information
my-git9 authored and ashutosh16 committed Oct 7, 2022
1 parent cbcf796 commit 2e0850c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/dex/dex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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")))
Expand Down

0 comments on commit 2e0850c

Please sign in to comment.