Skip to content

Commit

Permalink
[Cloud Security] [Alerts] Workflow enhancements for Alerts in Cloud S…
Browse files Browse the repository at this point in the history
…ecurity (#164902)

Co-authored-by: Maxim Kholod <[email protected]>
  • Loading branch information
opauloh and maxcold authored Sep 11, 2023
1 parent e72780a commit 5e12611
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/cloud_security_posture/public/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export interface RuleCreateProps {
description: string;
tags: string[];
max_signals: number;
investigation_fields?: {
field_names: string[];
};
note?: string;
}

export interface RuleResponse extends RuleCreateProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export const DetectionRuleCounter = ({ tags, createRuleFn }: DetectionRuleCounte
/>{' '}
<EuiLink onClick={rulePageNavigation}>
<FormattedMessage
id="xpack.csp.findingsFlyout.alerts.ruleCount"
defaultMessage="{ruleCount, plural, one {# rule} other {# rules}}"
id="xpack.csp.findingsFlyout.alerts.detectionRuleCount"
defaultMessage="{ruleCount, plural, one {# detection rule} other {# detection rules}}"
values={{ ruleCount: rulesData?.total || 0 }}
/>
</EuiLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const DEFAULT_RULE_LICENSE = 'Elastic License v2';
const DEFAULT_MAX_ALERTS_PER_RULE = 100;
const ALERT_SUPPRESSION_FIELD = 'resource.id';
const ALERT_TIMESTAMP_FIELD = 'event.ingested';
const DEFAULT_INVESTIGATION_FIELDS = {
field_names: ['resource.name', 'resource.id', 'resource.type', 'resource.sub_type'],
};

enum AlertSuppressionMissingFieldsStrategy {
// per each document a separate alert will be created
Expand Down Expand Up @@ -126,6 +129,8 @@ export const createDetectionRuleFromFinding = async (http: HttpSetup, finding: C
name: finding.rule.name,
description: finding.rule.rationale,
tags: generateFindingsTags(finding),
investigation_fields: DEFAULT_INVESTIGATION_FIELDS,
note: finding.rule.remediation,
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const DEFAULT_MAX_ALERTS_PER_RULE = 100;
const ALERT_SUPPRESSION_FIELD = 'resource.id';
const ALERT_TIMESTAMP_FIELD = 'event.ingested';
const ALERT_SEVERITY_MAP_FIELD = 'vulnerability.severity';
const DEFAULT_INVESTIGATION_FIELDS = {
field_names: ['resource.name', 'resource.id'],
};

enum RuleSeverityMapping {
Low = 'low',
Expand Down Expand Up @@ -145,6 +148,7 @@ export const createDetectionRuleFromVulnerabilityFinding = async (
name: getVulnerabilityRuleName(vulnerability),
description: vulnerability.description,
tags: generateVulnerabilitiesTags(vulnerability),
investigation_fields: DEFAULT_INVESTIGATION_FIELDS,
},
});
};

0 comments on commit 5e12611

Please sign in to comment.