diff --git a/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts b/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts index 636182e97e46f..4ef4a2c0ebb0f 100644 --- a/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts +++ b/x-pack/plugins/cloud_security_posture/common/schemas/csp_finding.ts @@ -12,8 +12,10 @@ import type { CspRuleMetadata } from './csp_rule_metadata'; export interface CspFinding { '@timestamp': string; cluster_id: string; - cluster?: { - name?: string; + orchestrator?: { + cluster?: { + name?: string; + }; }; result: CspFindingResult; resource: CspFindingResource; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts index 03767f366246c..2b288d6e696e8 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts @@ -18,7 +18,11 @@ const mockClusterBuckets: ClusterBucket[] = [ _id: '123', _index: '123', _source: { - cluster: { name: 'cluster_name' }, + orchestrator: { + cluster: { + name: 'cluster_name', + }, + }, rule: { benchmark: { name: 'CIS Kubernetes', id: 'cis_k8s' } }, '@timestamp': '123', }, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts index d768d65ac32c7..388672f25409d 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts @@ -71,7 +71,7 @@ export const getClustersFromAggs = (clusters: ClusterBucket[]): ClusterWithoutTr const meta = { clusterId: cluster.key, - clusterName: latestFindingHit._source.cluster?.name, + clusterName: latestFindingHit._source.orchestrator?.cluster?.name, benchmarkName: latestFindingHit._source.rule.benchmark.name, benchmarkId: latestFindingHit._source.rule.benchmark.id, lastUpdate: latestFindingHit._source['@timestamp'],