Skip to content

Commit

Permalink
feat(security): log user when access is blocked (argoproj#16558)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
  • Loading branch information
crenshaw-dev authored and Julien Fuix committed Feb 6, 2024
1 parent a750c4d commit cee46b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ func NewServer(
// If the user does provide a "project," we can respond more specifically. If the user does not have access to the given
// app name in the given project, we return "permission denied." If the app exists, but the project is different from
func (s *Server) getAppEnforceRBAC(ctx context.Context, action, project, namespace, name string, getApp func() (*appv1.Application, error)) (*appv1.Application, error) {
user := session.Username(ctx)
if user == "" {
user = "Unknown user"
}
logCtx := log.WithFields(map[string]interface{}{
"user": user,
"application": name,
"namespace": namespace,
})
Expand Down

0 comments on commit cee46b0

Please sign in to comment.