[9.0] [Authz]: added authorization opt-out reason for monitoring routes (#213884) (#214050)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Authz]: added authorization opt-out reason for monitoring routes
(#213884)](https://github.com/elastic/kibana/pull/213884)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-12T06:31:45Z","message":"[Authz]:
added authorization opt-out reason for monitoring routes (#213884)\n\n##
Summary\n\n Added authorization opt-out reason for monitoring
routes.\n\n\n### Checklist\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"78fb6883f102c09a63429507c67a810991d4a804","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Security/Authorization","backport:prev-minor","backport:version","Authz:
API migration","v9.1.0","v8.19.0"],"title":"[Authz]: added authorization
opt-out reason for monitoring
routes","number":213884,"url":"https://github.com/elastic/kibana/pull/213884","mergeCommit":{"message":"[Authz]:
added authorization opt-out reason for monitoring routes (#213884)\n\n##
Summary\n\n Added authorization opt-out reason for monitoring
routes.\n\n\n### Checklist\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"78fb6883f102c09a63429507c67a810991d4a804"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213884","number":213884,"mergeCommit":{"message":"[Authz]:
added authorization opt-out reason for monitoring routes (#213884)\n\n##
Summary\n\n Added authorization opt-out reason for monitoring
routes.\n\n\n### Checklist\n\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"78fb6883f102c09a63429507c67a810991d4a804"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2025-03-12 19:24:31 +11:00 committed by GitHub
parent 23c1e5cd0b
commit 46ef0fd07b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 234 additions and 0 deletions

View file

@ -27,6 +27,12 @@ export function registerV1HealthRoute(server: MonitoringCore) {
server.route({
method: 'get',
path: '/api/monitoring/v1/_health',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
query: validateQuery,
},

View file

@ -18,6 +18,12 @@ export function enableAlertsRoute(server: MonitoringCore, npRoute: RouteDependen
npRoute.router.post(
{
path: '/api/monitoring/v1/alerts/enable',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: false,
options: {
access: 'internal',

View file

@ -28,6 +28,12 @@ export function alertStatusRoute(npRoute: RouteDependencies) {
}),
}),
},
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
options: {
access: 'internal',
},

View file

@ -25,6 +25,12 @@ export function apmInstanceRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/apm/{apmUuid}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -23,6 +23,12 @@ export function apmInstancesRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/apm/instances',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -24,6 +24,12 @@ export function apmOverviewRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/apm',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -25,6 +25,12 @@ export function beatsDetailRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/beats/beat/{beatUuid}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -23,6 +23,12 @@ export function beatsListingRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/beats/beats',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -25,6 +25,12 @@ export function beatsOverviewRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/beats',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -20,6 +20,12 @@ export function checkAccessRoute(server: MonitoringCore) {
server.route({
method: 'get',
path: '/api/monitoring/v1/check_access',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {},
options: {
access: 'internal',

View file

@ -26,6 +26,12 @@ export function clusterRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -27,6 +27,12 @@ export function clustersRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
body: validateBody,
},

View file

@ -267,6 +267,12 @@ export function ccrRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch/ccr',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -91,6 +91,12 @@ export function ccrShardRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch/ccr/{index}/shard/{shardId}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -32,6 +32,12 @@ export function esIndexRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch/indices/{id}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -27,6 +27,12 @@ export function esIndicesRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch/indices',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
query: validateQuery,

View file

@ -25,6 +25,12 @@ export function mlJobRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch/ml_jobs',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -37,6 +37,12 @@ export function esNodeRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch/nodes/{nodeUuid}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -28,6 +28,12 @@ export function esNodesRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch/nodes',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -30,6 +30,12 @@ export function esOverviewRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/elasticsearch',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -17,6 +17,12 @@ export function clusterSettingsCheckRoute(server: MonitoringCore) {
server.route({
method: 'get',
path: '/api/monitoring/v1/elasticsearch_settings/check/cluster',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {},
options: {
access: 'internal',

View file

@ -83,6 +83,12 @@ export function internalMonitoringCheckRoute(server: MonitoringCore, npRoute: Ro
validate: {
body: validateBody,
},
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
options: {
access: 'internal',
},

View file

@ -17,6 +17,12 @@ export function nodesSettingsCheckRoute(server: MonitoringCore) {
server.route({
method: 'get',
path: '/api/monitoring/v1/elasticsearch_settings/check/nodes',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {},
options: {
access: 'internal',

View file

@ -17,6 +17,12 @@ export function setCollectionEnabledRoute(server: MonitoringCore) {
server.route({
method: 'put',
path: '/api/monitoring/v1/elasticsearch_settings/set/collection_enabled',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {},
options: {
access: 'internal',

View file

@ -17,6 +17,12 @@ export function setCollectionIntervalRoute(server: MonitoringCore) {
server.route({
method: 'put',
path: '/api/monitoring/v1/elasticsearch_settings/set/collection_interval',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {},
options: {
access: 'internal',

View file

@ -24,6 +24,12 @@ export function entSearchOverviewRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/enterprise_search',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -25,6 +25,12 @@ export function kibanaInstanceRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/kibana/{kibanaUuid}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -23,6 +23,12 @@ export function kibanaInstancesRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/kibana/instances',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -25,6 +25,12 @@ export function kibanaOverviewRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/kibana',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -30,6 +30,12 @@ export function logstashNodeRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/logstash/node/{logstashUuid}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -22,6 +22,12 @@ export function logstashNodesRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/logstash/nodes',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -24,6 +24,12 @@ export function logstashOverviewRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/logstash',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -30,6 +30,12 @@ export function logstashPipelineRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/logstash/pipeline/{pipelineId}/{pipelineHash?}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -21,6 +21,12 @@ export function logstashClusterPipelineIdsRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/logstash/pipeline_ids',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -31,6 +31,12 @@ export function logstashClusterPipelinesRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/logstash/pipelines',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -30,6 +30,12 @@ export function logstashNodePipelinesRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/clusters/{clusterUuid}/logstash/node/{logstashUuid}/pipelines',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
body: validateBody,

View file

@ -30,6 +30,12 @@ export function clusterSetupStatusRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/setup/collection/cluster/{clusterUuid?}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
query: validateQuery,

View file

@ -16,6 +16,12 @@ export function disableElasticsearchInternalCollectionRoute(server: MonitoringCo
server.route({
method: 'post',
path: '/api/monitoring/v1/setup/collection/{clusterUuid}/disable_internal_collection',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: createValidationFunction(postDisableInternalCollectionRequestParamsRT),
},

View file

@ -30,6 +30,12 @@ export function nodeSetupStatusRoute(server: MonitoringCore) {
server.route({
method: 'post',
path: '/api/monitoring/v1/setup/collection/node/{nodeUuid}',
security: {
authz: {
enabled: false,
reason: 'This route delegates authorization to the scoped ES cluster client',
},
},
validate: {
params: validateParams,
query: validateQuery,