From c40e421c0ca68049973182c11263237d9e99435e Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Wed, 2 Jul 2025 16:10:01 +0200 Subject: [PATCH] [Security Solution] Move license level independent tests to the common folder (#225495) **Relates to:** https://github.com/elastic/kibana/pull/219831 ## Summary This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e329206dae0e4ba76a5eebdd759dec6c8dd46f) # Conflicts: # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/revert_prebuilt_rules.ts --- .buildkite/ftr_security_stateful_configs.yml | 3 +- .../common/configs/ess_air_gapped.config.ts | 7 ++- .../ess_air_gapped_large_package.config.ts | 10 ++-- .../{import => }/fixtures/packages/README.md | 0 .../security_detection_engine-100.0.0.zip | Bin .../security_detection_engine-99.0.0.zip | Bin 0 -> 7948 bytes ...ecurity_detection_engine-99.0.1-beta.1.zip | Bin .../security_detection_engine-90.0.0.zip | Bin 7946 -> 0 bytes .../import/import_with_installing_package.ts | 10 ++-- .../prebuilt_rules/common/index.ts | 3 ++ .../install_prebuilt_rules/index.ts | 0 .../install_mocked_prebuilt_rule_assets.ts | 50 +++++++----------- .../air_gapped/index.ts | 3 +- .../air_gapped/install_bundled_package.ts | 0 .../install_large_bundled_package.ts | 0 .../air_gapped/prerelease_packages.ts | 15 ++++-- .../bootstrap_prebuilt_rules.ts | 0 .../prebuilt_rules_package/index.ts | 0 .../install_package_from_epr.ts | 0 .../prebuilt_rules_package/update_package.ts | 0 .../get_prebuilt_rule_base_version.ts | 0 .../revert_prebuilt_rules/index.ts | 0 .../revert_prebuilt_rules.ts | 50 +++++++----------- .../status/get_prebuilt_rules_status.ts | 0 .../status/index.ts | 0 .../legacy/get_prebuilt_timelines_status.ts | 0 .../customization_enabled/index.ts | 3 -- .../configs/ess_air_gapped.config.ts | 32 ----------- .../security_detection_engine-99.0.0.zip | Bin 20201 -> 0 bytes 29 files changed, 69 insertions(+), 117 deletions(-) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled/prebuilt_rules_package/air_gapped => common}/configs/ess_air_gapped_large_package.config.ts (83%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/{import => }/fixtures/packages/README.md (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled/prebuilt_rules_package/air_gapped => common}/fixtures/packages/large/security_detection_engine-100.0.0.zip (100%) create mode 100644 x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/fixtures/packages/security_detection_engine-99.0.0.zip rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled/prebuilt_rules_package/air_gapped => common}/fixtures/packages/security_detection_engine-99.0.1-beta.1.zip (100%) delete mode 100644 x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/import/fixtures/packages/security_detection_engine-90.0.0.zip rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/install_prebuilt_rules/index.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts (93%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/air_gapped/index.ts (83%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/air_gapped/install_bundled_package.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/air_gapped/install_large_bundled_package.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/air_gapped/prerelease_packages.ts (90%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/bootstrap_prebuilt_rules.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/index.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/install_package_from_epr.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/prebuilt_rules_package/update_package.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/revert_prebuilt_rules/get_prebuilt_rule_base_version.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/revert_prebuilt_rules/index.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/revert_prebuilt_rules/revert_prebuilt_rules.ts (91%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/status/get_prebuilt_rules_status.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/status/index.ts (100%) rename x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/{customization_enabled => common}/status/legacy/get_prebuilt_timelines_status.ts (100%) delete mode 100644 x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped.config.ts delete mode 100644 x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/fixtures/packages/security_detection_engine-99.0.0.zip diff --git a/.buildkite/ftr_security_stateful_configs.yml b/.buildkite/ftr_security_stateful_configs.yml index a9e5e6a889e82..b83da9c8a6b22 100644 --- a/.buildkite/ftr_security_stateful_configs.yml +++ b/.buildkite/ftr_security_stateful_configs.yml @@ -62,12 +62,11 @@ enabled: - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/basic_license_essentials_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_basic_license.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped.config.ts + - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped_large_package.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_disabled/configs/ess_basic_license.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/upgrade_prebuilt_rules/diffable_rule_fields/common_fields/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/upgrade_prebuilt_rules/diffable_rule_fields/type_specific_fields/configs/ess.config.ts - - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped_large_package.config.ts - - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/basic_license_essentials_tier/configs/ess.config.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped.config.ts index 52346ea21899e..c5b7a0134766b 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped.config.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped.config.ts @@ -10,7 +10,7 @@ import path from 'path'; const SECURITY_DETECTION_ENGINE_PACKAGES_PATH = path.join( path.dirname(__filename), - '../import/fixtures/packages' + '../fixtures/packages' ); export default async function ({ readConfigFile }: FtrConfigProviderContext) { @@ -20,7 +20,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { return { ...functionalConfig.getAll(), - testFiles: [require.resolve('../import/import_with_installing_package')], + testFiles: [ + require.resolve('../import/import_with_installing_package'), + require.resolve('../prebuilt_rules_package/air_gapped'), + ], kbnTestServer: { ...functionalConfig.get('kbnTestServer'), serverArgs: [ diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped_large_package.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped_large_package.config.ts similarity index 83% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped_large_package.config.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped_large_package.config.ts index 0e30ec5175923..417afdfa71e53 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped_large_package.config.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped_large_package.config.ts @@ -10,15 +10,19 @@ import path from 'path'; export const BUNDLED_PACKAGE_DIR = path.join( path.dirname(__filename), - './../fixtures/packages/large' + '../fixtures/packages/large' ); export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../../../configs/ess.config')); + const functionalConfig = await readConfigFile( + require.resolve('../../../../../../config/ess/config.base.basic') + ); return { ...functionalConfig.getAll(), - testFiles: [require.resolve('../install_large_bundled_package')], + testFiles: [ + require.resolve('../prebuilt_rules_package/air_gapped/install_large_bundled_package'), + ], kbnTestServer: { ...functionalConfig.get('kbnTestServer'), serverArgs: [ diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/import/fixtures/packages/README.md b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/fixtures/packages/README.md similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/import/fixtures/packages/README.md rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/fixtures/packages/README.md diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/fixtures/packages/large/security_detection_engine-100.0.0.zip b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/fixtures/packages/large/security_detection_engine-100.0.0.zip similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/fixtures/packages/large/security_detection_engine-100.0.0.zip rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/fixtures/packages/large/security_detection_engine-100.0.0.zip diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/fixtures/packages/security_detection_engine-99.0.0.zip b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/fixtures/packages/security_detection_engine-99.0.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..99cff031837c3b6e63a8737722f51ab58bca8ab1 GIT binary patch literal 7948 zcmb`M1ys~qx4;K!5b5p?8B)4KQicZU?ijiyq((xzO9bhVR8l~?6a>kkB&9(FLG%rJ zuX3;6`|-W^X4aYc&sww2Z|{Bf+2`!NRTSY7&;S>&V66e&Zx4TbPy@&St`=tQE;er7 zM&=f77G`cXU`HbhM=Kjg3!s1i8wVQ)yQT&z0KQ&I-uhy=d!Ym15RTvg00cbPBq~3q zj{e)!OjnuO&c@Wl(d0X!4>tS7_(wwA-w3?_1>uL1F7Eag-+3c2*23?37n-2}rh}$+ z(-aq;@4fbWXLo*y2l+|kA9VUeWlW8BZVofQkhx(TLDp&{Pa(oZ86R!O)etxhag zdW(WYYA~&M-XMHDQ+ly6MYqhvrecM(H@b+YaQ;Gu{B(c$iTj6R6X}&hx9rRCJw(57rSFEHfEnKKScu{S%siJ}wA?Ftrkj>q% z*fS0I0EM1jjY5b-O9wDvkY7hwB_XI^I9bFjtG8P%q*^N`Vf#K=Zn)=nA%0R=h-xQLK!zD=bI+E_c8N#*(qPsO}XJ|IP47c-~DRap)@7e3=XWY-B0*J2~sn` z5^}~-m1!SG)9T-BP{x`Bj~g4u$|VFC#cq#LCYS_gMFd-Y4$2SLKHFhC04AOwlX`W^ zl$MOeYO5p}mz=H=wBGxAEyyYTUF01~slLNTaio!=uWp+}+_7@}K% z$t9~oLXtSeJ*%z6Cy`WFywMFE{K(BpEib%UMH=V^93VTY_C@CizV1FrH zwLY5b)$3YBTkFj`B(?B>LDy)-w(1OqE{tT$<9oUN;q+zE#YdyZt`={%`xQ&0V?xJd zp0u)HtVVBXkNQIiLMeeAd$G=oLn5s$ea7$e<9ZmwnTD|nSs26^Fj|~!Av6L~nMJ8I zq72c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_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/import/import_with_installing_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/import/import_with_installing_package.ts index db4f93b0db548..107a0016a5426 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/import/import_with_installing_package.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/import/import_with_installing_package.ts @@ -32,8 +32,8 @@ export default ({ getService }: FtrProviderContext): void => { rule_id: PREBUILT_RULE_ID_A, version: 3, type: 'query', - name: 'Mock rule A from mock 90.0.0 package', - description: 'Mock rule A from mock 90.0.0 package', + name: 'Mock rule A from mock 99.0.0 package', + description: 'Mock rule A from mock 99.0.0 package', risk_score: 47, severity: 'medium', from: 'now-30m', @@ -53,7 +53,7 @@ export default ({ getService }: FtrProviderContext): void => { rule_id: PREBUILT_RULE_ID_B, version: 3, type: 'eql', - name: 'Mock rule B from mock 90.0.0 package', + name: 'Mock rule B from mock 99.0.0 package', description: 'Custom description', tags: ['custom-tag'], risk_score: 47, @@ -252,7 +252,7 @@ async function installMockPrebuiltRulesPackageWithTestRules( supertest: SuperTest.Agent ): Promise { const buffer = fs.readFileSync( - path.join(path.dirname(__filename), './fixtures/packages/security_detection_engine-90.0.0.zip') + path.join(path.dirname(__filename), '../fixtures/packages/security_detection_engine-99.0.0.zip') ); const response = await supertest .post('/api/fleet/epm/packages') @@ -270,7 +270,7 @@ async function installMockPrebuiltRulesPackageWithTestRules( function deleteMockPrebuiltRulesPackage(supertest: SuperTest.Agent): SuperTest.Test { return supertest - .delete('/api/fleet/epm/packages/security_detection_engine/90.0.0') + .delete('/api/fleet/epm/packages/security_detection_engine/99.0.0') .set('kbn-xsrf', 'xxxx') .set('elastic-api-version', '2023-10-31') .send(); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/index.ts index b450ece788e49..adaa0368691c6 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/index.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/index.ts @@ -11,5 +11,8 @@ export default ({ loadTestFile }: FtrProviderContext): void => { describe('Rules Management - Prebuilt Rules (Common tests)', function () { this.tags('skipFIPS'); loadTestFile(require.resolve('./import')); + loadTestFile(require.resolve('./install_prebuilt_rules')); + loadTestFile(require.resolve('./status')); + loadTestFile(require.resolve('./revert_prebuilt_rules')); }); }; diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/install_prebuilt_rules/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/index.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/install_prebuilt_rules/index.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/index.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts similarity index 93% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts index 13986710caf32..268941d9989c4 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts @@ -18,7 +18,6 @@ import { getPrebuiltRulesStatus, installPrebuiltRules, getInstalledRules, - getWebHookAction, } from '../../../../utils'; import { deleteAllRules, deleteRule } from '../../../../../../../common/utils/security_solution'; @@ -204,40 +203,19 @@ export default ({ getService }: FtrProviderContext): void => { ]); await installPrebuiltRulesAndTimelines(es, supertest); - // create connector/action - const createConnector = async (payload: Record) => - ( - await supertest - .post('/api/actions/action') - .set('kbn-xsrf', 'true') - .send(payload) - .expect(200) - ).body; - - const createWebHookConnector = () => createConnector(getWebHookAction()); - - const webHookAction = await createWebHookConnector(); - - const defaultRuleAction = { - id: webHookAction.id, - action_type_id: '.webhook' as const, - group: 'default' as const, - params: { - body: '{"test":"a default action"}', - }, - frequency: { - notifyWhen: 'onThrottleInterval' as const, - summary: true, - throttle: '1h' as const, - }, - uuid: 'd487ec3d-05f2-44ad-8a68-11c97dc92202', - }; - await securitySolutionApi .patchRule({ body: { rule_id: 'rule-1', - actions: [defaultRuleAction], + actions: [ + // use a pre-configured connector + { + group: 'default', + id: 'my-test-email', + action_type_id: '.email', + params: {}, + }, + ], }, }) .expect(200); @@ -257,7 +235,15 @@ export default ({ getService }: FtrProviderContext): void => { }); // Check the actions field of existing prebuilt rules is not overwritten - expect(prebuiltRule.actions).toEqual([defaultRuleAction]); + expect(prebuiltRule.actions).toEqual([ + expect.objectContaining({ + action_type_id: '.email', + frequency: { notifyWhen: 'onActiveAlert', summary: true, throttle: null }, + group: 'default', + id: 'my-test-email', + params: {}, + }), + ]); }); it('should NOT overwrite existing exceptions lists', async () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/index.ts similarity index 83% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/index.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/index.ts index 888e27843cc19..8959e2bf853b2 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/index.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/index.ts @@ -8,7 +8,8 @@ import { FtrProviderContext } from '../../../../../../../ftr_provider_context'; export default ({ loadTestFile }: FtrProviderContext): void => { - describe('Air-gapped environment with pre-bundled packages', () => { + describe('Air-gapped environment with pre-bundled packages', function () { + this.tags('skipFIPS'); loadTestFile(require.resolve('./install_bundled_package')); loadTestFile(require.resolve('./prerelease_packages')); }); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/install_bundled_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/install_bundled_package.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/install_bundled_package.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/install_bundled_package.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/install_large_bundled_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/install_large_bundled_package.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/install_large_bundled_package.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/install_large_bundled_package.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/prerelease_packages.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/prerelease_packages.ts similarity index 90% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/prerelease_packages.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/prerelease_packages.ts index f7116cc9fae32..67873a8e3e09f 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/prerelease_packages.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/air_gapped/prerelease_packages.ts @@ -52,8 +52,13 @@ export default ({ getService }: FtrProviderContext): void => { retryService ); - expect(fleetPackageInstallationResponse.items.length).toBe(1); - expect(fleetPackageInstallationResponse.items[0].id).toBe('rule_99.0.0'); // Name of the rule in package 99.0.0 + expect(fleetPackageInstallationResponse.items.length).toBe(2); + expect(fleetPackageInstallationResponse.items).toEqual( + expect.arrayContaining([ + expect.objectContaining({ id: 'test-prebuilt-rule-a' }), + expect.objectContaining({ id: 'test-prebuilt-rule-b' }), + ]) + ); // Name of the rule in package 99.0.0 // Get the installed package and check if the version is 99.0.0 const prebuiltRulesFleetPackage = await getPrebuiltRulesFleetPackage(supertest); @@ -63,7 +68,7 @@ export default ({ getService }: FtrProviderContext): void => { // Get status of our prebuilt rules (nothing should be instaled yet) const statusAfterPackageInstallation = await getPrebuiltRulesStatus(es, supertest); expect(statusAfterPackageInstallation.stats.num_prebuilt_rules_installed).toBe(0); - expect(statusAfterPackageInstallation.stats.num_prebuilt_rules_to_install).toBe(1); // 1 rule in package 99.0.0 + expect(statusAfterPackageInstallation.stats.num_prebuilt_rules_to_install).toBe(2); // 1 rule in package 99.0.0 expect(statusAfterPackageInstallation.stats.num_prebuilt_rules_to_upgrade).toBe(0); // Install prebuilt rules @@ -71,7 +76,7 @@ export default ({ getService }: FtrProviderContext): void => { // Verify that status is updated after package installation const statusAfterRulesInstallation = await getPrebuiltRulesStatus(es, supertest); - expect(statusAfterRulesInstallation.stats.num_prebuilt_rules_installed).toBe(1); // 1 rule in package 99.0.0 + expect(statusAfterRulesInstallation.stats.num_prebuilt_rules_installed).toBe(2); // 1 rule in package 99.0.0 expect(statusAfterRulesInstallation.stats.num_prebuilt_rules_to_install).toBe(0); expect(statusAfterRulesInstallation.stats.num_prebuilt_rules_to_upgrade).toBe(0); @@ -79,7 +84,7 @@ export default ({ getService }: FtrProviderContext): void => { const rulesResponse = await getInstalledRules(supertest); // Assert that installed rules are from package 99.0.0 and not from prerelease (beta) package - expect(rulesResponse.data.length).toBe(1); + expect(rulesResponse.data.length).toBe(2); expect(rulesResponse.data[0].name).not.toContain('beta'); expect(rulesResponse.data[0].name).toContain('99.0.0'); }); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/bootstrap_prebuilt_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/bootstrap_prebuilt_rules.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/bootstrap_prebuilt_rules.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/bootstrap_prebuilt_rules.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/index.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/index.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/index.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/install_package_from_epr.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/install_package_from_epr.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/install_package_from_epr.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/install_package_from_epr.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/update_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/update_package.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/update_package.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/prebuilt_rules_package/update_package.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/get_prebuilt_rule_base_version.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/get_prebuilt_rule_base_version.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/get_prebuilt_rule_base_version.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/get_prebuilt_rule_base_version.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/index.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/index.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/index.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/revert_prebuilt_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/revert_prebuilt_rules.ts similarity index 91% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/revert_prebuilt_rules.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/revert_prebuilt_rules.ts index ef1d6dd1c82db..4f5f18f2d6128 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/revert_prebuilt_rules.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/revert_prebuilt_rules.ts @@ -14,7 +14,6 @@ import { deleteAllPrebuiltRuleAssets, installPrebuiltRules, getCustomQueryRuleParams, - getWebHookAction, } from '../../../../utils'; import { revertPrebuiltRule } from '../../../../utils/rules/prebuilt_rules/revert_prebuilt_rule'; @@ -132,40 +131,19 @@ export default ({ getService }: FtrProviderContext): void => { }); it('does not modify `actions` field', async () => { - // create connector/action - const createConnector = async (payload: Record) => - ( - await supertest - .post('/api/actions/action') - .set('kbn-xsrf', 'true') - .send(payload) - .expect(200) - ).body; - - const createWebHookConnector = () => createConnector(getWebHookAction()); - - const webHookAction = await createWebHookConnector(); - - const defaultRuleAction = { - id: webHookAction.id, - action_type_id: '.webhook' as const, - group: 'default' as const, - params: { - body: '{"test":"a default action"}', - }, - frequency: { - notifyWhen: 'onThrottleInterval' as const, - summary: true, - throttle: '1h' as const, - }, - uuid: 'd487ec3d-05f2-44ad-8a68-11c97dc92202', - }; - const { body: customizedPrebuiltRule } = await securitySolutionApi.patchRule({ body: { rule_id: 'rule_1', description: 'new description', - actions: [defaultRuleAction], + actions: [ + // use a pre-configured connector + { + group: 'default', + id: 'my-test-email', + action_type_id: '.email', + params: {}, + }, + ], }, }); @@ -181,7 +159,15 @@ export default ({ getService }: FtrProviderContext): void => { is_customized: false, type: 'external', }, - actions: [defaultRuleAction], + actions: [ + expect.objectContaining({ + id: 'my-test-email', + action_type_id: '.email', + frequency: { notifyWhen: 'onActiveAlert', summary: true, throttle: null }, + group: 'default', + params: {}, + }), + ], }), ]); }); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/status/get_prebuilt_rules_status.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/status/get_prebuilt_rules_status.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/status/get_prebuilt_rules_status.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/status/get_prebuilt_rules_status.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/status/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/status/index.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/status/index.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/status/index.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/status/legacy/get_prebuilt_timelines_status.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/status/legacy/get_prebuilt_timelines_status.ts similarity index 100% rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/status/legacy/get_prebuilt_timelines_status.ts rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/status/legacy/get_prebuilt_timelines_status.ts diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/index.ts index 10ca4133b7e73..2d8c904977d22 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/index.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/index.ts @@ -11,9 +11,6 @@ export default ({ loadTestFile }: FtrProviderContext): void => { describe('Rules Management - Prebuilt Rules (Customization Enabled)', function () { loadTestFile(require.resolve('./customization')); loadTestFile(require.resolve('./export')); - loadTestFile(require.resolve('./install_prebuilt_rules')); - loadTestFile(require.resolve('./status')); loadTestFile(require.resolve('./upgrade_prebuilt_rules')); - loadTestFile(require.resolve('./revert_prebuilt_rules')); }); }; diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped.config.ts deleted file mode 100644 index b8b6d36ec10eb..0000000000000 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/configs/ess_air_gapped.config.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrConfigProviderContext } from '@kbn/test'; -import path from 'path'; - -export const BUNDLED_PACKAGE_DIR = path.join(path.dirname(__filename), './../fixtures/packages'); - -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../../../configs/ess.config')); - - return { - ...functionalConfig.getAll(), - testFiles: [require.resolve('..')], - kbnTestServer: { - ...functionalConfig.get('kbnTestServer'), - serverArgs: [ - ...functionalConfig.get('kbnTestServer.serverArgs'), - /* Tests in this directory simulate an air-gapped environment in which the instance doesn't have access to EPR. - * To do that, we point the Fleet url to an invalid URL, and instruct Fleet to fetch bundled packages at the - * location defined in BUNDLED_PACKAGE_DIR. - */ - `--xpack.fleet.isAirGapped=true`, - `--xpack.fleet.developer.bundledPackageLocation=${BUNDLED_PACKAGE_DIR}`, - ], - }, - }; -} diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/fixtures/packages/security_detection_engine-99.0.0.zip b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/air_gapped/fixtures/packages/security_detection_engine-99.0.0.zip deleted file mode 100644 index 7c725ce134e426990f7084dfa290c84cf151a490..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20201 zcmeHP&2J-VTFCU>!F1zg5p}Pksai+bUFC6y_!_3esSG~4t zVpn;q%K2Edg1+%};Dm%YaOvwx9Jz6V8yAH512`ZqNO0iJ?|DDUWha@g$@Fgeu$j)p z_4T~Z_s3h$l(_aJX~D771=- z>4dW+8l@L*%**U5S}=DUbI#I;xzj0&M&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