Skip to content

Commit

Permalink
Fix fleet route protections (#85626)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
legrego and kibanamachine committed Dec 13, 2020
1 parent a2771a3 commit 668f4d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion x-pack/plugins/fleet/server/routes/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export function enforceSuperUser<T1, T2, T3>(
const security = appContextService.getSecurity();
const user = security.authc.getCurrentUser(req);
if (!user) {
return res.unauthorized();
return res.forbidden({
body: {
message:
'Access to Fleet API require the superuser role, and for stack security features to be enabled.',
},
});
}

const userRoles = user.roles || [];
Expand Down

0 comments on commit 668f4d5

Please sign in to comment.