diff --git a/lib/auth/auth_with_roles.go b/lib/auth/auth_with_roles.go index 66d1eb1104a58..f7c6c2cfe9468 100644 --- a/lib/auth/auth_with_roles.go +++ b/lib/auth/auth_with_roles.go @@ -1289,7 +1289,9 @@ var ( func (a *ServerWithRoles) checkKindAccess(kind string) error { if _, ok := supportedUnifiedResourceKinds[kind]; !ok { - return trace.BadParameter("unsupported kind %q requested", kind) + // Treat unknown kinds as an access denied error instead of a bad parameter + // to prevent rejecting the request if users have access to other kinds requested. + return trace.AccessDenied("unsupported kind %q requested", kind) } switch kind { case types.KindNode: