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

[Security Solution] Fix Threat Match rules inability to upgrade #203366

Merged
merged 3 commits into from
Dec 10, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
HistoryWindowStart,
InvestigationFields,
InvestigationGuide,
KqlQueryLanguage,
MachineLearningJobId,
MaxSignals,
NewTermsFields,
Expand Down Expand Up @@ -131,7 +130,6 @@ export const DiffableThreatMatchFields = z.object({
threat_mapping: ThreatMapping,
data_source: RuleDataSource.optional(), // NOTE: new field
threat_indicator_path: ThreatIndicatorPath.optional(),
threat_language: KqlQueryLanguage.optional(),
alert_suppression: AlertSuppression.optional(),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ const extractDiffableThreatMatchFieldsFromRuleObject = (
threat_index: rule.threat_index,
threat_mapping: rule.threat_mapping,
threat_indicator_path: rule.threat_indicator_path,
threat_language: rule.threat_language,
alert_suppression: rule.alert_suppression,
};
};
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { ThreatQueryReadOnly } from './fields/threat_query/threat_query';
import { TypeReadOnly } from './fields/type/type';
import { AlertSuppressionReadOnly } from './fields/alert_suppression/alert_suppression';
import { assertUnreachable } from '../../../../../../../common/utility_types';
import { ThreatLanguageReadOnly } from './fields/threat_language/threat_language';

interface ThreatMatchRuleFieldReadOnlyProps {
fieldName: keyof DiffableThreatMatchFields;
Expand Down Expand Up @@ -53,8 +52,6 @@ export function ThreatMatchRuleFieldReadOnly({
threatIndicatorPath={finalDiffableRule.threat_indicator_path}
/>
);
case 'threat_language':
return <ThreatLanguageReadOnly threatLanguage={finalDiffableRule.threat_language} />;
case 'threat_mapping':
return <ThreatMappingReadOnly threatMapping={finalDiffableRule.threat_mapping} />;
case 'threat_query':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ const SUBFIELD_MAPPING: Record<string, string> = {
tiebreaker_field: 'tiebreaker_field',
timestamp_field: 'timestamp_field',
building_block_type: 'type',
threat_query: 'query',
threat_language: 'language',
threat_filters: 'filters',
rule_name_override: 'field_name',
timestamp_override: 'field_name',
timestamp_override_fallback_disabled: 'fallback_disabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ const threatMatchFieldsDiffAlgorithms: FieldsDiffAlgorithmsFor<DiffableThreatMat
threat_index: scalarArrayDiffAlgorithm,
threat_mapping: simpleDiffAlgorithm,
threat_indicator_path: singleLineStringDiffAlgorithm,
threat_language: simpleDiffAlgorithm,
alert_suppression: simpleDiffAlgorithm,
};

Expand Down
Loading