Skip to content

Commit

Permalink
[8.7] [Security Solution] Revisit prebuilt detection rules tests (#14…
Browse files Browse the repository at this point in the history
…9502) (#151999)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Security Solution] Revisit prebuilt detection rules tests
(#149502)](#149502)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dmitrii
Shevchenko","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-23T12:36:57Z","message":"[Security
Solution] Revisit prebuilt detection rules tests
(#149502)","sha":"a2bba156e23bfa1cb57f58c5f6e864b00d3d6203","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["technical
debt","release_note:skip","Team:Detections and Resp","Team:
SecuritySolution","Team:Detection Rules","Feature:Prebuilt Detection
Rules","v8.7.0","v8.8.0"],"number":149502,"url":"https://github.com/elastic/kibana/pull/149502","mergeCommit":{"message":"[Security
Solution] Revisit prebuilt detection rules tests
(#149502)","sha":"a2bba156e23bfa1cb57f58c5f6e864b00d3d6203"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/149502","number":149502,"mergeCommit":{"message":"[Security
Solution] Revisit prebuilt detection rules tests
(#149502)","sha":"a2bba156e23bfa1cb57f58c5f6e864b00d3d6203"}}]}]
BACKPORT-->
  • Loading branch information
xcrzx authored Feb 23, 2023
1 parent a99f950 commit 7a91663
Show file tree
Hide file tree
Showing 104 changed files with 1,052 additions and 864 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
import {
createSignalsIndex,
deleteSignalsIndex,
deleteAllAlerts,
deleteAllRules,
getRuleForSignalTesting,
waitForRuleSuccessOrStatus,
waitForSignalsToBePresent,
Expand Down Expand Up @@ -795,7 +795,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
await esArchiver.unload('x-pack/test/functional/es_archives/auditbeat/hosts');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
import {
createSignalsIndex,
deleteSignalsIndex,
deleteAllAlerts,
deleteAllRules,
getRuleForSignalTesting,
waitForRuleSuccessOrStatus,
waitForSignalsToBePresent,
Expand Down Expand Up @@ -358,7 +358,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
await esArchiver.unload('x-pack/test/functional/es_archives/auditbeat/hosts');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
import {
createSignalsIndex,
deleteSignalsIndex,
deleteAllAlerts,
deleteAllRules,
getRuleForSignalTesting,
waitForRuleSuccessOrStatus,
waitForSignalsToBePresent,
Expand Down Expand Up @@ -475,7 +475,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
await esArchiver.unload('x-pack/test/functional/es_archives/auditbeat/hosts');
});

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { DETECTION_ENGINE_RULES_URL } from '@kbn/security-solution-plugin/common
import { FtrProviderContext } from '../../common/ftr_provider_context';
import {
createSignalsIndex,
deleteAllAlerts,
deleteAllRules,
deleteSignalsIndex,
getSimpleRule,
getSimpleRuleOutput,
Expand Down Expand Up @@ -45,7 +45,7 @@ export default ({ getService }: FtrProviderContext) => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
});

it('should create a single rule with a rule_id', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DETECTION_ENGINE_RULES_BULK_CREATE } from '@kbn/security-solution-plugi
import { FtrProviderContext } from '../../common/ftr_provider_context';
import {
createSignalsIndex,
deleteAllAlerts,
deleteAllRules,
deleteSignalsIndex,
getSimpleRule,
getSimpleRuleOutput,
Expand Down Expand Up @@ -43,7 +43,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
});

it('should create a single rule with a rule_id', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../common/ftr_provider_context';
import {
createRule,
createSignalsIndex,
deleteAllAlerts,
deleteAllRules,
deleteSignalsIndex,
getSimpleRule,
getSimpleRuleOutput,
Expand All @@ -35,7 +35,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
});

it('should delete a single rule with a rule_id', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../common/ftr_provider_context';
import {
createRule,
createSignalsIndex,
deleteAllAlerts,
deleteAllRules,
deleteSignalsIndex,
getSimpleRule,
getSimpleRuleOutput,
Expand All @@ -35,7 +35,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
});

it('should delete a single rule with a rule_id', async () => {
Expand Down Expand Up @@ -147,7 +147,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
});

it('should delete a single rule with a rule_id', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
binaryToString,
createRule,
createSignalsIndex,
deleteAllAlerts,
deleteAllRules,
deleteSignalsIndex,
getSimpleRule,
getSimpleRuleOutput,
Expand All @@ -33,7 +33,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
});

it('should set the response content types to be expected', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../common/ftr_provider_context';
import {
createRule,
createSignalsIndex,
deleteAllAlerts,
deleteAllRules,
deleteSignalsIndex,
getComplexRule,
getComplexRuleOutput,
Expand All @@ -33,7 +33,7 @@ export default ({ getService }: FtrProviderContext): void => {

afterEach(async () => {
await deleteSignalsIndex(supertest, log);
await deleteAllAlerts(supertest, log);
await deleteAllRules(supertest, log);
});

it('should return an empty find body correctly if no rules are loaded', async () => {
Expand Down

This file was deleted.

Loading

0 comments on commit 7a91663

Please sign in to comment.