diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx index e6ac30f15c5b0..9459953b6d1d0 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx @@ -30,6 +30,7 @@ import { SecurityCellActionType, } from '../../../common/components/cell_actions'; import { FormattedRelativePreferenceDate } from '../../../common/components/formatted_date'; +import { formatRiskScore } from '../../common'; type HostRiskScoreColumns = Array>; @@ -128,7 +129,7 @@ export const getRiskScoreColumns = ( if (riskScore != null) { return ( - {Math.round(riskScore)} + {formatRiskScore(riskScore)} ); } diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx index e603c95b6604a..1da79d3d2cd0e 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx @@ -21,6 +21,7 @@ import { type CriticalityLevels } from '../../../../../common/constants'; import { ENTITIES_LIST_TABLE_ID } from '../constants'; import { isUserEntity, sourceFieldToText } from '../helpers'; import { CRITICALITY_LEVEL_TITLE } from '../../asset_criticality/translations'; +import { formatRiskScore } from '../../../common'; export type EntitiesListColumns = [ Columns, @@ -149,7 +150,7 @@ export const useEntitiesListColumns = (): EntitiesListColumns => { if (riskScore != null) { return ( - {Math.round(riskScore)} + {formatRiskScore(riskScore)} ); } diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx index e1509a03a9a90..ac85589736336 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx @@ -23,6 +23,7 @@ import { RiskScoreLevel } from '../severity/common'; import { ENTITY_RISK_LEVEL } from '../risk_score/translations'; import { CELL_ACTIONS_TELEMETRY } from '../risk_score/constants'; import { FormattedRelativePreferenceDate } from '../../../common/components/formatted_date'; +import { formatRiskScore } from '../../common'; export const getHostRiskScoreColumns = ({ dispatchSeverityUpdate, @@ -82,7 +83,7 @@ export const getHostRiskScoreColumns = ({ if (riskScore != null) { return ( - {Math.round(riskScore)} + {formatRiskScore(riskScore)} ); } diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx index 49eaf7b3cc26b..0cb7960ecabba 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx @@ -24,6 +24,7 @@ import { UsersTableType } from '../../../explore/users/store/model'; import { ENTITY_RISK_LEVEL } from '../risk_score/translations'; import { CELL_ACTIONS_TELEMETRY } from '../risk_score/constants'; import { FormattedRelativePreferenceDate } from '../../../common/components/formatted_date'; +import { formatRiskScore } from '../../common'; export const getUserRiskScoreColumns = ({ dispatchSeverityUpdate, @@ -85,7 +86,7 @@ export const getUserRiskScoreColumns = ({ if (riskScore != null) { return ( - {Math.round(riskScore)} + {formatRiskScore(riskScore)} ); } diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/host_risk_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/host_risk_tab.cy.ts index 2f1b4d4e9eb91..3123bd30cb450 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/host_risk_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/host_risk_tab.cy.ts @@ -46,7 +46,7 @@ describe('risk tab', { tags: ['@ess'] }, () => { kqlSearch('host.name: "siem-kibana" {enter}'); cy.get(HOST_BY_RISK_TABLE_CELL).eq(4).should('have.text', 'siem-kibana'); cy.get(HOST_BY_RISK_TABLE_CELL).eq(5).should('have.text', 'Mar 10, 2021 @ 14:51:05.766'); - cy.get(HOST_BY_RISK_TABLE_CELL).eq(6).should('have.text', '21'); + cy.get(HOST_BY_RISK_TABLE_CELL).eq(6).should('have.text', '21.00'); cy.get(HOST_BY_RISK_TABLE_CELL).eq(7).should('have.text', 'Low'); }); @@ -93,7 +93,7 @@ describe('risk tab', { tags: ['@ess'] }, () => { kqlSearch('host.name: "siem-kibana" {enter}'); cy.get(HOST_BY_RISK_TABLE_CELL).eq(4).should('have.text', 'siem-kibana'); cy.get(HOST_BY_RISK_TABLE_CELL).eq(5).should('have.text', 'Mar 10, 2021 @ 14:51:05.766'); - cy.get(HOST_BY_RISK_TABLE_CELL).eq(6).should('have.text', '90'); + cy.get(HOST_BY_RISK_TABLE_CELL).eq(6).should('have.text', '90.00'); cy.get(HOST_BY_RISK_TABLE_CELL).eq(7).should('have.text', 'Critical'); });