Merge pull request #45112 from liggitt/quote-log-message

Automatic merge from submit-queue

Quote groups in deny log message

Helps distinguish cases where an external authenticator is incorrectly combining multiple groups into one.

Before:
> RBAC DENY: user "bob" groups [system:masters view system:authenticated] cannot "list" resource "pods" cluster-wide

After:
> RBAC DENY: user "bob" groups ["system:masters view" "system:authenticated"] cannot "list" resource "pods" cluster-wide
This commit is contained in:
Kubernetes Submit Queue 2017-04-28 19:18:22 -07:00 committed by GitHub
commit dc5744b6a1

View File

@ -111,7 +111,7 @@ func (r *RBACAuthorizer) Authorize(requestAttributes authorizer.Attributes) (boo
scope = "cluster-wide"
}
glog.Infof("RBAC DENY: user %q groups %v cannot %s %s", requestAttributes.GetUser().GetName(), requestAttributes.GetUser().GetGroups(), operation, scope)
glog.Infof("RBAC DENY: user %q groups %q cannot %s %s", requestAttributes.GetUser().GetName(), requestAttributes.GetUser().GetGroups(), operation, scope)
}
reason := ""