From 2a428b4e06efa9291b1ac67d86be6a86cd1284b3 Mon Sep 17 00:00:00 2001
From: Ido Cohen <90558359+CohenIdo@users.noreply.github.com>
Date: Sun, 22 Sep 2024 17:31:13 +0300
Subject: [PATCH] [Cloud Security] Populate Missing Vulnerability Scores in
Vulnerabilities Flyout
---
.../output/kibana.serverless.staging.yaml | 128 ++++++++++++++++--
oas_docs/output/kibana.serverless.yaml | 89 ++++++++++++
oas_docs/output/kibana.staging.yaml | 128 ++++++++++++++++--
oas_docs/output/kibana.yaml | 89 ++++++++++++
.../pages/vulnerabilities/test_subjects.ts | 1 +
.../vulnerability_finding_flyout.test.tsx | 3 +
.../vulnerability_overview_tab.tsx | 9 +-
7 files changed, 419 insertions(+), 28 deletions(-)
diff --git a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml
index b7ba3491c241c..15790040e6a46 100644
--- a/oas_docs/output/kibana.serverless.staging.yaml
+++ b/oas_docs/output/kibana.serverless.staging.yaml
@@ -5404,7 +5404,7 @@ paths:
- APM annotations
/api/asset_criticality:
delete:
- description: Delete the asset criticality record for a specific asset if it exists.
+ description: Delete the asset criticality record for a specific entity.
operationId: DeleteAssetCriticalityRecord
parameters:
- description: The ID value of the asset.
@@ -5450,11 +5450,11 @@ paths:
description: Successful response
'400':
description: Invalid request
- summary: Delete Criticality Record
+ summary: Delete an asset criticality record
tags:
- Security Solution Entity Analytics API
get:
- description: Get the criticality record for a specific asset.
+ description: Get the asset criticality record for a specific entity.
operationId: GetAssetCriticalityRecord
parameters:
- description: The ID value of the asset.
@@ -5483,11 +5483,17 @@ paths:
description: Invalid request
'404':
description: Criticality record not found
- summary: Get Criticality Record
+ summary: Get an asset criticality record
tags:
- Security Solution Entity Analytics API
post:
- description: Create or update a criticality record for a specific asset.
+ description: >
+ Create or update an asset criticality record for a specific entity.
+
+
+ If a record already exists for the specified entity, that record is
+ overwritten with the specified value. If a record doesn't exist for the
+ specified entity, a new record is created.
operationId: CreateAssetCriticalityRecord
requestBody:
content:
@@ -5516,14 +5522,19 @@ paths:
description: Successful response
'400':
description: Invalid request
- summary: Upsert Criticality Record
+ summary: Upsert an asset criticality record
tags:
- Security Solution Entity Analytics API
/api/asset_criticality/bulk:
post:
- description: >-
- Bulk upsert up to 1000 asset criticality records, creating or updating
- them as needed.
+ description: >
+ Bulk upsert up to 1000 asset criticality records.
+
+
+ If asset criticality records already exist for the specified entities,
+ those records are overwritten with the specified values. If asset
+ criticality records don't exist for the specified entities, new records
+ are created.
operationId: BulkUpsertAssetCriticalityRecords
requestBody:
content:
@@ -5577,7 +5588,7 @@ paths:
description: Bulk upload successful
'413':
description: File too large
- summary: Bulk Upsert Asset Criticality Records
+ summary: Bulk upsert asset criticality records
tags:
- Security Solution Entity Analytics API
/api/asset_criticality/list:
@@ -5654,7 +5665,7 @@ paths:
- per_page
- total
description: Bulk upload successful
- summary: List Asset Criticality Records
+ summary: List asset criticality records
tags:
- Security Solution Entity Analytics API
/api/data_views:
@@ -15598,6 +15609,10 @@ paths:
- access:securitySolution
/api/risk_score/engine/schedule_now:
post:
+ description: >-
+ Schedule the risk scoring engine to run as soon as possible. You can use
+ this to recalculate entity risk scores after updating their asset
+ criticality.
operationId: ScheduleRiskEngineNow
requestBody:
content:
@@ -15624,7 +15639,7 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_RiskEngineScheduleNowErrorResponse
description: Unexpected error
- summary: Schedule the risk engine to run as soon as possible
+ summary: Run the risk scoring engine
tags:
- Security Solution Entity Analytics API
/api/saved_objects/_export:
@@ -19968,6 +19983,25 @@ components:
collection will be disabled
nullable: true
type: boolean
+ monitoring_diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
monitoring_enabled:
items:
enum:
@@ -19975,9 +20009,22 @@ components:
- logs
type: string
type: array
+ monitoring_http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
monitoring_output_id:
nullable: true
type: string
+ monitoring_pprof_enabled:
+ type: boolean
name:
type: string
namespace:
@@ -20449,6 +20496,63 @@ components:
type: string
inputs:
type: string
+ monitoring:
+ type: object
+ properties:
+ diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
+ enabled:
+ type: boolean
+ http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
+ logs:
+ type: boolean
+ metrics:
+ type: boolean
+ namespace:
+ type: string
+ pprof:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - enabled
+ traces:
+ type: boolean
+ use_output:
+ type: string
+ required:
+ - enabled
+ - metrics
+ - logs
+ - traces
output_permissions:
additionalProperties:
type: object
diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml
index 7a7079c9b99c7..ba913ee77b54b 100644
--- a/oas_docs/output/kibana.serverless.yaml
+++ b/oas_docs/output/kibana.serverless.yaml
@@ -12634,6 +12634,25 @@ components:
collection will be disabled
nullable: true
type: boolean
+ monitoring_diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
monitoring_enabled:
items:
enum:
@@ -12641,9 +12660,22 @@ components:
- logs
type: string
type: array
+ monitoring_http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
monitoring_output_id:
nullable: true
type: string
+ monitoring_pprof_enabled:
+ type: boolean
name:
type: string
namespace:
@@ -13115,6 +13147,63 @@ components:
type: string
inputs:
type: string
+ monitoring:
+ type: object
+ properties:
+ diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
+ enabled:
+ type: boolean
+ http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
+ logs:
+ type: boolean
+ metrics:
+ type: boolean
+ namespace:
+ type: string
+ pprof:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - enabled
+ traces:
+ type: boolean
+ use_output:
+ type: string
+ required:
+ - enabled
+ - metrics
+ - logs
+ - traces
output_permissions:
additionalProperties:
type: object
diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml
index 9651b3c9107ce..c2b530c0af263 100644
--- a/oas_docs/output/kibana.staging.yaml
+++ b/oas_docs/output/kibana.staging.yaml
@@ -6580,7 +6580,7 @@ paths:
- APM annotations
/api/asset_criticality:
delete:
- description: Delete the asset criticality record for a specific asset if it exists.
+ description: Delete the asset criticality record for a specific entity.
operationId: DeleteAssetCriticalityRecord
parameters:
- description: The ID value of the asset.
@@ -6626,11 +6626,11 @@ paths:
description: Successful response
'400':
description: Invalid request
- summary: Delete Criticality Record
+ summary: Delete an asset criticality record
tags:
- Security Solution Entity Analytics API
get:
- description: Get the criticality record for a specific asset.
+ description: Get the asset criticality record for a specific entity.
operationId: GetAssetCriticalityRecord
parameters:
- description: The ID value of the asset.
@@ -6659,11 +6659,17 @@ paths:
description: Invalid request
'404':
description: Criticality record not found
- summary: Get Criticality Record
+ summary: Get an asset criticality record
tags:
- Security Solution Entity Analytics API
post:
- description: Create or update a criticality record for a specific asset.
+ description: >
+ Create or update an asset criticality record for a specific entity.
+
+
+ If a record already exists for the specified entity, that record is
+ overwritten with the specified value. If a record doesn't exist for the
+ specified entity, a new record is created.
operationId: CreateAssetCriticalityRecord
requestBody:
content:
@@ -6692,14 +6698,19 @@ paths:
description: Successful response
'400':
description: Invalid request
- summary: Upsert Criticality Record
+ summary: Upsert an asset criticality record
tags:
- Security Solution Entity Analytics API
/api/asset_criticality/bulk:
post:
- description: >-
- Bulk upsert up to 1000 asset criticality records, creating or updating
- them as needed.
+ description: >
+ Bulk upsert up to 1000 asset criticality records.
+
+
+ If asset criticality records already exist for the specified entities,
+ those records are overwritten with the specified values. If asset
+ criticality records don't exist for the specified entities, new records
+ are created.
operationId: BulkUpsertAssetCriticalityRecords
requestBody:
content:
@@ -6753,7 +6764,7 @@ paths:
description: Bulk upload successful
'413':
description: File too large
- summary: Bulk Upsert Asset Criticality Records
+ summary: Bulk upsert asset criticality records
tags:
- Security Solution Entity Analytics API
/api/asset_criticality/list:
@@ -6830,7 +6841,7 @@ paths:
- per_page
- total
description: Bulk upload successful
- summary: List Asset Criticality Records
+ summary: List asset criticality records
tags:
- Security Solution Entity Analytics API
/api/cases:
@@ -19047,6 +19058,10 @@ paths:
- access:securitySolution
/api/risk_score/engine/schedule_now:
post:
+ description: >-
+ Schedule the risk scoring engine to run as soon as possible. You can use
+ this to recalculate entity risk scores after updating their asset
+ criticality.
operationId: ScheduleRiskEngineNow
requestBody:
content:
@@ -19073,7 +19088,7 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_RiskEngineScheduleNowErrorResponse
description: Unexpected error
- summary: Schedule the risk engine to run as soon as possible
+ summary: Run the risk scoring engine
tags:
- Security Solution Entity Analytics API
/api/saved_objects/_bulk_create:
@@ -27763,6 +27778,25 @@ components:
collection will be disabled
nullable: true
type: boolean
+ monitoring_diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
monitoring_enabled:
items:
enum:
@@ -27770,9 +27804,22 @@ components:
- logs
type: string
type: array
+ monitoring_http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
monitoring_output_id:
nullable: true
type: string
+ monitoring_pprof_enabled:
+ type: boolean
name:
type: string
namespace:
@@ -28244,6 +28291,63 @@ components:
type: string
inputs:
type: string
+ monitoring:
+ type: object
+ properties:
+ diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
+ enabled:
+ type: boolean
+ http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
+ logs:
+ type: boolean
+ metrics:
+ type: boolean
+ namespace:
+ type: string
+ pprof:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - enabled
+ traces:
+ type: boolean
+ use_output:
+ type: string
+ required:
+ - enabled
+ - metrics
+ - logs
+ - traces
output_permissions:
additionalProperties:
type: object
diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml
index 790e380ddd9b1..2f7ae5fd8b18b 100644
--- a/oas_docs/output/kibana.yaml
+++ b/oas_docs/output/kibana.yaml
@@ -19593,6 +19593,25 @@ components:
collection will be disabled
nullable: true
type: boolean
+ monitoring_diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
monitoring_enabled:
items:
enum:
@@ -19600,9 +19619,22 @@ components:
- logs
type: string
type: array
+ monitoring_http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
monitoring_output_id:
nullable: true
type: string
+ monitoring_pprof_enabled:
+ type: boolean
name:
type: string
namespace:
@@ -20074,6 +20106,63 @@ components:
type: string
inputs:
type: string
+ monitoring:
+ type: object
+ properties:
+ diagnostics:
+ type: object
+ properties:
+ limit:
+ type: object
+ properties:
+ burst:
+ type: number
+ interval:
+ type: string
+ uploader:
+ type: object
+ properties:
+ init_dur:
+ type: string
+ max_dur:
+ type: string
+ max_retries:
+ type: number
+ enabled:
+ type: boolean
+ http:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ host:
+ type: string
+ port:
+ type: number
+ required:
+ - enabled
+ logs:
+ type: boolean
+ metrics:
+ type: boolean
+ namespace:
+ type: string
+ pprof:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - enabled
+ traces:
+ type: boolean
+ use_output:
+ type: string
+ required:
+ - enabled
+ - metrics
+ - logs
+ - traces
output_permissions:
additionalProperties:
type: object
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts
index b1eddf50f7c14..6393bd8799683 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts
@@ -11,6 +11,7 @@ export const JSON_TAB_VULNERABILITY_FLYOUT = 'vulnerability_json_tab_flyout';
export const OVERVIEW_TAB_VULNERABILITY_FLYOUT = 'vulnerability_overview_tab_flyout';
export const DATA_SOURCE_VULNERABILITY_FLYOUT = 'vulnerability_flyout_data_source_display_box';
export const PUBLISHED_DATE_VULNERABILITY_FLYOUT = 'vulnerability_flyout_date_display_box';
+export const VULNERABILITY_SCORES_FLYOUT = 'vulnerability_flyout_score';
export const TAB_ID_VULNERABILITY_FLYOUT = (tabId: string) =>
`vulnerability-finding-flyout-tab-${tabId}`;
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx
index 081eff33c5c96..8f3f37390cfae 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx
@@ -17,6 +17,7 @@ import {
DATA_SOURCE_VULNERABILITY_FLYOUT,
FINDINGS_VULNERABILITY_FLYOUT_DESCRIPTION_LIST,
PUBLISHED_DATE_VULNERABILITY_FLYOUT,
+ VULNERABILITY_SCORES_FLYOUT,
} from '../test_subjects';
import { EMPTY_VALUE } from '../../configurations/findings_flyout/findings_flyout';
@@ -93,8 +94,10 @@ describe('', () => {
);
const dataSource = getByTestId(DATA_SOURCE_VULNERABILITY_FLYOUT);
const publisedDate = getByTestId(PUBLISHED_DATE_VULNERABILITY_FLYOUT);
+ const vulnerabilityScores = getByTestId(VULNERABILITY_SCORES_FLYOUT);
expect(dataSource.textContent).toEqual(`Data Source${EMPTY_VALUE}`);
expect(publisedDate.textContent).toEqual(`Published Date${EMPTY_VALUE}`);
+ expect(vulnerabilityScores.textContent).toEqual(`Vulnerability Scores${EMPTY_VALUE}`);
});
it('show empty state for no fixes', () => {
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx
index 9848bbd402e50..e25bbbf6c3111 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx
@@ -33,6 +33,7 @@ import {
DATA_SOURCE_VULNERABILITY_FLYOUT,
OVERVIEW_TAB_VULNERABILITY_FLYOUT,
PUBLISHED_DATE_VULNERABILITY_FLYOUT,
+ VULNERABILITY_SCORES_FLYOUT,
} from '../test_subjects';
import redhatLogo from '../../../assets/icons/redhat_logo.svg';
import { VulnerabilityDetectionRuleCounter } from './vulnerability_detection_rule_counter';
@@ -309,8 +310,8 @@ export const VulnerabilityOverviewTab = ({ vulnerabilityRecord }: VulnerabilityT
- {cvssScores?.length > 0 && (
-
+ {
+
- {cvssScores}
+ {!!cvssScores?.length ? cvssScores : EMPTY_VALUE}
- )}
+ }
);
};