kibana/x-pack/plugins/security_solution
Jatin Kathuria 5df083d62f
[8.8] [Security Solution] [Fix] [Performance] Alert Page Controls should query only from Alert Index. (#157286) (#160138)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Security Solution] [Fix] [Performance] Alert Page Controls should
query only from Alert Index.
(#157286)](https://github.com/elastic/kibana/pull/157286)

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

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

<!--BACKPORT [{"author":{"name":"Jatin
Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2023-06-21T12:21:16Z","message":"[Security
Solution] [Fix] [Performance] Alert Page Controls should query only from
Alert Index. (#157286)\n\n## Summary\r\n\r\nHandles :
#157217\r\n\r\n\r\n|Before|After|\r\n|---|---|\r\n|
<video\r\nsrc=\"aa892faf-8055-46e0-b23b-87061ecef67f\"\r\n/>
|
<video\r\nsrc=\"2f392ea4-cfc5-4759-96c7-94561f60c3f4\"\r\n/>
|","sha":"ac5207cca96db362ed31387e16e5b6849167f565","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Threat
Hunting:Investigations","backport:prev-MAJOR","v8.9.0"],"number":157286,"url":"https://github.com/elastic/kibana/pull/157286","mergeCommit":{"message":"[Security
Solution] [Fix] [Performance] Alert Page Controls should query only from
Alert Index. (#157286)\n\n## Summary\r\n\r\nHandles :
#157217\r\n\r\n\r\n|Before|After|\r\n|---|---|\r\n|
<video\r\nsrc=\"aa892faf-8055-46e0-b23b-87061ecef67f\"\r\n/>
|
<video\r\nsrc=\"2f392ea4-cfc5-4759-96c7-94561f60c3f4\"\r\n/>
|","sha":"ac5207cca96db362ed31387e16e5b6849167f565"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157286","number":157286,"mergeCommit":{"message":"[Security
Solution] [Fix] [Performance] Alert Page Controls should query only from
Alert Index. (#157286)\n\n## Summary\r\n\r\nHandles :
#157217\r\n\r\n\r\n|Before|After|\r\n|---|---|\r\n|
<video\r\nsrc=\"aa892faf-8055-46e0-b23b-87061ecef67f\"\r\n/>
|
<video\r\nsrc=\"2f392ea4-cfc5-4759-96c7-94561f60c3f4\"\r\n/>
|","sha":"ac5207cca96db362ed31387e16e5b6849167f565"}}]}] BACKPORT-->
2023-06-22 08:54:53 -07:00
..
.storybook
common [8.8] [Security Solution] Add support for GET requests to the Detection Engine health API (#159970) (#160023) 2023-06-20 09:21:22 -07:00
cypress [8.8] [Security Solution] [Fix] [Performance] Alert Page Controls should query only from Alert Index. (#157286) (#160138) 2023-06-22 08:54:53 -07:00
public [8.8] [Security Solution] [Fix] [Performance] Alert Page Controls should query only from Alert Index. (#157286) (#160138) 2023-06-22 08:54:53 -07:00
scripts [8.8] [Security Solution][Testing] Improve policy related endpoint regression test coverage (#157412) (#159482) 2023-06-12 08:13:49 -07:00
server [8.8] [Security Solution] Add support for GET requests to the Detection Engine health API (#159970) (#160023) 2023-06-20 09:21:22 -07:00
jest.config.dev.js Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
jest.integration.config.js [Security Solution][Endpoint] Move all endpoint responder jest tests for response actions to (jest) integration tests (#142006) 2022-09-29 09:40:41 -04:00
kibana.jsonc [8.8] [Security Solution] Elastic Security Assistant (#156933) (#158974) 2023-06-02 16:40:05 -07:00
package.json [Defend Workflows] PoC of e2e endpoint testing (#148893) 2023-02-15 19:02:46 +01:00
README.md
tsconfig.json [8.8] [Security Solution] Elastic Security Assistant (#156933) (#158974) 2023-06-02 16:40:05 -07:00

Security Solution

Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing.

Development

Tests

The endpoint specific tests leverage the ingest manager to install the endpoint package. Before the api integration and functional tests are run the ingest manager is initialized. This initialization process includes reaching out to a package registry service to install the endpoint package. The endpoint tests support three different ways to run the tests given the constraint on an available package registry.

  1. Using Docker
  2. Running your own local package registry
  3. Using the default external package registry

These scenarios will be outlined the sections below.

Endpoint API Integration Tests Location

The endpoint api integration tests are located here

Endpoint Functional Tests Location

The endpoint functional tests are located here

Using Docker

To run the tests using the recommended docker image version you must have docker installed. The testing infrastructure will stand up a docker container using the image defined here

Make sure you're in the Kibana root directory.

Endpoint API Integration Tests

In one terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts

In another terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts

Endpoint Functional Tests

In one terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts

In another terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts

Running your own package registry

If you are doing endpoint package development it will be useful to run your own package registry to serve the latest package you're building. To do this use the following commands:

Make sure you're in the Kibana root directory.

Endpoint API Integration Tests

In one terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts

In another terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080>  yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts

Endpoint Functional Tests

In one terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts

In another terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080>  yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts

Using the default public registry

If you don't have docker installed and don't want to run your own registry, you can run the tests using the ingest manager's default public package registry. The actual package registry used is here

Make sure you're in the Kibana root directory.

Endpoint API Integration Tests

In one terminal, run:

yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts

In another terminal, run:

yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts

Endpoint Functional Tests

In one terminal, run:

yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts

In another terminal, run:

yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts