Commit graph

1541 commits

Author SHA1 Message Date
Maxim Palenov
b0c7a8ce4f
[Security Solution] Allow users to save rule query with non critical validation errors (#202544)
**Addresses:** https://github.com/elastic/kibana/issues/171520

## Summary

This PR adds functionality to allow users save EQL and ES|QL queries in Prebuilt Rule Customization workflow by displaying a confirmation modal with non critical validation errors (a.k.a warnings). It also refactors confirmation modal usage in rule creation/editing forms for better reusability.

## Screenshots

<img width="1909" alt="Screenshot 2024-12-03 at 14 01 36" src="https://github.com/user-attachments/assets/c0054fc1-b52b-400f-80d7-af42391f4e18">

https://github.com/user-attachments/assets/2a20fcfe-ffc0-4547-8621-7ac6873c8dc9

https://github.com/user-attachments/assets/50b5cf5a-ea3f-4c22-a443-b5d4056a92c8

<img width="2541" alt="Screenshot 2024-12-03 at 14 06 29" src="https://github.com/user-attachments/assets/dde3fd60-6c69-4f8e-a65a-837b2319e4ac">

<img width="2552" alt="Screenshot 2024-12-03 at 14 06 51" src="https://github.com/user-attachments/assets/220817a6-991f-4361-88d2-ee3a47a36ad6">

<img width="2555" alt="Screenshot 2024-12-03 at 14 07 52" src="https://github.com/user-attachments/assets/c46fc49c-9ce1-4472-bdea-f9507aa62ece">

<img width="2553" alt="Screenshot 2024-12-03 at 14 08 18" src="https://github.com/user-attachments/assets/92388c56-8644-4c54-8727-b9a73b3497d1">
2024-12-06 06:06:39 -06:00
Bharat Pasupula
5145d76fb1
[Automatic Import] Add serverless availability cypress test (#202872) 2024-12-05 21:25:07 +01:00
Gerard Soldevila
b2d49b8beb
Sustainable Kibana Architecture: Move modules owned by @elastic/docs (#202416)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative. We kindly ask you to:

* Review the moved files, as some of them contain relative paths that
have been updated.
* Review the updated files, as some of them contain references that have
been updated.
* Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
  * customised eslint rules
  * docs pointing to source code
* We kindly ask you to:
* Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
* Manually review .buildkite/scripts/pipelines/pull_request/pipeline.ts
to ensure that any CI pipeline customizations continue to be correctly
applied after the changed path names
* Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below.


#### 1 package(s) are going to be relocated:

  | Id | Target folder |
  | -- | ------------- |
  | `@kbn/doc-links` | `src/platform/packages/shared/kbn-doc-links` |


<details>
<summary>Updated references</summary>

```
./docs/upgrade-notes.asciidoc
./package.json
./packages/kbn-repo-packages/package-map.json
./packages/kbn-ts-projects/config-paths.json
./src/core/tsconfig.type_check.json
./src/platform/packages/shared/kbn-doc-links/jest.config.js
./src/plugins/ai_assistant_management/selection/tsconfig.type_check.json
./tsconfig.base.json
./tsconfig.base.type_check.json
./tsconfig.refs.json
./x-pack/plugins/alerting/tsconfig.type_check.json
./x-pack/plugins/search_connectors/tsconfig.type_check.json
./x-pack/plugins/search_inference_endpoints/tsconfig.type_check.json
./x-pack/plugins/search_playground/tsconfig.type_check.json
./x-pack/plugins/security_solution/tsconfig.type_check.json
./x-pack/plugins/serverless_search/tsconfig.type_check.json
./x-pack/plugins/threat_intelligence/tsconfig.type_check.json
./yarn.lock
```
</details>
<details>
<summary>Updated relative paths</summary>

```
src/platform/packages/shared/kbn-doc-links/jest.config.js:12
src/platform/packages/shared/kbn-doc-links/tsconfig.json:2
src/platform/packages/shared/kbn-doc-links/tsconfig.type_check.json:2
```
</details>
<details>
<summary>Script errors</summary>

```

```
</details>
2024-12-05 14:54:58 +01:00
Pierre Gayvallet
14ad13b6a3
Add base FTR test coverage for inference APIs (#198000)
## Summary

Part of https://github.com/elastic/kibana-team/issues/1271

This PR introduces the first set of end to end integration test for the
inference APIs, and the tooling required to do so (see issue for more
context)

- Add a dedicated pipeline for ai-infra GenAI tests. pipeline is
triggered when:
  - genAI stack connectors, or ai-infra owned code is changed
  - when the `ci:all-gen-ai-suites` label is present on a PR
  - on merge
- adapt the `ftr_configs.sh` script to load GenAI connector
configuration from vault when a specific var env is set
- create the `@kbn/gen-ai-functional-testing` package, which for now
only contains utilities to load the GenAI connector configuration in FTR
tests
- Add FTR integration tests for the `chatComplete` API of the
`inference` plugin

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-04 06:39:45 -06:00
Zacqary Adam Xeper
8f267fd83c
[ResponseOps][Rules] Move Rule Form code into @kbn/response-ops-rule-form (#198725)
## Summary

Part of #195211

Moves Rule Form code out of `@kbn/alerts-ui-shared` and into a new
package called `@kbn/response-ops-rule-form`.

Some types and hooks that are used by multiple features or solutions are
still in `@kbn/alerts-ui-shared` and have been rerouted. The bulk of
Rule Form-specific code is in this new package.


### Checklist

- [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: Kevin Delemme <kevin.delemme@elastic.co>
2024-12-03 12:40:48 -06:00
Joe Reuter
56f2e2258a
🌊 Adjust codeowners for streams code (#202367)
Pending on adding the team to the repo

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-03 17:16:14 +01:00
Bharat Pasupula
6ef0284bce
[Automatic Import] Add base for ftr api tests (#200169)
## Summary

This PR adds a baseline for FTR API tests for Automatic Import.

- Relates https://github.com/elastic/kibana/issues/196063

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-03 15:56:10 +01:00
Alberto Blázquez
e5b1773971
Create the "Asset Inventory" Kibana Plugin (#202291)
## Summary

Closes https://github.com/elastic/kibana/issues/201704.

Create an empty "Asset Inventory" plugin with the minimal boilerplate
required to set it up, install it and run it on Kibana with a blank
slate.

I generated the files using the `node scripts/generate_plugin <NAME>`
script as per [this documentation
page](https://docs.elastic.dev/kibana-dev-docs/getting-started/hello-world-app#2-option-2---use-the-automatic-plugin-generator).

### Screenshots


<details><summary>Main page (Sample page)</summary>
<img width="2498" alt="Screenshot 2024-11-29 at 14 20 57"
src="https://github.com/user-attachments/assets/9d8a3751-519b-4661-bc90-cbb1e836b111">
</details> 

### Implementation details

- [x] Generated a new Kibana plugin with minimal boilerplate and zero
dependencies
- [x] Use [Cloud Security
Posture](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture)
plugin as configuration reference
- [x] Render "Inventory" title on the main page
- [x] Ensure the plugin is properly integrated into Kibana's build and
can be loaded without errors
- [x] Place the plugin under the `x-pack/plugins` directory
- [x] Include Readme file
- [x] Introduce placeholders for initialization of pipelines and
transforms following [Cloud Security
Posture](https://github.com/elastic/kibana/blob/main/x-pack/plugins/cloud_security_posture/server/plugin.ts)
plugin initialize function.

### PR Checklist

- [ ] No docs for now
~~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~~
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Risks

No risks at all since this is totally green-field and will be hidden by
a feature toggle.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paulo Silva <paulo.henrique@elastic.co>
2024-12-03 11:29:53 +01:00
seanrathier
acba610c67
[Cloud Security] Fix serverless quality gate tests and introduce a better solution tests that are only run in MKI Serverless Quality Gates (#202038) 2024-12-02 21:11:30 -08:00
Michael Olorunnisola
78842b7c1c
[Security Solution] - Update codeowners (#202046)
As part of the EUI update work here:
https://github.com/elastic/kibana/issues/199715, we've been asked to
more specifically identify files owned by sub teams of security
solution. This is an initial pass at that work. Please let me know if
any of the files identified for your team are innaccurate
2024-12-02 15:18:59 -06:00
Kerry Gallagher
b0122f547d
[Discover / Logs] Add new "Saved Search component" (#199787)
## Summary

Implements
https://github.com/elastic/logs-dev/issues/111#issuecomment-2446470635.

This adds a new "Saved Search component". The component is a wrapper
around the current Saved Search Embeddable, but uses
`ReactEmbeddableRenderer` directly to render the embeddable outside of
Dashboard contexts. It monitors changes to things like `index`,
`filters` etc and communicates these changes through the embeddable API.

For this PoC two locations were changed to use this component 1) Logs
Overview flyout 2) APM Logs tab (when the Logs Overview isn't enabled
via advanced settings).

The component itself is technically beyond a PoC, and resides in it's
own package. ~I'd like to get eyes from the Discover folks etc on the
approach, and if we're happy I can fix the remaining known issues (apart
from the mixing of columns point as I believe this exists on the roadmap
anyway) and we can merge this for the initial two replacement points.~
[Thanks Davis
👌](https://github.com/elastic/logs-dev/issues/111#issuecomment-2475350199).

`nonPersistedDisplayOptions` is added to facilitate some configurable
options via runtime state, but without the complexity of altering the
actual saved search saved object.

On the whole I've tried to keep this as clean as possible whilst working
within the embeddable framework, outside of a dashboard context.

## Known issues

- ~"Flyout on flyout" in the logs overview flyout (e.g. triggering the
table's flyout in this context).~ Fixed with `enableFlyout` option.
- ~Filter buttons should be disabled via pills (e.g. in Summary
column).~ Fixed with `enableFilters` option.
- Summary (`_source`) column cannot be used alongside other columns,
e.g. log level, so column customisation isn't currently enabled. You'll
just get timestamp and summary. This requires changes in the Unified
Data Table. **Won't be fixed in this PR**

- We are left with this panel button that technically doesn't do
anything outside of a dashboard. I don't *think* there's an easy way to
disable this. **Won't be fixed in this PR**
![Screenshot 2024-11-20 at 11 50
43](https://github.com/user-attachments/assets/e43a47cd-e36e-4511-ba88-c928a4acd634)


## Followups

- ~The Logs Overview details state machine can be cleaned up (it doesn't
need to fetch documents etc anymore).~ The state machine no longer
fetches it's own documents. Some scaffolding is left in place as it'll
be needed for showing category details anyway.

## Example

![Screenshot 2024-11-20 at 12 20
08](https://github.com/user-attachments/assets/3b25d591-e3e2-4e8a-98a8-1bfc849d3bc1)
![Screenshot 2024-11-20 at 12 23
34](https://github.com/user-attachments/assets/a2d28036-98c5-4404-934e-2298cf4a66bf)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-29 23:09:24 +00:00
Carlos Crespo
bedc0660d8
[Infra] Unskip infra serverless tests (#202146)
fixes [191809](https://github.com/elastic/kibana/issues/191809)

## Summary

Unskip infra e2e serverless tests
2024-11-29 11:45:48 -06:00
Elena Shostak
976b94ffa5
Dependency Ownership CLI (#201773)
## Summary

1. Show all packages owned by a specific team
```
node scripts/dependency_ownership -o <owner>
```
2. Identify owners of a specific dependency
```
node scripts/dependency_ownership -d <dependency>
```

3. List dependencies without an owner
```
node scripts/dependency_ownership --missing-owner
```

4. Generate a full dependency ownership report
```
node scripts/dependency_ownership
```

### Checklist

- [x]
[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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)


__Closes: https://github.com/elastic/kibana/issues/196767__

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-29 17:18:36 +01:00
Milton Hultgren
38c9c6728a
Reduce obs knowledge code ownership (#202010)
Trying again, by changing the plugin files...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-29 14:51:16 +01:00
Tre
c011bc7be6
[Ownership] Assign test files to obs team (#201985)
## Summary

Assign test files to obs team

Contributes to: #192979
2024-11-29 12:25:05 +00:00
Tre
0544f35355
[Ownership] Assign more to security solution (#200996)
## Summary

Assign test files to security solution team

Contributes to: #192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-29 09:37:18 +00:00
Davis McPhee
be7d748845
[Discover] Add context awareness telemetry tests for Observability profiles (#201310)
## Summary

As suggested in
https://github.com/elastic/kibana/pull/199255#discussion_r1842804292,
I've copied and modified the existing Discover context awareness
telemetry tests to work for Observability profiles. This helps test that
solution root profiles are picked up as expected, as well as giving us
some serverless coverage.

@elastic/appex-qa It didn't seem like there were any config specific
services for serverless tests yet, so I added the EBT to services to the
main serverless config. If there's a better way to do this, please let
me know and I can update it.

### Checklist

- [ ] 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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-11-28 20:12:26 -04:00
Alberto Blázquez
e3027cf1e1
Reorganize references to folders owned by CSP team in CODEOWNERS file (#202036)
## Summary

Reorganize references to folders owned by the CSP team in `CODEOWNERS`
file.

### Details

- Removed duplicated reference to
`x-pack/plugins/security_solution/public/cloud_security_posture` folder
- Removed redundant references to `basic.ts` and `essentials.ts` in
`x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture`
folder when whole of it is owned
- ~~Removed redundant references to `common`, `graph` and `public`
folders in CSP package when whole package is owned (and missed an
explicit reference to the `storybook` subfolder too)~~
- ~~Grouped and sorted references to all folders owned by our team to
avoid spreading them and to have them in a single part of the file~~ CI
autogenerates part of the file, so I could only group and sort some
references

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-27 12:41:50 -06:00
Tre
01c18c2795
[Ownership] Assign test files to shared ux team (#201988)
## Summary

Assign test files to shared ux team

Contributes to: #192979
2024-11-27 12:06:52 -06:00
Tre
9e75f1838e
[Ownership] Assign test files to presentation team (#201919)
## Summary

Assign test files to presentation team

Contributes to: #192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-27 16:24:18 +00:00
Tre
2c6c33ce7e
[Ownership] Assign test files to fleet team (#201918)
## Summary

Assign test files to fleet team

Contributes to: #192979
2024-11-27 11:48:16 +00:00
Tre
d0774144f0
[Ownership] Assign test files to data discovery team (#201648)
## Summary

Assign test files to data discovery team

Contributes to: #192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2024-11-27 05:29:47 -06:00
Sandra G
fa16ab3151
[Ownership] add security-solution to data usage tests (#201822)
security-solution also needs to be a part of data usage as they need to
review the PRs.
2024-11-26 13:39:42 -06:00
Dzmitry Lemechko
310d922f13
[kbn-scout] initial package implementation (playwright-test POC) (#194006)
## Summary

This PR introduces a new package, **kbn-scout**, designed to streamline
the setup and execution of Playwright tests for Kibana. The `kbn-scout`
package consolidates server management and testing capabilities by
wrapping both the Kibana/Elasticsearch server launcher and the
Playwright test runner. It includes:

- Test and worker-scoped fixtures for reliable setup across test suites
- Page objects combined into the fixture for Kibana UI interactions
- Configurations for seamless test execution in both local and CI
environments (`Cloud` execution is out of scope)
- This package aims to simplify test setup and enhance modularity,
making it easier to create, run, and maintain deployment-agnostic tests,
that are located in the plugin they actually test.

Tests example is available in `x-pack/plugins/discover_enhanced` plugin
under `ui_tests` folder

How to run:
1) As a single script (servers + tests): 
```
node scripts/scout_test.js --config=x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts --serverless=es
```

2) Start servers first
```
node scripts/scout_start_servers.js --serverless=es
```
then run tests:
```
npx playwright test --config=x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts
```
if you have Playwright plugin in IDEA, just use it to run tests files

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-26 17:33:49 +01:00
Tre
f43a8608da
[Ownership] Assign test screenshots to presentation team (#201646)
## Summary

Assign test screenshots to presentation team


Contributes to: #192979
2024-11-26 05:20:12 -06:00
Tre
97a43f7c90
[Ownership] Assign test files to security-detections-response team (#200998)
## Summary

Assign test files to security-detections-response team

Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-26 10:26:12 +00:00
Tre
2f6af2d884
[Ownership] Assign test files to ml team (#200946)
## Summary

Assign test files to ml team

Contributes to: #192979
2024-11-26 09:28:34 +00:00
Tre
553556d466
[Ownership] Assign test files to logstash team (#201005)
## Summary

Assign test files to logstash team
 
Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-26 09:24:18 +00:00
Tre
0ab703e3ef
[Ownership] Assign test files to data discovery team (#200932)
## Summary

Assign test files to data discovery team

Contributes to: #192979
2024-11-25 15:28:58 +00:00
Tre
d0f0809b06
[Ownership] Assign test files to mgmt team (#200989)
## Summary

Assign test files to mgmt team

Contributes to: #192979
2024-11-25 09:08:55 -06:00
Tre
da1a7c49f3
[Ownership] Assign more to presentation team (#201551)
## Summary

Assign more to presentation team

Contributes to: #192979
2024-11-25 14:03:43 +00:00
Tre
9d44c14f66
[Ownership] Assign test files to obs ai assist team (#200936)
## Summary

Assign test files to obs ai assist team

Contributes to: #192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 14:01:56 +00:00
Tre
94c9012f1b
[Ownership] Assign test files to search team (#200988)
## Summary

Assign test files to search team

Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 14:01:07 +00:00
Dario Gieselaar
63da7701e7
[Streams] App plugin (#200060)
Creates the Streams app plugin, which renders UI for managing streams
(see https://github.com/elastic/kibana/pull/198713).

Additional changes in this PR:

- The menus were updated to conditionally add a link to the Streams app.
The Streams plugin itself returns a status$ observable which signals if
Streams have been enabled. This value is used to conditionally render
the link in the various flavors of menus.
- There's a small change in the ES types to allow for ordered params in
ES|QL (vs named params)
- `@kbn/server-route-repository` was updated to be able to override
`access` (instead of only inferring it from the endpoint name).
Additionally, we now allow all route options by default.
- `@kbn/typed-react-router-config` now also exports a `useBreadcrumbs`.
This was copied over from the APM implementation.
- the signature of the `esql` method in
`ObservabilityElasticsearchClient` was updated to separate processing
options from options that are sent over to the _query endpoint.

---------

Co-authored-by: Chris Cowan <chris@elastic.co>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-25 14:51:24 +01:00
Elena Shostak
34bf83b54f
Dependency usage CLI (#198920)
## Summary


[dependency-cruiser](https://github.com/sverweij/dependency-cruiser/tree/main)
is used for building dependency graph.

### Show all dependencies for a specific package/plugin or directory

#### Run for all plugins
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins -o ./tmp/deps-result-all.json
```

#### Run for single plugin
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -o ./tmp/deps-result-single.json
```

#### Run for multiple plugins
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution x-pack/plugins/security -o ./tmp/deps-result-multiple.json
```

#### Run for `x-pack/packages`
```bash
bash scripts/dependency_usage.sh -p x-pack/packages -o ./tmp/deps-packages-1.json
```

#### Run for `packages`
```bash
bash scripts/dependency_usage.sh -p packages -o ./tmp/deps-packages-2.json
```

#### Benchmark

| Analysis              | Real Time   | User Time   | Sys Time   |
|-----------------------|-------------|-------------|------------|
| All plugins           | 7m 21.126s  | 7m 53.099s  | 20.581s    |
| Single plugin         | 31.360s     | 45.352s     | 2.208s     |
| Multiple plugins      | 36.403s     | 50.563s     | 2.814s     |
| x-pack/packages       | 6.638s      | 12.646s     | 0.654s     |
| packages              | 25.744s     | 39.073s     | 2.191s     |


#### Show all packages/plugins within a directory that use a specific
dependency

```sh
bash scripts/dependency_usage.sh -d rxjs -p x-pack/plugins/security_solution
```
---
#### Show all packages/plugins within a directory grouped by code owner
```sh
bash scripts/dependency_usage.sh -d rxjs -p x-pack/plugins -g owner
```
---

#### Group by code owner with adjustable collapse depth for fine-grained
grouping
**Fine-grained grouping**:
```sh
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -g owner --collapse-depth 4
```
**Collapsed grouping**: groups the results under a higher-level owner
(e.g., `security_solution` as a single group).
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -g owner --collapse-depth 1
```
---

#### Show all dependencies matching a pattern (e.g., `react-*`) within a
package
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -d 'react-*' -o ./tmp/result.json
```

### Checklist

- [x]
[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

__Related: https://github.com/elastic/kibana/issues/196767__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 14:07:40 +01:00
Tre
5d6d45c341
[Ownership] Assign test files to viz team (#200934)
## Summary

Assign test files to viz team

Contributes to: #192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 07:03:53 -06:00
Tre
99eb6823e6
[Ownership] Assign test files to core team (#200950)
## Summary

Assign test files to core team

Contributes to: #192979
2024-11-25 05:38:53 -06:00
Tre
18eb11a958
[Ownership] Assign test files to security-defend-workflows team (#201000)
## Summary

Assign test files to security-defend-workflows team

Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 09:11:21 +00:00
Tre
3e10e6053b
[Ownership] Assign test files to obs-ux-logs team (#200940)
## Summary

Assign test files to obs-ux-logs team

Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-24 14:00:11 -06:00
Tre
9bf50ff622
[Ownership] Assign test files to platform-security team (#200951)
## Summary

Assign test files to platform-security team

Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-24 13:55:22 -06:00
Kevin Lacabane
0b3f4fbd3c
[eem] _search endpoint / initial entity manager UI (#199609)
## Summary

- create `_search` endpoint to discover entities with esql queries. It
currently reads sources of the provided `type` from
`kibana_entity_definitions` index. Run this query to insert a
definition:
```
POST kibana_entity_definitions/_doc
{
    "entity_type": "service",
    "index_patterns": ["remote_cluster:logs-*"],
    "metadata_fields": [],
    "identity_fields": ["service.name"],
    "filters": [],
    "timestamp_field": "@timestamp"
}
```

By default `_search` will look at data in the last 5m. The lookup period
can be overriden by providing `start`/`end` parameters in ISO format. It
also accepts a `limit` to specify the number of entities returned which
defaults to 10

```
POST kbn:/internal/entities/v2/_search
{
    "type": "service",
    "start": "2024-11-19T20:40:00.000Z",
    "end": "2024-11-19T20:50:00.000Z",
    "limit": 20
}
```

- create `_search/preview` endpoint to preview output of entity sources
without persisting them
 
- create UI to preview results of an entity definition at
`/app/entity_manager`. The application is living in its own plugin at
`observability_solution/entity_manager_app`
![Screenshot 2024-11-11 at 11 37
18](https://github.com/user-attachments/assets/f284342d-21a3-4ba1-be94-38cff311266c)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Milton Hultgren <miltonhultgren@gmail.com>
2024-11-22 16:12:04 +01:00
Ievgen Sorokopud
a627e011a8
[Rules migration][UI] Basic rule migrations UI (#10820) (#200978)
## Summary

[Internal link](https://github.com/elastic/security-team/issues/10820)
to the feature details

This is a very first version of the SIEM rules migrations UI
functionality. The main goal is to setup and agree on a folder structure
where the feature gonna live. Tests covering feature will follow in a
separate PR (see [internal
link](https://github.com/elastic/security-team/issues/11232) for more
details).

The code follows the structure of prebuilt rules feature
https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table
and hidden behind `siemMigrationsEnabled` feature flag.

### Key UI changes

* New "SIEM Rules Migrations." rules management sub-page
* Navigation between different "finished" migrations
* InMemory table with all the translations within the selected migration
* Translation details preview flyout with `Translation` and `Overview`
tabs
* User cannot modify translations via UI

### Testing locally

Enable the flag

```
xpack.securitySolution.enableExperimental: ['siemMigrationsEnabled']
```
### Screenshot


https://github.com/user-attachments/assets/a5a7e777-c5f8-40b4-be1d-1bd07a2729ac
2024-11-22 15:48:14 +01:00
Rodney Norris
a84122c4ca
[Search] Introduce search navigation plugin (#200314) 2024-11-22 08:35:49 -06:00
Gerard Soldevila
b24fdf5d3f
Sustainable Kibana Architecture: Categorise straightforward packages (#199630)
## Summary

This PR is part of the Kibana Sustainable Architecture effort.

The goal is to start categorising Kibana packages into _generic
platform_ (`group: "platform"`) vs _solution-specific_.

```
group?: 'search' | 'security' | 'observability' | 'platform'
visibility?: 'private' | 'shared'
```
Uncategorised modules are considered to be `group: 'common', visibility:
'shared'` by default.

We want to prevent code from solution A to depend on code from solution
B.
Thus, the rules are pretty simple:

* Modules can only depend on:
  * Modules in the same group
  * OR modules with 'shared' visibility
* Modules in `'observability', 'security', 'search'` groups are
mandatorily `visibility: "private"`.

Long term, the goal is to re-organise packages into dedicated folders,
e.g.:

```
x-pack/platform/plugins/private
x-pack/observability/packages
```

For this first wave, we have categorised packages that seem
"straightforward":
* Any packages that have:
  * at least one dependant module
  * all dependants belong to the same group
* Categorise all Core packages:
  * `@kbn/core-...-internal` => _platform/private_
  * everything else => _platform/shared_
* Categorise as _platform/shared_ those packages that:
  * Have at least one dependant in the _platform_ group.
  * Don't have any `devOnly: true` dependants.

### What we ask from you, as CODEOWNERS of the _package manifests_, is
that you confirm that the categorisation is correct:

* `group: "platform", visibility: "private"` if it's a package that
should only be used from platform code, not from any solution code. It
will be loaded systematically in all serverless flavors, but solution
plugins and packages won't be able to `import` from it.
* `group: "platform", visibility: "shared"` if it's a package that can
be consumed by both platform and solutions code. It will be loaded
systematically in all serverless flavors, and anybody can import / use
code from it.
* `group: "observability" | "security" | "search", visibility:
"private"` if it's a package that is intented to be used exclusively
from a given solution. It won't be accessible nor loaded from other
solutions nor platform code.

Please refer to
[#kibana-sustainable-architecture](https://elastic.slack.com/archives/C07TCKTA22E)
for any related questions.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-22 10:33:25 +01:00
Tim Sullivan
0b92c1d072
[Codeowners] fix a missing space character (#201296)
## Summary

Found a missing space character in the code owners file. This created
problems when trying to filter for all the areas owned by
@elastic/appex-sharedux
2024-11-21 17:36:27 -06:00
Tre
55a5b9f865
[Ownership] Assign test files to cloud-security-posture team (#201003)
## Summary

Assign test files to cloud-security-posture team

Contributes to: #192979
2024-11-21 04:40:28 -06:00
Tre
bb5acea689
[Ownership] Assign test files to qa team (#200948)
## Summary

Assign test files to qa team

Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-21 04:30:27 -06:00
Tre
a459b0d8c3
[Ownership] Assign test files to response ops team (#200952)
## Summary

Assign test files to response ops team

Contributes to: #192979
2024-11-21 08:39:33 +00:00
Tre
115e4dbd3e
[Ownership] Assign test files to presentation team (#200943)
## Summary

Assign test files to presentation team

Contributes to: #192979
2024-11-20 16:56:17 +00:00
Tre
7c02b3279c
[Ownership] Assign test files to fleet team (#200939)
## Summary

Assign test files to fleet team

Contributes to: #192979
2024-11-20 10:41:57 -06:00