-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Security Solution] Enable critical Rule Management tests in MK…
…I periodic and 2nd quality gate pipelines (#193666) (#194249) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Enable critical Rule Management tests in MKI periodic and 2nd quality gate pipelines (#193666)](#193666) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Maxim Palenov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-27T04:41:30Z","message":"[Security Solution] Enable critical Rule Management tests in MKI periodic and 2nd quality gate pipelines (#193666)\n\n**Resolves:** https://github.com/elastic/security-team/issues/10609\r\n\r\n## Summary\r\n\r\nThis PR enables critical Rule Management tests in periodic and 2nd quality gate MKI pipelines. In the other words it enable smoke testing for Rule Management critical features.\r\n\r\n## Details\r\n\r\nA prerequisite Rule Management FTR and Cypress tests audit result are summarized in a [Google Sheet document](https://docs.google.com/spreadsheets/d/1jyNXlMpTLAxt5u_ZTNJVms7UnTmwA2xALq2C3HEOEqQ). Based on feature criticality it was decided to enable critical FTR and Cypress tests in periodic and 2nd quality gate MKI pipelines and disable non critical tests in MKI pipelines.","sha":"4ab4c661272fa2763f027204461c37d0a1620aad","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","backport:prev-minor","Project:Serverless","v8.16.0"],"title":"[Security Solution] Enable critical Rule Management tests in MKI periodic and 2nd quality gate pipelines","number":193666,"url":"https://github.com/elastic/kibana/pull/193666","mergeCommit":{"message":"[Security Solution] Enable critical Rule Management tests in MKI periodic and 2nd quality gate pipelines (#193666)\n\n**Resolves:** https://github.com/elastic/security-team/issues/10609\r\n\r\n## Summary\r\n\r\nThis PR enables critical Rule Management tests in periodic and 2nd quality gate MKI pipelines. In the other words it enable smoke testing for Rule Management critical features.\r\n\r\n## Details\r\n\r\nA prerequisite Rule Management FTR and Cypress tests audit result are summarized in a [Google Sheet document](https://docs.google.com/spreadsheets/d/1jyNXlMpTLAxt5u_ZTNJVms7UnTmwA2xALq2C3HEOEqQ). Based on feature criticality it was decided to enable critical FTR and Cypress tests in periodic and 2nd quality gate MKI pipelines and disable non critical tests in MKI pipelines.","sha":"4ab4c661272fa2763f027204461c37d0a1620aad"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193666","number":193666,"mergeCommit":{"message":"[Security Solution] Enable critical Rule Management tests in MKI periodic and 2nd quality gate pipelines (#193666)\n\n**Resolves:** https://github.com/elastic/security-team/issues/10609\r\n\r\n## Summary\r\n\r\nThis PR enables critical Rule Management tests in periodic and 2nd quality gate MKI pipelines. In the other words it enable smoke testing for Rule Management critical features.\r\n\r\n## Details\r\n\r\nA prerequisite Rule Management FTR and Cypress tests audit result are summarized in a [Google Sheet document](https://docs.google.com/spreadsheets/d/1jyNXlMpTLAxt5u_ZTNJVms7UnTmwA2xALq2C3HEOEqQ). Based on feature criticality it was decided to enable critical FTR and Cypress tests in periodic and 2nd quality gate MKI pipelines and disable non critical tests in MKI pipelines.","sha":"4ab4c661272fa2763f027204461c37d0a1620aad"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maxim Palenov <[email protected]>
- Loading branch information
1 parent
6dfc890
commit 34d4498
Showing
40 changed files
with
896 additions
and
839 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...s_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_enable_disable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* 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 expect from 'expect'; | ||
import { BulkActionTypeEnum } from '@kbn/security-solution-plugin/common/api/detection_engine/rule_management'; | ||
import { getCustomQueryRuleParams, fetchRule } from '../../../utils'; | ||
import { createRule, deleteAllRules } from '../../../../../../common/utils/security_solution'; | ||
import { FtrProviderContext } from '../../../../../ftr_provider_context'; | ||
|
||
export default ({ getService }: FtrProviderContext): void => { | ||
const supertest = getService('supertest'); | ||
const securitySolutionApi = getService('securitySolutionApi'); | ||
const log = getService('log'); | ||
|
||
describe('@ess @serverless @serverlessQA Bulk enable/disable', () => { | ||
beforeEach(async () => { | ||
await deleteAllRules(supertest, log); | ||
}); | ||
|
||
it('should enable rules', async () => { | ||
const ruleId = 'ruleId'; | ||
await createRule( | ||
supertest, | ||
log, | ||
getCustomQueryRuleParams({ rule_id: ruleId, enabled: false }) | ||
); | ||
|
||
const { body } = await securitySolutionApi.performRulesBulkAction({ | ||
query: {}, | ||
body: { action: BulkActionTypeEnum.enable }, | ||
}); | ||
|
||
expect(body.attributes.summary).toEqual({ failed: 0, skipped: 0, succeeded: 1, total: 1 }); | ||
|
||
// Check that the updated rule is returned with the response | ||
expect(body.attributes.results.updated[0].enabled).toEqual(true); | ||
|
||
// Check that the updates have been persisted | ||
const ruleBody = await fetchRule(supertest, { ruleId }); | ||
expect(ruleBody.enabled).toEqual(true); | ||
}); | ||
|
||
it('should disable rules', async () => { | ||
const ruleId = 'ruleId'; | ||
await createRule( | ||
supertest, | ||
log, | ||
getCustomQueryRuleParams({ rule_id: ruleId, enabled: true }) | ||
); | ||
|
||
const { body } = await securitySolutionApi.performRulesBulkAction({ | ||
query: {}, | ||
body: { action: BulkActionTypeEnum.disable }, | ||
}); | ||
|
||
expect(body.attributes.summary).toEqual({ failed: 0, skipped: 0, succeeded: 1, total: 1 }); | ||
|
||
// Check that the updated rule is returned with the response | ||
expect(body.attributes.results.updated[0].enabled).toEqual(false); | ||
|
||
// Check that the updates have been persisted | ||
const ruleBody = await fetchRule(supertest, { ruleId }); | ||
expect(ruleBody.enabled).toEqual(false); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.