Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cloud Security] address pr nit comments #172853

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions x-pack/plugins/cloud_security_posture/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const CompactPercentageLabels = ({
</>
);

const NonCompactPercentageLabels = ({
const PercentageLabels = ({
onEvalCounterClick,
stats,
}: {
Expand Down Expand Up @@ -301,7 +301,7 @@ export const ComplianceScoreChart = ({
onEvalCounterClick={onEvalCounterClick}
/>
) : (
<NonCompactPercentageLabels
<PercentageLabels
stats={{ totalPassed: data.totalPassed, totalFailed: data.totalFailed }}
onEvalCounterClick={onEvalCounterClick}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Loading