kibana/x-pack/plugins/security_solution
Angela Chuang 8fd6dbed55
[SecuritySolution] Security Solution Dashboard edit mode (#159486)
## Summary

issue: https://github.com/elastic/kibana/issues/152955

Test environment:
https://p.elstc.co/paste/9-b8FqRA#EkVP6KV1UAFOu1cWFwX1laj63P9wc5eQtnT7bCPyEuX

Known issues:
https://github.com/elastic/kibana/pull/159486#issuecomment-1740604651



23d30613-2dc3-423c-ada1-b52cd2f409ee



1. Reuse Kibana Dashboard's tool bar



<img width="2543" alt="Screenshot 2023-09-26 at 15 51 30"
src="b0279665-578a-45f9-b416-675e152b7dbd">




2. Dashboard with a `Managed` tag does `not` have the edit tool bar
under the title.

<img width="2558" alt="Screenshot 2023-09-29 at 10 11 34"
src="7c0774c1-2bf2-478b-a30e-59ff8609b584">


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
2023-10-02 06:37:40 -07:00
..
.storybook
common [Security Solution][Detection Engine] adds ES|QL rule type to Security Detections rules (#165450) 2023-09-30 09:45:34 +01:00
docs/testing/test_plans [Security Solution] Coverage overview test plan (#165530) 2023-09-28 12:46:11 -04:00
public [SecuritySolution] Security Solution Dashboard edit mode (#159486) 2023-10-02 06:37:40 -07:00
scripts Bump cypress@13.3.0 (#162383) 2023-10-01 10:55:01 +02:00
server [Security Solution][Detection Engine] fixes type errors, adds category for new ES|QL rule type (#167745) 2023-10-02 13:47:22 +02:00
jest.config.dev.js Transform Security's Cypress Junit reports to have the same format as those produced by FTR and Jest (#162279) 2023-07-24 10:50:13 -04: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 [Drift] Enable chat globally + A/B test for pages where the chat was available before (#167069) 2023-10-01 16:07:11 +02:00
package.json [Security Solution][Endpoint] Combine the Endpoint management cypress test suites into a single configuration/run (#166757) 2023-09-20 14:38:29 -04:00
README.md Huge fields generating/loading scripts (#160155) 2023-07-17 14:49:53 +02:00
tsconfig.json [SecuritySolution] Security Solution Dashboard edit mode (#159486) 2023-10-02 06:37:40 -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

Generate huge amount of indices with huge amount of fields

The result of this operation will be 10 separate bucket folders within mappings_folder. Each bucket folder will contain a mappings.json file describing 50 indices.

yarn mappings:generate --fieldsCount=10000 --indexCount=500 --indexPrefix='.ds-huge' --unmappedRate=.2 --buckets=10 --outputDirectory='mappings_folder'

Load generated mappings

yarn mappings:load --mappings-dir='mappings_folder' --es-url=http://username:password@localhost:9200 --kibana-url=http://username:password@localhost:5601/app