mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-01 11:26:29 +02:00
authorize: only log headers if debug set (#940)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
c29807c391
commit
7dfa1d0a41
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/protobuf/ptypes"
|
"github.com/golang/protobuf/ptypes"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
|
||||||
"github.com/pomerium/pomerium/authorize/evaluator"
|
"github.com/pomerium/pomerium/authorize/evaluator"
|
||||||
"github.com/pomerium/pomerium/internal/grpc/databroker"
|
"github.com/pomerium/pomerium/internal/grpc/databroker"
|
||||||
|
@ -277,7 +278,6 @@ func logAuthorizeCheck(
|
||||||
evt = evt.Str("request-id", requestid.FromContext(ctx))
|
evt = evt.Str("request-id", requestid.FromContext(ctx))
|
||||||
evt = evt.Str("check-request-id", hdrs["X-Request-Id"])
|
evt = evt.Str("check-request-id", hdrs["X-Request-Id"])
|
||||||
evt = evt.Str("method", hattrs.GetMethod())
|
evt = evt.Str("method", hattrs.GetMethod())
|
||||||
evt = evt.Interface("headers", hdrs)
|
|
||||||
evt = evt.Str("path", hattrs.GetPath())
|
evt = evt.Str("path", hattrs.GetPath())
|
||||||
evt = evt.Str("host", hattrs.GetHost())
|
evt = evt.Str("host", hattrs.GetHost())
|
||||||
evt = evt.Str("query", hattrs.GetQuery())
|
evt = evt.Str("query", hattrs.GetQuery())
|
||||||
|
@ -287,5 +287,11 @@ func logAuthorizeCheck(
|
||||||
evt = evt.Int("status", reply.Status)
|
evt = evt.Int("status", reply.Status)
|
||||||
evt = evt.Str("message", reply.Message)
|
evt = evt.Str("message", reply.Message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// potentially sensitive, only log if debug mode
|
||||||
|
if zerolog.GlobalLevel() <= zerolog.DebugLevel {
|
||||||
|
evt = evt.Interface("headers", hdrs)
|
||||||
|
}
|
||||||
|
|
||||||
evt.Msg("authorize check")
|
evt.Msg("authorize check")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue