Commit graph

948 commits

Author SHA1 Message Date
Kevin Delemme
4107d9809d
chore(slo): Add testing plan (#213392) 2025-03-06 09:54:23 -05:00
Michael Olorunnisola
4db40eacde
[Performance][Security Solution] - Improve cell renderer performance (#212982)
## Summary

Background: https://github.com/elastic/kibana/pull/212173

Based off of feedback on the work in the PRs listed in that issue,
additional performance improvements can be made to the cells rendered in
the alert table. The changes made in this PR involve migrating out
shared context to a provider so certain hooks (some expensive... i.e.
browserFieldsByName) aren't made for every cell in the UI, but once and
passed down to each cell accordingly.


- [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-03-06 08:35:04 -05:00
José Luis González
c67a239e45
[Search] Removing elastic managed connectors misleading content (#213335)
## Summary

Fixing misleading info noted in this GH issue ticket
https://github.com/elastic/search-team/issues/9483 regarding Elastic
managed connectors that are not available in Serverless


Connectors empty state page:

![CleanShot 2025-03-06 at 10 38
45@2x](https://github.com/user-attachments/assets/c26da5f3-ec9a-4ec0-bf6c-a50284556bbd)

Connectors list page (without the Callout banner on top):

![CleanShot 2025-03-06 at 10 41
00@2x](https://github.com/user-attachments/assets/68920905-b2d3-49b8-a2ad-a8500717e129)



### 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)
- [ ] 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-03-06 14:24:11 +01:00
jennypavlova
f195570049
[ObsUX] [APM] [OTel] Runtime metrics show dashboards with different ingest path (#211822)
Closes #211783
Part of https://github.com/elastic/kibana/issues/195857

## Summary

This PR expands the logic to get the dashboard files based on the agent.
We have many different ways to ingest data so we want to add more
metrics dashboards to the APM metrics tab. The different ingest paths we
have:
Classic APM Agent   --> APM Server       --> ES
Vanilla OTel SDKs     --> APM Server       --> ES
EDOT OTel SDKs      --> APM Server       --> ES
Classic APM Agent   --> EDOT Collector --> ES
Vanilla OTel SDKs.    --> EDOT Collector --> ES
EDOT OTel SDKs      --> EDOT Collector --> ES
We agreed on having a dashboard filename pattern to make showing the
correct dashboard easier described
[here](https://github.com/elastic/kibana/issues/195857#issue-2580733648)

First, we determine if the ingest path is through APM Server or EDOT
Collector by checking the `telemtry.sdk` fields.

## TODOs / Reviewer notes
- [ ] Currently, we have a fallback to metrics charts which is valid
only if we have APM agent so this PR adds an empty state message:
"Runtime metrics are not available for this Agent / SDK type." in case
there is no dashboard for the service language. To be improved in
https://github.com/elastic/kibana/issues/211774 and will be updated in
this PR when ready - I will still open it for review as the other logic
can be reviewed
- The dashboards are to be updated (by the agent team so not part of the
changes here)

## Testing: 
- Using e2e PoC 
- The available dashboard cases can be found in
[loadDashboardFile](91f169e19a/x-pack/solutions/observability/plugins/apm/public/components/app/metrics/static_dashboard/dashboards/dashboard_catalog.ts (L40))
- Cases to be checked:
- OTel native with Vanilla OTel SDKs with available dashboard (example
case file: `otel_native-otel_other-nodejs`, `...-java`, `...-dotnet`)
   
<img width="1903" alt="image"
src="https://github.com/user-attachments/assets/44d37b05-a8e7-4f14-a1de-2c631f1843bb"
/>

- APM server with Vanilla OTel SDKs service with available dashboard
(example case file: `classic_apm-otel_other-nodejs`, `...-java`,
`...-dotnet`)
   

![image](https://github.com/user-attachments/assets/caef88ea-2603-41ad-b815-f4c0c3647809)

- APM server with Classic APM Agent (example case file:
`classic_apm-apm-nodejs`, `...-java`)
   
<img width="962" alt="image"
src="https://github.com/user-attachments/assets/f9e96dce-55c8-467a-93f0-a09fa219597e"
/>

- OTel native with Vanilla OTel SDKs without available dashboard (empty
state case example: python service)
 

![image](https://github.com/user-attachments/assets/4cb6cca3-240e-422b-9288-701ef080f9cc)

- APM server with Vanilla OTel SDKs service without available dashboard
(empty state)
   
<img width="1910" alt="image"
src="https://github.com/user-attachments/assets/5219cf94-5013-4874-aaea-e558cca69281"
/>

- APM server with Classic APM Agent without available dashboard (Current
metrics fallback)
   
<img width="1914" alt="image"
src="https://github.com/user-attachments/assets/66342f49-876c-4ad5-a4d1-1414c3abac75"
/>

- ⚠️ OTel native Dashboards are still not available (at the time of
adding the description)

---------

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-06 13:52:44 +01:00
Meghan Murphy
02c313ca06
[Connectors] A11y refocus manage button (#212157)
## Summary

As part of Accessibility requirements, a user thats using only the
keyboard should be able to know which element they are on at the moment
after closing windows. As part of that the 'Ingest Pipelines' page, the
'Manage' button now refocuses once the 'Delete Custom Pipeline' popup is
closed. See screenshots below

### Closes https://github.com/elastic/kibana/issues/196650

<img width="1437" alt="Screenshot 2025-02-21 at 3 20 47 PM"
src="https://github.com/user-attachments/assets/4fa44b18-9856-4e39-9c1b-03dd367d798b"
/>
<img width="1407" alt="Screenshot 2025-02-21 at 3 19 53 PM"
src="https://github.com/user-attachments/assets/71aa01ca-f936-47f2-909e-57f649b03ca5"
/>
<img width="1443" alt="Screenshot 2025-02-21 at 3 20 05 PM"
src="https://github.com/user-attachments/assets/f1df4d64-e4e3-440f-a833-a7b2746def60"
/>
<img width="1448" alt="Screenshot 2025-02-21 at 3 20 16 PM"
src="https://github.com/user-attachments/assets/ac5f4100-b155-417a-b453-5ba9594d06e5"
/>

Notice that the 'Manage' button is refocused

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

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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Rodney Norris <rodney@tattdcodemonkey.com>
2025-03-06 07:51:00 -05:00
Pablo Machado
98c18a395e
[main] [SecuritySolution] Fix risk engine component template renaming (#212853) (#213329)
# Backport

This will backport the following commits from `8.18` to `main`:
- [[SecuritySolution] Fix risk engine component template renaming
(#212853)](https://github.com/elastic/kibana/pull/212853)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2025-03-05T09:50:31Z","message":"[SecuritySolution]
Fix risk engine component template renaming (#212853)\n\n##
Summary\n\nThe previous implementation tried to rename the index
template during\n`init` and did not consider multiple spaces. to fix it,
I have:\n* Delete the previous code from `init`\n* Created a new
migration that created the new component templates and\nupdated the
index templates\n* Deleted the old component template after all spaces
migration ran\n* Add support for multiple spaces\n* I also renamed a
function inside `init` to make the code more clear\n* Added error
handling code that concatenates error messages and logs\nall of them at
the end\n\n\n### How to test it:\n\n**Scenario 1**\n\n* The usual way to
desk test this PR would be\n* Create a cluster with 8.17\n* Enable the
risk Engine in 8.17\n* Create a new space in 8.17\n* Upgrade the cluster
to 8.18 (this branch)\n* Enable the risk engine in the second
space.\n\n**Scenario 2**\n* Create a cluster with 8.17\n* Enable the
risk engine\n* Create a space\n* Enable another risk engine\n* Create
another space\n* Upgrade the cluster to 8.18 (this branch)\n* Check if
the migration ran in the logs\n* Check if all risk engines are installed
and the index templates and\nindex components are there.\n* Install a
new risk engine in the space where it isn't installed.\n* Restart Kibana
and make sure the migrations didn't run a second time\n\n###
Checklist\n\nReviewers should verify this PR satisfies this list as
well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\n[ ] This PR needs to be tested for upgrades between
different versions\nand a diverse number of spaces and risk engines
installed\n\n---------\n\nCo-authored-by: abhishekbhatia1710
<abhishek.bhatia@elastic.co>","sha":"b7908a4c6f91c79459f7b509bfd444ad169d6770","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:
SecuritySolution","Feature:Entity Analytics","Team:Entity
Analytics","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[SecuritySolution]
Fix risk engine component template
renaming","number":212853,"url":"https://github.com/elastic/kibana/pull/212853","mergeCommit":{"message":"[SecuritySolution]
Fix risk engine component template renaming (#212853)\n\n##
Summary\n\nThe previous implementation tried to rename the index
template during\n`init` and did not consider multiple spaces. to fix it,
I have:\n* Delete the previous code from `init`\n* Created a new
migration that created the new component templates and\nupdated the
index templates\n* Deleted the old component template after all spaces
migration ran\n* Add support for multiple spaces\n* I also renamed a
function inside `init` to make the code more clear\n* Added error
handling code that concatenates error messages and logs\nall of them at
the end\n\n\n### How to test it:\n\n**Scenario 1**\n\n* The usual way to
desk test this PR would be\n* Create a cluster with 8.17\n* Enable the
risk Engine in 8.17\n* Create a new space in 8.17\n* Upgrade the cluster
to 8.18 (this branch)\n* Enable the risk engine in the second
space.\n\n**Scenario 2**\n* Create a cluster with 8.17\n* Enable the
risk engine\n* Create a space\n* Enable another risk engine\n* Create
another space\n* Upgrade the cluster to 8.18 (this branch)\n* Check if
the migration ran in the logs\n* Check if all risk engines are installed
and the index templates and\nindex components are there.\n* Install a
new risk engine in the space where it isn't installed.\n* Restart Kibana
and make sure the migrations didn't run a second time\n\n###
Checklist\n\nReviewers should verify this PR satisfies this list as
well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\n[ ] This PR needs to be tested for upgrades between
different versions\nand a diverse number of spaces and risk engines
installed\n\n---------\n\nCo-authored-by: abhishekbhatia1710
<abhishek.bhatia@elastic.co>","sha":"b7908a4c6f91c79459f7b509bfd444ad169d6770"}},"sourceBranch":"8.18","suggestedTargetBranches":["9.0","main","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212853","number":212853,"mergeCommit":{"message":"[SecuritySolution]
Fix risk engine component template renaming (#212853)\n\n##
Summary\n\nThe previous implementation tried to rename the index
template during\n`init` and did not consider multiple spaces. to fix it,
I have:\n* Delete the previous code from `init`\n* Created a new
migration that created the new component templates and\nupdated the
index templates\n* Deleted the old component template after all spaces
migration ran\n* Add support for multiple spaces\n* I also renamed a
function inside `init` to make the code more clear\n* Added error
handling code that concatenates error messages and logs\nall of them at
the end\n\n\n### How to test it:\n\n**Scenario 1**\n\n* The usual way to
desk test this PR would be\n* Create a cluster with 8.17\n* Enable the
risk Engine in 8.17\n* Create a new space in 8.17\n* Upgrade the cluster
to 8.18 (this branch)\n* Enable the risk engine in the second
space.\n\n**Scenario 2**\n* Create a cluster with 8.17\n* Enable the
risk engine\n* Create a space\n* Enable another risk engine\n* Create
another space\n* Upgrade the cluster to 8.18 (this branch)\n* Check if
the migration ran in the logs\n* Check if all risk engines are installed
and the index templates and\nindex components are there.\n* Install a
new risk engine in the space where it isn't installed.\n* Restart Kibana
and make sure the migrations didn't run a second time\n\n###
Checklist\n\nReviewers should verify this PR satisfies this list as
well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\n[ ] This PR needs to be tested for upgrades between
different versions\nand a diverse number of spaces and risk engines
installed\n\n---------\n\nCo-authored-by: abhishekbhatia1710
<abhishek.bhatia@elastic.co>","sha":"b7908a4c6f91c79459f7b509bfd444ad169d6770"}},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
2025-03-06 17:19:51 +05:30
Faisal Kanout
3535d86d39
[OBX-UX-MGMT] Test plan for Rules and alerts, Overview page, and Cases (#212097)
## Summary

Adding a UI test plan for Rules, Alerts, Overview page, and Cases
2025-03-06 11:25:50 +00:00
Pablo Machado
b69b696e7f
[SecuritySolution] Fix Risk score Insufficient privileges warning missing cluster privileges (#212405)
## Summary

### 
* Fixes Bug: User with no cluster privileges should not be able to
enable the risk score
When users with no cluster privileges open the risk score page, they
don't see any errors and are able to click the install button.

This happened because we were only checking for index privileges in the
UI, but for the enablement flow we also need to check cluster
privileges. I also introduced a new parameter to the missing privileges
hook so pages that only need to check for `read` privileges can work as
before.


https://github.com/user-attachments/assets/fe162005-ee2b-497d-8744-6262e4511d2d


* Fixed Bug: The install button was enabled when all toggles were
disabled
There were too many booleans in the panel, which was confusing and led
me to introduce more bugs while trying to fix this one, so I refactored
the code to understand it before fixing it.
I also simplified the logic to display the modal. Now, it only shows
when one of the engines' status is "not_installed"

<img width="300"
src="https://github.com/user-attachments/assets/a2e8fbba-ac64-4c97-9ef0-ef6fe61e60cd"
/>







### To Reproduce

1. Create a user with security privileges and index privileges but no
cluster privileges
2. Go to the risk score page and enable the toggle


### Checklist

Check the PR satisfies following conditions. 


- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or
2025-03-06 10:51:08 +01:00
Shahzad
8f7f5ff73b
[Observability] Add alert details action button !! (#213195)
## Summary

Add alert details action button !!

if you have opened up the flyout, reason action button gets hidden.

Also fixed dark theme issues for the chart !!

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/e9ba3330-2378-418a-91b7-52b67fdc4c09"
/>
2025-03-06 08:02:37 +01:00
Nathan Reese
04ee5fc4f3
[embeddable] remove EmbeddableInput type (#211949)
EmbeddableInput type is part of the legacy embeddable system. The legacy
embeddable system is being removed and as such, the EmbeddableInput type
is being removed.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-05 18:41:00 -07:00
Alejandro Fernández Haro
c240b035d4
[CI tools] Use ES 8.x (#213056)
## Summary

After upgrading the ES client to 9.0
(https://github.com/elastic/kibana/pull/208776), we noticed that the CI
fails to upload the results of the tests to the CI cluster:

```
ERROR ResponseError: media_type_header_exception
      	Caused by:
      		status_exception: Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json; compatible-with=9
      	Root causes:
      		media_type_header_exception: Invalid media-type value on headers [Content-Type, Accept]
```

This PR makes sure that the CI client is still using v8.x until we
upgrade that cluster.
2025-03-05 20:26:57 +01:00
Shahzad
80f4aab305
[Synthetics] Fix tls alert data !! (#212758)
### Summary
This PR improves and fixes the TLS alert data handling in the Synthetics
plugin. Key updates include:


### Code changes

1. **Request Body Updates**:
   - Added `agent.name`.
- Changed optional chaining to direct property access for
`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.
   - Added `ping.agent.name`.

2. **Cert Type Adjustments**:
- Added fields: `monitorName`, `monitorId`, `monitorType`, `locationId`,
`locationName`, `@timestamp`, `hostName`.

3. **Observer Codec**:
   - Ensured `name` and `geo.name` are required fields.

4. **Monitor Type and Ping Type**:
   - Added `name` to `MonitorType`.
   - Moved `@timestamp` to required fields in `PingType`.

7. **Message Utils**:
- Adjusted `getCertSummary` and `getTLSAlertDocument` so that we can
properly generate alert document
2025-03-05 19:40:04 +01:00
Jordan
827219b82a
[Cloud Security] Asset Inventory - Universal Flyout Header Boxes, Tags, Fields Components (#211366) 2025-03-05 18:13:35 +01:00
Alberto Blázquez
af147b5cc6
Set from & to as optional args in @kbn/grouping (#213212)
## Summary

Set `from` and `to` as optional args in `getGroupingQuery`, a function
exposed by `@kbn/grouping`.

It will unblock this PR:
- https://github.com/elastic/kibana/pull/212955

### Motivation 

`getGroupingQuery` returns an ES aggregation for grouping documents.
This function assumes data will be queried in a certain interval of
time. However, Asset Inventory needs to query data from the beginning of
time because the UI will not provide any time-range filter. So in order
to reuse this logic, we need to set both args as optional.

Reason for wrapping both fields in an optional `timeRange` record is to
have either both present or both undefined, not only one of them
present.

### 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/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
- [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)
- [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
- [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 risk at all. It would be a breaking change otherwise, if we had to
require args that were optional before.
2025-03-05 11:21:54 -05:00
Jatin Kathuria
197a281bf9
[Siem Migrations] Translated Rules Upsell Page (#212777)
## Summary

This PR adds the Upsell for `Translated Rules` Page as per
[design](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=oJug1zebtufPlNKM-0).


Below is the Demo for the same.

|Instance|Demo|
|---|---|
|ESS|<video
src="https://github.com/user-attachments/assets/d7484635-292d-4bf0-883b-c9fd93b72096"/>|
|Serverless|<video
src="https://github.com/user-attachments/assets/767d8409-a391-41b8-b4d1-1c838dffc363"/>|




### 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/src/platform/packages/shared/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


### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-05 15:53:26 +01:00
Tomasz Kajtoch
75f9c6113d
Upgrade EUI to v99.4.0 (#212974) 2025-03-05 14:09:55 +01:00
Davis Plumlee
461787bea6
[Security Solution] Add UI incentivizers to upgrade prebuilt rules (#211862)
## Summary

Partially addresses https://github.com/elastic/kibana/issues/210358

Adds all callouts and logic to incentivize users to upgrade their rules asap. These include:

- [x] Showing a callout on the Rule Management page
- [x] Showing a callout on the Rule Details page
  - [x] Letting users open the Rule Upgrade flyout from the Rule Details page
- [x] Showing a callout on the Rule Editing page
- [x] Showing a callout in the Rule Upgrade flyout if rule has missing base version

This PR also adds related updates to the rule diff algorithms in order to facilitate an easier upgrade experience when rules have missing base versions. These include:

- [x] When the rule has a missing base version and is NOT marked as customized:
  - [x] We should return all the target fields from the diff algorithm as NO_CONFLICT
- [x] When the rule has a missing base version and is marked as customized:
  - [x] We should attempt to merge all non-functional mergeable fields (any field that doesn't have consequences with how the rule runs e.g. tags) and return them as `SOLVABLE_CONFLICT`.
    - **NOTE**: When base versions are missing and the rule is customized, we attempt to merge all mergable, non-functional rule fields. These include all fields covered by the scalar diff array (`tags`, `references`, `new_terms_fields`, `threat_index`). We typically also consider multi-line string fields as mergeable but without three versions of the string, we are currently unable to merge the strings together, so we just return target version.
  - [x] We should pick the target version for all functional mergeable fields (e.g. `index`) and non-mergeable fields and return them as `SOLVABLE_CONFLICT`.


### Screenshots


**Callout on Rule details page w/ flyout button**
![Screenshot 2025-03-03 at 3 58 17 PM](https://github.com/user-attachments/assets/77117cad-fd8c-4b37-8ef7-f66d77f373b8)

---

**Upgrade flyout now accessible from rule details page**
![Screenshot 2025-03-03 at 3 58 25 PM](https://github.com/user-attachments/assets/f78e10fe-0767-44ab-a9c9-a5ae616b8b0e)

---

**Callout on rule editing page**
![Screenshot 2025-03-03 at 3 58 38 PM](https://github.com/user-attachments/assets/be68420f-a612-4e3d-9139-ad65a3d8b9fc)

---

**Dismissible callout on rule management page**
![Screenshot 2025-03-03 at 3 57 52 PM](https://github.com/user-attachments/assets/5227a4d1-474a-44d2-b0bb-fc020e584e8e)

---

**Callout in rule upgrade flyout when rule has missing base version**
![Screenshot 2025-03-03 at 3 58 04 PM](https://github.com/user-attachments/assets/3c1a23fa-f1f0-4301-b392-4c91097a9cb9)

### 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/src/platform/packages/shared/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
2025-03-05 13:14:31 +01:00
Arturo Lidueña
cb4e2023b4
fix: Product Documentation function not available error (#212676)
## Summary
Closes [#212655](https://github.com/elastic/kibana/issues/212655)
FIX:
When a user asks a question about the Elastic stack, we expect the LLM
to request the `retrieve_elastic_doc` function. However, due to the
limit of number of functions we can register, it errors out because the
function is not available.


![Image](https://github.com/user-attachments/assets/585ee05d-f10b-4a03-b40b-a07b2148d11b)
2025-03-05 12:43:16 +01:00
Ievgen Sorokopud
85555042be
[Attack Discovery][Scheduling] Add a new feature flag to hide scheduling feature (#12005) (#213148)
## Summary

Feature description: [internal
link](https://github.com/elastic/security-team/issues/10142)
Addresses: [internal
link](https://github.com/elastic/security-team/issues/12005)

These changes introduce a new feature flag to control visibility of the
Attack Discovery Scheduling feature.

To enable the flag:

> xpack.securitySolution.enableExperimental:
['assistantAttackDiscoverySchedulingEnabled']
2025-03-05 12:18:49 +01:00
Jatin Kathuria
4998b75677
[Siem Migration] - Start/Stop Translation integration tests (#212030)
## Summary

Handles
- https://github.com/elastic/security-team/issues/11232

This PR adds the integration tests for 
- Start Translation API
- Stop Translation API
2025-03-05 12:06:06 +01:00
Søren Louv-Jansen
0fb83efd82
[Obs AI Assistant] Add API test for get_alerts_dataset_info tool (#212858)
Follow-up to: https://github.com/elastic/kibana/pull/212077

This PR includes an API test that covers `get_alerts_dataset_info` and
would have caught the bug fixed in
https://github.com/elastic/kibana/pull/212077.

It also contains the following bug fixes:

- Fix system message in `select_relevant_fields`
- Change prompt in `select_relevant_fields` so that the LLM consistently
uses the right format when responding.
2025-03-05 09:09:22 +01:00
Nathan Reese
f66fa68ab5
[dashboard] remove folder src/platform/plugins/shared/dashboard/public/dashboard_container (#212587)
PR removes `dashboard_container` and adds `dashboard_renderer` folder. I
tried to find a best fit for files but have no strong opinions about
where I put things. Please comment if you would like files in different
locations.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-04 18:36:03 -07:00
Patryk Kopyciński
5e742f0425
[Security Assistant] Fix use default inference endpoint (#212191)
## Summary

Removes internal feature flag responsible for switching to Kibana's
internal inference endpoint instead of using a dedicated one.

How to test:

**Clean cluster:**
**1. Setup KB**
**2. Make sure the `.kibana-elastic-ai-assistant-knowledge-base-*` Data
Stream is using default Inference endpoint**
```
http://localhost:5601/app/management/data/index_management/component_templates/.kibana-elastic-ai-assistant-component-template-knowledge-base
```
<img width="1656" alt="image"
src="https://github.com/user-attachments/assets/84fda205-6272-4393-8f7d-a449fae2a090"
/>

<img width="1086" alt="image"
src="https://github.com/user-attachments/assets/19e562ec-da5f-4ec2-ab64-7bfb1d64789c"
/>

**3. Make sure there is no inference endpoint on the list**
<img width="1875" alt="image"
src="https://github.com/user-attachments/assets/3465df8b-7c0d-4faf-b113-df897694521e"
/>

**4. Make sure Security Labs content exists on KB list and you can add
and edit Document/Index entry
```
http://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=knowledge_base
```

Migration:
**1. Setup KB on at least 2 Kibana spaces on `main` branch**
**2. Switch to this PR's branch and start Kibana**
**3. Make sure there is no inference endpoint on the list**
```
http://localhost:5601/app/elasticsearch/relevance/inference_endpoints
```
<img width="1875" alt="image"
src="https://github.com/user-attachments/assets/3465df8b-7c0d-4faf-b113-df897694521e"
/>

**4. Make sure that the Data stream was rolled over**
```
http://localhost:5601/app/management/data/index_management/indices?filter=know&includeHiddenIndices=true
```
Should see two indices per Kibana space:
<img width="1741" alt="Zrzut ekranu 2025-03-3 o 15 37 55"
src="https://github.com/user-attachments/assets/e6da48c8-59e9-43b8-8eac-c2b5e0059954"
/>

The older index per space should have mapping:
<img width="1083" alt="image"
src="https://github.com/user-attachments/assets/01f6e422-77d1-4f8b-8b7e-9c541a7ea47c"
/>

Newer index per space:
<img width="1086" alt="image"
src="https://github.com/user-attachments/assets/19e562ec-da5f-4ec2-ab64-7bfb1d64789c"
/>

**4. Make sure Security Labs content exists on KB list and you can add
and edit Document/Index entry
```
http://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=knowledge_base
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-05 02:14:08 +01:00
Saikat Sarkar
1e00a04c2b
[Playground] Increase the height of the indices container (#212827)
This PR increase the height of the container for indices in the
playground




https://github.com/user-attachments/assets/0fbacb11-ce8e-4566-b07e-b6058de89af0
2025-03-04 17:34:42 -07:00
Kevin Delemme
df59c26083
feat(slo): update preview data API to show groups (#211801) 2025-03-04 17:04:10 -05:00
Kevin Delemme
d7445380b3
chore(slo): replace error log level with debug (#212975)
## Summary

Resolves https://github.com/elastic/kibana/issues/212972

This PR replaces the info and error log levels with debug since most of
these errors are for developers or users. Not operations.
2025-03-04 20:35:28 +01:00
Joey F. Poon
647a183e3b
[Security Solution] defend insights langgraph upgrade (#211038)
## Summary

This is intended to be a "minimal" migration for Defend Insights to
langgraph + output chunking. Other than the increased events due to the
context increase from output chunking, the functionality is unchanged.

* migrates defend insights to langgraph
* adds output chunking / refinement


### 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-03-04 19:43:28 +01:00
Nathan Reese
b213eb6bb2
[embeddable] replace Embeddable ViewMode with presentation-publishing ViewMode (#211960)
Embeddable ViewMode is part of legacy embeddable architecture. This PR
removes Embeddable ViewMode and replaces its usage with
presentation-publishing ViewMode. presentation-publishing ViewMode is a
string literal type so an enum is no longer needed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 09:05:23 -07:00
Carlos Crespo
8e5b8580f4
[Infra] Fix hosts total count query (#212749)
Fixes [#212745](https://github.com/elastic/kibana/issues/212745)

## Summary

Fix for the hosts total count query, which was not correctly filtering
hosts from system integration and APM

<img width="584" alt="image"
src="https://github.com/user-attachments/assets/05c3b244-3a0f-425a-82db-3498c1a6dbb7"
/>


### How to test
- Connect Kibana to an edge cluster
- Navigate to Infrastructure > Hosts
- The total number of items on the table should be equal to the number
in the hosts count KPI

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 16:46:21 +01:00
Konrad Szwarc
dfe542bd8e
[EDR Workflows] Workflow Insights - insights generating script (#213094)
This PR introduces a new script for loading parameterized workflow
insights into a data stream. It enables UI/UX testing without requiring
an agent installation or generating insights manually.

Arguments

```
--endpointId       Required. The endpoint ID to use for generating workflow insights.
--elasticsearch    Optional. The URL to Elasticsearch. Default: http://localhost:9200
--username         Optional. The username to use for authentication. Default: elastic
--password         Optional. The password to use for authentication. Default: changeme
--count            Optional. The number of workflow insights to generate. Default: 5
--os               Optional. The OS to use for generating workflow insights. Default: linux
--antivirus        Optional. The antivirus to use for generating workflow insights. Default: ClamAV
--path             Optional. The executable path of the AV to use for generating workflow insights. Default: /usr/bin/clamscan
```
Example usage:

* Load 5 workflow insights, using the default values - Linux, ClamAV,
/usr/bin/clamscan on the endpoint with ID
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6
 
`node ./load_workflow_insights.js --endpointId
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6`
 
* Load 10 workflow insights for Malwarebytes with path of C:\\Program
Files\\Malwarebytes\\Anti-Malware\\mbam.exe on Windows endpoint with ID
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6
        
`node ./load_workflow_insights.js --endpointId
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6 --count 10 --os windows --antivirus
Malwarebytes --path 'C:\\Program
Files\\Malwarebytes\\Anti-Malware\\mbam.exe'`
2025-03-04 16:09:35 +01:00
Vitalii Dmyterko
847be917a6
[Security Solution][Detection Engine] adds bulkGetUserProfiles privilege to Security Feature (#211824)
## Summary

- addresses https://github.com/elastic/kibana/issues/202051

Few observations, based on ticket
[description](https://github.com/elastic/kibana/issues/202051):

1. User can update assignees in alert(i.e. update any alert details,
which is handled by **SecuritySolution** priv)
2. User can see suggested users in searchbox
3. User **can not** see assignees details(name, avatar) in alerts table
column and alerts flyout(that's where error toast originates from)

Why this happens?
2 different APIs used to show users in searchbox and user details in
alerts table column:

1. API to show users in searchbox:
[/internal/detection_engine/users/_find](https://github.com/elastic/kibana/blob/8.18/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#L24)
It requires `securitySolution` privilege
2. API for alerts table cell:
[/internal/security/user_profile/_bulk_get](https://github.com/elastic/kibana/blob/8.18/x-pack/platform/plugins/shared/security/server/routes/user_profile/bulk_get.ts#L20)
It requires `bulkGetUserProfiles` privilege

User was configured with read only Security Feature, that covers only
first API, that's why we see error
> API [POST /internal/security/user_profile/_bulk_get] is unauthorized
for user, this action is granted by the Kibana privileges
[bulkGetUserProfiles] (403)

However `bulkGetUserProfiles` is covered by `Cases` feature already. If
Cases access will be set to read, user would be able to see assignees
details through `/internal/security/user_profile/_bulk_get` API.
It happens, because cases API tags include `bulkGetUserProfiles`
privilege:
https://github.com/elastic/kibana/blob/8.18/x-pack/platform/plugins/shared/cases/common/utils/api_tags.ts#L32,
https://github.com/elastic/kibana/blob/8.18/x-pack/solutions/security/packages/features/src/cases/types.ts#L7

This PR includes `bulkGetUserProfiles` privilege in Security Feature:
https://github.com/elastic/kibana/pull/211824. Since, it's already
present in Cases feature, and user profiles available through Security
Solution `/internal/detection_engine/users/_find` API
2025-03-04 15:08:41 +00:00
Zacqary Adam Xeper
367ff8dbec
[Response Ops] [Rule Form] Add Rule Form Flyout v2 (#206685)
## Summary

Part of #195211

Replaces the create/edit rule flyout with the new rule flyout

<img width="1032" alt="Screenshot 2025-01-14 at 3 12 30 PM"
src="https://github.com/user-attachments/assets/9cbcf4f8-1078-4f7e-a55a-aacc2d877a14"
/>
<img width="1383" alt="Screenshot 2025-01-14 at 3 12 52 PM"
src="https://github.com/user-attachments/assets/2270d57b-9462-4898-9dd0-41baefcc02d4"
/>

Restores the confirmation prompt before canceling or saving a rule
without actions defined.

Also fixes most of the design papercuts in the Actions step:

<img width="494" alt="Screenshot 2025-01-14 at 3 11 06 PM"
src="https://github.com/user-attachments/assets/3cf21d43-88e0-4250-b290-a545e1ebdbcf"
/>
<img width="494" alt="Screenshot 2025-01-14 at 3 11 01 PM"
src="https://github.com/user-attachments/assets/00ef3f95-c91b-4bb7-aead-a3e23c02f7df"
/>





### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 16:52:58 +02:00
Katerina
a16dc711fb
[Perfomance] Add Inline documentation for TTFMP (#212393)
## Summary

closes https://github.com/elastic/observability-dev/issues/4101 

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/4937722f-f05b-404b-9844-930e80c8e15e"
/>


### ⚠️ Instrumentation

Pass the `description` as metadata. The prefix [TTFMP] is required. 

### How to test

- Checkout the PR
- make sure you run `yarn kbn bootstrap`
- go to any page that has onPageReady function instrumented (ex
services)
2025-03-04 15:33:38 +01:00
Alex Prozorov
17931c5c5b
[Cloud Security ]update csp README.md file i18n instructions (#213068)
## Summary
update i18 instructions regarding how to add and remove translations.
2025-03-04 14:49:53 +02:00
Alberto Blázquez
2473d5951a
Refactor Asset Inventory page (#212436)
## Summary

Refactors code in Asset Inventory page for simplicity and consistency.

### Changes

- Centralized constants for consistency
- Simplified `<AllAssets>` page, removed unused props, renamed
variables, etc...
- Encapsulated technical preview stuff into `<TechnicalPreviewBadge>`
- Removed deprecations in EUI components and styling

Also, this PR **deletes the mocked data** that was used before
integrating the UI with the backend.

### Questions

- Do we see value in centralizing all strings in a new file such as
`localized_strings.ts`?

### Out of scope

Hooks in `hooks/use_asset_inventory_data_table` and field selector
components were all duplicated from the CSP plugin. I haven't put effort
in refactoring those since we'll need to remove the duplication and make
them reusable

### Checklist

- [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/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
- [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 risk since code is still hidden behind the *Enable Asset Inventory*
advanced setting and the beta *Cloud Asset* integration must be
installed.
2025-03-04 12:28:12 +01:00
christineweng
6b6eb43183
[Security Solution] Alert flyout - fix suppressed alerts alignment (#213029)
## Summary

Ref: https://github.com/elastic/kibana/issues/204184

Before

![image](https://github.com/user-attachments/assets/d578194a-aaf4-45c1-bccb-42d02110be28)


After

![image](https://github.com/user-attachments/assets/b183a2ae-dd73-47d8-8319-984246309d98)


### Checklist

- [ ] 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)
2025-03-04 06:01:51 +00:00
christineweng
bac5c30e1c
[Security Solution][Document Flyout] Fix alert insights color order (#212980)
## Summary

Updated order of the insights, following from left to right `Low` to
`Critical`


![image](https://github.com/user-attachments/assets/3b40bca0-4f29-421d-af34-fbacb49486dc)

### 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)
2025-03-03 22:16:15 -06:00
Patryk Kopyciński
f0d66691b8
[Security Assistant] Fix Product documentation installation banner (#212463)
## Summary

Fixes logic on fresh cluster where the ELSER was not started yet, in
this case API reports `status` as `uninstalled`, but it doesn't mean
that the Product documentation was actually uninstall, but rather it's a
default state.
Added internal `product_documentation_status` to KB status API to make
sure we keep track of the status internally and present the banner only
if the docs were intentionally uninstalled

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-04 02:28:35 +01:00
Michael Olorunnisola
750e156c26
[Performance][Security Solution][1/4] - Field Browser Performance (#212469)
## Summary
Part 1 of https://github.com/elastic/kibana/pull/212173

### Testing
For setup see testing section here:
https://github.com/elastic/kibana/pull/212173#issue-2870522020

**Areas to test:**
- Alert Table (Alerts, Rule Detail, Rule Preview pages)
- Security solution field browser component
- Flyout table tab.

### Background

When investigating the performance of the security solution application,
one of the issues that was observed was locking of the page and field
browser component when the total number of fields returned were
significantly high.

This led to cell values not rendering in the alert table, and the field
browser in all the security solution pages causing the page to crash.
The relevant images can be seen at the bottom of this description

In short: The `push(...fields)` is non-performant at scale, and at a
significant enough scale (Testing was done with 500k mapped fields),
fails to run due to excessive arguments provided to the `push` method.
In this PR improvements are made in the `browserFields` transformations
that are done for the field browser component, expandable flyout table
tab, and alert/rule tables via `CellValue` component.

This work was done to get immediate improvements in the security
solution UI, but a longer term consideration will be whether or not the
`browserFields` is even necessary anymore as a concept based on what is
available via the `fields` api. We will revisit once our Sourcerer
refactoring work is done.

<img width="1728" alt="Screenshot 2025-02-26 at 10 15 29 AM"
src="https://github.com/user-attachments/assets/a25f577f-f758-415e-9c93-5452eadb8020"
/>

<img width="1445" alt="Screenshot 2025-02-26 at 10 18 36 AM"
src="https://github.com/user-attachments/assets/d70970d3-991a-47ba-b617-5862d18101b6"
/>

<img width="1469" alt="Screenshot 2025-02-26 at 10 19 48 AM"
src="https://github.com/user-attachments/assets/1767aa9b-66ab-46be-bc1a-5311630c2765"
/>


![image](https://github.com/user-attachments/assets/5d746b21-fa9b-425b-826a-cc7abd444f21)


![image](https://github.com/user-attachments/assets/4dff2378-d61b-4770-b46b-41cb37d6ead4)


### After the fix
(Done on [this branch](https://github.com/elastic/kibana/pull/212173)
that has the other changes as well)


https://github.com/user-attachments/assets/da992296-4eb8-49d4-96ca-b0a19a00f1f0


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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-03-03 20:22:25 -05:00
Christophe Alladoum
e9813b8c72
[Elastic Defend] Add windows.ransomware.dump_process for endpoint advanced policy setting (#212439)
## Summary

This PR exposes `windows.ransomware.dump_process` as an advanced policy
option for Elastic Defend.
If enabled, this option will make the endpoint generate a memory dump of
the ransomware process before killing it, assisting the ransomware
investigation process.


### 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/src/platform/packages/shared/kbn-i18n/README.md)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-03 16:57:20 -08:00
Tiago Costa
bee6ba88c9
skip flaky suite (#206204) 2025-03-03 21:20:02 +00:00
Michael Olorunnisola
98b52804d5
[Performance][Security Solution][3/4] - Sourcerer performance (#212482)
## Summary
Part 3 of https://github.com/elastic/kibana/pull/212173

### Testing
For setup see testing section here:
https://github.com/elastic/kibana/pull/212173#issue-2870522020

Testing this work is a bit more `console.log` related, as the primary
aim of many of these changes was to limit the amount of re-renders
caused by state changes within many of the sourcerer utils. React is
relatively fast at handling many of these re-renders, but considering
the widespread usage of `useSourcererDataView` and the top level
location of `useInitSourcerer`, it was worth taking care of some low
hanging fruit.

### Background

The changes in this PR centered around limiting the number of re-renders
that were being caused unnecessarily in `useSourcererDataView` and
`useInitSourcerer` by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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
### Identify risks

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-03 16:06:38 -05:00
Steph Milovic
095fc222aa
[Security Assistant] Conversation pagination refactor (#211831) 2025-03-03 13:41:20 -07:00
Michael Olorunnisola
7f32eb0225
[Performance][Security Solution][4/4] - General Performance changes (#212488)
## Summary
Part 4 (Final) of https://github.com/elastic/kibana/pull/212173

### Testing
For setup see testing section here:
https://github.com/elastic/kibana/pull/212173#issue-2870522020

For testing, feel free to add a `console.count('!! - Number of
re-renders:)` to
`x-pack/solutions/security/plugins/security_solution/public/app/home/index.tsx`.
The memoization changes
[here](https://github.com/elastic/kibana/pull/212488/files#diff-b0cdd6dc57dd06dba69d90894de8c88a7bb7c71c0e58753f324eb8ba664a0782R18)
to the plugin template wrapper, prevented 2 extra re-renders, but there
is still an underlying problem of how the `PageTemplateWrapper` is used,
as it causes unmounting and remounting of the security views when
navigating between pages.

The only other change was to rely on React's built in diffing on the
alerts page for the page level filters
2025-03-03 12:59:43 -05:00
Yuliia Naumenko
7afe813b35
[AI Assistant] Fixed DataClient find method to pass fields param to esClient.msearch (#212465)
Fixed `AIAssistantDataClient` to send values of the `fields` param if is
provided to `esClient.msearch` request.

To test run the API query
`http://localhost:5601/api/security_ai_assistant/current_user/conversations/_find?page=1&per_page=99&fields=id,users,apiConfig.connectorId`
and makes sure the only provided fields are returned in the result.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-03 17:43:16 +00:00
Angela Chuang
24d2cd3e4f
[SecuritySolution] Fix add to library action (#212659)
## Summary

Add to library actions are not working.
Issue description and steps to reproduce:
https://github.com/elastic/kibana/issues/212650


Update according to SaveModalComponent change:
https://github.com/elastic/kibana/pull/186642/files#diff-137261ad728b083fd39cb5d6b58d7afd3d4c4e24749b78609a9aa4b3c63e4170R290


https://github.com/user-attachments/assets/a0d0e81e-5a0f-4462-b110-370894c6bf36

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
2025-03-03 16:33:10 +00:00
Alberto Blázquez
ed30926f0f
Remove page and links to Cloud Defend from Assets (#212753)
## Summary

Closes:
- https://github.com/elastic/security-team/issues/11933.

Continues work on:
- https://github.com/elastic/kibana/pull/200895.

### Acceptance criteria

- `9.0` / `Serverless`: 
- Removes links to Cloud Defend from Assets page in Security Solution.
- Disables navigation to `app/security/cloud_defend/` redirecting to the
default `app/security/get_started/`.
- `8.x` / `8.18`: 
- No changes (impact is minimal, only affects 4 customers who were told
to uninstall the plugin)

### Screenshot

<details><summary>Before - Assets page</summary>
<img width="1749" alt="Screenshot 2025-02-27 at 19 35 38"
src="https://github.com/user-attachments/assets/0bb076bc-984a-45be-bff8-63fe62ba6571"
/>
</details> 

<details><summary>Before - Cloud Defend page</summary>
<img width="1736" alt="Screenshot 2025-02-27 at 19 36 57"
src="https://github.com/user-attachments/assets/3f4f80b0-869d-48a9-90a3-70d03a37c7f6"
/>
</details>

<details><summary>After - Assets page</summary>
<img width="2006" alt="Screenshot 2025-02-28 at 12 12 11"
src="https://github.com/user-attachments/assets/3ef4bfb2-6b0b-4a77-83ea-cc7b9f54e37f"
/>
</details> 

<details><summary>After - Cloud Defend page redirects to
get_started/siem_migrations </summary>
<img width="2011" alt="Screenshot 2025-02-28 at 11 25 43"
src="https://github.com/user-attachments/assets/2ddafd46-7629-44fe-9234-049f09bc6b71"
/>
</details>

### How to test

Authenticate to Docker Registry with
```bash
docker login -u <YOUR_USER> -p <YOUR_PASSWORD> docker.elastic.co
```

Then run ES with

```bash
yarn es serverless --projectType security --kill
```

In a second terminal, run Kibana with
```bash
yarn serverless-security
```

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

We should not show more links to Cloud Defend in other parts of the app
because the feature was deprecated and it might confuse end users. But
there's no risk of breaking the app because navigation is handled
correctly.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-03 14:52:04 +00:00
Kenneth Kreindler
d37fcb6fb6
[Security Solution] [GenAi] refactor security ai assistant tools to use tool helper method (#212865)
## Summary

Clean up some security ai assistant code.

- Replace the usage of `new DynamicStructuredTool()` with the `tool()`
helper method. This is the recommended approach today and has the
correct types to work with
[`Command`](https://langchain-ai.github.io/langgraphjs/concepts/low_level/#command).
- Extract code such as the default assistant graph state and
agentRunnableFactory to reduce cognitive overload.
- Update AssistantTool type definition

### 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/src/platform/packages/shared/kbn-i18n/README.md)
- [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] 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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

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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-03 14:35:22 +00:00
Dmitrii Shevchenko
c4a016eda3
[Security Solution] Reduce the _review rule upgrade endpoint response size (#211045)
**Resolves: https://github.com/elastic/kibana/issues/208361**
**Resolves: https://github.com/elastic/kibana/issues/210544**

## Summary

This PR introduces significant memory consumption improvements to the
prebuilt rule endpoints, ensuring users won't encounter OOM errors on
memory-limited Kibana instances.

Memory consumption testing results provided in
https://github.com/elastic/kibana/pull/211045#issuecomment-2689854328.

## Details

This PR implements a number of memory usage optimizations to the
prebuilt rule endpoints with the final goal reducing chances of getting
OOM errors. The changes are extensive and require thorough testing
before merging.

The changes are described by the following bullets

- The most significant change is the addition of pagination to the
`upgrade/_review` endpoint. This endpoint was known for causing OOM
errors due to its large and ever-growing response size. With pagination,
it now returns upgrade information for no more than 20-100 rules at a
time, significantly reducing its memory footprint.
- New backend methods, such as
`ruleObjectsClient.fetchInstalledRuleVersions`, have been introduced.
These methods return rule IDs with their corresponding installed
versions, allowing to build a map of outdated rules without loading all
available rules into memory. Previously, all installed rules, along with
their base and target versions, were fetched unconditionally before
filtering for updates.
- The `stats` data structure of the review endpoint has been deprecated
(it can be safely removed after one Serverless release cycle). Since the
endpoint now returns paginated results, building stats is no longer
feasible due to the limited rule set size fetched on the server side. As
the side effect it required removing related Cypress tests asserting
`Update All` disabled when rules can't be updated.
- All changes to the endpoints are backward-compatible. All previously
required returned structures still present in response. All newly added
structures are optional.
- Upgradeable rule tags are now returned from the prebuilt rule status
endpoint.
- The frontend logic has been updated to move sorting and filtering of
prebuilt rules from the client side to the server side.
- The `upgrade/_perform` endpoint has been rewritten to use lightweight
rule version information rather than full rules to determine upgradeable
rules. Additionally, upgrades are now performed in batches of up to 100
rules, further reducing memory usage.
- A dry run option has been added to the upgrade perform endpoint. This
is needed for the "Update all" rules scenario to determine if any rules
contain conflicts and display a confirmation modal to the user.
- An option to skip conflicting rules has been added to the upgrade
endpoint when called with the `ALL_RULES` mode.
- The `install/_review` endpoint's memory consumption has been optimized
by avoiding loading all rules into memory to determine available rules
for installation. Redundant fetching of all base versions has also been
removed, as they do not participate in the calculation.

---------

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
2025-03-03 15:03:07 +01:00
Gergő Ábrahám
e4ea87e92b
[EDR Workflows][Investigation] Telemetry config watcher fix (#210406)
## Summary

To update the `global_telemetry_config` flag in Defend package policies,
we subscribe to the Telemetry plugin's `isOptedIn$` observable during
Kibana's `start()` phase, and receive the initial value immediately.
This feature is used for 'migrating' existing package policies: after
stack upgrade, when Kibana starts up, this subscription mechanism makes
sure that existing policies are backfilled with the new field.

But not on cloud and serverless instances.

It turned out, that while this works on local instances, on cloud and
serverless instances, at the very moment we receive the value during
`start()`, some mechanisms are not yet green, and this resulted in
`security_exception: missing authentication credentials for REST
request` when trying to read Saved Objects.

As subscribing to`core.status.core$`, and waiting until `ServiceStatus`
for `elasticsearch` and `savedObjects` is `available` didn't solve the
issue, I simply added a retry mechanism, which, at least, protects
against other temporary issues as well.

Some additional logging is added as well.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-03 12:31:00 +00:00