Commit graph

6634 commits

Author SHA1 Message Date
Ash
ba8d83a14c
[SecuritySolution][Endpoint] Update serverless roles to include stack connector sub-privilege (#208155)
## Summary

Adds EDR stack connectors sub-privilege to serverless roles.

### Checklist

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/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
- [ ] [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)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
2025-01-27 17:40:28 +00:00
Rickyanto Ang
a2d36067e9
[Cloud Security] Deleting K8S Dashboard (#207127)
## Summary

As K8S Dashboard is currently hidden on main , the code serves no
purpose other than potentially causing Tech debts whenever a refactor or
a migration happens. As such its better to remove it completely. In case
we want to bring it back later we will just pull it from git history

> [!CAUTION]
> **This should only affect Serverless and Main, 8.x.x should still be
able to see and access K8S Dashboard**

## Related Tickets
- https://github.com/elastic/security-team/issues/11418
- https://github.com/elastic/security-team/issues/10735

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paulo Silva <paulo.henrique@elastic.co>
Co-authored-by: Maxim Kholod <maxim.kholod@elastic.co>
2025-01-27 14:06:29 +01:00
Ryland Herrick
c430a6c254
[Security Solution] EUI Refresh Followup Pt. 1 (#205990)
## Summary

This is the first batch of work involving
https://github.com/elastic/kibana/issues/202052. It includes the
following tasks:

- [x] (Important) Review usage of "success" colors for positive,
semantic
intent.([details](https://github.com/elastic/kibana/issues/202052#success)).
- [x] (Important) Review and update color palette usage.
([details](#color-palettes))
- [x] (Important) Replace vis colors used outside of visualizations with
color tokens .
([details](https://github.com/elastic/kibana/issues/202052#viz-colors))
- [x] (Important) Replace custom colors with semantic tokens
([details](https://github.com/elastic/kibana/issues/202052#custom-colors))
- [x] (Important) Replace color calculation functions with semantic
tokens.
([details](https://github.com/elastic/kibana/issues/202052#color-functions))
- [x] Update tokens to use the new naming scheme.
([details](https://github.com/elastic/kibana/issues/202052#renamed))

### What changed?
Broadly, these changes involve two main areas: Exception Lists and the
Rule Creation form (specifically: the EQL query bar and the "time"
inputs (Suppression Duration, Interval, Lookback)).

I also found an unused component, and fixed a minor UI bug with
Exception Comments.

Screenshots (before and after, and with both themes) are included below.

Also: as a majority of these components' usage of theme variables is
done with `@styled-components`, and we are transitioning away from that
toward `@emotion`, I also opted to remove usages of `@styled-components`
wherever possible, as that change was negligible in comparison with the
theming changes. If a file being changed included references to static
eui theme variables, e.g. `euiThemeVars`, those were removed as well
(but many are still outstanding).


### Screenshots

__NOTE__: Most of the "Before" screenshots were taken from a cluster
using the Borealis theme.

<details>
  <summary>
    <h3>Rule Exceptions Tab</h3>
  </summary>
  <kbd>
    <h3>Before</h3>
<img width="1594" alt="Rule Exceptions - Before"
src="https://github.com/user-attachments/assets/56feb5e8-b5ec-4bdc-9372-968056e6bca3"
/>

  </kbd>
  <kbd>
    <h3>After (Amsterdam)</h3>
<img width="805" alt="Rule Exceptions - After (Amsterdam)"
src="https://github.com/user-attachments/assets/a6ab3d47-acc7-4eb6-8a0c-bd9ccafc2021"
/>

  </kbd>
  <kbd>
    <h3>After (Borealis)</h3>
<img width="805" alt="Rule Exceptions - After (Borealis)"
src="https://github.com/user-attachments/assets/9fbd8a17-0afb-4ccc-95ea-5bab4da5b254"
/>

  </kbd>
</details>

<details>
  <summary>
    <h3>Shared Exception Lists</h3>
  </summary>
  <kbd>
    <h3>Before</h3>
<img width="1594" alt="Shared Exception Lists - Before"
src="https://github.com/user-attachments/assets/b2a69f9c-4892-4732-a2e1-e167461680d1"
/>

  </kbd>
  <kbd>
    <h3>After (Amsterdam)</h3>
<img width="805" alt="Shared Exception Lists - After (Amsterdam)"
src="https://github.com/user-attachments/assets/1aea0dff-97ee-4482-9a66-38c4be2baea8"
/>

  </kbd>
  <kbd>
    <h3>After (Borealis)</h3>
<img width="805" alt="Shared Exception Lists - After (Borealis)"
src="https://github.com/user-attachments/assets/76be9446-17fb-451d-b15a-99166cb1f588"
/>
  </kbd>
</details>

<details>


  <summary>
    <h3>Shared List Details</h3>
  </summary>
  <kbd>
    <h3>Before</h3>
<img width="1594" alt="Shared List Details - Before"
src="https://github.com/user-attachments/assets/5eeec91d-ea96-4e3c-8c7d-b5e6bb8bf35a"
/>

  </kbd>
  <kbd>
    <h3>After (Amsterdam)</h3>
<img width="805" alt="Shared List Details - After (Amsterdam)"
src="https://github.com/user-attachments/assets/5229b850-356c-40e7-80f1-d32156f97a56"
/>

  </kbd>
  <kbd>
    <h3>After (Borealis)</h3>
<img width="805" alt="Shared List Details - After (Borealis)"
src="https://github.com/user-attachments/assets/81219613-c329-48f8-8fd3-857207d0ada0"
/>

  </kbd>
</details>

<details>
  <summary>
    <h3>EQL Query Input</h3>
  </summary>
  <kbd>
    <h3>Before</h3>
<img width="1085" alt="EQL Bar - Before"
src="https://github.com/user-attachments/assets/b19cf18b-a5d2-4001-bebc-9154af8e9b43"
/>

  </kbd>
  <kbd>
    <h3>After (Amsterdam)</h3>
<img width="1085" alt="EQL Bar - After (Amsterdam)"
src="https://github.com/user-attachments/assets/70911ad2-9e52-4b65-b305-cd90a6be1fd2"
/>

  </kbd>
  <kbd>
    <h3>After (Borealis)</h3>
<img width="1085" alt="EQL Bar - After (Borealis)"
src="https://github.com/user-attachments/assets/92a789d0-fffa-483c-bcb2-fc02b5e8ce10"
/>

  </kbd>
</details>


<details>
  <summary>
    <h3>Suppression Fields</h3>
  </summary>
  <kbd>
    <h3>Before</h3>
<img width="1085" alt="Suppression Fields - Before"
src="https://github.com/user-attachments/assets/458c3464-0eba-47d4-abbe-8de0b333b8ec"
/>

  </kbd>
  <kbd>
    <h3>After (Amsterdam)</h3>
<img width="1085" alt="Suppression Fields - After (Amsterdam)"
src="https://github.com/user-attachments/assets/b6fb67b0-7908-4fe8-9e02-d9e14c8f97c5"
/>

  </kbd>
  <kbd>
    <h3>After (Borealis)</h3>
<img width="1085" alt="Suppression Fields - After (Borealis)"
src="https://github.com/user-attachments/assets/f48c24a5-50ea-41fd-af45-b3d32f20921b"
/>

  </kbd>

</details>

<details>
  <summary>
    <h3>Suppression Fields (Disabled)</h3>
  </summary>
  <kbd>
    <h3>Before</h3>
<img width="1085" alt="Suppression Fields (Disabled) - Before"
src="https://github.com/user-attachments/assets/e60aa561-d8ce-4b23-8694-e6443ad37c16"
/>

  </kbd>
  <kbd>
    <h3>After (Amsterdam)</h3>
<img width="1085" alt="Suppression Fields (Disabled) - After
(Amsterdam)"
src="https://github.com/user-attachments/assets/45277962-482d-484c-b8bd-3a587b7c16d1"
/>

  </kbd>
  <kbd>
    <h3>After (Borealis)</h3>
<img width="1085" alt="Suppression Fields (Disabled) - After (Borealis)"
src="https://github.com/user-attachments/assets/69f6217b-a2c2-4c6a-be9e-80dfd0a4e5f1"
/>

  </kbd>
</details>

<details>
  <summary>
    <h3>Exception Comments UI Bug</h3>
  </summary>
  <kbd>
    <h3>Before</h3>
<img width="805" alt="Comments UI Bug - Before"
src="https://github.com/user-attachments/assets/652d35fa-8ff2-4850-a9a4-79cec3b4b698"
/>

  </kbd>
  <kbd>
    <h3>After</h3>
<img width="805" alt="Comments UI Bug - After"
src="https://github.com/user-attachments/assets/a8cc1cd6-b25f-4694-a479-c35f45eae6aa"
/>

  </kbd>
</details>

### Checklist

- [ ] [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>
2025-01-23 15:06:03 -06:00
Dzmitry Lemechko
14c3235182
Scout: run tests in parallel (with spaces) (#207253)
## Summary

This PR adds `spaceTest` interface to `kbn-scout` to run space aware
tests, that can be executed in parallel. Most of Discover tests were
converted to parallel run because we see runtime improvement with 2
parallel workers.

Experiment 1: **ES data pre-ingested**, running 9 Discover **stateful**
tests in **5 files** locally
| Run setup  | Took time |
| ------------- | ------------- |
| 1 worker  | `1.3` min |
| 2 workers | `58.7` sec  |
| 3 workers | `48.3` sec  |
| 4 workers | **tests fail**  |

Conclusion: using **2** workers is the optimal solution to continue

Experiment 2: Running Discover tests for stateful/serverless in **Kibana
CI** (starting servers, ingesting ES data, running tests)
| Run setup  | 1 worker | 2 workers | diff
| ------------- | ------------- |------------- |------------- |
| stateful, 9 tests / 5 files  | `1.7` min | `1.2` min | `-29.4%`|
| svl ES, 8 tests / 4 files  | `1.7` min | `1.3` min | `-23.5%`|
| svl Oblt, 8 tests / 4 files  | `1.8` min | `1.4` min | `-22.2%`|
| svl Search, 5 tests / 2 files  | `59.9` sec | `51.6` sec | `-13.8%`|

Conclusion: parallel run effectiveness benefits from tests being split
in **more test files**.

Experiment 3: Clone existing tests to have **3 times more test files**
and re-run tests for stateful/serverless in **Kibana CI** (starting
servers, ingesting ES data, running tests)
| Run setup  | 1 worker | 2 workers | diff
| ------------- | ------------- |------------- |------------- |
| stateful, 27 tests / 15 files  | `4.3` min | `2.7` min | `-37.2%`|
| svl ES, 24 tests / 12 files  | `4.3` min | `2.7` min | `-37.2%`|

Conclusion: parallel run effectiveness is **increasing** with more test
files in place, **not linear** but with good test design we can expect
**up to 40%** or maybe a bit more.

How parallel run works:
- `scoutSpace` fixture is loaded on Playwright worker setup (using
`auto: true` config), creates a new Kibana Space, expose its id to other
fixtures and deletes the space on teardown.
- `browserAuth` fixture for parallel run caches Cookie per worker/space
like `role:spaceId`. It is needed because Playwright doesn't spin up new
browser for worker, but only new context.
- kbnClient was updated to allow passing `createNewCopies: true` in
query, it is needed to load the same Saved Objects in parallel
workers/spaces and generate new ids to work with them. `scoutSpace`
caches ids and allows to reach saved object by its name. This logic is
different from single thread run, where we can use default ids from
kbnArchives.

How to run parallel tests locally, e.g. for stateful: 
```
node scripts/scout run-tests --stateful --config x-pack/platform/plugins/private/discover_enhanced/ui_tests/parallel.playwright.config.ts
```
2025-01-23 20:09:06 +01:00
Nathan Reese
d7f801ab3e
[visualizations] lazy load actions (#207147)
Clean up visualizations page load size by
* lazy loading actions
* avoid exporting from index files to avoid exporting unused code
* move `urlFor` and `getFullPath` into `url_utils` to avoid including
`utils/saved_visualize_utils` in page load bundle

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-23 11:33:23 -07:00
Elena Shostak
ac5366a70e
[Spaces] Moved tests to agnostic setup (#200606)
## Summary

Moved space tests to deployment agnostic setup.


### 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

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-23 15:15:11 +01:00
Yngrid Coello
511f77c231
[Dataset quality] Failure store support (#206758)
Closes https://github.com/elastic/logs-dev/issues/183,
https://github.com/elastic/logs-dev/issues/184 and
https://github.com/elastic/logs-dev/issues/185.

## Summary
This PR aims to support failure store in dataset quality page. The
following acceptance criteria items were resolved

### Dataset quality page
- [x] A column for Failed docs is included in the table
- [x] A tooltip is placed in the title of the column
- [x] A % of documents inside Failure store is calculated for every
dataStream
- [x] If % is lesser than 0.0001 but greater than 0 we should show ⚠
symbol next to the ~0 value (as we do with degraded docs)
- [x] Failed docs percentages greater than 0 should link to discover

 🎥 Demo 


https://github.com/user-attachments/assets/6d9e3f4c-02d9-43ab-88cb-ae70716b05d9

### Dataset details page
- [x] A metric, Failed docs, is included in the Overview panel under
Data set quality. This metric includes the number of documents inside
the failure store for the specific dataStream.
- [x] A tooltip is placed in the title of the Failed docs metric with
message: `The percentage of docs sent to failure store due to an issue
during ingestion.`
- [x] Degraded docs graph section is transformed to Document trends
allowing the users to switch between Degraded docs and Failed docs
trends over time.
- [x] A new chart for failed documents is created with links to
discover/Logs explorer using the right dataView

 🎥 Demo 


https://github.com/user-attachments/assets/6a3a1f09-2668-4e83-938e-ecdda798c199

### Failed docs ingestion issue flyout

- [x] Whenever documents are found in failure store we should list
Document indexing failed in Quality issues table
- [x] User should be able to expand Document indexing failed and see
more information in the flyout
- [x] The flyout will show Docs count, an aggregation of the number of
documents inside failure store for the selected timeframe
- [x] The flyout will show Last ocurrence, the datetime registered for
the most recent document in the failure store.
- [x] The flyout will contain a section called Error messages where a
list of unique error messages should be shown, exposing Content (error
message) and Type (Error Type).
- [x] Type should contain a tooltip where message (`Error message
category`) explain users how we are categorising the errors.
- [x] Other issues inside Quality issues table will be appended by field
ignored and the field will be shown in bold.


https://github.com/user-attachments/assets/94dc81f0-9720-4596-b256-c9d289cefd94

Note: This PR was reconstructed from
https://github.com/elastic/kibana/pull/199806 which it supersedes.

## How to test

1. Execute `failed_logs` synthtrace scenario
2. Open dataset quality page

## Follow ups
- Enable in serverless
- Deployment agnostic tests cannot be added until we enable this in
serverless
- FTR tests will be added as part of
https://github.com/elastic/logs-dev/issues/182

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-23 09:13:28 +01:00
Giorgos Bamparopoulos
368475e8e5
[One Discover] Display stacktrace in the logs overview tab (#204521)
## 📓 Summary
Adds a new section to the overview tab in the log details flyout in
Discover to display stacktrace information for logs and exceptions.

In a follow-up, the stacktrace could be moved to a new tab in the log
details flyout and actions can be added to the stacktrace (and quality)
icons in the document table to open the relevant sections in the flyout.

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

### APM - Log stacktrace (library frames)
<img width="1470" alt="image"
src="https://github.com/user-attachments/assets/8991f882-d329-4bc5-aa37-424576bcee72"
/>

### APM - Exception (with cause)
<img width="1476" alt="image"
src="https://github.com/user-attachments/assets/cfbf24a7-6f82-48f1-b275-5aac977411ac"
/>

### APM - Exception (simple stacktrace)
<img width="1474" alt="image"
src="https://github.com/user-attachments/assets/fc0306c4-5fcd-4b74-bb0d-c1784a48d677"
/>

### Apache Tomcat Integration (Catalina) - Stacktrace
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/281f1822-faea-4e2d-9515-c11a9ee12f50"
/>

## 📝 Notes for reviewers
- The `@kbn/apm-types` package was marked as platform / shared as it's
being used by the
[unified_doc_viewer](https://github.com/elastic/kibana/blob/main/src/plugins/unified_doc_viewer/kibana.jsonc)
- The code used to render stacktraces in APM was moved into a new
`@kbn/event-stacktrace` package as it is reused in the
`unified_doc_viewer`
- The code used to render metadata table in APM was moved into a new
`@kbn/key-value-metadata-table` package

## 🧪 Testing instructions
The deployed environments have sample logs that can be used (time range:
Jan 1, 2025 - now). For a local setup, please follow the instructions
below:

1. Ingest sample logs with stacktraces
([gist](https://gist.github.com/gbamparop/0da21ca7f65b24c4a9c071ce9e9b97b0)).
Please note that these are test data and some fields that are not used
by stacktraces might not be consistent
2. View relevant logs in Discover (Query: `service.name: "synth-node-0"
OR apache_tomcat :*`, Time range: Jan 1, 2025 - now)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-22 18:06:14 +02:00
jennypavlova
10519c2d4a
[Inventory v2][APM] Remove redundant synthtrace scenario (#207716)
## Summary

As discussed in
https://github.com/elastic/kibana/pull/207305#discussion_r1924280917 we
can use `simple_logs` scenario for the same case instead of the new
`logs_only` so this PR removes it.
2025-01-22 11:38:15 +00:00
jennypavlova
bd5e8ca320
[Inventory v2] Fix issue with logs only views (#207305)
Closes https://github.com/elastic/kibana/issues/206967

## Summary

After some changes related to V2 migration of getting the entities,
there was an issue with the new data coming from the endpoint - the
`data_stream.type` is a string instead of an array in case of a single
data stream so this PR adds a fix to support that (and a test)

## Bug fixes
- Service overview page loads for a logs-only data stream
- After adding the fix, I saw another error related to the `useTheme`
and changed it to use the `euiTheme` similar to the other changes
related to the Borealis team upgrade

## Testing
To test the scenario with services and hosts coming from logs (without
APM / metrics) I added a new scenario in synthtrace so to test then we
should:
- Run the new scenario: `node scripts/synthtrace logs_only` (if possible
on a clean ES)
- Enable `observability:entityCentricExperience` in Stack Management >
Advanced Setting
- Go to Inventory and click on a service
   - The logs-only views should be available
- Go to Inventory and click on a host
   - The logs-only views should be available
   


https://github.com/user-attachments/assets/cfd5fd40-ac44-4807-9a29-f3ee3015d814


 - Test one of the scenarios with mix of APM/metrics/logs
    - Run `node scripts/synthtrace infra_hosts_with_apm_hosts`
- Enable `observability:entityCentricExperience` in Stack Management >
Advanced Setting
    - Go to Inventory and click on a service from APM
       - The APM views (service/traces) should be available
    - Go to Inventory and click on a host
       - The asset details view should be available and show metrics
     


https://github.com/user-attachments/assets/894c7c1a-aaa1-42cb-9dcb-05c9a5ca8177



- Infrastructure (Inventory/Hosts, etc) and Applications (Service
Inventory/Traces, etc) should load the data for this scenario and not
for the logs only (also for an oblt cluster connection)
    
    


https://github.com/user-attachments/assets/4d092cc6-a8ad-4022-b980-b443be09acc9
2025-01-21 17:29:05 +01:00
jennypavlova
8b97ad0b13
[APM][Transactions] Test trace summary (#207115)
Closes #206947

## Summary

This PR adds tests for trace summary (Otel / APM cases) and changes the
`styled-components` to `css`.
2025-01-21 09:49:03 +01:00
Nathan Reese
f4df5856f2
[controls] lazy load control actions (#206876)
* register control actions with async method
* move floating actions into controls plugin
* replace `PANEL_HOVER_TRIGGER` => `CONTROL_HOVER_TRIGGER`
* Load controls in single chunk
<img width="400" alt="Screenshot 2025-01-16 at 11 40 08 AM"
src="https://github.com/user-attachments/assets/3171c9bf-26bc-4c07-950d-c35603cfb65a"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-20 14:00:48 -07:00
Tomasz Kajtoch
8d2a43a0ce
Replace Borealis isServerless conditional with YML config (#206690)
Resolves https://github.com/elastic/eui-private/issues/171
Resolves https://github.com/elastic/eui-private/issues/177

## Summary

This PR addresses a prior PR review
[comment](https://github.com/elastic/kibana/pull/203840/files#diff-bb850523655bac7adb30995553acabae9705435fa51e5b8bf13c483152db694a)
by removing `isServerless` from the logic determining what theme should
be used at runtime with a simple YML configuration setting instead.

I added a non-public `uiSettings.experimental.defaultTheme` config
property that defaults to `borealis` and is set to `amsterdam` in
`serverless.yml`. Since the default theme is now (and should be) set to
Borealis, I also updated `DEFAULT_THEME_NAME` and `FALLBACK_THEME_NAME`
to reflect that. This doesn't have any impact on Serverless; it will
keep using Amsterdam.

Additionally, while making these changes, I wanted to simultaneously
improve types and address earlier PR
[comment](https://github.com/elastic/kibana/pull/199748#discussion_r1840402343).
Now `SUPPORTED_THEME_NAMES` array is declared as `const` making the
`ThemeName` type strict instead of resolving a generic `string` type.
Usages were updated to use `ThemeName` instead of `string`, too.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-20 16:38:50 +01:00
Gerard Soldevila
a3a2b2273f
SK: Relocate Script v7.2 (#207081)
## Summary

* Added a few transforms to simplify package paths.
* Fixed typo causing `.mdx` files to not be processed when replacing
references.
* Added preliminary support for `--healthcheck` (to check for broken
references to files and links).
2025-01-20 15:43:32 +01:00
Jan Monschke
1b167d9dc2
[SecuritySolution] Breaking out timeline & note privileges (#201780)
## Summary

Epic: https://github.com/elastic/security-team/issues/7998

In this PR we're breaking out the `timeline` and `notes` features into
their own feature privilege definition. Previously, access to both
features was granted implicitly through the `siem` feature. However, we
found that this level of access control is not sufficient for all
clients who wanted a more fine-grained way to grant access to parts of
security solution.

In order to break out `timeline` and `notes` from `siem`, we had to
deprecate it feature privilege definition for. That is why you'll find
plenty of changes of `siem` to `siemV2` in this PR. We're making use of
the feature privilege's `replacedBy` functionality, allowing for a
seamless migration of deprecated roles.

This means that roles that previously granted `siem.all` are now granted
`siemV2.all`, `timeline.all` and `notes.all` (same for `*.read`).
Existing users are not impacted and should all still have the correct
access. We added tests to make sure this is working as expected.

Alongside the `ui` privileges, this PR also adds dedicated API tags.
Those tags haven been added to the new and previous version of the
privilege definitions to allow for a clean migration:

```mermaid
flowchart LR
    subgraph v1
    A(siem) --> Y(all)
    A --> X(read)
    Y -->|api| W(timeline_write / timeline_read / notes_read / notes_write)
    X -->|api| V(timeline_read /notes_read)
    end

    subgraph v2
    A-->|replacedBy| C[siemV2]
    A-->|replacedBy| E[timeline]
    A-->|replacedBy| G[notes]
    

    E --> L(all)
    E --> M(read)
    L -->|api| N(timeline_write / timeline_read)
    M -->|api| P(timeline_read)

    G --> Q(all)
    G --> I(read)

    Q -->|api| R(notes_write / notes_read)
    I -->|api| S(notes_read)
    end
```

### Visual changes

#### Hidden/disabled elements

Most of the changes are happening "under" the hood and are only
expressed in case a user has a role with `timeline.none` or
`notes.none`. This would hide and/or disable elements that would usually
allow them to interact with either timeline or the notes feature (within
timeline or the event flyout currently).

As an example, this is how the hover actions look for a user with and
without timeline access:

| With timeline access | Without timeline access |
| --- | --- |
| <img width="616" alt="Screenshot 2024-12-18 at 17 22 49"
src="https://github.com/user-attachments/assets/a767fbb5-49c8-422a-817e-23e7fe1f0042"
/> | <img width="724" alt="Screenshot 2024-12-18 at 17 23 29"
src="https://github.com/user-attachments/assets/3490306a-d1c3-41aa-af5b-05a1dd804b47"
/> |

#### Roles

Another visible change of this PR is the addition of `Timeline` and
`Notes` in the edit-role screen:

| Before | After |
| ------- | ------ |
| <img width="746" alt="Screenshot 2024-12-12 at 16 31 43"
src="https://github.com/user-attachments/assets/20a80dd4-c214-48a5-8c6e-3dc19c0cbc43"
/> | <img width="738" alt="Screenshot 2024-12-12 at 16 32 53"
src="https://github.com/user-attachments/assets/afb1eab4-1729-4c4e-9f51-fddabc32b1dd"
/> |

We made sure that for migrated roles that hard `security.all` selected,
this screen correctly shows `security.all`, `timeline.all` and
`notes.all` after the privilege migration.

#### Timeline toast

There are tons of places in security solution where `Investigate / Add
to timeline` are shown. We did our best to disable all of these actions
but there is no guarantee that this PR catches all the places where we
link to timeline (actions). One layer of extra protection is that the
API endpoints don't give access to timelines to users without the
correct privileges. Another one is a Redux middleware that makes sure
timelines cannot be shown in missed cases. The following toast will be
shown instead of the timeline:

<img width="354" alt="Screenshot 2024-12-19 at 10 34 23"
src="https://github.com/user-attachments/assets/1304005e-2753-4268-b6e7-bd7e22d8a1e3"
/>

### Changes to predefined security roles

All predefined security roles have been updated to grant the new
privileges (in ESS and serverless). In accordance with the migration,
all roles with `siem.all` have been assigned `siemV2.all`,
`timeline.all` and `notes.all` (and `*.read` respectively).

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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)
- [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] 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.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: PhilippeOberti <philippe.oberti@elastic.co>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
2025-01-20 14:09:16 +01:00
Amir Ben Nun
fec5d74398
[Fleet] Send Agentless API resources (#206042)
## Summary

Conclude agentless policy resources and send them to the Agentless API
on the creation request.
- Resolves: https://github.com/elastic/kibana/issues/203371
2025-01-19 12:52:10 +02:00
Anton Dosov
3ca02b3240
[React@18] fix outstanding easy unit tests (#206917)
## Summary

Extracted remaining easy backward-compatible unit test fixes that fail
with React@18 from https://github.com/elastic/kibana/pull/206411

The idea is that the tests should pass for both React@17 and React@18
2025-01-17 11:55:08 +00:00
Dzmitry Lemechko
158146402e
[kbn-scout-reporting] escape html characters in html report (#206987)
## Summary

Fixing `Error details` section not properly displaying html characters
in error stacktrace.

Before:

<img width="1347" alt="image"
src="https://github.com/user-attachments/assets/1821751f-3a89-46a6-bf55-ed2fe845a196"
/>

After: 

<img width="1347" alt="image"
src="https://github.com/user-attachments/assets/83526d8a-ca3c-4b62-a01e-69029f0e8e7e"
/>
2025-01-17 10:16:15 +01:00
Tre
8b1394986b
[FTR] Fixup Retry Logging (#205894)
## Summary

Only log out the number of attempts when the `retryCount` is truthy

Previously we were seeing the attempt counter, constantly reporting 0
for each attempt.

### To Run Locally
```
node scripts/jest --config packages/kbn-ftr-common-functional-services/jest.config.js
```

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-16 17:03:16 +00:00
Philippe Oberti
097fb03bc4
move content-management and react files left behind in the packages folder (#206874)
## Summary

While looking at the `packages` folder at the root of Kibana, I noticed
some files were left over in otherwise empty folders:
- 2 README files were left in the `content-management` folder
- 1 README file and 1 png file were left in the `react` folder

The rest of the content was moved to a new location as part of the
Sustainable Kibana Architecture effort (see [this
PR](https://github.com/elastic/kibana/pull/205593) and [that
one](https://github.com/elastic/kibana/pull/205924)) and I wonder if
those few files were left behind by mistake.

I did not making any changes to the content of the files, I just moved
them to their respective new locations.

Please let me know if these were left behind intentionally, or if they
should be deleted instead of moved!

### Notes

The `appex-sharedux` codeowner only appeared after pushing the second
commit which impacts the `react` folder. I realized that the codeowners
file was pointing to the folder within
`src/platform/packages/shared/content-management/content_insights` and
`src/platform/packages/shared/content-management/favorites` so update it
to point to the parent folder, which now contains the moved README
files. I hope that's ok!

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-16 11:01:20 -06:00
Larry Gregory
395e49484e
Add check to fail CI if any dependencies are unowned (#206679)
## Summary
- Updates `scripts/dependency_ownership` to use the
`@kbn/dev-cli-runner` for consistency with other CI-related CLIs.
- Adds a new `failIfUnowned` flag to exit with an error code if any
dependencies are unowned.
- Adds a new dependency ownership check to `quick_checks` and `renovate`
CI steps.


From a CI run, the additional quick check executes successfully in 3
seconds:
```sh
info [quick-checks] Passed check: /opt/buildkite-agent/builds/bk-agent-prod-gcp-abc123/elastic/kibana-pull-request/kibana/.buildkite/scripts/steps/checks/dependencies_missing_owner.sh in 3s
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-16 09:59:04 -05:00
Tre
9a439b7549
[FTR] migrate p-retry usage to Retry service (#206088)
## Summary

Use the
[tryWithRetries](37d7a5efb7/packages/kbn-ftr-common-functional-services/services/retry/retry.ts (L105))
service method instead of `pRetry` as detailed
[here](https://github.com/elastic/kibana/issues/178535)

`tryWithRetries` offers granular control of `retryCount`, `retryDelay`,
and `timeout`.
> [!IMPORTANT]
In some cases, there are helper functions that do not have access to the
FTR's provider context.
So, instead of using `retry.tryWithRetries`, we are using
`retryForSuccess` instead.
`retryForSuccess` is the function that `tryWithRetries` uses "_under the
hood_".
As long as we use the `retryCount` argument, we will get the retry
logging, as per [this related
pr](https://github.com/elastic/kibana/pull/205894)
 
Related: https://github.com/elastic/kibana/issues/178535,
https://github.com/elastic/kibana/pull/205894

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-16 13:19:14 +00:00
Nathan Reese
55f3cf7a66
[dashboard] lazy load dashboard actions (#206492)
* move actions to `registerActionAsync`
* remove global string file loaded in page load bundle
* Break constants into smaller files so only constants required by page
load bundle are exposed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-15 11:57:09 -07:00
Dzmitry Lemechko
1023402f8d
[kbn-scout-reporting] add failed test reporter (#205096)
## Summary

Extending scout-reporter with `failed-test-reporter`, that saves
failures in json summary file. For each test failure html report file is
generated and linked in summary report:
```
[
  {
    "name": "stateful - Discover app - saved searches - should customize time range on dashboards",
    "htmlReportFilename": "c51fcf067a95b48e2bbf6098a90ab14.html"
  },
  {
    "name": "stateful - Discover app - value suggestions: useTimeRange enabled - dont show up if outside of range",
    "htmlReportFilename": "9622dcc1ac732f30e82ad6d20d7eeaa.html"
  }
]
```

This PR updates `failed_tests_reporter_cli` to look for potential Scout
test failures and re-generate test failure artifacts in the same format
we already use for FTR ones.

These new artifacts are used to list failures in BK annotation: 

<img width="1092" alt="image"
src="https://github.com/user-attachments/assets/09464c55-cdaa-45a4-ab47-c5f0375b701c"
/>


test failure html report example: 
<img width="1072" alt="image"
src="https://github.com/user-attachments/assets/81f6e475-1435-445d-82eb-ecf5253c42d3"
/>

Note for reviewer: 3 Scout + 1 FTR tests were "broken" to show/test
reporter, those changes must be reverted before merge. See failed
pipeline
[here](https://buildkite.com/elastic/kibana-pull-request/builds/266822)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-15 18:40:34 +00:00
Gerard Soldevila
b21a70dabb
SKA: Relocate @kbn/grid-layout (#206821)
## 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.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * 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, as some of them contain relative paths
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

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

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

| Id | Target folder |
| -- | ------------- |
| `@kbn/grid-layout` | `src/platform/packages/private/kbn-grid-layout` |


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

```
./.i18nrc.json
./examples/grid_example/tsconfig.type_check.json
./package.json
./packages/kbn-ts-projects/config-paths.json
./src/platform/packages/private/kbn-grid-layout/jest.config.js
./src/platform/packages/private/kbn-repo-packages/package-map.json
./tsconfig.base.json
./tsconfig.base.type_check.json
./tsconfig.refs.json
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
src/platform/packages/private/kbn-grid-layout/jest.config.js:12
src/platform/packages/private/kbn-grid-layout/tsconfig.json:2
src/platform/packages/private/kbn-grid-layout/tsconfig.type_check.json:2
```

</details>
2025-01-15 17:39:41 +00:00
Nathan Reese
a928f28e9a
remove SCSS imports from presentation_panel page load bundle (#206533)
* removes SCSS import from presentation_panel
* Removes strings file to avoid importing all strings in page load
bundle.
2025-01-15 10:22:00 -07:00
Philippe Oberti
708789102f
[Security Solution] - remove styled-components and cleanup for event viewer and data table components (#206523)
## Summary

This PR originally aimed at replacing the usages `styled-components`
with `@emotion/react` in the
`security_solution/public/common/components/events_viewer` folder. I
quickly realized removing some of these would require a small refactor.
This lead to making a few more changes, as many properties were actually
unused so a cleanup was welcome.

Only 2 small UI changes are introduced in this PR:
- the inspect icon on the top right corner of the tables are now always
visible instead of only visible on hover. I'm aware that this is a
different behavior from the alerts table in the alerts page, but we also
have other tables (like the one on threat intelligence page) where the
icon is always shown. Waiting on @codearos for confirmation here
- the `Grid view` and `Additional filters` button are reversed due to
the simplification of the code

No other UI changes are introduced. No behavior logic has been changed
either.

The biggest code cleanup are:
- removal of a bunch of unused properties and logic
- deletion of the RightTopMenu component: it was used in both
`StatefulEventsViewerComponent` and `getPersistentControlsHook` but none
of the internal logic was overlapping. I don't know how we got there but
its current implementation was overly complex and completely
unnecessary...

#### Alerts page

![Screenshot 2025-01-13 at 4 33
36 PM](https://github.com/user-attachments/assets/c6c588c1-16f1-49f8-bcc0-246fb05f7e10)

#### Rule creation page

![Screenshot 2025-01-13 at 4 34
14 PM](https://github.com/user-attachments/assets/ea2332c3-425a-4960-8bd6-f2d7395cdf34)

#### Host/User/Network events tab

![Screenshot 2025-01-13 at 4 34
27 PM](https://github.com/user-attachments/assets/4194e406-6bff-4a46-bc99-aadd1aea88d7)

#### Host session view tab

![Screenshot 2025-01-13 at 4 34
42 PM](https://github.com/user-attachments/assets/045b3bb2-2681-4089-a303-a77f797f9b90)

### 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>
2025-01-15 09:18:19 -06:00
Philippe Oberti
d9b9425372
[Security Solution] - remove styled-components and cleanup for timeline header actions (#206694)
## Summary

Similar to [this previous
PR](https://github.com/elastic/kibana/pull/206523), this PR originally
aimed at replacing the usages styled-components with @emotion/react in
the security_solution/public/common/components/header_actions folder. I
quickly realized that a lot of props and event components were actually
not used at all, so a cleanup was welcome.

Absolutely no UI or behavior logic changes should be introduced by this
PR.

This PR will impact the tables in timeline, and the markdown use in
osquery.

The biggest code cleanup are:
- removing a couple of components related to the header actions used in
timeline
- removing random unused translations, constants or helper functions

#### Timeline query, correlation and pinned tabs

![Screenshot 2025-01-14 at 5 29
49 PM](https://github.com/user-attachments/assets/8c06c0f3-c323-4dd7-96d1-14357abc551d)

![Screenshot 2025-01-14 at 5 30
05 PM](https://github.com/user-attachments/assets/7332fbe2-8744-46d5-a5e8-bd056fba0375)

![Screenshot 2025-01-14 at 5 30
27 PM](https://github.com/user-attachments/assets/86053a20-f0e4-4f0a-8bdd-0c2678194903)

### 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
2025-01-15 09:14:28 -06:00
Faisal Kanout
b0973cf26c
[Exploratory View] Audit new EUI Borealis theme (#205212)
## Summary

It fixes #205051 

<del>
Files are excluded because of `euiScrollBar` and `euiScrollBarCorner`
replacement (TBD)
-
x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/series_editor.tsx

-
x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/components/filter_values_list.tsx
</del>
  DONE
2025-01-15 15:53:49 +01:00
Hannah Mudge
686571547f
[Dashboard][Collapsable Panels] Swap react-grid-layout for kbn-grid-layout (#205341)
Closes https://github.com/elastic/kibana/issues/190446

## Summary

This PR swaps out `react-grid-layout` for the new internal
`kbn-grid-layout` in the Dashboard plugin. This is the first major step
in making collapsible sections possible in Dashboard.

- **`react-grid-layout` (before)**:


https://github.com/user-attachments/assets/ca6ec059-7f4a-43fb-890e-7b72b781e50b

- **`kbn-grid-layout` (after)**:


https://github.com/user-attachments/assets/3d3de1f3-1afc-4e6b-93d6-9cc31a46e2cf

### Notable Improvements

- Better handling of resizing panels near the bottom of the screen
   
  | `react-grid-layout` | `kbn-grid-layout` |
  |--------|--------|
| ![Jan-09-2025
09-59-00](https://github.com/user-attachments/assets/75854b76-3ad7-4f06-9745-b03bde15f87a)
| ![Jan-09-2025
09-26-24](https://github.com/user-attachments/assets/f0fbc0bf-9208-4866-b7eb-988c7abc3e50)
|


- Auto-scroll when dragging / resizing panels near the top and bottom of
the screen, making it much easier to move panels around by larger
distances

  | `react-grid-layout` | `kbn-grid-layout` |
  |--------|--------|
| ![Jan-09-2025
10-01-30](https://github.com/user-attachments/assets/e3457e5e-3647-4024-b6e6-c594d6d3e1d7)
| ![Jan-09-2025
09-25-35](https://github.com/user-attachments/assets/3252bdec-2bbc-4793-b089-346866d4589b)
|

- More reliable panel positioning due to the use of CSS grid rather than
absolute positioning via pixels

  | `react-grid-layout` | `kbn-grid-layout` |
  |--------|--------|
| ![Screenshot 2025-01-09 at 9 32
52 AM](https://github.com/user-attachments/assets/06bd31a4-0a9f-4561-84c3-4cd96ba297b0)
| ![Screenshot 2025-01-09 at 9 35
14 AM](https://github.com/user-attachments/assets/573dab98-3fb9-4ef6-9f37-c4cf4d03ce52)
|

- Better performance when dragging and resizing (see
https://github.com/elastic/kibana/pull/204134 for a more thorough
explanation) and a smaller bundle size than `react-grid-layout`

### 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
- [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)

### Identify risks

This PR contains a significant change to the Dashboard layout engine,
which means that it carries a decent amount of risk for introducing new,
uncaught bugs with dragging / resizing panels and collision resolution.
That being said, `kbn-grid-layout` has been built **iteratively** with
plenty of testing along the way to reduce this risk.

## Release note
Improves Dashboard layout engine by switching to the internally
developed `kbn-grid-layout`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
2025-01-14 14:51:14 -07:00
Gerard Soldevila
7cf4ee8121
SKA: Cleanup and follow-up tasks (1 of many) (#206420)
## Summary

* Cleanup duplicate CODEOWNERS entries (introduced in
https://github.com/elastic/kibana/pull/203682).
* Update `node scripts/generate package` to support sustainable folders.
* Rescue orphan `.mdx` files belonging to shared-ux
* Update broken link
2025-01-14 19:03:58 +01:00
Candace Park
4162fe07ef
[Defend Workflows][Eui Visual Refresh] Basic theme update (#204892)
## Summary

For the most part, all of our colors translated fine into Borealis when
testing our pages. There will be more changes needed in the future to
completely replace all of the `euiThemeVars` usages, especially in
components that are shared with other teams. There are also quite a few
exported custom styled components that can't easily use the
`useEuiTheme` hook since they are not inside a react component. I didn't
want to touch those at this time.

- [x] Replace deprecated tokens to use new naming scheme ( like
successText --> textSuccess)
- [x] Use the hook `useEuiTheme()` over other methods

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-14 09:54:30 -05:00
Faisal Kanout
ac584159e0
[UX Plugin] Audit new EUI Borealis theme (#205195)
## Summary

It fixes #205051

---------
2025-01-14 14:05:43 +01:00
Agustina Nahir Ruidiaz
487be325c0
[Security Solution] [EUI Visual Refresh] update deprecated usage of "success" color (#205679)
## Summary

Resolves EUI Visual Refresh issue #202491
This PR is part of a list of PRs to perform the changes necessary to get
the new Borealis theme working correctly. It focuses on replacing the
deprecated color "success" colors have been updated to
"accentSecondary".

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-14 13:56:50 +01:00
Eyo O. Eyo
e6e4eda151
[Authz] Migrate outstanding SharedUX routes with access tags (#206260)
## Summary

Relates to https://github.com/elastic/kibana-team/issues/1235, this PR
tackles routes could not have been migrated automatically by the
security team. Following the guidance by the security provided in the
aforementioned issue instances where the tag approach had been
previously used to configure access have been migrated to use the
`requiredPrivilege` property on `security.authz` for route definitions.

### Checklist
<!--
Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/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
- [ ] [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)
-->
- [x] 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)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

-->

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-13 14:52:06 +01:00
Gerard Soldevila
683a768941
SKA: Relocate remaining modules (#206103)
## 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.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * 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, as some of them contain relative paths
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

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 2 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/entities-data-access-plugin` |
`x-pack/solutions/observability/plugins/entities_data_access` |
| `@kbn/entityManager-app-plugin` |
`x-pack/solutions/observability/plugins/entity_manager_app` |




#### 10 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/core-user-settings-server` |
`src/core/packages/user-settings/server` |
| `@kbn/core-user-settings-server-internal` |
`src/core/packages/user-settings/server-internal` |
| `@kbn/core-user-settings-server-mocks` |
`src/core/packages/user-settings/server-mocks` |
| `@kbn/calculate-auto` |
`src/platform/packages/shared/kbn-calculate-auto` |
| `@kbn/charts-theme` | `src/platform/packages/shared/kbn-charts-theme`
|
| `@kbn/palettes` | `src/platform/packages/shared/kbn-palettes` |
| `@kbn/saved-search-component` |
`src/platform/packages/shared/kbn-saved-search-component` |
| `@kbn/use-tracked-promise` |
`src/platform/packages/shared/kbn-use-tracked-promise` |
| `@kbn/response-ops-rule-form` |
`src/platform/packages/shared/response-ops/rule_form` |
| `@kbn/streams-schema` |
`x-pack/solutions/observability/packages/kbn-streams-schema` |


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

```
./.i18nrc.json
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-ts-projects/config-paths.json
./src/core/packages/user-settings/server-internal/jest.config.js
./src/core/packages/user-settings/server-mocks/jest.config.js
./src/platform/packages/private/kbn-repo-packages/package-map.json
./src/platform/packages/shared/kbn-calculate-auto/jest.config.js
./src/platform/packages/shared/kbn-charts-theme/jest.config.js
./src/platform/packages/shared/kbn-palettes/jest.config.js
./src/platform/packages/shared/kbn-saved-search-component/jest.config.js
./src/platform/packages/shared/kbn-use-tracked-promise/jest.config.js
./src/platform/packages/shared/response-ops/rule_form/jest.config.js
./tsconfig.base.json
./x-pack/solutions/observability/packages/kbn-streams-schema/jest.config.js
./x-pack/solutions/observability/plugins/entities_data_access/jest.config.js
./x-pack/solutions/observability/plugins/entity_manager_app/jest.config.js
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
src/core/packages/user-settings/server-internal/jest.config.js:12
src/core/packages/user-settings/server-internal/tsconfig.json:2
src/core/packages/user-settings/server-mocks/jest.config.js:12
src/core/packages/user-settings/server-mocks/tsconfig.json:2
src/core/packages/user-settings/server/tsconfig.json:2
src/platform/packages/shared/kbn-calculate-auto/jest.config.js:12
src/platform/packages/shared/kbn-calculate-auto/tsconfig.json:2
src/platform/packages/shared/kbn-charts-theme/jest.config.js:12
src/platform/packages/shared/kbn-charts-theme/tsconfig.json:2
src/platform/packages/shared/kbn-palettes/jest.config.js:12
src/platform/packages/shared/kbn-palettes/tsconfig.json:2
src/platform/packages/shared/kbn-saved-search-component/jest.config.js:12
src/platform/packages/shared/kbn-saved-search-component/tsconfig.json:2
src/platform/packages/shared/kbn-use-tracked-promise/jest.config.js:12
src/platform/packages/shared/kbn-use-tracked-promise/tsconfig.json:2
src/platform/packages/shared/response-ops/rule_form/jest.config.js:12
src/platform/packages/shared/response-ops/rule_form/tsconfig.json:2
x-pack/solutions/observability/packages/kbn-streams-schema/jest.config.js:10
x-pack/solutions/observability/packages/kbn-streams-schema/tsconfig.json:2
x-pack/solutions/observability/plugins/entities_data_access/jest.config.js:12
x-pack/solutions/observability/plugins/entities_data_access/tsconfig.json:2
x-pack/solutions/observability/plugins/entity_manager_app/jest.config.js:12
x-pack/solutions/observability/plugins/entity_manager_app/tsconfig.json:2
x-pack/solutions/observability/plugins/entity_manager_app/tsconfig.json:7
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-13 09:12:28 +01:00
Tomasz Kajtoch
93935619de
Make Borealis the default theme in non-serverless (#203840) 2025-01-11 14:23:45 +01:00
Nick Partridge
481b8037d6
[kbn-test] Jest run script should use testPathPattern to lookup config (#206341)
Adds logic to support the jest vscode extension by reading the
`--testPathPattern` arg for the purpose of config lookup. This enables
running tests easily in the vscode jest extension.
2025-01-10 17:27:05 -06:00
Mark Hopkin
80baa2cd9e
[Entity Analytics][9.0] Remove all legacy risk engine code and features (#201810) 2025-01-10 21:51:32 +00:00
Zacqary Adam Xeper
d8b0b6e926
[ResponseOps] [Rule Form] Move rule form steps to hook with progress tracking (#205944)
## Summary

Part of #195211 

In preparation for the horizontal rule form layout, move the generation
of the rule form steps into three hooks:

- `useCommonRuleFormSteps`: private hook that generates a series of
objects specifying the rule form steps, how to display them, and what
order to display them in
- `useRuleFormSteps`: hook that calls `useCommonRuleFormSteps` and
transforms them into data for the standard vertical `EuiSteps`, along
with progress tracking based on `onBlur` events
- `useRuleFormHorizontalSteps`: hook that calls hook that calls
`useCommonRuleFormSteps` and transforms them into data for
`EuiStepsHorizontal`, plus navigation functions. ***These will be used
in the smaller rule form flyout in a second PR***

Because `EuiStepsHorizontal` rely more heavily on the `EuiSteps`
`status` property, I took this opportunity to improve progress tracking
in the standard vertical steps. Most rule types will load the create
page with Step 1: Rule Definition already being in a `danger` state,
because an incomplete rule definition component immediately sends
errors, and the error API doesn't distinguish between invalid data or
incomplete data.

This PR wraps each step in a `reportOnBlur` higher-order component,
which will report the first time a step triggers an `onBlur` event.
Steps with errors will now report `incomplete` until they first trigger
an `onBlur`. The result:

1. The user loads the Create Rule page. Rule Definition is marked
`incomplete`
2. The user interacts with Rule Definition, but does not yet complete
the definition.
3. The user interacts with the Actions step, the Rule Details step, or
another part of the page. The Rule Definition is now marked `danger`.

This is inelegant compared to an error API that can actually distinguish
between an incomplete form and an invalid form, but it's an improvement
for now.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-10 15:08:14 -06:00
Dzmitry Lemechko
ecf1818608
[kbn-test] export fleet package registry image (#206234)
## Summary

Should fix TS check error `Project references may not form a circular
graph` by removing `@kbn/test-suites-xpack` from `kbn-scout` dependency
list.

Since dockerImage for Fleet package registry is just a constant, that is
used across different FTR and Scout configurations, it makes sense to
export it from `kbn-test`
2025-01-10 17:44:06 +01:00
Lola
473eb721bc
[Cloud Security] Feature Flag Support for Cloud Security Posture Plugin (#205438)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

## Changes

* Adds `enableExperimental` to server `configSchema`
* Makes feature flags configurable via
`xpack.cloudSecurityPosture.enableExperimental` in `kibana.dev.yml`
* Implements `ExperimentFeatureService.get()` for accessing feature
flags
* Add passing `initliaterContext` to plugin in order to access our
plugin config

## Benefits

* Avoids circular dependency with Security Solution
`useIsExperimentalFeatureEnabled` and prop drilling feature flags from
Fleet plugin `PackagePolicyReplaceDefineStepExtensionComponentProps`
* Provides server-side configuration support
* Enables pre-release feature testing
* Creates centralized feature flag management

This allows controlled testing of new features before release through
configuration rather than code changes.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-10 10:55:06 -05:00
Anton Dosov
64b6a1a5e7
Sustainable Kibana Architecture: Move the rest of shared-ux modules (#205924)
## 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.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * 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, as some of them contain relative paths
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

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

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

| Id | Target folder |
| -- | ------------- |
| `@kbn/url-drilldown-plugin` |
`x-pack/platform/plugins/private/drilldowns/url_drilldown` |




#### 21 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/core-chrome-browser` | `src/core/packages/chrome/browser` |
| `@kbn/deeplinks-shared` |
`src/platform/packages/shared/deeplinks/shared` |
| `@kbn/home-sample-data-card` |
`src/platform/packages/shared/home/sample_data_card` |
| `@kbn/home-sample-data-tab` |
`src/platform/packages/shared/home/sample_data_tab` |
| `@kbn/home-sample-data-types` |
`src/platform/packages/shared/home/sample_data_types` |
| `@kbn/guided-onboarding` |
`src/platform/packages/shared/kbn-guided-onboarding` |
| `@kbn/item-buffer` | `src/platform/packages/private/kbn-item-buffer` |
| `@kbn/management-settings-section-registry` |
`src/platform/packages/shared/kbn-management/settings/section_registry`
|
| `@kbn/management-settings-ids` |
`src/platform/packages/shared/kbn-management/settings/setting_ids` |
| `@kbn/react-mute-legacy-root-warning` |
`src/platform/packages/private/kbn-react-mute-legacy-root-warning` |
| `@kbn/saved-objects-settings` |
`src/platform/packages/private/kbn-saved-objects-settings` |
| `@kbn/react-kibana-context-common` |
`src/platform/packages/shared/react/kibana_context/common` |
| `@kbn/react-kibana-context-render` |
`src/platform/packages/shared/react/kibana_context/render` |
| `@kbn/react-kibana-context-root` |
`src/platform/packages/shared/react/kibana_context/root` |
| `@kbn/react-kibana-context-styled` |
`src/platform/packages/shared/react/kibana_context/styled` |
| `@kbn/react-kibana-context-theme` |
`src/platform/packages/shared/react/kibana_context/theme` |
| `@kbn/react-kibana-mount` |
`src/platform/packages/shared/react/kibana_mount` |
| `@kbn/serverless-project-switcher` |
`src/platform/packages/private/serverless/project_switcher` |
| `@kbn/serverless-common-settings` |
`src/platform/packages/private/serverless/settings/common` |
| `@kbn/serverless-observability-settings` |
`src/platform/packages/shared/serverless/settings/observability_project`
|
| `@kbn/serverless-types` |
`src/platform/packages/private/serverless/types` |


<details >
<summary>Updated relative paths</summary>

```
src/core/packages/chrome/browser/jest.config.js:12
src/core/packages/chrome/browser/tsconfig.json:2
src/core/packages/chrome/browser/tsconfig.type_check.json:2
src/core/packages/chrome/browser/tsconfig.type_check.json:21
src/core/packages/chrome/browser/tsconfig.type_check.json:24
src/core/packages/chrome/browser/tsconfig.type_check.json:27
src/core/packages/chrome/browser/tsconfig.type_check.json:30
src/core/packages/chrome/browser/tsconfig.type_check.json:33
src/core/packages/chrome/browser/tsconfig.type_check.json:36
src/core/packages/chrome/browser/tsconfig.type_check.json:39
src/core/packages/chrome/browser/tsconfig.type_check.json:42
src/core/packages/chrome/browser/tsconfig.type_check.json:45
src/core/packages/chrome/browser/tsconfig.type_check.json:48
src/core/packages/chrome/browser/tsconfig.type_check.json:51
src/core/packages/chrome/browser/tsconfig.type_check.json:54
src/platform/packages/private/kbn-item-buffer/jest.config.js:12
src/platform/packages/private/kbn-item-buffer/tsconfig.json:2
src/platform/packages/private/kbn-react-mute-legacy-root-warning/jest.config.js:12
src/platform/packages/private/kbn-react-mute-legacy-root-warning/tsconfig.json:2
src/platform/packages/private/kbn-saved-objects-settings/jest.config.js:12
src/platform/packages/private/kbn-saved-objects-settings/tsconfig.json:2
src/platform/packages/private/kbn-saved-objects-settings/tsconfig.type_check.json:2
src/platform/packages/private/serverless/project_switcher/jest.config.js:12
src/platform/packages/private/serverless/project_switcher/tsconfig.json:2
src/platform/packages/private/serverless/project_switcher/tsconfig.type_check.json:2
src/platform/packages/private/serverless/project_switcher/tsconfig.type_check.json:23
src/platform/packages/private/serverless/settings/common/tsconfig.json:2
src/platform/packages/private/serverless/settings/common/tsconfig.type_check.json:2
src/platform/packages/private/serverless/settings/common/tsconfig.type_check.json:20
src/platform/packages/private/serverless/types/tsconfig.json:2
src/platform/packages/private/serverless/types/tsconfig.type_check.json:2
src/platform/packages/shared/deeplinks/shared/jest.config.js:12
src/platform/packages/shared/deeplinks/shared/tsconfig.json:2
src/platform/packages/shared/deeplinks/shared/tsconfig.type_check.json:2
src/platform/packages/shared/home/sample_data_card/jest.config.js:12
src/platform/packages/shared/home/sample_data_card/tsconfig.json:2
src/platform/packages/shared/home/sample_data_card/tsconfig.type_check.json:2
src/platform/packages/shared/home/sample_data_card/tsconfig.type_check.json:23
src/platform/packages/shared/home/sample_data_card/tsconfig.type_check.json:29
src/platform/packages/shared/home/sample_data_tab/jest.config.js:12
src/platform/packages/shared/home/sample_data_tab/tsconfig.json:2
src/platform/packages/shared/home/sample_data_tab/tsconfig.type_check.json:2
src/platform/packages/shared/home/sample_data_tab/tsconfig.type_check.json:23
src/platform/packages/shared/home/sample_data_types/jest.config.js:12
src/platform/packages/shared/home/sample_data_types/tsconfig.json:2
src/platform/packages/shared/home/sample_data_types/tsconfig.type_check.json:2
src/platform/packages/shared/kbn-guided-onboarding/jest.config.js:12
src/platform/packages/shared/kbn-guided-onboarding/tsconfig.json:2
src/platform/packages/shared/kbn-guided-onboarding/tsconfig.type_check.json:2
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.json:2
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.type_check.json:2
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.type_check.json:22
src/platform/packages/shared/kbn-management/settings/section_registry/tsconfig.type_check.json:25
src/platform/packages/shared/kbn-management/settings/setting_ids/tsconfig.json:2
src/platform/packages/shared/kbn-management/settings/setting_ids/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/common/jest.config.js:12
src/platform/packages/shared/react/kibana_context/common/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/common/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/render/jest.config.js:12
src/platform/packages/shared/react/kibana_context/render/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/render/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/render/tsconfig.type_check.json:25
src/platform/packages/shared/react/kibana_context/root/jest.config.js:12
src/platform/packages/shared/react/kibana_context/root/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:28
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:31
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:34
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:37
src/platform/packages/shared/react/kibana_context/root/tsconfig.type_check.json:40
src/platform/packages/shared/react/kibana_context/styled/jest.config.js:12
src/platform/packages/shared/react/kibana_context/styled/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/styled/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/styled/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_context/theme/jest.config.js:12
src/platform/packages/shared/react/kibana_context/theme/tsconfig.json:2
src/platform/packages/shared/react/kibana_context/theme/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_context/theme/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_mount/jest.config.js:12
src/platform/packages/shared/react/kibana_mount/tsconfig.json:2
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:2
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:22
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:25
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:28
src/platform/packages/shared/react/kibana_mount/tsconfig.type_check.json:34
src/platform/packages/shared/serverless/settings/observability_project/tsconfig.json:2
src/platform/packages/shared/serverless/settings/observability_project/tsconfig.type_check.json:2
src/platform/packages/shared/serverless/settings/observability_project/tsconfig.type_check.json:20
x-pack/platform/plugins/private/drilldowns/url_drilldown/tsconfig.json:2
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-01-10 11:30:37 +00:00
Gerard Soldevila
3b42b80bce
SKA: Relocate Script v7.1 (#206233)
## Summary

* Fix an issue with the `--list` command failing the 1st run.
* Allow passing in no filters, and relocate "incorrect" modules (aka
modules that are not in the correct folder) in that case.
2025-01-10 10:47:47 +00:00
Alex Szabo
b3b81331b5
[ci] Work around docosaurus errors (#206097)
## Summary
This workaround removes the folder that needs to be built differently
after cloning the repos.

See: https://github.com/elastic/kibana/issues/206077
2025-01-09 16:33:30 -06:00
Larry Gregory
a9f5f432ad
Dependency ownership refinements (#205937)
## Summary

This PR assigns owners for dependencies that are not yet claimed. These
assignments were a "best effort", and will likely need tweaking once
downstream teams start receiving renovate PRs.
2025-01-09 18:33:38 +00:00
Janki Salvi
a56227bf37
[ResponseOps][Rules] Allow to set notify when and throttle at rule level (#203235)
## Summary

Fixes https://github.com/elastic/kibana/issues/199494

This PR allows to create and update rule with `notify_when` and
`throttle` attributes at rule level instead of `action.frequency` level.

### How to test
- create a rule via api where `notify_when` and `throttle` attributes
are at rule level
  <details><summary>Example</summary>
  Note: use your existing connector for action
  
  ```typescript
  POST kbn:/api/alerting/rule
  {
    "tags": [],
    "params": {
      "searchConfiguration": {
        "query": {
          "query": "",
          "language": "kuery"
        },
        "index": "ff959d40-b880-11e8-a6d9-e546fe2bba5f"
      },
      "timeField": "order_date",
      "searchType": "searchSource",
      "timeWindowSize": 5,
      "timeWindowUnit": "d",
      "threshold": [
        10
      ],
      "thresholdComparator": ">",
      "size": 100,
      "aggType": "count",
      "groupBy": "all",
      "termSize": 5,
      "excludeHitsFromPreviousRun": false,
      "sourceFields": []
    },
    "schedule": {
      "interval": "1m"
    },
    "consumer": "stackAlerts",
    "name": "ES query rule from devtools",
    "rule_type_id": ".es-query",
    "notify_when": "onThrottleInterval",
    "throttle": "1h",
    "actions": [
      {
        "group": "query matched",
        "id": "ad923c8a-d27d-41a9-8c71-d33d94db4abb",
        "params": {
          "documents": [
            {
              "name": "{{rule.name}}"
            }
          ]
        }
      }
    ],
    "alert_delay": {
      "active": 1
    }
  }
  ``` 
  </details> 

- open the created rule
- go to `settings` tab 
- verify that dropdowns reflect notify_when and throttle value correctly
- update the rule via UI and verify the same
- update the rule via API and verify the same

### Flaky test runner: 
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7684

### Checklist

Check the PR satisfies following conditions. 

- [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
2025-01-09 16:18:28 +00:00
Alberto Blázquez
1e9606de9c
Turn AssetInventory sub-plugin into a Security solution page (#205363)
## Summary

Turn AssetInventory plugin into a simple Security solution page based on
this conversation:
- https://github.com/elastic/security-team/issues/10346

Follow-up of this work, where we initially developed the Asset Inventory
bare-bones as a plugin:
- https://github.com/elastic/kibana/issues/201704

Part of this work stream though not originally planned:
- https://github.com/elastic/security-team/issues/11247?reload=1

### Motivation

Reasoning behind is enabling fast development changes without any major
refactors in other packages/components that need to be reused, which
seems impossible as of now with the current codebase.

### Checklist

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

### Identify risks

In the future, we'll probably have to turn AssetInventory into a
sub-plugin again. Doing so doesn't bring any risk in the present, and
should only involve the re-generation of the deleted files in this PR.

---------

Co-authored-by: Paulo Henrique <paulo.henrique@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-09 13:53:31 +01:00
Angela Chuang
78dfe5f81e
[Security Solution][threat hunting explore] EUI refresh: Remove custom color hex (#204631)
## Summary

https://github.com/elastic/kibana/issues/202498
https://github.com/elastic/kibana/issues/202503

1. This PR does **Not** include the severity color change. It will be
implemented in a follow up PR once color tokens have been decided.
2. This PR updates the type `GetLensAttributes` to accept `euiTheme`, so
all the functions in this type are updated accordingly.

https://github.com/elastic/kibana/pull/204631/files#diff-abe20658865cad59eadcff945552b40832d96da0264ed89ddd5ab25ded1420a3R30

----

## To test:

Please verify if visualizations are displayed properly.

### Running Kibana with the Borealis theme
In order to run Kibana with `Borealis`, you'll need to do the following:

1. Set the following in kibana.dev.yml:
`uiSettings.experimental.themeSwitcherEnabled: true`
4. Run Kibana with the following environment variable set: 
```KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn start```

5. This will expose a toggle under Stack Management > Advanced Settings > Theme version, which you can use to toggle between Amsterdam and Borealis.


![Image](https://github.com/user-attachments/assets/78d64946-43fc-4400-bbb1-229d900b7f05)

----


### Explore


<img width="2557" alt="host_after" src="https://github.com/user-attachments/assets/f69b6e2a-58f6-4ed4-9f38-dcdbcf9919ed" />
<img width="1281" alt="users_after" src="https://github.com/user-attachments/assets/0eec8e9c-e678-4a66-83ee-4b8d11380b8e" />
<img width="2552" alt="network_dns" src="https://github.com/user-attachments/assets/19f06d2a-6e51-419b-9f89-233bfa5727ba" />
<img width="2557" alt="network_after" src="https://github.com/user-attachments/assets/3b90c5e2-23a1-4f15-a2d0-f9290a39af30" />

----

### Dashboards

<img width="2557" alt="dashboard_overview" src="https://github.com/user-attachments/assets/c1873359-fee9-42c6-addd-fe2bc1c98aee" />
<img width="2558" alt="dashboard_detection_response_2" src="https://github.com/user-attachments/assets/f6853710-0938-402b-b326-fa00d586b5d6" />
<img width="2559" alt="dashboard_detection_response_1" src="https://github.com/user-attachments/assets/4eb75526-9a57-46e9-b090-b53353956ea1" />

----


### Alerts
<img width="2555" alt="alerts_chart_collapsed" src="https://github.com/user-attachments/assets/6ecf5dd5-a785-4701-900b-0454f024b36d" />
<img width="2554" alt="summary" src="https://github.com/user-attachments/assets/1731a6ea-ef2b-4d7d-bf21-4041e59f0ad4" />
<img width="2559" alt="trend" src="https://github.com/user-attachments/assets/b9a741d1-a359-4273-9555-850cdcbc8932" />
<img width="2557" alt="counts" src="https://github.com/user-attachments/assets/a6193ccc-86b8-4974-ad9f-9417e200e859" />
<img width="1281" alt="treemap" src="https://github.com/user-attachments/assets/7b6e163a-a660-4bb1-a6de-88e21934b98a" />

----

### Rules preview
<img width="2556" alt="Screenshot 2024-12-18 at 13 45 33" src="https://github.com/user-attachments/assets/47099c18-86ee-455a-a5af-ebd6a29904a5" />


----

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-09 12:46:55 +00:00
Marta Bondyra
ea6d7bef93
[Dashboard][Collapsable Panels] Respond to touch events (#204225)
## Summary

Adds support to touch events. The difference between these ones and
mouse events is that once they are active, the scroll is off (just like
in the current Dashboard)


https://github.com/user-attachments/assets/4cdcc850-7391-441e-ab9a-0abbe70e4e56

Fixes https://github.com/elastic/kibana/issues/202014
2025-01-08 23:59:46 +00:00