diff --git a/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts b/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts index 95e1770826d6f..a128d14314052 100644 --- a/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts +++ b/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts @@ -36,6 +36,13 @@ export function registerDynamicRoute({ router.get( { path: `${MONITORING_COLLECTION_BASE_PATH}/{type}`, + security: { + authz: { + enabled: false, + reason: + 'This route is opted out from authorization because it is only retrieving the ES cluster UUID', + }, + }, options: { access: 'internal', authRequired: true, diff --git a/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/prometheus/get_metrics.ts b/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/prometheus/get_metrics.ts index 6977be155a4fb..ccc8465917679 100644 --- a/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/prometheus/get_metrics.ts +++ b/x-pack/platform/plugins/private/monitoring_collection/server/routes/api/v1/prometheus/get_metrics.ts @@ -20,6 +20,13 @@ export function registerV1PrometheusRoute({ router.get( { path: PROMETHEUS_PATH, + security: { + authz: { + enabled: false, + reason: + 'This route is opted out from authorization because it is not interacting with ES at all', + }, + }, options: { authRequired: true, tags: ['api'], // ensures that unauthenticated calls receive a 401 rather than a 302 redirect to login page