forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cloud Security][Benchmark] Benchmark Page Improvement Phase I (elast…
…ic#171703) ## Summary This PR is for Benchmark Page Improvements <img width="1427" alt="Screenshot 2023-11-24 at 1 57 55 PM" src="https://github.com/elastic/kibana/assets/8703149/5b6dcfa5-399e-4ba4-a585-50f7dc94d33b"> --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Kfir Peled <[email protected]>
- Loading branch information
1 parent
9e140d1
commit 780ca37
Showing
30 changed files
with
869 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
// Optionally, re-export the entire set of types. Interfaces and types declared after this will override v1 declarations. | ||
import { schema } from '@kbn/config-schema'; | ||
import type { BenchmarkScore } from './v1'; | ||
|
||
export type { BenchmarkScore } from './v1'; | ||
|
||
export type BenchmarksCisId = 'cis_k8s' | 'cis_azure' | 'cis_aws' | 'cis_eks' | 'cis_gcp'; | ||
|
||
export interface Benchmark { | ||
id: BenchmarksCisId; | ||
name: string; | ||
version: string; | ||
score: BenchmarkScore; | ||
evaluation: number; | ||
} | ||
|
||
export interface GetBenchmarkResponse { | ||
items: Benchmark[]; | ||
} | ||
|
||
export const benchmarkResponseSchema = schema.object({ | ||
items: schema.arrayOf( | ||
schema.object({ | ||
id: schema.oneOf([ | ||
schema.literal('cis_k8s'), | ||
schema.literal('cis_azure'), | ||
schema.literal('cis_aws'), | ||
schema.literal('cis_eks'), | ||
schema.literal('cis_gcp'), | ||
]), | ||
name: schema.string(), | ||
version: schema.string(), | ||
score: schema.object({ | ||
postureScore: schema.number({ defaultValue: 0, min: 0 }), | ||
resourcesEvaluated: schema.number({ defaultValue: 0, min: 0 }), | ||
totalFailed: schema.number({ defaultValue: 0, min: 0 }), | ||
totalFindings: schema.number({ defaultValue: 0, min: 0 }), | ||
totalPassed: schema.number({ defaultValue: 0, min: 0 }), | ||
}), | ||
evaluation: schema.number({ defaultValue: 0, min: 0 }), | ||
}) | ||
), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*/ | ||
|
||
export * from './rules/v3'; | ||
export * from './benchmarks/v2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.