Skip to content

Commit

Permalink
feat(server): Write an audit log entry for SSO users (#5145)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec committed Feb 18, 2021
1 parent 2ab02d9 commit 633da25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/auth/gatekeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ func (s gatekeeper) getClients(ctx context.Context) (*servertypes.Clients, *type
}
return clients, claims, nil
} else {
// important! write an audit entry (i.e. log entry) so we know which user performed an operation
log.WithFields(log.Fields{"subject": claims.Subject}).Info("using the default service account for user")
return s.clients, claims, nil
}
default:
Expand Down Expand Up @@ -230,6 +232,7 @@ func (s *gatekeeper) rbacAuthorization(ctx context.Context, claims *types.Claims
return nil, err
}
claims.ServiceAccountName = serviceAccount.Name
// important! write an audit entry (i.e. log entry) so we know which user performed an operation
log.WithFields(log.Fields{"serviceAccount": serviceAccount.Name, "subject": claims.Subject}).Info("selected SSO RBAC service account for user")
return clients, nil
}
Expand Down

0 comments on commit 633da25

Please sign in to comment.