Commit graph

1444 commits

Author SHA1 Message Date
Davis Plumlee
1b6376e9c9
[Security Solution] Fixes related integrations render performance on rule editing pages (#217254)
## Summary

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

Adds logic to fix the re-render performance issues caused by the related
integrations component on the rule edit and creation pages. This copies
a strategy used in https://github.com/elastic/kibana/pull/180682 to fix
a similar issue with required fields. Related integrations component now
doesn't re-render when there are updates to components that don't affect
it.

#### React Profile while typing in query field component
![Screenshot 2025-04-04 at 8 12
38 PM](https://github.com/user-attachments/assets/9d3edcaa-4856-42df-9e6d-59bcc4785b5d)



### 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-04-18 14:47:20 -04:00
Philippe Oberti
112eab3a65
[AI4DSOC] Alert summary page performance improvements (#218632)
## Summary

This PR applies some performance improvements to the newly created Alert
summary page (for AI for SOC).

Here are the multiple changes:
- instead of fetching all rules in multiple places (components and
hooks), we're now fetching all rules in the most top level
`alert_summary.tsx` pages component. We're then passing the result down
via props to the children components. Though some of the components
inside the `alerts_table` component for example cannot be passed via
props, so we're leveraging the `additionalContext` property to pass down
rules information. Also, for the components working within the
`grouping_alerts_table`, we had to wrap the whole component with a local
context.
- similarly, the packages were already fetched in the very top
`alert_summary.tsx` pages component and were passed via props to the
children components, but we applied the same logic for the
`alerts_table` and the `grouping_alerts_table` components.

The PR also improves the `integration_icon.tsx` component to make it
more generic, and reused in all places to avoid the previous code
duplication.

**No UI or behavior changes are introduced!**


https://github.com/user-attachments/assets/1fc1b6d0-290c-4b8e-b3e1-6ccb82f4f82b

## How to test

This needs to be ran in Serverless:
- `yarn es serverless --projectType security`
- `yarn serverless-security --no-base-path`

You also need to enable the AI for SOC tier, by adding the following to
your `serverless.security.dev.yaml` file:
```
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
```

Use one of these Serverless users:
- `platform_engineer`
- `endpoint_operations_analyst`
- `endpoint_policy_manager`
- `admin`
- `system_indices_superuser`

Then:
- generate data: `yarn test:generate:serverless-dev`
- create 4 catch all rules, each with a name of a AI for SOC integration
(`google_secops`, `microsoft_sentinel`,, `sentinel_one` and
`crowdstrike`)
- change [this
line](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alert_summary/use_fetch_integrations.ts#L73)
to `installedPackages: availablePackages` to force having some packages
installed
- change [this
line](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alert_summary/use_integrations.ts#L63)
to `r.name === p.name` to make sure there will be matches between
integrations and rules


### 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-04-18 13:31:52 -05:00
Devin W. Hurley
6e4a06ee0f
[Security Solution] [Detections] Clarify result of missing read-index privileges on index patterns for a given rule (#215941)
## Summary

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

Updates the text shown when a rule may not have read privileges to a
given index pattern.
2025-04-18 14:14:45 -04:00
Sergi Romeu
36c495c9f0
[ObsUX][Infra] Fix broken storybook stories (#218090)
## Summary

Closes #218063

This PR fixes the broken storybook stories we have for Infra.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-18 18:54:14 +02:00
Ievgen Sorokopud
2a97766b9d
[Attack Discovery][Scheduling] Revert removed AD scheduling route registration (#218649)
## Summary

These changes revert accidentally removed attack discovery scheduling
routes registration by this PR
https://github.com/elastic/kibana/pull/218018/files#diff-fc08114e3940ca525cd8a2b7d746786ddabf8d27f8595438cdfc19371ee23831L44

Since the changes from that PR did not go into the `8.19`, we would not
need the backport to that branch.

## NOTES

The feature is hidden behind the feature flag (in `kibana.dev.yml`):

```
feature_flags.overrides:
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```
2025-04-18 17:57:38 +02:00
christineweng
095ee417e8
[Security Solution] Replace sourcerer in analyzer (#218183)
## Summary

Replace sourcerer in analyzer to use dataview picker when
`newDataViewPickerEnabled` is on.


![image](https://github.com/user-attachments/assets/077329ce-2510-4d6f-bc55-89b6b636df4f)


### 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-04-18 10:09:14 -05:00
Yuliia Naumenko
221c199ed1
[Search Connectors][Serverless] Add Search Connectors UI to the Stack Management data Section (#213509)
**!!MAJORITY OF THE CHANGED FILES ARE MOVED OR COPIED!!**

### Vision

According to the product vision we will build a new simple UI/UX in the
future https://github.com/elastic/security-team/issues/11790

This PR is a first iteration on enabling Content Connectors Management
UI in Serverless Kibana Stack Management.
Elastic Managed content connectors will be available only for Security
and Observability projects.
### Current PR scope

1. Used initial search_connectors plugin and renamed it to
content_connectors + moved from `x-pack/solutions/search` to
`x-pack/platform/plugins/shared`
2. Copy relevant connectors UI and routes from enterprise_search plugin.
3. Introduce the new Stack Management card/navigation option under the
Data section.
4. Enabled this plugin only in Serverless for Security and Observability
projects.
5. For making PR smaller Pipelines tab was not moved. And according to
Search team vision this functionality should be dropped anyway soon.
6. Extended fleet package logic to include elastic_connectors for
security and o11y serverless projects
7. Added back `search:agentless-connectors-manager` task

In Stack Management navigation:
<img width="2062" alt="Screenshot 2025-04-15 at 3 51 43 PM"
src="https://github.com/user-attachments/assets/5c93ba01-9a6a-4eac-a21d-1370f03b8f35"
/>

Stack Management cards:
<img width="2081" alt="Screenshot 2025-04-10 at 8 41 43 PM"
src="https://github.com/user-attachments/assets/3def1c12-561b-4a84-8241-4dd61cd9313d"
/>


Create Elastic Managed Connector UI (on Agentless):

<img width="1822" alt="Screenshot 2025-04-15 at 3 55 29 PM"
src="https://github.com/user-attachments/assets/6e9fea48-85e7-43df-919d-0e5492d0e704"
/>

Create Self Managed Connector UI:

<img width="2064" alt="Screenshot 2025-04-15 at 3 55 49 PM"
src="https://github.com/user-attachments/assets/d5051898-c8fa-4e41-b9ea-b41d4ed4a0d5"
/>

### Next steps

- [ ] Remove duplicated code between content_connectors,
enterprise_search and serverless_search
- [ ] Extract [common server
libs](https://github.com/elastic/kibana/tree/main/x-pack/solutions/search/plugins/enterprise_search/server/lib)
to the shared package `kbn-search-connectors`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Artem Shelkovnikov <artem.shelkovnikov@elastic.co>
Co-authored-by: Artem Shelkovnikov <lavatroublebubble@gmail.com>
Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
2025-04-18 04:50:56 +02:00
Steph Milovic
ba0894daa6
[AI4DSOC] Alert Flyout (#218018)
## Summary

Alert flyout for AI for the SOC. 
<img width="600" alt="Screenshot 2025-04-11 at 12 15 22 PM"
src="https://github.com/user-attachments/assets/fea2f7fb-7424-46b5-b9c2-5cafa336b0a9"
/>

### The flyout sections include:
- New header highlighting the integration source
<img width="596" alt="Screenshot 2025-04-11 at 12 16 00 PM"
src="https://github.com/user-attachments/assets/13033225-9e41-431f-8061-5df96a981665"
/>

- AI generated alert summary generated by button (Generate or
Regenerate). Stored in a new data stream
(`.kibana-elastic-ai-assistant-alert-summary-*`)
<img width="595" alt="Screenshot 2025-04-11 at 12 15 55 PM"
src="https://github.com/user-attachments/assets/ac835db2-2cbb-4a59-9e71-f1a9616a777f"
/>
- Anonymization toggle for the alert summary is located in the flyout
gear settings menu
<img width="270" alt="Screenshot 2025-04-11 at 12 32 45 PM"
src="https://github.com/user-attachments/assets/952936b9-571b-48e5-bd57-ecfd33855df3"
/>
- Highlighted fields
<img width="600" alt="Screenshot 2025-04-11 at 12 15 52 PM"
src="https://github.com/user-attachments/assets/3fccfab2-3e8b-4edc-adaf-3f320d9a5d20"
/>
- Attack discovery `MiniAttackChain` (currently hardcoded to a
preconfigured connector, waiting for further work from @andrew-goldstein
to hook up to actual alert related AD)
<img width="597" alt="Screenshot 2025-04-11 at 12 15 36 PM"
src="https://github.com/user-attachments/assets/d181f68d-5b77-4df4-a316-54e84d655a4c"
/>
- Conversations dropdown that show any conversations this alert is
referenced
<img width="601" alt="Screenshot 2025-04-11 at 12 18 03 PM"
src="https://github.com/user-attachments/assets/71d533d3-99b4-49c4-b336-05152fd64ed4"
/>
- Suggested prompts that create a new conversation with the alert as
context (_copy pending_)
<img width="594" alt="Screenshot 2025-04-11 at 12 18 09 PM"
src="https://github.com/user-attachments/assets/bca58f5a-f05c-4cdf-a466-0926c99e0ad6"
/>
- The connector used in the alert summary generation is selected in
Stack Management > Advanced Settings > Security Solution > Default AI
Connector (_copy pending_)
<img width="1163" alt="Screenshot 2025-04-11 at 12 34 15 PM"
src="https://github.com/user-attachments/assets/d2128497-22e4-4c14-b08c-991dc8287391"
/>

### New prompts
This PR adds 2 new prompts under a new `promptGroupId.aiForSoc`:
    - `promptDictionary.alertSummarySystemPrompt`
    - `promptDictionary.alertSummary`
In order to access these prompts in the proper spots, the new find alert
summary route returns the "user" prompt
(`promptDictionary.alertSummary`). In order to get the system prompt in
place, we pass a `promptIds` object to the
`POST_ACTIONS_CONNECTOR_EXECUTE` which is appended to the main system
prompt

## Testing

This needs to be ran in Serverless:
- `yarn es serverless --projectType security`
- `yarn serverless-security --no-base-path`

You also need to enable the AI for SOC tier, by adding the following to
your `serverless.security.dev.yml` file:
```
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
```

Use one of these Serverless users:
- `platform_engineer`
- `endpoint_operations_analyst`
- `endpoint_policy_manager`
- `admin`
- `system_indices_superuser`

Then:
- generate data: `yarn test:generate:serverless-dev`
- create 4 catch all rules, each with a name of a AI for SOC integration
(`google_secops`, `microsoft_sentinel`,, `sentinel_one` and
`crowdstrike`) => to do that you'll need to temporary comment the
`serverless.security.dev.yaml` config changes as the rules page is not
accessible in AI for SOC.
- change [this
line](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alert_summary/use_fetch_integrations.ts#L73)
to `installedPackages: availablePackages` to force having some packages
installed
- change [this
line](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alert_summary/use_integrations.ts#L63)
to `r.name === p.name` to make sure there will be matches between
integrations and rules

With this alerts data, you should be able to test each section of the
flyout _except_ the attack discovery widget, instructions for that are
below.

#### Attack discovery widget

As I am waiting for updates from Andrew, currently the attack discovery
widget looks up attack discoveries from a particular preconfigured
connector. In order to test:
1. Add preconfigured connector to your `kibana.dev.yml`:
https://p.elstc.co/paste/J2qmGMeQ#GKSPhlggX4F93aUSKJsKpsqtCcyTepCkfJOEVxlZyfB
2. Generate attack discovery with this connector
3. Open the new flyout, you will see the attack discovery widget

## Outstanding TODOs

These are all noted in the code
1. Attack discovery widget is hardcoded to the preconfigured connector
id. The widget should instead look up discoveries by alert ID, pending
work from @andrew-goldstein
2. Update copy for suggested prompts
3. Update copy for ai connector UI setting
4. Update AI connector UI setting to default to Elastic Managed LLM once
it is fully available in serverless

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: PhilippeOberti <philippe.oberti@elastic.co>
Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
2025-04-18 01:08:23 +00:00
Philippe Oberti
add6e303d2
[AI4DSOC] Alert summary table and flyout ai assistant (#217744)
## Summary

This PR builds up on the previous
https://github.com/elastic/kibana/pull/216744 and the AI assistant in 2
places in the AI for SOC alert summary page:
- in each row of the alert table as a row action
- in the footer of the alert details flyout


https://github.com/user-attachments/assets/65fb10f1-c22b-4796-9109-3b7dbdba6313

To keep consistency between the alert summary and the alerts page, this
PR also removes the Chat icon button in the header of the alert details
flyout and adds a `Ask AI Assistant` button in the footer.

| Before  | After |
| ------------- | ------------- |
| ![Screenshot 2025-04-15 at 11 54
36 PM](https://github.com/user-attachments/assets/b6039081-d5b8-4bf7-ada1-af3844e17bad)
| ![Screenshot 2025-04-15 at 11 54
09 PM](https://github.com/user-attachments/assets/6833a89c-931e-4eb3-be93-4fc1e2ed96e2)
|

## How to test

This needs to be ran in Serverless:
- `yarn es serverless --projectType security`
- `yarn serverless-security --no-base-path`

You also need to enable the AI for SOC tier, by adding the following to
your `serverless.security.dev.yaml` file:
```
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
```

Use one of these Serverless users:
- `platform_engineer`
- `endpoint_operations_analyst`
- `endpoint_policy_manager`
- `admin`
- `system_indices_superuser`

Then:
- generate data: `yarn test:generate:serverless-dev`
- create 4 catch all rules, each with a name of a AI for SOC integration
(`google_secops`, `microsoft_sentinel`,, `sentinel_one` and
`crowdstrike`)
- change [this
line](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alert_summary/use_fetch_integrations.ts#L73)
to `installedPackages: availablePackages` to force having some packages
installed
- change [this
line](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alert_summary/use_integrations.ts#L63)
to `r.name === p.name` to make sure there will be matches between
integrations and rules

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

https://github.com/elastic/security-team/issues/11973
2025-04-18 00:37:06 +00:00
Saikat Sarkar
da5e8cc6e9
[Onboarding] Make navigation consistent on stack (#218364)
## Summary

The navigation differs slightly between Serverless and Stack. To ensure
consistency, this PR introduces the following changes to Stack.

- `Dev Tools` has been moved to `Build` on top of Playground
- `Content` has been updated to `Data`
- `Kibana` has been renamed to `Analyze`
-  Reorder the sections in Serverless to match the order used in Stack

### Stack
<img width="1024" alt="Screenshot 2025-04-16 at 4 58 41 PM"
src="https://github.com/user-attachments/assets/6eaac498-b423-4cc3-a524-2dfd586f1b04"
/>


### Serverless 
<img width="935" alt="Screenshot 2025-04-16 at 2 21 44 PM"
src="https://github.com/user-attachments/assets/5c3a2fc4-d277-4d47-92ab-d97850b79978"
/>




### 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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)
- [ ] ...
2025-04-18 02:18:30 +02:00
Ievgen Sorokopud
85093e5de7
[Attack Discovery][Scheduling] UI: Schedule details and editing flows (#12006) (#218572)
## Summary

Main ticket ([Internal
link](https://github.com/elastic/security-team/issues/12006))

These changes add Schedule Details and Editing workflows allowing users
to see schedule information in a separate flyout and/or update the
schedule parameters within it.

## NOTES

The feature is hidden behind the feature flag (in `kibana.dev.yml`):

```
feature_flags.overrides:
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-17 21:19:22 +02:00
Gabriel Landau
906c8978e7
Advanced policy opt-out for scan-on-event (#218354)
## Summary

Allow users to opt out of scan-on-event to help troubleshoot and resolve
performance issues.

## Release note

{elastic-defend} users can now opt out of event-driven Memory Protection
scanning via advanced policy.

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

---------

Co-authored-by: Konrad Szwarc <konrad.szwarc@elastic.co>
2025-04-17 15:00:15 -04:00
Philippe Oberti
a7be37e1cd
[Security Solution][Expandable flyout] minor performance improvements (#218503)
## Summary

This PR performs some very minor performance improvements to the
`expandable-flyout` package:
- prevent unnecessary re-renders by extracting styles to const
- better use of `useCallback`

No UI or behavior changes are introduced.


https://github.com/user-attachments/assets/c7f55a4e-7f98-4c18-bb22-f8b81a11e626
2025-04-17 20:07:46 +02:00
Sebastián Zaffarano
c9b3a3e27b
[Security Solution][Telemetry] Add index metadata EBT event (#218546)
## Summary



- Fix https://github.com/elastic/kibana/issues/216044
- Add a new EBT event collecting index template info
    ```typescript
    export interface IndexTemplateInfo {
      template_name: string;
      index_mode: Nullable<string>;
      datastream: boolean;
      package_name: Nullable<string>;
      managed_by: Nullable<string>;
      beat: Nullable<string>;
      is_managed: Nullable<boolean>;
      composed_of: string[];
      source_enabled: Nullable<boolean>;
      source_includes: string[];
      source_excludes: string[];
    }
    ```

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2025-04-17 20:00:26 +02:00
Philippe Oberti
7160b360c7
[AI4DSOC] Alert summary table custom cell renderers (#217124)
## Summary

This PR builds up on the previous [table setup
PR](https://github.com/elastic/kibana/pull/216744) and add custom cell
renderers for the alert summary table:
- we show the package's icon for the Integration column (pointing to the
`kibana.alert.rule.parameters` field)
- we show an EuiBadge for the severity column (pointing to the
`kibana.alert.severity` field)

All the other fields remain unchanged.

| Before  | After |
| ------------- | ------------- |
| ![Screenshot 2025-04-15 at 3 01
01 PM](https://github.com/user-attachments/assets/047c7fd1-3da2-40fd-a0f4-792177454c00)
| ![Screenshot 2025-04-15 at 2 59
20 PM](https://github.com/user-attachments/assets/643510a7-5f12-4084-8101-4f027ea04099)
|

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

https://github.com/elastic/security-team/issues/11973
2025-04-17 19:30:05 +02:00
Nikita Indik
40a9159435
[Security Solution] Show banner to promote prebuilt rule customization in both Serverless and ESS (#218540)
**Resolves: https://github.com/elastic/kibana/issues/209000**
**Related PR: https://github.com/elastic/kibana/pull/213750**

## Summary

This PR updates the code to show a promo banner in the rules table. With
this change, this banner will be shown in both ESS (8.18+) and
Serverless. Previously it was shown only in ESS. In both ESS and
Serverless the blog link is the same – this is expected and correct.

We couldn't add a banner for Serverless earlier, because the blog post
was published on the 8.18/9.0 release day. If we would have added it
earlier, Serverless users would click on a link at get a 404 page.

Expected behaviour for both ESS and Serverless:
 - Banner is visible above the rules table
- The link leads to
https://www.elastic.co/blog/security-prebuilt-rules-editing

<img width="1006" alt="Scherm­afbeelding 2025-03-11 om 12 25 45"
src="https://github.com/user-attachments/assets/41d83db9-4bc4-433e-a7e2-c5ef1049a20c"
/>

**Changes:**
- Adds a rule management table banner to promote prebuilt rule
customization in Serverless. Previously this banner was only shown in
ESS. Banner is dismissible. Its state is stored in localStorage.
- Tweaks banner wording a bit as per docs suggestion
([comment](https://github.com/elastic/kibana/pull/213750/files#r1989313701))
2025-04-17 19:11:47 +02:00
Cauê Marcondes
822aef361c
[APM]Embeddable Trace Waterfall Enhancements (#217679)
For the embeddable waterfall to be successful, we want to remove
unnecessary information and be able to select which records should be
displayed.

We need to remove:
- Accordions
- Services Legend

We want to display (or hide anything that isn't):
- root,
- direct parent,
- current span or transaction (highlighted)
- up to 2 children.
- Errors will be represented with an icon in the embeddable form of the
waterfall and the badge in the regular form


https://github.com/user-attachments/assets/bf8d34d7-173c-4a1a-8ccf-2f98f43fc625

## Using the embeddable:

1: Loads standard trace waterfall (like the one on APM UI)
```
<ReactEmbeddableRenderer
    type="APM_TRACE_WATERFALL_EMBEDDABLE"
    getParentApi={() => ({
      getSerializedStateForChild: () => ({
        rawState: {
          serviceName: 'foo',
          traceId: 'e7b9d541fae0e25106291f7ac0947acd',
          entryTransactionId: '2d94d9d4fda31c18',
          rangeFrom: '2025-03-26T00:00:00.513Z',
          rangeTo: '2025-03-26T20:52:42.513Z',
          displayLimit: 5, //optional param when omitted it renders the entire waterfall
        },
      }),
    })}
    hidePanelChrome={true}
  />
```

2: Loads focused trace waterfall (some trace events are hidden and a
summary is available)
```
<ReactEmbeddableRenderer
    type="APM_TRACE_WATERFALL_EMBEDDABLE"
    getParentApi={() => ({
      getSerializedStateForChild: () => ({
        rawState: {
          traceId: 'e7b9d541fae0e25106291f7ac0947acd',
          rangeFrom: '2025-03-26T00:00:00.513Z',
          rangeTo: '2025-03-26T20:52:42.513Z',
          docId: SPAN_OR_TRANSACTION_ID
        },
      }),
    })}
    hidePanelChrome={true}
  />
```
2025-04-17 12:10:31 -03:00
Vitalii Dmyterko
3d7aac1a44
[Security Solution][Detection Engine] adds async ES|QL query (#216667)
## Summary

- addresses https://github.com/elastic/security-team/issues/11116 (list
item 2)

Introducing async query would allow to overcome ES request timeout for
long running rules and queries.

Timeout for ES request is [defined in alerting
framework](https://github.com/elastic/kibana/blob/8.18/x-pack/platform/plugins/shared/alerting/server/lib/get_es_request_timeout.ts#L21)
and is smaller value out of rule execution timeout or default ES request
timeout(which is 5m and hardcoded
[here](https://github.com/elastic/kibana/blob/8.18/x-pack/platform/plugins/shared/alerting/server/lib/get_rule_task_timeout.ts)).

If ES|QL rule performs a single long-running ES query, it can time out
after 5m due to this ES request timeout. This value can't be changed,
unlike rule execution timeout. It can be overwritten in Kibana config

```
xpack.alerting.rules.run:
  timeout: '10m'
  ruleTypeOverrides:
    - id:  'siem.esqlRule'
      timeout: '15m'
```
So, we can encounter situations when rule fails execution after 5m due
to ES request timeout, despite a fact it configured with longer timeout
of 15m

By using async query, we can overcome this limitation and can poll async
query results until it completes or rule timeouts

More details in internal
[issue](https://github.com/elastic/sdh-security-team/issues/1224)

---------

Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
2025-04-17 15:23:07 +01:00
Jedr Blaszyk
c5ff7aa155
feat: workchat assistant list/details/edit page (#217984)
## Summary

### UI changes
- assistant UI 
  - list view
  - details view
  - modals: edit info, edit prompt, create 
- rename routes from `agents` to `assistatns`

### Server changes
- Add `avatar` object to agent/assistnat saved object schema
- changed schema from dynamic `strict` to `false`

### Recording 



https://github.com/user-attachments/assets/df689d87-2c0e-4e82-8dc1-46de4a9ab9d8



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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-17 15:34:08 +02:00
Marco Liberati
e21bec3f31
[chore] Reuse bundled lodash and lodash/fp dependency (#217467)
## Summary

After #217202 and #217034 this the another attempt with `lodash` and
`lodash/fp`.

In short:
`lodash` and `lodash/fp` have a special webpack treatment as they are
imported within the shared bundle.
Now webpack is not smart enough to understand that `import camelCase
from 'lodash/camelCase';` is still pointing to `lodash` and it thinks
that `lodash/camelCase` is a different package, de-optimizing the
bundling caching system.
So I’ve tweaked the import to make it point to the shared bundle and
save few kbs here and there
2025-04-17 14:54:25 +02:00
Francesco Fagnani
ec939b6718
[Synthetics] Changed embeddable view when only one monitor in one location is selected (#218402)
This PR closes #208981 by adding a new action to the Monitor card to
view only that monitor in the dashboard.



https://github.com/user-attachments/assets/f500d220-b57f-4c43-a632-b2383e33988e

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
2025-04-17 14:03:40 +02:00
Gerard Soldevila
cf94c2fe0f
SKA: Relocate ai assistant management (#218129)
## Summary

Pre-requisite for https://github.com/elastic/kibana/pull/216088, as the
`AI Assistant Management` configuration settings should be available for
Search too.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-17 13:55:02 +02:00
Mykola Harmash
35407c9240
[Oblt Onboarding][K8S OTel] Override docker image in values.yml for serverless (#218527)
The current `values.yml` on serverless uses
`docker.elastic.co/beats/elastic-agent:9.0.0` which doesn't exist. [The
actual fix](https://github.com/elastic/elastic-agent/pull/7882) will be
in v9.0.1 but in the meantime we have to do a workaround on the Kibana
side and override the broken value in the code snippet.

![CleanShot 2025-04-17 at 09 25
18@2x](https://github.com/user-attachments/assets/134af691-0417-4a46-86d7-1efbac75f02a)
2025-04-17 12:17:53 +02:00
Ievgen Sorokopud
b01eb0a0c8
[Attack Discovery][Scheduling] Add attack discovery scheduling rule executor (#12004) (#218324)
## Summary

Main ticket ([Internal
link](https://github.com/elastic/security-team/issues/12004))

These changes add the attack discovery schedules executor handler. It
connects registered earlier rule with the attack discoveries generation
logic. As a result of the execution the attack discovery alerts will be
created and stored in the index.

<details>
  <summary>Alert document example</summary>

```json
{
        "_index": ".internal.alerts-security.attack.discovery.alerts-default-000001",
        "_id": "a43601aa-fc0b-4a4a-bee7-42c5441dc598",
        "_score": 1,
        "_source": {
          "kibana.alert.attack_discovery.alerts_context_count": 100,
          "kibana.alert.attack_discovery.alert_ids": [
            "9d998a07afbbb450f3816bbe95b2ea94fb91c4b2c606b4162b07776f879a1f9b",
            "19321981f126e52b922a0254a9a9d69f3a69a618902f5d09fe4b7929de235988",
            "95414ec55e273cbd94bb9c870a6dd1a7105f3737a132074d979b01e5af0e901c",
            "ae13ac0587896ee4bcb1a7789151f440290b61d6ed5300541639748644eba8d2",
            "7cb65dc71618e6994329ed4bf276e5f677c1dde61f1e04763f245c46ad8cdffb",
            "4508424e93f35500b281593313a10c205cdf15d05dbca7190eed55f8d03c0635"
          ],
          "kibana.alert.attack_discovery.api_config": {
            "action_type_id": ".bedrock",
            "connector_id": "sonnet-3-7",
            "name": "Sonnet 3.7 (Bedrock)"
          },
          "kibana.alert.attack_discovery.details_markdown": """## Multi-Stage Attack on Windows Host

A sophisticated attack chain was detected on {{ host.name 26709885-b791-4269-b71b-1e7f0eb161ca }}. The attack began at 17:01:05 UTC with the execution of malware masquerading as Windows Explorer.

### Stage 1: Initial Compromise
Malware was detected running as {{ process.name explorer.exe }} from the suspicious path {{ process.executable C:/fake/explorer.exe }} with high integrity level ({{ process.Ext.token.integrity_level_name high }}). The malware was executed by {{ user.name fdc95bdc-cadc-4bd9-8cfb-4a40af6f59f0 }} from domain {{ user.domain efcslocplk }}. This indicates the initial foothold on the system with elevated privileges.

### Stage 2: Command and Control
At 17:08:26 UTC, suspicious network activity was observed from the same host. The process {{ process.name notepad.exe }} running from {{ process.executable C:/fake_behavior/notepad.exe }} established a connection from {{ source.ip 10.58.64.134 }} to {{ destination.ip 10.53.33.237 }}. This unusual network behavior from Notepad suggests command and control communication. The process was running with high integrity level and was associated with {{ user.name cfb342fc-1302-47e6-8139-b46d5b28c22c }} from domain {{ user.domain l57fcz01tu }}.

### Stage 3: Credential Harvesting
The attack culminated at 17:16:51 UTC with the execution of {{ process.name mimikatz.exe }} from {{ process.executable C:\mimikatz.exe }} by {{ user.name 6f2dbaa3-048d-4f9a-8c42-6eba737ab378 }}. Mimikatz is a powerful credential harvesting tool used to extract passwords, hashes, and Kerberos tickets from memory.

This attack chain demonstrates a clear progression from initial compromise to establishing command and control, and finally to credential theft, all occurring on the same Windows host within a 15-minute timeframe.""",
          "kibana.alert.attack_discovery.details_markdown_with_replacements": """## Multi-Stage Attack on Windows Host

A sophisticated attack chain was detected on {{ host.name 26709885-b791-4269-b71b-1e7f0eb161ca }}. The attack began at 17:01:05 UTC with the execution of malware masquerading as Windows Explorer.

### Stage 1: Initial Compromise
Malware was detected running as {{ process.name explorer.exe }} from the suspicious path {{ process.executable C:/fake/explorer.exe }} with high integrity level ({{ process.Ext.token.integrity_level_name high }}). The malware was executed by {{ user.name fdc95bdc-cadc-4bd9-8cfb-4a40af6f59f0 }} from domain {{ user.domain efcslocplk }}. This indicates the initial foothold on the system with elevated privileges.

### Stage 2: Command and Control
At 17:08:26 UTC, suspicious network activity was observed from the same host. The process {{ process.name notepad.exe }} running from {{ process.executable C:/fake_behavior/notepad.exe }} established a connection from {{ source.ip 10.58.64.134 }} to {{ destination.ip 10.53.33.237 }}. This unusual network behavior from Notepad suggests command and control communication. The process was running with high integrity level and was associated with {{ user.name cfb342fc-1302-47e6-8139-b46d5b28c22c }} from domain {{ user.domain l57fcz01tu }}.

### Stage 3: Credential Harvesting
The attack culminated at 17:16:51 UTC with the execution of {{ process.name mimikatz.exe }} from {{ process.executable C:\mimikatz.exe }} by {{ user.name 6f2dbaa3-048d-4f9a-8c42-6eba737ab378 }}. Mimikatz is a powerful credential harvesting tool used to extract passwords, hashes, and Kerberos tickets from memory.

This attack chain demonstrates a clear progression from initial compromise to establishing command and control, and finally to credential theft, all occurring on the same Windows host within a 15-minute timeframe.""",
          "kibana.alert.attack_discovery.entity_summary_markdown": "Multi-stage attack on {{ host.name 26709885-b791-4269-b71b-1e7f0eb161ca }} progressing from malware execution to C2 communication to credential harvesting",
          "kibana.alert.attack_discovery.entity_summary_markdown_with_replacements": "Multi-stage attack on {{ host.name 26709885-b791-4269-b71b-1e7f0eb161ca }} progressing from malware execution to C2 communication to credential harvesting",
          "kibana.alert.attack_discovery.mitre_attack_tactics": [
            "Initial Access",
            "Execution",
            "Defense Evasion",
            "Command and Control",
            "Credential Access"
          ],
          "kibana.alert.attack_discovery.replacements": [
            {
              "uuid": "6f2dbaa3-048d-4f9a-8c42-6eba737ab378",
              "value": "2m1hxyyp5k"
            },
            {
              "uuid": "26709885-b791-4269-b71b-1e7f0eb161ca",
              "value": "Host-vz00iiz3xt"
            },
            {
              "uuid": "17ddd5ab-0894-4b42-9d22-2d3340039226",
              "value": "alu5fbteof"
            },
            {
              "uuid": "89f901f0-bd5a-4677-99c8-7fa205e3d08b",
              "value": "Host-c9mokbxqq9"
            },
            {
              "uuid": "cfb342fc-1302-47e6-8139-b46d5b28c22c",
              "value": "ip779k9h2f"
            },
            {
              "uuid": "792cf4b0-dce9-4c58-8a24-0dc48dff4676",
              "value": "308yoa4oi2"
            },
            {
              "uuid": "b48f9fdc-bcec-401e-b532-375566f6afcb",
              "value": "Host-y52gawummo"
            },
            {
              "uuid": "66055979-d21f-413a-a94b-dcd7b0629da4",
              "value": "7pv0le3ddv"
            },
            {
              "uuid": "695ef89d-8067-4c67-a126-6c33611052d9",
              "value": "Host-e5crsbi7wf"
            },
            {
              "uuid": "fdc95bdc-cadc-4bd9-8cfb-4a40af6f59f0",
              "value": "f6mjxsb0nn"
            },
            {
              "uuid": "2cba9c01-67a4-4d02-a316-7754f2f02b74",
              "value": "gfjkop396r"
            },
            {
              "uuid": "e30ac2a3-5f45-4a32-9795-43997959df6c",
              "value": "Host-n4wpdgubwj"
            },
            {
              "uuid": "72f71340-3961-4b02-8891-53ff0df36a30",
              "value": "2ew26fqxar"
            },
            {
              "uuid": "73972b46-845c-4200-aa2c-ff7753f138fd",
              "value": "Host-wibsctmrac"
            },
            {
              "uuid": "14f79e2b-7001-49b1-aad0-799fb7d14d2d",
              "value": "6or4l2c2zw"
            },
            {
              "uuid": "6c158c81-19b2-4b39-97e1-d42bcce38c70",
              "value": "sdlrlkhc97"
            },
            {
              "uuid": "1fb56455-d5dc-4a4c-8438-e1bb0c85d3a8",
              "value": "Host-oh2j5s5jp9"
            },
            {
              "uuid": "e332d063-4573-4394-94b3-f306ff9f93cb",
              "value": "3kq2s4e71l"
            },
            {
              "uuid": "75bda08d-2939-4cb7-a2c6-ac53031583f3",
              "value": "dpobzupa9k"
            },
            {
              "uuid": "1f3c57d8-4652-4b7a-af86-776338f63607",
              "value": "0dqllmid1m"
            },
            {
              "uuid": "bb4397d3-9dfe-472e-92fd-aae3bd3834f1",
              "value": "Host-og5nsbrpmr"
            },
            {
              "uuid": "91bce06a-d35e-4a80-b405-dc9d12b506e1",
              "value": "g8rvcddri8"
            },
            {
              "uuid": "044c3512-5932-401e-a313-4f5d3e9e2b3e",
              "value": "Host-yfgxi1hbzo"
            },
            {
              "uuid": "b7b97ffb-f0b7-4bcf-8001-d3c5340147c5",
              "value": "3ml9827im4"
            },
            {
              "uuid": "3444ce30-b149-4c4d-bbea-1ef24bb43147",
              "value": "kby4o09qlp"
            },
            {
              "uuid": "8e189f02-ac4e-453d-b995-23c1ba092da9",
              "value": "5r6hdjyfo9"
            },
            {
              "uuid": "e460d63c-580c-44a5-b97d-2e22302e8c8f",
              "value": "1kyc03i63k"
            },
            {
              "uuid": "dcf2cdb0-27d2-459d-a1d7-249e0c0ed053",
              "value": "lfhcwf52hi"
            },
            {
              "uuid": "3debe130-2185-40ac-9886-706ece11893c",
              "value": "8mu08rmb1p"
            },
            {
              "uuid": "9a069477-9785-4989-88b3-cee2117f06d7",
              "value": "9zwlud9esc"
            },
            {
              "uuid": "41479f4f-787b-4a79-ba93-73f666881afd",
              "value": "a3mq578522"
            },
            {
              "uuid": "0117dcf0-7189-4d54-a5cf-0f4148468402",
              "value": "zwevwtnrbm"
            },
            {
              "uuid": "267d4ad7-1a6e-4975-a5df-fe5d59fd12d0",
              "value": "7s7nyul6p2"
            },
            {
              "uuid": "8e5d0eab-7574-4019-a89e-e52357b1d017",
              "value": "pb7v301dfe"
            },
            {
              "uuid": "0fa1f8ce-546a-4a7c-b1d8-97ee388ad4ef",
              "value": "txnoomwpmq"
            },
            {
              "uuid": "578ae707-8deb-4540-8729-10696c1a51b4",
              "value": "6u1ov6043k"
            },
            {
              "uuid": "85ff0b12-3f9f-4f79-91fb-5c4463846a76",
              "value": "5up8q7vvih"
            },
            {
              "uuid": "d070b8be-a7d5-4d39-9ea2-da0d3d0e3415",
              "value": "7gkbzie50r"
            },
            {
              "uuid": "f344fc43-1e8f-456b-b319-41bf0572ecb3",
              "value": "zf6m1h1gdh"
            },
            {
              "uuid": "61dad511-5308-4f8e-8800-1d1ea8a442a0",
              "value": "dwjw7h9du7"
            },
            {
              "uuid": "29a4f23a-29ef-4227-b44f-7436e243acec",
              "value": "sli680ll8k"
            },
            {
              "uuid": "e77a123f-a0c7-445e-9334-da5b5bb4a60a",
              "value": "fwnzc893dw"
            },
            {
              "uuid": "873be780-33ff-433d-b183-8d96b192447d",
              "value": "gg4txo2aem"
            },
            {
              "uuid": "90f9a8cc-ab69-4da4-966f-5130c46ee611",
              "value": "972f67n5mp"
            },
            {
              "uuid": "d47f2148-7f26-45e9-9186-bee24c6c0c88",
              "value": "mqhyrwk5wp"
            },
            {
              "uuid": "62c2c7a2-e480-40b0-bb30-791a4ad446b3",
              "value": "1nwogpmvq0"
            },
            {
              "uuid": "8a464630-f156-4474-8ceb-0f265d105abb",
              "value": "Host-5fx9yj3afd"
            },
            {
              "uuid": "ae9e1b39-95dd-4979-b434-4ff8c218651f",
              "value": "bhtz09ap0y"
            },
            {
              "uuid": "43ddde44-6213-4870-9964-0e36d2633aa3",
              "value": "fkywgod7sh"
            },
            {
              "uuid": "af8fb588-f565-478c-aed8-d2f62ff3dc3b",
              "value": "lq1dwqpp4f"
            },
            {
              "uuid": "b4cb4654-56da-4ea2-aa9e-7629f79ee256",
              "value": "m7oz3zew9u"
            },
            {
              "uuid": "959eee63-8e1f-4af3-88da-353e8cd3b1d7",
              "value": "j0ysovxuph"
            },
            {
              "uuid": "6bf42ac0-26bd-41c8-b438-d8a67c81f0aa",
              "value": "o8r2x6gm2l"
            },
            {
              "uuid": "6dda5776-0542-4dec-ac01-43fded9d479d",
              "value": "gzygo814tw"
            },
            {
              "uuid": "398334df-b179-4f78-b6d0-dea48015da8a",
              "value": "370lqwjv0w"
            },
            {
              "uuid": "d664ddf8-7aee-4c21-90e6-b73dfe0c7e6a",
              "value": "1xfk593nt2"
            },
            {
              "uuid": "37011c41-309b-4efe-93ee-29c523ca7af3",
              "value": "Host-3he2cu7cly"
            },
            {
              "uuid": "702fadc7-3490-4b83-9e2f-24dd49044fd2",
              "value": "i5h2ps7hcq"
            },
            {
              "uuid": "b3f38b02-5a1d-46a3-b396-4f5a19a3c133",
              "value": "x378aal3j0"
            },
            {
              "uuid": "6a935fc7-ce21-490f-91f5-c3c6e2992e0d",
              "value": "qwunhqng06"
            },
            {
              "uuid": "d404c479-44ed-47e5-8935-0b7466fdf6f7",
              "value": "3ba55r1pc3"
            },
            {
              "uuid": "8acdef7f-e0bc-4d27-a816-7b25f3dc8eaf",
              "value": "8dj1gefezl"
            },
            {
              "uuid": "55641fba-7ae1-4075-958c-6c3638c67ded",
              "value": "Host-u93wjvex8b"
            },
            {
              "uuid": "3765b6dd-c844-4426-af16-36d45f386cd6",
              "value": "zdng4n08t6"
            },
            {
              "uuid": "57d51271-2e03-4889-982f-85b8e4c22863",
              "value": "2l915yteo6"
            },
            {
              "uuid": "44375026-fadd-4f73-8563-9574053a8dea",
              "value": "9fsmxyyerb"
            },
            {
              "uuid": "5cf1f48b-71d8-450f-acab-f41aeea774ed",
              "value": "b799g8gri4"
            },
            {
              "uuid": "2ff664c4-d115-4c14-bcd7-80ebb6167540",
              "value": "3wdgaal1ho"
            },
            {
              "uuid": "3606a7cf-40a4-4ac3-bc0d-208058feb6f3",
              "value": "2tsbf5r1r1"
            },
            {
              "uuid": "f6bb6ade-fd24-402f-8b3f-768dfd7be610",
              "value": "8pfyx06ody"
            },
            {
              "uuid": "68f39810-3929-40bb-821e-4fa005a26995",
              "value": "e5rp6vrlz6"
            },
            {
              "uuid": "1bfb5511-4bf4-4321-adea-7f7dd6d78e11",
              "value": "8i4t08jguh"
            },
            {
              "uuid": "fc760443-8d60-43d5-9f4f-1353ff04e38a",
              "value": "lboc1fohja"
            },
            {
              "uuid": "d0466adc-d32a-41e4-84ae-bd79c54fafaa",
              "value": "jayxv5sk91"
            },
            {
              "uuid": "4d114039-197c-4cd7-abe8-0018f25ea4f6",
              "value": "7udi36ubkm"
            },
            {
              "uuid": "d37f12e1-8613-4086-9335-431be8c4d213",
              "value": "udw5949690"
            },
            {
              "uuid": "40cbc1f5-f090-459c-bd43-40ae695cea14",
              "value": "b5elvnu9p3"
            },
            {
              "uuid": "bbb7519d-8c0b-4d25-9a88-39188e349288",
              "value": "qpd3lv52f1"
            },
            {
              "uuid": "b939d956-e73d-48a3-b7a2-a80fb636e4ce",
              "value": "4rp44xht63"
            },
            {
              "uuid": "c6636d8e-9730-4dcf-9c3c-f8d85014feda",
              "value": "pphm512rmc"
            }
          ],
          "kibana.alert.attack_discovery.summary_markdown": "Detected multi-stage attack on {{ host.name 26709885-b791-4269-b71b-1e7f0eb161ca }} beginning with malware masquerading as Explorer, followed by suspicious network connections via Notepad, and culminating in Mimikatz credential harvesting.",
          "kibana.alert.attack_discovery.summary_markdown_with_replacements": "Detected multi-stage attack on {{ host.name 26709885-b791-4269-b71b-1e7f0eb161ca }} beginning with malware masquerading as Explorer, followed by suspicious network connections via Notepad, and culminating in Mimikatz credential harvesting.",
          "kibana.alert.attack_discovery.title": "Multi-Stage Windows Host Compromise",
          "kibana.alert.attack_discovery.title_with_replacements": "Multi-Stage Windows Host Compromise",
          "kibana.alert.rule.category": "Attack Discovery Schedule",
          "kibana.alert.rule.consumer": "siem",
          "kibana.alert.rule.execution.uuid": "6288991a-b722-407b-ace9-ff4969e68c68",
          "kibana.alert.rule.name": "Schedule 1!",
          "kibana.alert.rule.parameters": {
            "alertsIndexPattern": ".alerts-security.alerts-default",
            "apiConfig": {
              "connectorId": "sonnet-3-7",
              "actionTypeId": ".bedrock",
              "name": "Sonnet 3.7 (Bedrock)"
            },
            "end": "now",
            "size": 100,
            "start": "now-24h"
          },
          "kibana.alert.rule.producer": "assistant",
          "kibana.alert.rule.revision": 0,
          "kibana.alert.rule.rule_type_id": "attack-discovery",
          "kibana.alert.rule.tags": [],
          "kibana.alert.rule.uuid": "006311e7-6818-42d5-87da-891e7acc4fd7",
          "kibana.space_ids": [
            "default"
          ],
          "@timestamp": "2025-04-15T17:21:44.201Z",
          "event.action": "open",
          "event.kind": "signal",
          "kibana.alert.rule.execution.timestamp": "2025-04-15T17:21:44.201Z",
          "kibana.alert.action_group": "default",
          "kibana.alert.flapping": false,
          "kibana.alert.flapping_history": [
            true
          ],
          "kibana.alert.instance.id": "fd852368-26a4-4223-b61e-5be4173d1e37",
          "kibana.alert.maintenance_window_ids": [],
          "kibana.alert.consecutive_matches": 1,
          "kibana.alert.pending_recovered_count": 0,
          "kibana.alert.status": "active",
          "kibana.alert.uuid": "a43601aa-fc0b-4a4a-bee7-42c5441dc598",
          "kibana.alert.severity_improving": false,
          "kibana.alert.workflow_status": "open",
          "kibana.alert.duration.us": 0,
          "kibana.alert.start": "2025-04-15T17:21:44.201Z",
          "kibana.alert.time_range": {
            "gte": "2025-04-15T17:21:44.201Z"
          },
          "kibana.version": "9.1.0",
          "tags": []
        }
}
```

</details>

## NOTES

The feature is hidden behind the feature flag (in `kibana.dev.yml`):

```
feature_flags.overrides:
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```
2025-04-17 10:00:04 +02:00
Francesco Fagnani
e96f0566ce
[Synthetics] Fixed test run logs per page (#218458) 2025-04-17 07:34:38 +02:00
Ash
f6ad013220
[Ai4dSoc][Serverless] Hide Security feature sub-privileges in search_ai_lake tier (#217210)
## Summary

Hides security sub-privileges for ai4soc/search_ai_lake tier.
![Screenshot 2025-04-11 at 10 22
09](https://github.com/user-attachments/assets/6f3294bc-82de-404e-b9d3-22e717d54b65)

### Reasoning for changes added to `x-pack/packages/security`:

Currently, the feature description of Security feature is tied to the
fact that it has a list of sub-privileges. This is true on ESS and
`essentials/complete` serverless tiers.

With the introduction of the lower `search_ai_lake` tier, security
feature would not have any sub-privileges available and thus it does not
make sense to show that description.

The ideal way to handle this would be to load feature privileges config
settings at the plugin level
(security_solution/security_solution_serverless) and set `description`
to `null | undefined` based on the tier, as currently the feature
privileges settings live in [kibana_features file
(v2_features)](795094d8c6/x-pack/solutions/security/packages/features/src/security/v2_features/kibana_features.ts (L72))
(also another set in v1_features) and the plugins only select a set of
those based on the [feature keys
available](d4a33a2b61/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_config.ts)
on each tier. The refactoring to pass in feature configs at the plugin
level (instead of just feature keys) is not in the scope of the work cut
out for RSA conf.

Thus the other simpler approach in this PR is to allow overriding the
description field on the tier specific config file.

## How to Test

1. While on the Kibana root directory, run ES/Kibana on serverless mode
with:

```bash
yarn es serverless --kill --projectType security --kibanaUrl=http://0.0.0.0:5601
```
and on a new window
```bash
yarn serverless-security --no-base-path
```

Enable the AI for SOC tier, by adding the following to your
`serverless.security.dev.yaml` file:

```json5
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
```

2. Once Kibana is up and running login in with the `admin` role using
the role dropdown.
3. Navigate to `app/management/roles/edit`
4. Click on `Assign to space` button and assign a space to that role on
the `Assign role to spaces` flyout.
5. Expand the `Security` category and verify that `Security` feature is
listed in the list of features.
6. Also verify that there is neither an accordion icon beside `Security`
feature nor a description text under it about sub-privileges.

### 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-04-16 15:40:09 -06:00
Kylie Meli
a63876b1a4
[AI4DSOC] Add configurations integrations page (#217905)
## Summary

Implements the curated Integrations management page for AI for the SOC:

- Adds the new Integrations page utilizing the `PackageListGrid`
exported fleet component
- Paths of `/configurations/integrations/browse` and
`configurations/integrations/installed` to be consistent with current
fleet pages `/integrations/browse` and `/integrations/installed`
- Updates the `PackageCard` to expose new settings options defaulted to
the existing behavior
- Updates the sidebar link order to match the tabs

<img width="1722" alt="Screenshot 2025-04-14 at 12 00 41 PM"
src="https://github.com/user-attachments/assets/982e01b9-4ceb-4a1e-9cfe-4a44d2f9c8bf"
/>

<img width="1720" alt="Screenshot 2025-04-14 at 12 00 55 PM"
src="https://github.com/user-attachments/assets/401f37fe-791f-4f7c-b31f-f0d6b56f1b46"
/>

<img width="517" alt="Screenshot 2025-04-10 at 3 11 29 PM"
src="https://github.com/user-attachments/assets/f60e6eda-6750-40fb-8611-e73ef5d8fa91"
/>

## How to test

- Add the following to `serverless.security.dev.yml`:
  ```
  xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
  ```
- Run Kibana serverless for security
- Verify behavior matches the UX mockups:
[figma](https://www.figma.com/design/DYs7j4GQdAhg7aWTLI4R69/AI4DSOC?node-id=2969-143558&p=f&m=dev)

Couple things to note:
- some of the actual logos vary slightly from the figma, but UX has
approved
- if you want to actually install integrations in agentless, be sure to
reference fleet docs for [serverless
](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/dev_docs/local_setup/developing_kibana_in_serverless.md)
and
[agentless](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/dev_docs/local_setup/agentless.md).
If you just want to get an idea of what it would look like installed
without doing that, just navigate to the Settings tab on the
integrations overview and install its assets

Relates: https://github.com/elastic/security-team/issues/11789
2025-04-16 15:42:57 -04:00
Brad White
a7796cd0d0
[SB] Fix graph layout stories (#217766)
## Summary

This fixes the graph layout stories not rendering properly after
#214684. Open to a better or preferred fix as I'm not familiar with
these components.

There was a console warning:
```js
[React Flow]: The React Flow parent container needs a width and a height to render the graph. Help: https://reactflow.dev/error#004
```

[Storybook preview
link](https://ci-artifacts.kibana.dev/storybooks/pr-217766/cloud_security_posture_graph/index.html?path=/story/components-graph-components-graph-layout--simple-api-mock)

---------

Co-authored-by: Kfir Peled <61654899+kfirpeled@users.noreply.github.com>
2025-04-16 19:59:08 +03:00
Marco Liberati
0a6bc1b46c
[chore] Bundle fp-ts into the shared bundle (#217034)
## Summary

Just had some fun and made fp-ts available in the shared bundle, with
support for partial imports.

Changes in this PR:
* aligned `fp-ts` direct imports to the format: `fp-ts/<module>`
* Mapped the direct imports into the shared bundle re-using the same
`fp-ts` module under the hood
2025-04-16 18:01:41 +02:00
jennypavlova
f816e7b84f
[APM][OTel] Encode service name in the APM URLs (#217092)
Closes #213943

## Summary

This PR ensures the service name is always encoded in the APM UIs. It's
a follow-up of https://github.com/elastic/kibana/pull/215031 and aims to
find a better solution to the problem:
- Add the encoding directly to `formatRequest` as suggested there
- I saw that there are many places where we use legacy Url builders, so
I will try to replace them where possible and use
apm router link method where the path is encoded
([ref](7158e0201b/src/platform/packages/shared/kbn-typed-react-router-config/src/create_router.ts (L184-L185)))
- The PR includes the changes to address the issue above:
   - Replaced and removed `LegacyAPMLink`
- Refactored `useAPMHref` to support encoding (and extracted and test
the encoding logic)
     - Example usage: 
        - Before: 
        ```js
           useAPMHref({
                path: `/services/${serviceName}/.....`,
                persistedFilters,
           });
        ```
        - After:
        ```js
          useAPMHref({
              path: '/services/{serviceName}/.......}',
              pathParams: { serviceName },
              persistedFilters,
         });
        ```
   - Used the APM router link method as much as possible


## Testing
- Run `node scripts/synthtrace trace_with_service_names_with_slashes.ts
--clean --live --uniqueIds --live`
- Go to service inventory and click the links:


https://github.com/user-attachments/assets/fcd4fbfc-4125-4cc8-9b00-53c5f375423f
2025-04-16 17:52:33 +02:00
Marshall Main
52ecdd0ac7
[Security Solution][Rules Management] Separate actions import logic from rules import (#216380)
## Summary

Redo of https://github.com/elastic/kibana/pull/193471
Closes https://github.com/elastic/security-team/issues/8644

> Fixes a bug where importing a rule fails with a connector into a space
where (1) the connector already exists, and (2) the existing connector
was exported and re-imported from another space. The import logic in
this scenario effectively tries to convert the action ID on the rule
import twice. The second conversion attempt tries to use the old action
ID to look up the correct new action ID in a map, however, in this test
scenario the action ID has already been updated by legacy SO ID
migration logic and there is no map entry with the new ID as a key. The
result is that the second attempt sets the action ID to undefined,
resulting in an import failure.

The root cause of the bug is that we have two different places in the
rule import logic where action IDs are migrated. The first ID migration
was done by `migrateLegacyActionsIds` prior to importing rule actions,
and the second migration was done by `importRuleActionConnectors` after
importing the actions. `importRuleActionConnectors` used a lookup table
to convert old IDs to new IDs, but if the connector already existed and
had an `originId` then the rule action would already be migrated by
`migrateLegacyActionsIds`. The lookup table used by
`importRuleActionConnectors` does not have entries for migrated IDs,
only the original IDs, so in that case the result of the lookup is
`undefined` which we assign to the action ID.

This PR reworks the logic to create a clean separation between action
and rule import. We now import the connectors first, ignoring the rules,
then migrate action IDs on the rules afterwards. This handles connectors
changing IDs in any way, either through the 7.x->8.0 migration long ago
or IDs changing on import if there are ID conflicts. Only after the
connectors are imported and rule actions are migrated do we then verify
if each rule action references a connector ID that actually exists with
the new `checkRuleActions` function, replacing
`checkIfActionsHaveMissingConnectors` and related functions that were
also buggy.

Finally, as a nice side effect this rework removes "rule action
connector missing" errors out of the `action_connector_errors` part of
the response. `action_connector_errors` is reserved for errors importing
connectors specifically. If a rule action is missing a connector and
therefore we don't import the rule, that's a rule error and it's
represented in the `errors` part of the response. Since the shape of the
response is not changing, I don't consider this a breaking change but
rather a bug fix.

## Repro Steps

Repro Steps
1. Download the export file below and change the extension back to
.ndjson from .json (github does not allow .ndjson files

[rules_export.json](https://github.com/user-attachments/files/17065272/rules_export.json)
2. Import the rule and connector into a space (default is fine)
3. Create a new space
4. Import the rule and connector into the new space
5. Import the rule and connector into the new space again, but check the
`Overwrite existing connectors with conflicting action "id"` box.
Observe the failure.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-16 11:47:26 -04:00
Konrad Szwarc
a2b70a0d45
[EDR Workflows][Insights][UI] Rename Endpoint Insights to Automatic Troubleshooting in Permissions (#216977)
Docs update request -
https://github.com/elastic/docs-content/issues/1015

This PR updates the Permissions flyout to rename Endpoint Insights to
Automatic Troubleshooting. The change ensures the title and description
align with the current feature name.

![Screenshot 2025-04-03 at 11 12
12](https://github.com/user-attachments/assets/a9f5b63b-a10f-49eb-b2ab-d550ef2f7ddf)
2025-04-16 16:58:32 +02:00
Kevin Qualters
c277812ffe
[Security Solution] Fix redux action being fired because of unused react-router value (#217055)
## Summary

This pr fixes a bug with the RouteCapture component, used at a high
level in the security solution component tree, to reflect url changes
into redux. The code previously used the full result of
'react-router-dom' 's useLocation hook as the payload, which contains 4
parameters, pathname, search, hash that we make use of, and a 4th that
was added sometime later by the library that is essentially a random id
generated every time the hook is called, called key. We have never used
this, and it was being inadvertently copied into the redux state, and
also causing some other actions or hooks based listeners to run I think
as well.

Below is the contrived example of going from the home page to an empty
alerts page, and you can see 4 actions in the after, and 5 in the
before, with 1 updating only the key. May reduce more unneeded actions
with more going on in the page, but exactly how many is not known.
Before:

![image](https://github.com/user-attachments/assets/93cc2c5a-56e4-4764-8791-c41879fd5b45)


After:

![image](https://github.com/user-attachments/assets/ebd75055-4e17-497b-bed2-a5fd58c5c92f)


### 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
2025-04-16 10:13:44 -04:00
Agustina Nahir Ruidiaz
f00f83715c
[Security Solution][Onboarding] Adding telemetry to video selectors (#217280)
## Summary

New event created for the video selectors inside rules, dashboards and
alerts cards.

```
export interface OnboardingHubSelectorCardClickedParams {
  originStepId: string;
  selectorId: string;
}
```

To verify:

Add these lines to kibana.dev.yml

```
logging.browser.root.level: debug
telemetry.optIn: true
```

1. In the onboarding hub, expand the rules card
2. It should log `Report event "Onboarding Hub Step Selector Clicked"`.


https://github.com/user-attachments/assets/c1b1084e-4917-4412-93ed-984a74b6b6b4


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] [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>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-16 15:42:30 +02:00
Sergi Massaneda
937dbba41e
[Security Solution] Allow disabling experimental features via config (#217363)
## Summary

This PR adds support for disabling experimental features using the
existing `xpack.securitySolution.enableExperimental` configuration.

This solves the problem of not being able to disable a feature by config
once the feature has been enabled by default.

### The Challenge 

When we start developing a feature under an experimental flag we always
follow the same steps:

1 - Create the experimental flag disabled by default + enable it via
config for testing
2 - Implement the feature
3 - Enable the experimental flag by default when we want to release the
feature.
4 - Deployments can disable the feature via config (as a safety
measure).
5 - Remove the experimental flag after some time.

We start by creating the flag disabled by default while we implement it.
In `experimental_features.ts`:
```ts
export const allowedExperimentalValues = Object.freeze({
  myFeatureEnabled: false,
  [...]
```
And enable it via config with:
```yml
xpack.securitySolution.enableExperimental:
  - myFeatureEnabled
```

Once the implementation is done and the experimental flag can be enabled
by default, we have to do a trick:
Since the `xpack.securitySolution.enableExperimental` config can only
turn flags to _true_, instead of setting `myFeatureEnabled: true`, what
we have to do is rename the flag to `myFeatureDisabled` and keep the
value as _false_:

```ts
export const allowedExperimentalValues = Object.freeze({
  myFeatureDisabled: false,
  [...]
```
Then we also need to do a code refactor to update all the places in the
code where the flag was checked: `if (myFeatureEnabled)` -> `if
(!myFeatureDisabled)`

This way, we have the option of disabling the feature via config (in
case something goes wrong):
```yml
xpack.securitySolution.enableExperimental:
  - myFeatureDisabled
```

### A solution

This PR introduces the possibility to turn a flag to _false_ using the
same `xpack.securitySolution.enableExperimental` config. This was
preferable to introducing a new config since this one is already
whitelisted in Cloud UI, can be easily overritten in deployments, and
also because people are used to it.

With these changes, the first two steps would be the same, with the
difference that we won't need to have the _Enabled_ or _Disabled_ word
at the end of the flag name. It could be just the feature name, in
`experimental_features.ts`:
```ts
export const allowedExperimentalValues = Object.freeze({
  myFeature: false,
  [...]
```

And when we need to enable the feature by default, we can just turn it
to `true`:
```ts
export const allowedExperimentalValues = Object.freeze({
  myFeature: true,
  [...]
```
No tedious refactor or confusing naming would be required. 

Then, in case we need to disable the feature in a production deployment
for some reason, we could just do this via config :
```yml
xpack.securitySolution.enableExperimental:
  - disable:myFeature
```

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-16 14:09:28 +02:00
Mykola Harmash
fc686f8a6d
[Oblt Onboarding] Remove Custom Logs flow (#216053)
Closes https://github.com/elastic/kibana/issues/208025

This change deleted the "Stream log files" onboarding flow which is now
replaced by the Auto Detect flow.

| Before | After |
| --- | --- |
| ![CleanShot 2025-03-27 at 14 55
55@2x](https://github.com/user-attachments/assets/46a90769-8b3d-495f-b600-9a8f24964761)
| ![CleanShot 2025-03-27 at 14 56
28@2x](https://github.com/user-attachments/assets/e800cab8-cfd2-48e8-8d1a-8a41c037d532)
|


Changes made:
* Deleted UI components responsible for rendering the Custom Logs flow
* Deleted the definition for a custom card in the onboarding search
results
* Deleted API endpoints and supporting files used only by the Custom
Logs flow
* `/internal/observability_onboarding/logs/setup/environment` endpoint
was still used by the OTel Host flow, so it was moved to a dedicated
OTel route and pathname changed to
`/internal/observability_onboarding/otel_host/setup`
* Functionality of the `/internal/observability_onboarding/otel/api_key`
endpoint was merged into the above mentioned OTel route, so UI has to
make a single API request to get all the necessary information from the
server
* Deleted Scout UI tests for the Custom Logs flow
* Deleted API integration tests for the deleted endpoints
* API tests that we previously testing
`/internal/observability_onboarding/logs/flow` were converted to test
`/internal/observability_onboarding/flow'` used by the Auto Detect flow

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-16 11:01:18 +02:00
Kenneth Kreindler
1d430d4d35
[Security solution] [Ai Assistant] ES|QL generation with self healing (#213726) 2025-04-16 09:12:49 +01:00
Francesco Fagnani
ec88cca373
[Synthetics] Added drilldown to synthetics stats overview embeddable (#217688)
This PR closes #208066 by adding drilldowns to the synthetics stats
overview embeddable.



https://github.com/user-attachments/assets/fe8d9eb0-ecdc-449d-93af-7d165c541d46
2025-04-16 09:52:16 +02:00
Saikat Sarkar
398123d22c
[Playground chat] UX cleanup for EIS on by default (#217410)
## Summary

This PR involves changes in the UX for playground setup page and
Palyground Chat. Following items have been addressed.

- [x] Convert LLM Connected button to a label that is not interactive
- [x] Rename that label to "Elastic LLM Connected" if EIS is connected,
otherwise "LLM Connected"
- [x] Split the main panel into two panel: one for connecting to an LLM,
one for adding data
- [x] Add unit tests

# Before 
![Screenshot 2025-04-09 at 4 48
35 PM](https://github.com/user-attachments/assets/a632bc94-eeea-4403-bbd3-f7bfcc0deae2)
![Screenshot 2025-04-09 at 4 49
37 PM](https://github.com/user-attachments/assets/fb667ff6-6efc-470b-bb55-5b63bf33f61a)



# After
![Screenshot 2025-04-14 at 5 43
20 PM](https://github.com/user-attachments/assets/d9da3bd9-b7b5-490d-9b7c-d4783e3a4d3b)

![Screenshot 2025-04-09 at 4 40
24 PM](https://github.com/user-attachments/assets/ab0a9fac-d8e0-4f64-a7d5-588c2990a015)


### 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-04-15 19:04:00 -05:00
jennypavlova
7c9a3ee1f2
[APM][OTel] EDOT error summary fix (#217885)
## Summary

This PR fixes the issue with the error summary missing items using edot.
It includes e2e tests with synthtrace for both edot and otel services.

TODO 

- [x] Test with serverless (waiting for the PR to be deployed)
Tested on serverless works as expected: 

<img width="2560" alt="image"
src="https://github.com/user-attachments/assets/8dd7962e-7d66-482d-97fb-0b08882bd04f"
/>
2025-04-15 21:44:11 +02:00
Shahzad
83f3d614cc
[Custom threshold rule] Allow group for ip type fields !! (#216062)
Allow group by for ip fields !!

---------

Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-15 20:15:02 +02:00
christineweng
a4a11bb46f
[Security Solution][Alert flyout] Edit highlighted fields in overview tab (#216740)
## Summary

This PR allows user to edit highlighted fields in alert flyout, under
`Investigations`. The modal shows default highlighted fields that are
defined by Elastic, and allow user to edit custom highlighted fields.

Currently this feature is behind feature flag
`editHighlightedFieldsEnabled` (not enabled by default).



https://github.com/user-attachments/assets/35b3d09e-5e21-42ea-80e9-e8c0753985c9



#### Disabled when:

<details>
<summary>User does not have security privilege</summary>


![image](https://github.com/user-attachments/assets/69ba7bc7-2d9b-4a2c-ae8e-e9c14f396a31)

</details>

<details>
<summary>Prebuilt rule w/o enterprise license (showing upsell)</summary>


![image](https://github.com/user-attachments/assets/a9c38e20-85b2-4082-af5e-a8707b2098cb)

</details>

#### Do not show the button when:
<details>
<summary>Not an alert </summary>


![image](https://github.com/user-attachments/assets/b5e9afde-f0d0-4a88-aaed-7481ba586850)

</details>

<details>
<summary>rule preview</summary>


![image](https://github.com/user-attachments/assets/283d7a83-50b2-48ab-af2d-11692501c205)

</details>

### 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
- [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-04-15 12:18:35 -05:00
Ievgen Sorokopud
34df5e3328
[Attack Discovery][Scheduling] Fix the attack discovery alert type (#218025)
## Summary

This is a fix for the incorrectly generated attack discovery alert
schema type due to the limitation of the generation tool.
2025-04-15 18:18:33 +02:00
Drew Tate
9b4403b7dc
[ES|QL] remove worker (#218006)
## Summary

Fix https://github.com/elastic/kibana/issues/217923

Investigations in https://github.com/elastic/kibana/issues/217368 showed
that there was basically no performance impact to passing the AST across
a thread boundary. But we also didn't detect a pressing reason to remove
the worker.

Since then, however, we noticed another cost associated with the worker:
it's a hefty Javascript file, even in production builds. In addition, we
are doing parsing on the main thread _and_ the worker, so the
`kbn-esql-ast` package is actually being loaded and parsed twice by the
browser, once for the main thread and once for the worker.

This PR removes our worker. Our parsing associated with validation and
autocomplete will still be done asynchronously, but on the main thread.

I do not see any regression in perceived performance.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-04-15 10:18:07 -06:00
Francesco Fagnani
f693e7218e
[Synthetics] Sync global parameters is called in the endpoints to add, edit or delete global params (#216197)
This PR closes #215668.

The global parameters are synched in the endpoints where they are
created, edited or deleted.

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
2025-04-15 16:53:14 +02:00
Kibana Machine
7b629a9908 skip failing test suite (#207773) 2025-04-15 16:38:12 +02:00
Ievgen Sorokopud
10943319b2
[Attack Discovery][Scheduling] UI: "Attack Discovery Scheduling" management (#12007) (#217917)
## Summary

Main ticket ([Internal
link](https://github.com/elastic/security-team/issues/12007))

These changes add the attack discovery schedules management table.


https://github.com/user-attachments/assets/619ad1d6-d919-4a8d-b743-6a73fbfbf318

## Key changes

* UI side API handlers
* Create schedule workflow
* Schedules table
* Enable schedule from the table
* Disable schedule from the table
* Delete schedule from the table
* Pagination and sorting in find schedules API

## NOTES

The feature is hidden behind the feature flag (in `kibana.dev.yml`):

```
feature_flags.overrides:
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```
2025-04-15 15:06:06 +02:00
Marshall Main
dee4dfbe59
[Security Solution][Detection Engine] Split search request building from search (#216887)
## Summary

This PR better separates the request building logic in the detection
engine from query building logic, removes outdated error checking logic,
updates the `singleSearchAfter` `search` call to no longer use the
legacy `meta: true` param, and improves search response type inference.
2025-04-15 08:19:34 -04:00
Maxim Palenov
87f8274f41
[Security Solution] Suppress prebuilt rule SO duplicates in review install endpoint (#218123)
## Summary

This PR makes sure a buggy `security_detection_engine` package doesn't affect a preview installation endpoint. Older security detection rules package versions contain saved object rule duplicates affecting the endpoint.

Having `security_detection_engine` v`8.17.1` package installed `/internal/detection_engine/prebuilt_rules/status` and `/internal/detection_engine/prebuilt_rules/installation/_review` endpoints return a different number of rules available to install.

## Details

Older `security_detection_engine` package versions contain rule saved objects duplicates representing the latest version. For example, `8.17.1` version has a rule `Microsoft 365 User Restricted from Sending Email` with `rule_id` = `0136b315-b566-482f-866c-1d8e2477ba16` and the latest version `206`. Since a package may contain multiple historical rule versions it sticks to the following format `<rule_id>_<version>` where `<rule_id>` is the unique rule's UUID and `<version>` it's version. Some older package versions omit `<version>` for the latest rule version. `Microsoft 365 User Restricted from Sending Email` rule mentioned above has two equal assets corresponding to the latest version with the only difference in the saved object id `0136b315-b566-482f-866c-1d8e2477ba16` and `0136b315-b566-482f-866c-1d8e2477ba16_206`.

Prebuilt rules preview endpoint was designed to handle `<rule_id>_<version>` format only. Consequently, it improperly handles older prebuilt rules package version.

This bug manifested in https://github.com/elastic/kibana/pull/217544 where `security_detection_engine` version has been bumped to `8.18.1`. It resulted in a failed integration test. Further investigation has shown that the test installs an older package version `8.17.1` to assert prebuilt rules upgrade workflow works correctly.

The fix is implemented in `PrebuiltRuleAssetsClient.fetchAssetsByVersion()` by using `Map` to deduplicate prebuilt rule assets.
2025-04-15 13:45:08 +02:00
Dzmitry Lemechko
edf8d6d975
[kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status (#217230)
## Summary

Follow-up to #217153

### Problem Description
In UI tests, there was no reliable way to determine when the Alerts
table content had fully loaded before interacting with it. This could
lead to flaky tests where interactions occurred before the data was
available (rows are not present yet), causing failures or inconsistent
results (checking for row with specific content to exist)


![image](https://github.com/user-attachments/assets/6580f134-0bf2-48b8-8cc9-b6d476f4e932)

Quite often we see tests waiting for global indicator (spinner in the
top left corner) to be hidden as a condition for page loading is
complete. This is quite unreliable approach and testing tools have no
consistent built-in solution: FTR, Cypress or even Playwright - network
idle wait is officially marked as
[discouraged](https://playwright.dev/docs/api/class-page)).
We need to help testing tool to interact with UI components in ready
state only.


### Solution
To address this issue, I modified a `data-test-subj` property in the
`<EuiDataGrid>` component. The property dynamically switches between
`alertsTableIsLoading` when data is still loading and
`alertsTableIsLoaded `once the content is available. This allows UI
tests to wait for precisely `alertsTableIsLoaded` to be in in the DOM
before interacting with the table, ensuring more reliable and stable
test execution.


Passed 10/10
<img width="538" alt="image"
src="https://github.com/user-attachments/assets/e44bae5f-4094-4ed2-89f3-74a52cb2be53"
/>
2025-04-15 13:05:49 +02:00