diff --git a/x-pack/plugins/cloud_security_posture/common/constants.ts b/x-pack/plugins/cloud_security_posture/common/constants.ts index 770f4ef5d06e..5e56b1131f10 100644 --- a/x-pack/plugins/cloud_security_posture/common/constants.ts +++ b/x-pack/plugins/cloud_security_posture/common/constants.ts @@ -78,6 +78,8 @@ export const RULE_FAILED = `failed`; export const POSTURE_TYPE_ALL = 'all'; +export const CSPM_FINDINGS_STATS_INTERVAL = 5; + // A mapping of in-development features to their status. These features should be hidden from users but can be easily // activated via a simple code change in a single location. export const INTERNAL_FEATURE_FLAGS = { diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx index 01821e04403f..58c06b2d35e7 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx @@ -132,7 +132,7 @@ const CompactPercentageLabels = ({ ); -const NonCompactPercentageLabels = ({ +const PercentageLabels = ({ onEvalCounterClick, stats, }: { @@ -301,7 +301,7 @@ export const ComplianceScoreChart = ({ onEvalCounterClick={onEvalCounterClick} /> ) : ( - diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts index 150c531f4a1f..f0369dd3a562 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts @@ -7,10 +7,12 @@ import { ElasticsearchClient, Logger } from '@kbn/core/server'; import { calculatePostureScore } from '../../../common/utils/helpers'; -import { BENCHMARK_SCORE_INDEX_DEFAULT_NS } from '../../../common/constants'; +import { + BENCHMARK_SCORE_INDEX_DEFAULT_NS, + CSPM_FINDINGS_STATS_INTERVAL, +} from '../../../common/constants'; import type { PosturePolicyTemplate, Stats } from '../../../common/types_old'; import { toBenchmarkDocFieldKey } from '../../lib/mapping_field_util'; -import { CSPM_FINDINGS_STATS_INTERVAL } from '../../tasks/findings_stats_task'; interface FindingsDetails { total_findings: number; diff --git a/x-pack/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts b/x-pack/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts index c157e8081546..93886c8f8acc 100644 --- a/x-pack/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts +++ b/x-pack/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts @@ -19,6 +19,7 @@ import { getIdentifierRuntimeMapping } from '../../common/runtime_mappings/get_i import { FindingsStatsTaskResult, ScoreByPolicyTemplateBucket, VulnSeverityAggs } from './types'; import { BENCHMARK_SCORE_INDEX_DEFAULT_NS, + CSPM_FINDINGS_STATS_INTERVAL, LATEST_FINDINGS_INDEX_DEFAULT_NS, LATEST_VULNERABILITIES_INDEX_DEFAULT_NS, VULNERABILITIES_SEVERITY, @@ -36,7 +37,6 @@ import { toBenchmarkMappingFieldKey } from '../lib/mapping_field_util'; const CSPM_FINDINGS_STATS_TASK_ID = 'cloud_security_posture-findings_stats'; const CSPM_FINDINGS_STATS_TASK_TYPE = 'cloud_security_posture-stats_task'; -export const CSPM_FINDINGS_STATS_INTERVAL = 5; export async function scheduleFindingsStatsTask( taskManager: TaskManagerStartContract,