diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts index 3e22fdea80666..0d605ba6edb74 100644 --- a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts @@ -7,8 +7,8 @@ import { euiThemeVars } from '@kbn/ui-theme'; export const statusColors = { - passed: euiThemeVars.euiColorSuccess, - failed: euiThemeVars.euiColorVis9, + passed: '#00bfb3', + failed: '#e7664c', unknown: euiThemeVars.euiColorLightShade, }; diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts index 54bcb357137b7..8ecb2b2a6fc03 100644 --- a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts @@ -5,33 +5,47 @@ * 2.0. */ -import { euiThemeVars } from '@kbn/ui-theme'; import type { VulnSeverity } from '@kbn/cloud-security-posture-common'; import { VULNERABILITIES_SEVERITY } from '@kbn/cloud-security-posture-common'; +const VULNERABILITY_SEVERITY_COLOR_PALETTE = { + critical: '#BD271E', + high: '#FF7E62', + medium: '#F1D86F', + low: '#54B399', + unknown: '#aaa', +}; + +const VULNERABILITY_SCORE_COLOR_PALETTE = { + critical: '#BD271E', + high: '#DA8B45', + medium: '#D6BF57', + low: '#54B399', +}; + export const getCvsScoreColor = (score: number): string | undefined => { if (score <= 4) { - return euiThemeVars.euiColorVis0; // low severity + return VULNERABILITY_SCORE_COLOR_PALETTE.low; } else if (score >= 4 && score <= 7) { - return euiThemeVars.euiColorVis7; // medium severity + return VULNERABILITY_SCORE_COLOR_PALETTE.medium; } else if (score >= 7 && score <= 9) { - return euiThemeVars.euiColorVis9; // high severity + return VULNERABILITY_SCORE_COLOR_PALETTE.high; } else if (score >= 9) { - return euiThemeVars.euiColorDanger; // critical severity + return VULNERABILITY_SCORE_COLOR_PALETTE.critical; } }; export const getSeverityStatusColor = (severity: VulnSeverity): string => { switch (severity) { case VULNERABILITIES_SEVERITY.LOW: - return euiThemeVars.euiColorVis0; + return VULNERABILITY_SEVERITY_COLOR_PALETTE.low; case VULNERABILITIES_SEVERITY.MEDIUM: - return euiThemeVars.euiColorVis5_behindText; + return VULNERABILITY_SEVERITY_COLOR_PALETTE.medium; case VULNERABILITIES_SEVERITY.HIGH: - return euiThemeVars.euiColorVis9_behindText; + return VULNERABILITY_SEVERITY_COLOR_PALETTE.high; case VULNERABILITIES_SEVERITY.CRITICAL: - return euiThemeVars.euiColorDanger; + return VULNERABILITY_SEVERITY_COLOR_PALETTE.critical; default: - return '#aaa'; + return VULNERABILITY_SEVERITY_COLOR_PALETTE.unknown; } };