From 2a5af16f51432e0d8b9fe845a5082de3266604c5 Mon Sep 17 00:00:00 2001 From: "Eyo O. Eyo" <7893459+eokoneyo@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:51:15 +0100 Subject: [PATCH] [Authz] migration for sharedUX routes without access tags (#206308) ## Summary Relates to https://github.com/elastic/kibana-team/issues/1236, this PR tackles routes could not have been migrated automatically by the security team. Following the guidance provided in the aforementioned issue leveraging util provided by the security team have been employed to explain why the routes modified in this PR aren't requiring an specific kind of privilege. Co-authored-by: Elastic Machine --- .../favorites_server/src/favorites_routes.ts | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.ts index 512b2cbe1260e..38fed392c9372 100644 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.ts +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.ts @@ -90,8 +90,13 @@ export function registerFavoritesRoutes({ ) ), }, - // we don't protect the route with any access tags as - // we only give access to the current user's favorites ids + security: { + authz: { + enabled: false, + reason: + "we don't protect the route with any access tags as we only give access to the current user's favorites ids", + }, + }, }, async (requestHandlerContext, request, response) => { const coreRequestHandlerContext = await requestHandlerContext.core; @@ -148,8 +153,13 @@ export function registerFavoritesRoutes({ type: typeSchema, }), }, - // we don't protect the route with any access tags as - // we only give access to the current user's favorites ids + security: { + authz: { + enabled: false, + reason: + "we don't protect the route with any access tags as we only give access to the current user's favorites ids", + }, + }, }, async (requestHandlerContext, request, response) => { const coreRequestHandlerContext = await requestHandlerContext.core; @@ -187,8 +197,13 @@ export function registerFavoritesRoutes({ type: typeSchema, }), }, - // we don't protect the route with any access tags as - // we only give access to the current user's favorites ids + security: { + authz: { + enabled: false, + reason: + "we don't protect the route with any access tags as we only give access to the current user's favorites ids", + }, + }, }, async (requestHandlerContext, request, response) => { const coreRequestHandlerContext = await requestHandlerContext.core;