Skip to content

Commit

Permalink
[util/dex] Add security logging
Browse files Browse the repository at this point in the history
Signed-off-by: xin.li <xin.li@daocloud.io>
  • Loading branch information
my-git9 committed Sep 30, 2022
1 parent a23bfc3 commit 862349f
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 862349f

Please sign in to comment.