diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts b/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts index a3c81fd1c87b8..f5f1ca1306232 100644 --- a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts +++ b/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts @@ -57,12 +57,6 @@ export const KqlQueryLanguageEnum = KqlQueryLanguage.enum; export type IsRuleImmutable = z.infer; export const IsRuleImmutable = z.boolean(); -/** - * The date and time that the external/prebuilt rule was last updated in its source repository. - */ -export type ExternalSourceUpdatedAt = z.infer; -export const ExternalSourceUpdatedAt = z.string().datetime(); - /** * Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value). */ @@ -84,7 +78,6 @@ export type ExternalRuleSource = z.infer; export const ExternalRuleSource = z.object({ type: z.literal('external'), is_customized: IsExternalRuleCustomized, - source_updated_at: ExternalSourceUpdatedAt.optional(), }); /** diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml b/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml index aa56be14120ec..9864ba4b160b3 100644 --- a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml +++ b/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml @@ -45,12 +45,6 @@ components: deprecated: true description: '[DEPRECATION WARNING TODO] - This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.' - ExternalSourceUpdatedAt: - type: string - format: date-time - example: '2021-08-31T00:00:00Z' - description: The date and time that the external/prebuilt rule was last updated in its source repository. - IsExternalRuleCustomized: type: boolean description: Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value). @@ -76,8 +70,6 @@ components: - external is_customized: $ref: '#/components/schemas/IsExternalRuleCustomized' - source_updated_at: - $ref: '#/components/schemas/ExternalSourceUpdatedAt' required: - type - is_customized diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml index 617e5e167c11f..9c404464889d8 100644 --- a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml @@ -2968,8 +2968,6 @@ components: properties: is_customized: $ref: '#/components/schemas/IsExternalRuleCustomized' - source_updated_at: - $ref: '#/components/schemas/ExternalSourceUpdatedAt' type: enum: - external @@ -2977,13 +2975,6 @@ components: required: - type - is_customized - ExternalSourceUpdatedAt: - description: >- - The date and time that the external/prebuilt rule was last updated in - its source repository. - example: '2021-08-31T00:00:00Z' - format: date-time - type: string FindRulesSortField: enum: - created_at diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml index 5c99a0676e615..587e33bfe708a 100644 --- a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml @@ -2242,8 +2242,6 @@ components: properties: is_customized: $ref: '#/components/schemas/IsExternalRuleCustomized' - source_updated_at: - $ref: '#/components/schemas/ExternalSourceUpdatedAt' type: enum: - external @@ -2251,13 +2249,6 @@ components: required: - type - is_customized - ExternalSourceUpdatedAt: - description: >- - The date and time that the external/prebuilt rule was last updated in - its source repository. - example: '2021-08-31T00:00:00Z' - format: date-time - type: string FindRulesSortField: enum: - created_at diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts index d154b4a440a6f..fa6c78bb7a8c1 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts @@ -72,7 +72,6 @@ function zodMaskFor() { * Big differences between this schema and RuleCreateProps: * - rule_id is a required field * - version is a required field - * - source_updated_at is a new, optional field in support of prebuilt rule customization * - some fields are omitted because they are not present in https://github.com/elastic/detection-rules */ export type PrebuiltRuleAsset = z.infer; @@ -82,6 +81,5 @@ export const PrebuiltRuleAsset = BaseCreateProps.omit(BASE_PROPS_REMOVED_FROM_PR z.object({ rule_id: RuleSignatureId, version: RuleVersion, - source_updated_at: z.string().datetime().optional(), }) ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.test.ts index 31a096b295561..02871be57bd1c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.test.ts @@ -21,7 +21,6 @@ const buildTestRuleAsset = (overrides?: Partial) => { return { rule_id: 'rule_id', version: 1, - source_updated_at: '2024-05-01', ...overrides, } as PrebuiltRuleAsset; }; @@ -76,7 +75,6 @@ describe('calculateRuleSourceFromAsset', () => { expect(result).toEqual({ type: 'external', - source_updated_at: '2024-05-01', is_customized: true, }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.ts index 5da267d8b289b..c60a694847583 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source_from_asset.ts @@ -40,6 +40,5 @@ export const calculateRuleSourceFromAsset = ({ return { type: 'external', is_customized: isCustomized, - source_updated_at: prebuiltRuleAsset.source_updated_at, }; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts index 8200834c98921..e96908d21206c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts @@ -21,7 +21,6 @@ const buildTestRuleAsset = (overrides?: Partial) => { return { rule_id: 'rule_id', version: 1, - source_updated_at: '2024-05-01', ...overrides, } as PrebuiltRuleAsset; }; @@ -64,7 +63,6 @@ describe('calculateRuleSourceForImport', () => { expect(result).toEqual({ type: 'external', - source_updated_at: '2024-05-01', isCustomized: true, }); });