Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Detection Engine Test Automation and Coverage #153633

Open
29 of 54 tasks
banderror opened this issue Mar 24, 2023 · 0 comments
Open
29 of 54 tasks

[Security Solution] Detection Engine Test Automation and Coverage #153633

banderror opened this issue Mar 24, 2023 · 0 comments
Assignees
Labels
epic Feature:Detection Alerts Security Solution Detection Alerts Feature Feature:Detection Rules Security Solution rules and Detection Engine Team:Detection Engine Security Solution Detection Engine Area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. technical debt Improvement of the software architecture and operational architecture test_ui_functional test test-api-integration test-coverage issues & PRs for improving code test coverage v8.10.0 v8.11.0 v8.12.0

Comments

@banderror
Copy link
Contributor

banderror commented Mar 24, 2023

Related to: https://github.com/elastic/security-team/issues/6482, https://github.com/elastic/security-team/issues/6706, https://github.com/elastic/security-team/issues/6607, https://github.com/elastic/security-team/issues/6754 (internal issues)

Summary

We need to start stabilizing and improving our automated tests and increasing the test coverage for our features. Reasons:

  • Having stable, non-flaky tests with sufficient coverage of our features is very important for going live with Serverless. This is a very high priority.
  • We've been lacking help from QA engineers, for reasons outside of our control, and unfortunately, we can't rely on manual testing -- neither from their side nor from ourselves. We need all tests to be automated.

Goals:

  1. Flakiness. Make Cypress and API integration tests stable: reduce flakiness to zero.
  2. Serverless tests. We should create a dedicated suite of E2E and API integration tests that will be run against Serverless environments. We should reuse our existing tests instead of duplicating them.
  3. Structure. Improve the folder structure of the tests to be able to fix the ownership problem. Split tests into semantically meaningful and cohesive groups and FTR configs. Create two new Cypress configs for Detection Engine and Rule Management teams.
  4. Ownership. Fix issues with the code ownership of Cypress and API integration tests. Update the CODEOWNERS file.
  5. Speed. Make Cypress and API integration tests faster: both locally (speed) and on CI (parallelization). Each parallel task should run under 40 minutes.
  6. CI/CD. Enable running Cypress tests for all PRs on CI.
  7. Knowledge sharing. Write developer docs on best practices for writing Cypress and API integration tests. Start sharing knowledge across AET and whole Security.
  8. Coverage. Increase the test coverage for every feature each of the area teams owns: @elastic/security-detection-engine, @elastic/security-detection-rule-management. For each feature, we should write a test plan and cover its business logic by any/all types of tests: E2E, integration, and unit.
  9. Maintainability. Refactor Cypress and API integration tests to improve their maintainability.

Sub-tasks

Flakiness

Preview Give feedback
  1. 15 of 15
    8.10 candidate Meta Team: SecuritySolution Team:Detections and Resp Team:Threat Hunting
  2. 8 of 8
    8.10 candidate Meta Team: SecuritySolution Team:Detection Engine Team:Detections and Resp technical debt test test-api-integration test_ui_functional v8.10.0
    e40pud
  3. 18 of 18
    8.10 candidate Meta Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp technical debt test test-api-integration test_ui_functional v8.10.0
    jpdjere maximpn
  4. 9 of 9
    8.12 candidate Meta Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp technical debt test test-api-integration test_ui_functional v8.11.0 v8.12.0
    jpdjere maximpn
  5. 6 of 6
    8.12 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp test test-failure-flaky
    banderror
  6. 13 of 13
    8.13 candidate Meta Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp technical debt test test-api-integration test_ui_functional
    maximpn
  7. 5 of 5
    8.15 candidate Meta Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp technical debt test test-api-integration test_ui_functional
  8. 4 of 9
    Meta Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Team:Threat Hunting technical debt test test-api-integration test_ui_functional
  9. Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Test:Cypress performance technical debt test test_ui_functional
    banderror
  10. Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Test:Cypress docs test
  11. 6 of 11
    Team: SecuritySolution
  12. Team: SecuritySolution
  13. Team: SecuritySolution Team:Detection Engine
  14. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp test
  15. Team: SecuritySolution Team:Detection Engine
  16. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp test

Speed

Preview Give feedback
  1. 8.13 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp test test_ui_functional

Structure and Ownership

Preview Give feedback
  1. Team:Detection Engine
    yctercero
  2. 8.10 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp technical debt test test_ui_functional
    banderror
  3. Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Test:Cypress refactoring technical debt test test_ui_functional v8.10.0
  4. Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Test:Cypress refactoring technical debt test test_ui_functional
  5. 8.12 candidate Team: SecuritySolution Team:Detections and Resp Team:Threat Hunting technical debt test test_ui_functional
    MadameSheema
  6. 8.13 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp refactoring technical debt test test-api-integration
    yctercero
  7. 2 of 5
    8.13 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp refactoring technical debt test test-api-integration

Serverless tests

Preview Give feedback
  1. 8.11 candidate Team: SecuritySolution Team:Defend Workflows Team:Detections and Resp Team:Threat Hunting test test-api-integration test_ui_functional
  2. 8.11 candidate Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp test
    banderror
  3. 8.12 candidate Team: SecuritySolution Team:Detection Engine Team:Detections and Resp test test-coverage
    jpdjere yctercero
  4. 8.12 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp test test-coverage
    maximpn
  5. 8.12 candidate Team: SecuritySolution Team:Detection Engine Team:Detections and Resp test test-coverage
  6. 8.13 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp test test-coverage v8.12.0
  7. Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp test
    maximpn
  8. 4 of 24
    Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Test:Cypress consider-next test test-coverage
    yctercero

CI/CD

Preview Give feedback
  1. 8.11 candidate Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp Team:Threat Hunting Theme: consistent_performant_ux performance technical debt test test_ui_functional
    MadameSheema marshallmain
    maximpn michaelolo24 stephmilovic yctercero
  2. Team: SecuritySolution
    MadameSheema

Knowledge sharing

Preview Give feedback
  1. Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Test:Cypress docs test
  2. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp documentation technical debt test
  3. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp documentation technical debt test test_ui_functional
  4. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp documentation technical debt test test-api-integration

Coverage

Preview Give feedback
  1. Team: SecuritySolution Team:Detection Engine Team:Detections and Resp technical debt test test-api-integration test-coverage test_ui_functional
    yctercero
  2. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp technical debt test test-api-integration test-coverage test_ui_functional
    banderror
  3. 0 of 1
    Meta Team: SecuritySolution Team:Detection Engine Team:Detections and Resp technical debt test test-coverage
  4. 1 of 2
    Meta Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp technical debt test test-coverage

Maintainability

Preview Give feedback
  1. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp backport:prev-minor refactoring release_note:skip technical debt test-api-integration v8.7.1 v8.8.0
    maximpn
  2. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp backport:prev-minor refactoring release_note:skip technical debt test test_ui_functional v8.7.1 v8.8.0
    maximpn
  3. Team: SecuritySolution Team:Detection Rule Management Team:Detections and Resp refactoring technical debt test test_ui_functional

Misc

Preview Give feedback
  1. Team: SecuritySolution Team:Detection Engine Team:Detection Rule Management Team:Detections and Resp Team:Threat Hunting bug technical debt test
@banderror banderror added test test_ui_functional test-api-integration test-coverage issues & PRs for improving code test coverage Feature:Detection Rules Security Solution rules and Detection Engine Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Detection Alerts Security Solution Detection Alerts Feature Team:Security Solution Platform Security Solution Platform Team Team:Detection Rule Management Security Detection Rule Management Team Team:Detection Alerts Security Detection Alerts Area Team 8.8 candidate labels Mar 24, 2023
@banderror banderror added the epic label Mar 24, 2023
@banderror banderror added the technical debt Improvement of the software architecture and operational architecture label Mar 24, 2023
ThomThomson pushed a commit to ThomThomson/kibana that referenced this issue Aug 1, 2023
…n/cypress/e2e/detection_rules` folder (elastic#162373)

**Epic:** elastic#153633
**Partially addresses:** elastic#153645

## Summary

This PR builds upon elastic#161900 and
moves tests located in the `e2e/detection_rules` folder into
`e2e/detection_response` and splits them into multiple sub-folders
according to the Detection Engine subdomains we have. It also updates
the CODEOWNERS file accordingly.

<img width="451" alt="Screenshot 2023-07-25 at 21 03 08"
src="https://github.com/elastic/kibana/assets/7359339/fb6052c9-3c5d-4547-98f1-61f44b9f7187">

## Details

Specifically, changes in this PR include:

- The `e2e/detections_response` folder was renamed to
`e2e/detection_response`.
- The `e2e/detections_response/bulk_actions` folder became
`e2e/detection_response/rule_management/rule_actions/bulk_actions`.
- Cypress tests for rule types (which actually test rule creation for
different rule types) were moved to
`e2e/detection_response/rule_creation`.
- The CODEOWNERS file was updated.

Things not addressed in this PR:

- No ownership was assigned for `e2e/detection_response/rule_actions`.
Will need to figure this out with @yctercero.
- No restructuring was done for `security_solution/cypress/screens` and
`security_solution/cypress/tasks`. Will be done in follow-up PRs.
- No refactoring was done for the tests themselves. Some of this work is
also upcoming.

The full file structure of the `detection_response` tests looks like
this:

<img width="452" alt="Screenshot 2023-07-25 at 21 03 44"
src="https://github.com/elastic/kibana/assets/7359339/2b89c6d2-9f2d-4cf6-914f-a71c3fa93595">
@yctercero yctercero added Test:Cypress Team:Detection Engine Security Solution Detection Engine Area and removed Team:Detection Engine Security Solution Detection Engine Area Test:Cypress labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Feature:Detection Alerts Security Solution Detection Alerts Feature Feature:Detection Rules Security Solution rules and Detection Engine Team:Detection Engine Security Solution Detection Engine Area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. technical debt Improvement of the software architecture and operational architecture test_ui_functional test test-api-integration test-coverage issues & PRs for improving code test coverage v8.10.0 v8.11.0 v8.12.0
Projects
None yet
Development

No branches or pull requests

4 participants