diff --git a/x-pack/plugins/fleet/common/types/models/epm.ts b/x-pack/plugins/fleet/common/types/models/epm.ts index 68f5744089a19e..b31be52468ea42 100644 --- a/x-pack/plugins/fleet/common/types/models/epm.ts +++ b/x-pack/plugins/fleet/common/types/models/epm.ts @@ -36,7 +36,11 @@ export type EpmPackageInstallStatus = 'installed' | 'installing'; export type DetailViewPanelName = 'overview' | 'policies' | 'settings' | 'custom'; export type ServiceName = 'kibana' | 'elasticsearch'; export type AgentAssetType = typeof agentAssetTypes; -export type AssetType = KibanaAssetType | ElasticsearchAssetType | ValueOf | 'rules'; +export type AssetType = + | KibanaAssetType + | ElasticsearchAssetType + | ValueOf + | 'rules'; /* Enum mapping of a saved object asset type to how it would appear in a package file path (snake cased) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/epm/constants.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/epm/constants.tsx index 652b48237e6141..79264c4431c157 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/epm/constants.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/epm/constants.tsx @@ -31,7 +31,7 @@ export const AssetTitleMap: Record = { map: 'Map', data_stream_ilm_policy: 'Data Stream ILM Policy', lens: 'Lens', - rules: 'Detection Rules' + rules: 'Detection Rules', }; export const ServiceTitleMap: Record = { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/__mocks__/api.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/__mocks__/api.ts index 4d01d51af4e492..3b4c3d12b255ef 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/__mocks__/api.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/__mocks__/api.ts @@ -40,6 +40,7 @@ export const getPrePackagedRulesStatus = async ({ rules_installed: 12, rules_not_installed: 0, rules_not_updated: 0, + rules_package_version: null, timelines_installed: 0, timelines_not_installed: 0, timelines_not_updated: 0, diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts index e06e86b9d28d08..fa92d0a3fed4f4 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts @@ -251,10 +251,10 @@ export const duplicateRules = async ({ rules }: DuplicateRulesProps): Promise ({ to: 'now', }, packagerTaskInterval: '60s', + usePackageRegistryRules: false, validateArtifactDownloads: true, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts index cd5c85ca274c64..ca75675e2c9ee2 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts @@ -80,7 +80,7 @@ export const addPrepackedRulesRoute = ( frameworkRequest, config.maxTimelineImportExportSize, undefined, - request.body.rules_package_version + request.body?.rules_package_version || undefined ); return response.ok({ body: validated ?? {} }); } catch (err) { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_prepackaged_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_prepackaged_rules.ts index 6b224bbb08459a..854da3b8f6385e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_prepackaged_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_prepackaged_rules.ts @@ -130,7 +130,7 @@ export const checkAndStageUpdate = async () => { } try { - const registryPackage = await fetchFindLatestPackage(DetectionRulesPackageName); + const registryPackage = await fetchFindLatestPackage(DETECTION_RULES_PACKAGE_NAME); if (!latestRulesPackageVersion || registryPackage.version !== latestRulesPackageVersion) { // automatically download and cache the latest in memory const downloaded = await getPackageRegistryRules(registryPackage.version);