[Cloud Posture] Adding cluster name to cluster card (#144667)

[Cloud security Posture] - Adding cluster name to cluster card
This commit is contained in:
ofiriro3 2022-11-07 11:59:22 +02:00 committed by GitHub
parent 3d82d7e338
commit f16c7d7140
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -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;

View file

@ -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',
},

View file

@ -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'],