Commit graph

1445 commits

Author SHA1 Message Date
Efe Gürkan YALAMAN
62f8027c57
[Query Rules]Query rules UI plugin (#215029)
## Summary

Adds Query Rules UI Plugin. It is disabled and pretty much empty as we
want to split the implementation in multiple parts and enable the
feature once implementation is done.

It is disabled for Security.
It is disabled for Observability.
It is enabled but behind a feature flag for Search while it is not
useful to enable it with partial implementations.


### 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)
2025-03-21 15:19:25 +01:00
Rodney Norris
5b504f8f2a
[Search][Playground] Query mode support for running search (#214482)
## Summary

Updated the Search Playground Query View to allow running the query and
seeing the JSON response.

### Screenshots
Empty State

![image](https://github.com/user-attachments/assets/1edb1ad8-5b5d-4069-a96f-4fbb0f9212b4)

With Query Response:

![image](https://github.com/user-attachments/assets/8fe7b1c5-70b3-4b24-91e5-f948d91d83d0)


### 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
- [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
- [ ] 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>
2025-03-21 08:59:51 -05:00
Sebastián Zaffarano
9cf3bea759
[Security Solution][Telemetry] Add ingest pipelines stats task (#213435)
## Summary

Add a new telemetry task to the security solution plugin to collect
ingest pipeline stats. The new task runs once a day, calls the
`_nodes/stats/ingest` API, and sends an EBT event with the following
information:

```js
export interface NodeIngestPipelinesStats {
  name: string;
  totals: Totals;
  pipelines: Pipeline[];
}

export interface Pipeline {
  name: string;
  totals: Totals;
  processors: Processor[];
}

export interface Processor {
  name: string;
  totals: Totals;
}

export interface Totals {
  count: number;
  time_in_millis: number;
  current: number;
  failed: number;
}
```

### 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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
2025-03-21 14:38:58 +01:00
Konrad Szwarc
f09945bb1b
[EDR Workflows] Unskip management Jest tests (#215324)
8.17 PR - https://github.com/elastic/kibana/pull/215474
Part of https://github.com/elastic/security-team/issues/12176

Unskiped: 
### `use_list_artifact.test.tsx`
Path
`.../plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.test.tsx`
Closes https://github.com/elastic/kibana/issues/196724
Commit 438553a1d1
Reason for unskipping: Couldn't recreate failure locally. Increased
timeout from 1000 to 5000 ms.


### `actions_log_users_filter.test.tsx`
Path
`.../plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.test.tsx`
Closes https://github.com/elastic/kibana/issues/193554
https://github.com/elastic/kibana/issues/193092
Commit ca7b971683
de03fd5448
fb3910e738
Reason for unskipping: wrapped expects in waitFor since they are
awaiting for state change. Increased the delay between keystrokes when
typing. Increased the timeout of tests since locally they are bordering
5s executions.

### `bad_argument.test.tsx`
Path
`.../plugins/security_solution/public/management/components/console/components/bad_argument.test.tsx`
Closes https://github.com/elastic/kibana/issues/193093
Commit 6959cd2e3f
Reason for unskipping: wrapped expects in waitFor since they are
awaiting for state change. Increased timeout to 10s.

### `use_get_endpoint_details.test.ts`
Path
`.../plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts`
Closes https://github.com/elastic/kibana/issues/192435
Commit 3ba10029b6
Reason for unskipping: increased timeout of waitFor for
renderReactQueryHook to 5s since locally it was bordering 3 seconds
2025-03-21 13:26:30 +01:00
Gloria Hornero
d5a0501fb8
initial @kbn/scout-security plugin (#210433)
## Summary

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

In this PR we are adding the initial structure for the
@kibana/scout-security package, note that this is not ready to be used
and any new test using this package, is not going to be executed as part
of the regular pipelines, meaning, you are not going to add coverage to
the application.


@kibana/scout-security package is a test package that extends @kbn/scout
with test helpers specifically designed to test Security Solution
functionalities in Kibana. All tests under Security plugins should only
import from @kbn/scout-security, not from @kbn/scout.



This PR is a POC to start testing development by providing custom
Playwright fixtures, page objects, and utilities tailored for
Security-related testing scenarios.

Things to follow-up:



- CustomQueryRule interface is already declared in
`x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.gen.ts`
as `QueryRuleCreateProps`

- DETECTION_ENGINE_RULES_URL and DETECTION_ENGINE_RULES_BULK_ACTION are
already declared in `@kbn/security-solution-plugin/common/constants`

It would be great if all of that is extracted from the plugin to a
package so it can be reused instead of having to duplicate the code.

Until the package is not ready to be used and has not been introduced to
the different teams, appex-qa and myself will be the owners of it to
make sure that best practices are followed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2025-03-21 12:59:30 +02:00
Abhishek Bhatia
dbe28b9f94
[Security Solution][Risk Score] Use Risk Engine SavedObject intead of localStorage on the Risk Score web page (#215304)
## Summary

The PR updates the implementation to fetch data from the Risk Engine
Saved Object instead of storing and reusing it from LocalStorage.

This change ensures that settings are applied globally rather than being
limited to the browser’s LocalStorage. Since the Saved Object holds the
most up-to-date information, it is now used to update the "Date" and the
toggle for "including closed alerts for risk scoring" across all web
browsers.


### Normal and Incognito Mode : 



https://github.com/user-attachments/assets/7638c88b-ff9e-4d42-9944-e55b53e33518


### Default space vs custom space : 



https://github.com/user-attachments/assets/46bb35c7-3cd9-4b97-9f1c-90ec4ef1241a


## Testing Steps

### Verify Initial Values
1. Open the Entity Risk Score web page where the settings are applied.
2. Ensure that the date picker and toggle for "including closed alerts"
reflect the values stored in the Risk Engine Saved Object rather than
LocalStorage.
3. Modify and Save changes,
   - Change the date range in the date picker.
   - Toggle the "Include Closed Alerts" switch.

### Page Refresh Test
- Refresh the page and confirm that the modified values persist, fetched
correctly from the Risk Engine Saved Object.

### Cross-Browser Test
- Open the same web page in a different browser or incognito mode.
- Verify that the settings are consistent and correctly loaded from the
Risk Engine Saved
  Object.

### Expected Outcome
The settings should persist after a page refresh or across different
browsers.
The latest values should always be pulled from the Risk Engine Saved
Object.


### 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
- [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)
2025-03-21 14:19:24 +05:30
Umberto Pepato
7d65957683
[ResponseOps][SecuritySolution][Alerts] Fix cases service missing in detection engine alerts table (#215111)
## Summary

Provides the Cases service to the detection engine alerts table. The
missing services caused the cases actions to disappear from the bulk
actions menu.

## Verification steps

1. Create Security rules that fire alerts
2. Visit the Security > Alerts page
3. Select one or more alert rows from the table
4. Open the `Selected X alerts` bulk action menu
5. Check that the cases bulk actions are available

## Release Notes

Fixes a regression that caused the cases actions to disappear from the
detections engine alerts table bulk actions menu.

### 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-21 00:57:30 +02:00
Bryce Buchanan
522f83fd25
Adds 'page reload' screen reader warning (#214822)
## Summary

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

Adds 'page reload' screen reader warning to metadata filter button on
the infrastructure host detail fly-out.


https://private-user-images.githubusercontent.com/75274611/420462482-a32e59f8-e04d-40a7-90af-1d039d4b4e67.mov?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDIyMjk5OTQsIm5iZiI6MTc0MjIyOTY5NCwicGF0aCI6Ii83NTI3NDYxMS80MjA0NjI0ODItYTMyZTU5ZjgtZTA0ZC00MGE3LTkwYWYtMWQwMzlkNGI0ZTY3Lm1vdj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMzE3VDE2NDEzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTliMjQyMmMzOWNkNDA1Y2JiZmE2MzY2YmY4N2ZmMzEwNDcxYzA1NmM2NWMzMDFhNGU3MTQ0Y2ZjZGViZDUxMjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.GbLcX-q0dpVHSicv7T25cvyUqem6sYFYj8D_AjrvRVE

### 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)
2025-03-20 21:42:47 +02:00
Philippe Oberti
3605a331b9
[AI4DSOC] Alert summary page routing and initialization (#214889)
## Summary

This PR is the setting the foundations for the AI for SOC Alert summary
page. It has very little UI, instead it focuses on the following:
- add routing for the `alert_summary` page
- fetches the integrations, filters them to only keep the ones related
to AI for SOC, then decides what to render depending on if some AI for
SOC packages have been installed or not

The PR also makes a small change to the `SecurityRoutePageWrapper`
component, to allow us to redirect to the Security Solution HomePage
instead of the NoPrivilegesPage. While this might not be a long term
solution, it is the easiest path forward. In the future, AI for SOC will
most likely be its own plugin (leaving outside of Security Solution)
hence this will not be needed anymore.

Here's the basic behavior of the Alert summary page:
- The `Landing page` will be shown if none of the hardcoded AI for SOC
packages are installed (these values are hardcoded as we currently do
not have a way to filter integrations for the AI for SOC ones only):
  - splunk // doesnt yet exist
  - google_secops
  - microsoft_sentinel
  - sentinel_one
  - crowdstrike
- The `Wrapper` component will only be shown if you have at least one of
the above AI for SOC packages installed.

### Very limited UI added in this PR

| Loading integrations | No installed packages | Some installed packages
|
| ------------- | ------------- | ------------- |
| ![Screenshot 2025-03-17 at 6 58
45 PM](https://github.com/user-attachments/assets/68089c33-fa40-4201-8b51-3e7236d50d5a)
| ![Screenshot 2025-03-17 at 6 59
15 PM](https://github.com/user-attachments/assets/e7e5af2d-bdab-4bef-881e-bb5e512c3545)
| ![Screenshot 2025-03-17 at 6 59
40 PM](https://github.com/user-attachments/assets/61b346bb-799f-4a0b-95cb-e3092ea58d37)
|

### Notes

We need to remove the section at the top of the page that currently
shows the `Add integrations` button. A follow PR will take care of that.
[This](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/app/home/index.tsx#L54)
is where that bar is being added. We will have to find a way to not show
that for the AI for SOC tier.

## 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' },
  ]
```

The Alert summary navigation will NOT be shown for the following
Serverless users: `viewer`, `t1_analyst`.
and `t2_analyst`. For those, the navigation entry is not present, and
navigating to the url directly will automatically re-route to the
Security home page.

Currently, retrieving the integrations (via the `fleet/epm/packages`
endpoint) is also unauthorized for the following users: `editor`,
`t3_analyst`, `threat_intelligence_analyst`, `rule_author`,
`soc_manager` and `detections_admin`.

This means that the only users that can be currently used to test this
PR are:
- `platform_engineer`
- `endpoint_operations_analyst`
- `endpoint_policy_manager`
- `admin`
- `system_indices_superuser`

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

Will help close https://github.com/elastic/security-team/issues/11954 as
well as https://github.com/elastic/security-team/issues/11979.
2025-03-20 13:42:36 -05:00
Sergi Massaneda
108716dce8
[Security Solution] Siem migration copy changes (#215220)
## Summary

Last-minute copy changes

<img width="788" alt="task"
src="https://github.com/user-attachments/assets/839b4d9c-67f6-43b9-a62e-4f1f974215ca"
/>
2025-03-20 20:02:57 +02:00
Justin Kambic
21cafda9e9
[Synthetics] Remove all notions of uptime from the Synthetics README file (#215183)
## Summary

Some of the text in the Synthetics README is 6+ years old, which is
older than Synthetics itself. We need to try to keep these instructions
up to date a bit more as they are intended to be useful to inexperienced
contributors.
2025-03-20 13:23:16 -04:00
Sergi Romeu
8193e56970
[APM] remove unnecessary field service.environment from top dependency spans endpoint (#215321)
## Summary

Fixes #215106

This PR removes `service.environment` as a required field for
`getTopDependencySpans` endpoint.
It was not used at all, so it can be safely removed without adapting the
UI.
2025-03-20 16:31:36 +01:00
Ryland Herrick
07acd2480a
[Detection Engine] Rule Data View select uses Data View name for display (#214495)
## Summary

Supersedes #190936, and also addresses
https://github.com/elastic/kibana/issues/137823. This mainly just
rebases the changes introduced there to the latest `main`. I also
noticed that it originally had some unit tests, so I resurrected those
as well. ~~I modified the copy as well, so nota bene @ARWNightingale~~
After some discussion, we determined that an explicit UI note about this
behavior was unnecessary.


## Screenshots

<kbd>
<img width="979" alt="Screenshot 2025-03-13 at 5 24 42 PM"
src="https://github.com/user-attachments/assets/69da29bf-5504-461e-b797-d016adcd4b59"
/></kbd>

<kbd><img width="1052" alt="Screenshot 2025-03-18 at 4 37 58 PM"
src="https://github.com/user-attachments/assets/8ee5e55e-2413-4936-aa87-7dadb3d7cbb1"
/></kbd>




### 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: Yara Tercero <yara.tercero@elastic.co>
2025-03-20 10:01:26 -05:00
Pablo Machado
42183d6039
[SecuritySolution] Fix Data view refresh does not support the indexPattern parameter (#215151)
## Summary

When the data view refresh API or task was executed, it was overwriting
the engine's additional `indexPattern`.

This PR updates the code to support `indexPattern` and ensures the user
has privileges for all indices.

I extracted the merge function to add deduplicate logic.

### How to reproduce it?
* Create an entity store using the indexPatterns param
* Call refresh dataview API (`POST
kbn:api/entity_store/engines/apply_dataview_indices`)
* It will apply the dataview and ignore the indexPatterns param

After the fix, we should be able to update the indexPatterns param, and
the task that refreshes the index pattern should pick up the change
properly.


### 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-20 15:41:54 +01:00
Sander Philipse
9b6d1aa35d
[Search] Fix code examples (#215286)
## Summary

This fixes a couple small bugs in some of our Curl examples.


### 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-20 14:46:10 +01:00
Gergő Ábrahám
c90716092b
[EDR Workflows] Enable endpoint data reduction banner feature flag for serverless (#215131)
## Summary

enables feature flag `eventCollectionDataReductionBannerEnabled` for
serverless, to be synced with 8.18/9.0 release


<img width="1170" alt="image"
src="https://github.com/user-attachments/assets/b1b88a66-dbfe-463e-a36a-e9328658a3bb"
/>
2025-03-20 14:41:16 +01:00
Nick Clark
9b9a12e9ae
Update SLO custom metric bundle (#215082) 2025-03-20 08:12:05 -04:00
Shahzad
0dad68dce7
[Synthetics] Retries journeys on failures !! (#215264)
## Summary

Retries journeys on failures !!
2025-03-20 11:53:55 +01:00
Gerard Soldevila
adb4bdf8d8
SKA: Extract list of Kibana solutions into a dedicated package (#213353)
## Summary

The intent is to have a centralised place to store the list of Kibana
solutions and serverless project types.
To that end, this PR creates a `@kbn/projects-solutions-groups` package.
It also adds the new solution type `'chat'`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-20 10:20:07 +01:00
Abhishek Bhatia
a3f89ec2c2
[Security Solution][Risk Score]Code changes for limiting the transformID length to 36 characters (#213405)
## Summary

The code changes in this PR ensure that the transform ID is limited to
36 characters when creating or updating the transform for risk-score.

This adjustment aligns with ES constraint on transform ID length.


## Test Steps

1. Create a new namespace with a very long name. Ex :
`namespace_that_stretches_farther_than_the_universe_and_beyond_like_buzz`
🚀
2. Enable the Risk Score in the new namespace. It should successfully
get enabled.
3. Check the transform that was created (using dev tools)

```
GET _transform/risk_score_latest_transform_*?filter_path=transforms.id,transforms._meta.space_id
```

Output 


![image](https://github.com/user-attachments/assets/3b5d5e67-cddf-4c6a-b8ff-675517c123b2)

### 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
- [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] 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: Mark Hopkin <mark.hopkin@elastic.co>
2025-03-20 11:23:55 +05:30
Jared Burgett
64743b3a82
Added more request validation to entity store enablement (#212657)
# Purpose

This change introduces new validations that ensure no loss of data is
possible if a user accidentally sets the Security Entity Store enrich
policy execution interval to a value that “doesn’t play nicely” with the
lookback period value.

The specific logic (greater than or equal to half the value) was chosen
to not only ensure no loss of data, but also provide extra resiliency in
case of a failed enrich policy execution.

(Note that this is not considered a breaking change, as the parameters
are not yet available on any version of Elastic, including Serverless.)

# How to test

1. Load appropriate entity log data to your Kibana instance (for
example, using the
[security-documents-generator](https://github.com/elastic/security-documents-generator))
2. Navigate to the Developer console
3. Attempt to enable the Entity Store via the /enable or /init routes
(examples below), and pass in values that are expected to error. For
example, “lookbackPeriod”: “24h” and “enrichPolicyExecutionInterval”:
“24h” should fail, because of the validation logic
4. Expect results similar to those shown below, specifically a 400
error, or else a success message

<img width="1902" alt="Screenshot 2025-02-27 at 12 57 45 AM"
src="https://github.com/user-attachments/assets/a7f4b0fb-9899-4e00-a0ae-d172245bd506"
/>
<img width="1909" alt="Screenshot 2025-02-27 at 12 58 06 AM"
src="https://github.com/user-attachments/assets/372acde2-9d7b-4c75-8596-af8374088f79"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-20 01:31:31 +02:00
Alexander Wert
81f69713f3
Enable editing central config for EDOT Agents / SDKs (#211468)
## Summary
Enables central configuration for EDOT Agents / SDKs while keeping it
disabled for other OTel Agents.

**EDOT JAVA agent**
<img width="2124" alt="Screenshot 2025-03-17 at 09 26 37"
src="https://github.com/user-attachments/assets/fcff661c-6655-444d-bc09-39b70c835b82"
/>

**EDOT Nodejs Agent**
<img width="1264" alt="Screenshot 2025-03-18 at 13 08 12"
src="https://github.com/user-attachments/assets/97cdd03b-b6cd-494f-bd7e-a9b3fc4976b4"
/>

---------

Signed-off-by: Alexander Wert <alexander.wert@elastic.co>
Co-authored-by: jackshirazi <jacks@fasterj.com>
Co-authored-by: Caue Marcondes <caue.marcondes@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-19 16:06:08 -03:00
Maryam Saeidi
cc9494ccb0
[Custom threshold] Use createLazy instead of create when initializing searchSource (#213904)
## Summary

In this PR, we use a similar approach as was introduced in the ES Query
rule in this [PR](https://github.com/elastic/kibana/pull/183694) for the
custom threshold rule to reduce the field_caps traffic using createLazy.
(Thanks @mikecote for pointing this out!)

||Screenshot|
|---|---|
|Create (796
ms)|![image](https://github.com/user-attachments/assets/2df8f864-bbc5-44e4-af43-7ae70f5dd2c3)|
|CreateLazy (321
ms)|![image](https://github.com/user-attachments/assets/cd9a6e51-af7e-411a-ab2e-5d7a2efd3ce5)|

### 🧪 How to test
- Enable APM locally
```
elastic.apm.active: true
elastic.apm.transactionSampleRate: 1.0
elastic.apm.environment: username
```
- Create a custom threshold rule and check its execution in
[traces](https://kibana-cloud-apm.elastic.dev/app/apm/traces?rangeFrom=now-15m&rangeTo=now)
filtered for your `username` as the environment. There should be one
with your rule name:
<img
src="https://github.com/user-attachments/assets/59274acc-3edf-4de7-8870-3b175af73523"
width=500 />
    
The timing for `_field_caps` would be more if you replace the
`createLazy` with the `create` function.
2025-03-19 17:23:26 +01:00
Kevin Qualters
7f435b046d
[Security Solution] Cleanup alerts table rendering and reference issues (#213649)
## Summary

This pr fixes some odd issues with getBulkActions, which is really a
hook in disguise, as well as an issue with the useGetMutedAlertsQuery
hook, which was/is fetching data much more often than it should, exactly
why that is I'm not sure, perhaps something to do with how timeline
blocks focus to the underlying DOM when it's open, and this causes the
default to true refetchOnWindowFocus prop of useQuery to re-run the
query, or if there's an error with the queryKey.

Below are 2 GIFs comparing react performance profiles of simply opening
and then closing the timeline while on the alerts page with 50 alerts in
the table.

Before fix:

![pre_fixes_profiler](https://github.com/user-attachments/assets/548d1ea8-6bde-460f-90da-0cead5ea76e1)

12 renders for a total of 950 ms, a large portion of which is coming
from the alert table cells.

After fix:


![with_fixes_profiler](https://github.com/user-attachments/assets/7119725a-fe3a-4e66-a181-4dd7b24204f0)

8 renders for a total of 380 ms, almost none of it coming from the alert
table.

Each of the alerts table and timeline/discover drive some of the more
stateful and complex workflows in kibana on their own, and on top of
that one is rendering within a flyout on top of the other, listening to
the same url changes/tens of context provider wrappers changing above
them in the tree/kibana services, etc, & so proper memoization is a
pre-requisite for a good ux.

### 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-19 12:07:54 -04:00
Paul Tavares
e11c3ecea5
[Security Solution][Endpoint] Adjust Artifacts policy assignment component in support of spaces (#214487)
## Summary


### Fleet

- Exposed API route for bulk get package policies via the routes service
- Created and exposed type `BulkGetPackagePoliciesRequestBody`

<br/>


### Security Solution

The following changes were made to Endpoint Artifacts in support of
spaces:

> [!NOTE]
> Space awareness is currently behind feature flag:
`endpointManagementSpaceAwarenessEnabled`


- The policy assignment component, which is displayed on artifact's
Create and Update forms, now:
- Displays the count of policies (if any) that are associated with the
artifact, but not currently accessible in the active space (screen
capture 1️⃣ )
- When a user does NOT have the Global Artifact privilege, the `Global`
toggle selection will be disabled and a tooltip is displayed. This
change also applies to the create form where the default selection will
be per-policy and the global button will be disabled. (screen capture
2️⃣ )
- Artifact policy assignments that are not accessible in active space
are preserved when submitting an update to the artifact
- The component was also refactored a bit to simplify its list of props
- Artifact card policy assignment menu was adjusted to show any policy
that is not accessible to the user as "disabled" along with a tooltip
(screen capture 3️⃣ )
- The update artifact API was changed (via server-side extension point)
to not error when validating policies that are not accessible in active
space if they were already associated with the item being updated.
- Fixes a bug in the Find artifacts API (impact only when spaces was
enabled) where an invalid filter was created when there was no policies
currently shared with active space.
2025-03-19 11:12:59 -04:00
Riccardo Magliocchetti
ea73a1aa1c
[ObsUX] [APM] [OTel] Reduce python runtime metrics dashboard to otel_native (#215005)
## Summary

Since the GA supported path is the native OTel one, start simple with
just that one.
This also renames the dashboard to match the dashboard triplet.

This is a follow up from #213599

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

This reduce risks since it reduces the surface of changes from #213599
2025-03-19 16:58:38 +02:00
Philippe Oberti
97f3594c3a
[Security Solution] Fix issue with alert grouping re-render (#215086)
## Summary

While doing a POC trying to implement the grouping component with the
UnifiedDataTable, I discovered a rendering issue that caused some sort
of infinite loop rerendering after selecting a group.

This PR fixes that issue but making sure we do not have a new instance
of an empty array every time the component is rendered.
2025-03-19 09:57:55 -05:00
Gonçalo Rica Pais da Silva
54d9cf45cb
[Discover][APM] Refactor APM sources for better trace enablement (#212634)
## Summary

This PR reworks how APM handles getting its sources data, elevating the
necessary code to a private shared plugin so that Discover for Traces
can access the data and handle user provided configuration. It also
removes the need for Discover for Traces to rely on the APM static data
view, so the Trace data source and document profile will work on any
compatible/configured index, even in ESQL mode.

Closes #211414

<img alt="ESQL Discover Traces Screenshot 2025-03-04 173032"
src="https://github.com/user-attachments/assets/f5bbb736-8b8b-45dc-ac23-4bf7083aa47e"
/>

## How to test

Test with olbt-cli instance for now, will post for doing with synthtrace
data. Ensure the following is added to your kibana.dev.yml:

```yaml
discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
```

- Make sure your space has the Observability solution view configured
- Go to Discover page
- Select Data Views mode if required and create a view with a `traces`
specific index. Or use the APM static data view.
- The default columns on the page should show the summary column with
four of the following badges: `service.name`, `event.outcome`,
`transaction.name`, `transaction.duration.us`, `span.name`,
`span.duration.us`
- Go to ESQL mode with the query targetting a `traces` index
- The default columns should show the same as in Data View mode

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Irene Blanco <irene.blanco@elastic.co>
2025-03-19 15:52:30 +01:00
Jatin Kathuria
89a56ec73c
[Security Solution] Fix - Extra timeline space because of Borealis changes (#215124)
## Summary

This very small PR fixes an extra space below querybar in timeline. This
was issue because of what `euiThemeVars` v/s`euiTheme` returns as a size
i.e. `8` v/s `8px`

### Before

![image](https://github.com/user-attachments/assets/ee767778-741b-4430-aac2-543a08b50822)


### After

![image](https://github.com/user-attachments/assets/cf9eca1c-8c99-43ef-96f4-914e68fcc233)



### 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-19 14:45:21 +02:00
Sergi Romeu
0ee664a555
[APM] Prevent getChildrenGroupedByParentId to include the parent in the children list (#214957)
## Summary

Closes #213074

This PR prevents `getChildrenGroupedByParentId` to include the parent
item in the children list, as this was causing some duplication.

| Before | After |

|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
<img width="1433" alt="image"
src="https://github.com/user-attachments/assets/788684a8-21d7-48a6-820c-07b1fb3d0045"
/>|<img width="858" alt="image"
src="https://github.com/user-attachments/assets/b68129e1-137d-42fe-a7ce-70373447ece9"
/>|
|<img width="1372" alt="image"
src="https://github.com/user-attachments/assets/ff6a5ac8-b46a-4eea-9c4c-638f4b479dc8"
/>|<img width="844" alt="image"
src="https://github.com/user-attachments/assets/31ef881c-a6d0-41ea-80d4-aebd587e76cd"
/>|
2025-03-19 13:28:20 +01:00
Abhishek Bhatia
90dd368e71
[Security Solution][Entity Analytics][Bug][Risk Score]Changes to replace 30m to 30d for Risk score lookback period (#215093)
## Summary

The PR updates the code to extend the lookback period for Risk scoring
calculations from `now-30m` to `now-30d`.

This change impacts:  
- Risk score UI (date picker)
- The preview API  
- The enable API (for Risk Score Saved Object configuration)


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

Screenshots : 

## UI and Preview API payload


![image](https://github.com/user-attachments/assets/9a074dc4-328f-405b-8ffe-5ce8a7def3d6)

## Risk Engine configuration SO


![image](https://github.com/user-attachments/assets/bfd4f6f8-3f1c-4f83-8247-66b9e93a71c2)


## Testing Steps:

1. Navigate to the Entity Analytics management page (Entity Risk Score
webpage).
2. Ensure the default text in the date picker displays **"Last 30
days"**.
3. Open the **Network** tab in Developer Tools and verify that the
**"preview"** API request reflects a 30-day difference between the
`from` and `to` values.
4. If the **Risk Engine** is enabled, disable it and open a window
displaying Kibana logs.
5. Re-enable the **Risk Engine** and check the logs for the
configuration message: **"Risk engine running with configuration"**. The
expected range should be:
   ```json
   "range": {
     "start": "now/M",
     "end": "now"
   }
   ```


## Advanced Testing Steps  

1. The date picker should default to **"Last 30 days"**. If you change
it to **"Yesterday"** without clicking **Save changes**, the **Preview
API** should reflect "Yesterday," but the **Saved Object (SO)** should
**not** update its range.
2. Upon refreshing the page without saving the changes, the date picker
should reset to its default value, **"Last 30 days"**.
2025-03-19 17:16:24 +05:30
Robert Stelmach
b913373b7c
Change url path to start with monitor creation flow (#214604)
Change url path to start with monitor creation flow
Before: 


https://github.com/user-attachments/assets/dcf75a38-9cde-4999-b382-1211f436ad64

After: 


https://github.com/user-attachments/assets/51859c92-fceb-47fb-8be2-33789c48b303
2025-03-19 11:01:26 +01:00
Mykola Harmash
81f6f2897f
[Onboarding][OTel K8s] Use MOTel managed service on Serverless (#213261)
Closes https://github.com/elastic/kibana/issues/208037

This change switches OTel K8S quickstart flow on Serverless to the
managed OTel collector as the ingest endpoint.

* Adds shared `useOtelIngestEndpointUrl` hook to be later re-used in
OTel Host flow as well
* Adds the logic to use APM API key on serverless to access the managed
service endpoint
* Modifies the code snipped with the new variables

## How to test

* Use the Serverless instance deployed from this PR, make sure OTel K8S
flow code snippet uses the managed service endpoint, ingest logs from
your computer (you can use [reference-stack
cluster](https://github.com/elastic/oblt-reference-stack) with minikube)
* Run the classic Kibana locally, and make sure the OTel K8S flow uses
the usual code snippet with ES ingest endpoint, ingest logs from your
computer

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-19 10:58:40 +01:00
Bailey Cash
0a10127efc
[SLO] add ability to select all services for apm slos (#214653)
## Summary

Resolves #212981

![Screenshot 2025-03-14 at 4 32
57 PM](https://github.com/user-attachments/assets/37ce3d96-1337-4106-91de-6de0f3057fee)

## Release Notes

Adds the ability to create an APM availability or latency SLO for all
services

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
2025-03-18 21:23:19 +02:00
Patryk Kopyciński
be777cf44f
[Security Assistant] Fix inference rollover (#214718)
## Summary
Fixes https://github.com/elastic/kibana/issues/214709#event-16799922233

The issue was caused by the rollover of the Knowledge Base Data stream
to use default inference endpoint.
During the rollover it first got to this branch
https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_service/index.ts#L347-L369
where it went through all the steps and continued, but it didn't
override `this.knowledgeBaseStream`, so the next time someone hit API it
was going through this path calling `getInitializedResources` to make
sure all data streams were configured properly, but because we didn't
update `this.knowledgeBaseStream` it was failing, because the original
configuration that was created in service constructor was not called,
that's why it was returning an error
2025-03-18 19:47:45 +02:00
Elena Shostak
a3dd168cb1
Unauthorized route migration for routes owned by search-kibana (#214786)
### Authz API migration for unauthorized routes

This PR migrates last unauthorized routes owned by your team to a new
security configuration.
Please refer to the documentation for more information: [Authorization
API](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)

### **Before migration:**
```ts
router.get({
  path: '/api/path',
  ...
}, handler);
```

### **After migration:**
```ts
router.get({
  path: '/api/path',
  security: {
    authz: {
      enabled: false,
      reason: 'This route is opted out from authorization because ...',
    },
  },
  ...
}, handler);
```
2025-03-18 18:29:08 +01:00
Pablo Machado
6ab5523a28
[SecuritySolution] Add index privileges check to applyDataViewIndices (#214803)
## Summary

Add a new privileges check before executing `applyDataViewIndices`.

This change impacts the API call `applyDataViewIndices` and the job. 
`applyDataViewIndices` updates the transforms. Executing without
privileges generates a silence error because the transform can't run.

I also added some extra unit tests for `applyDataViewIndices`.

Required privileges
['read', 'view_index_metadata'] for all security solution dataview +
asset_criticality and risk_score indices.


### How to test it
1. **API call with unprivileged user scenario**
* Enable the entity store with a superuser
* Create an unprivileged user
* Call `POST kbn:api/entity_store/engines/apply_dataview_indices`
* It should return an error
* Add the required privileges
* It executes successfully

2. **Task execution with an unprivileged user scenario**
* Create a user and add privileges only for the required Entity Store
indices
* Login with the new user
* Enable the entity store
* Add a new index to the security data view (the new user shouldn't have
access to the new index)
* Wait for 30min for the job to run, or update the [source
code](8d0feb580f/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/tasks/data_view_refresh/data_view_refresh_task.ts (L150))
to make it run more often
* The job execution should fail with an error message containing the new
index name.




### Checklist

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-18 17:37:39 +02:00
Efe Gürkan YALAMAN
a73477c7c0
Add FTR cases for synonyms (#214476)
## Summary

Adds more coverage for FTRs to test Synonyms UI in serverless.

Adds test cases for synonyms set listing, synoyms set detail and adding
deleting rules.
Covers some happy paths.


### 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
- [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)
2025-03-18 17:25:48 +02:00
Bailey Cash
56f1ebfca6
[SLO] Check for unique SLO ids across spaces (#214496)
## Summary 
Resolves #212784 
Ensure that when an SLO is created, the id is verified across all
spaces.

## Release Notes
Ensure that when an SLO is created, the id is verified across all
spaces.

## Testing
1. Create an SLO and save the id returned in the response in a space "A"
2. Create a second SLO with the id saved from the first SLO in the
request in a different space "B"
3. User should receive a 409 error from the SLO API.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-18 10:44:58 -04:00
Viduni Wickramarachchi
69e8dcf59b
[Obs AI Assistant] Fix KB bulk import UI example (#214970)
Closes https://github.com/elastic/kibana/issues/214849

## Summary

The KB bulk import UI example has a missing property `title`.
This PR adds the missing property so that the users know which format is
expected when bulk importing.


![image](https://github.com/user-attachments/assets/38466e7d-d87d-4680-8675-327237357999)

### Checklist

- [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-18 10:34:21 -04:00
Bena Kansara
48124058e3
[Observability] [Alert] Add context.grouping action variable in Custom threshold and APM rules (#212895)
Partially resolves https://github.com/elastic/kibana/issues/180709

Adds `context.grouping` action variable in the following rules:
- Custom threshold rule
- APM Latency threshold rule
- APM Failed transaction rate rule
- APM Error count rule

I will open a follow up PR to add `context.grouping` action variable in
the following rules:
- Elasticsearch query rule
- SLO burn rate rule

Excluded from scope:
- Metric threshold rule (already has `context.groupByKeys`)
- Log threshold rule (already has `context.groupByKeys`)
- Inventory threshold rule (already has `context.group` and this rule
doesn't have explicit group by fields)

### Testing
1. Create each rule with group by fields, and with "active" and
"recovered" actions
3. In "active" and "recovered" action message, use `context.grouping`
variable
4. Ensure that both "active" and "recovered" alert notifications contain
correct information
5. Ensure that the action variables UI in rule form shows
`context.grouping` action variable

Example of action message for APM Latency threshold rule with group by
on `transaction.name`:

```
{
  "grouping": "{{context.grouping}}",
  "service.name": "{{context.grouping.service.name}}",
  "service.environment": "{{context.grouping.service.environment}}",
  "transaction.type": "{{context.grouping.transaction.type}}",
  "transaction.name": "{{context.grouping.transaction.name}}"
}
```

Example of action message for Custom threshold rule with group by on
`host.name` and `container.id`:

```
{
  "grouping": "{{context.grouping}}",
  "host.name": "{{context.grouping.host.name}}",
  "container.id": "{{context.grouping.container.id}}"
}
```

---------

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
2025-03-18 13:46:17 +01:00
Saarika Bhasi
c5a8fcb69d
[Onboarding] Stack - update index management breadcrumbs (#209599)
## Summary 

**Requirement:** 
In stack and when its search solution space, we need to update search
index details breadcrumbs, when navigated via Content -> Index
Management :

- Index management list page - `Content / Index Management / Indices`
- Index list page -` Content / Index Management / indices /
<index_name>`
- drop `Stack management` from the breadcrumb 

In Classic nav, index management index details page breadcrumbs will
have no change in UI. But index management app is rendered from
search_indices plugin

### Solutions

Currently, Index management app is rendered from
[management_app](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/management/public/components/management_app/management_app.tsx).
The management app sets breadcrumbs for all the dependant apps. The
easiest way to implement is to set breadcrumbs based on active solution
type - `es` but this would alter breadcrumbs when index management app
is rendered from side nav footer ( management -> index management) and
other related management apps as well.

Other options is to modify setBreadcrumbs in
[ManagementAppMountParams](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/management/public/types.ts#L79)
but the setBreadcrumbs is used by multiple other apps.

In this PR, index management app is mounted via search indices plugin.
In this way we can customize breadcrumbs for index management when
rendered from search_indices plugin. When its search solution type,
index management app will work independently from management app.


### Screenshots

#### Search solution Nav - Changed breadcrumb ( dropped stack management
& added index name)
<img width="1727" alt="Screenshot 2025-02-04 at 1 29 08 PM"
src="https://github.com/user-attachments/assets/bc6f733f-62f4-44bc-8373-24d92719f5df"
/>


#### Serverless 
**Note:** No change in functionality from this PR. Added for additional
info

index details page breadcrumbs should be `Data/ Index Management /
Indices/<index_name>`
index list page breadcrumbs should be `Data/ Index Management /
Indices/`

**Serverless Details page**
<img width="1727" alt="Screenshot 2025-02-04 at 1 23 14 PM"
src="https://github.com/user-attachments/assets/72bac7a8-d7d1-40fc-9c73-bbd0545dba1f"
/>

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-18 08:37:21 -04:00
Dario Gieselaar
70f1880e4f
[Inference] Inference CLI client (#214691)
Exposes an Inference (plugin) API client for scripts, that mimicks the
`chatComplete` and `output` APIs that are available on its start
contract. It depends on the KibanaClient that is exposed from the
`@kbn/kibana-api-cli` package. It automatically selects a connector if
available.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-18 13:33:30 +01:00
Sergi Romeu
e1f094d1f5
[APM] Filter out upstream orphans in waterfall (#214704)
## Summary

Closes #212797


This PR filters out upstream orphans in the waterfall, which was
confusing as we were reparenting to the entry transaction.
2025-03-18 14:06:36 +02:00
Dzmitry Lemechko
48cd2075f7
[scout] add 'apiServices' fixture to group Kibana API helpers (#214470)
## Summary

We decided to group `Kibana API helpers` under a single fixture:
`apiServices` instead of individual fixtures. It should simplify the
search of existing helpers and reduce a risk for Teams to create the
same helper like we see today with FTR.
Adding just `apiServices` in test context and adding dot will expand a
list of all available API helpers + it can be extended for individual
solution (e.g. @kbn/scout-oblt) and directly in plugin (if there is no
chance to re-use it in other plugins)

<img width="699" alt="image"
src="https://github.com/user-attachments/assets/34a76659-04af-48c4-ab69-abda0c950206"
/>


Before:

```
test('should create something', async ({
      fleetApi,
      onboardingApi,
      alertingApi,
    }) => {
      await fleetApi.integration.install(integrationName);
      await onboardingApi.updateInstallationStepStatus(
        onboardingId,
        'ea-download',
        'complete'
      );
      await alertingApi.waitForAlert(alertId);
```

After:

```
test('should create something', async ({
      apiServices,
    }) => {
      await apiServices.fleet.integration.install(integrationName);
      await apiServices.onboarding.updateInstallationStepStatus(
        onboardingId,
        'ea-download',
        'complete'
      );
      await apiServices.alerting.waitForAlert(alertId);
```
2025-03-18 13:34:25 +02:00
Konrad Szwarc
9a179d7fd6
[EDR Workflows] Defend Insights - Evaluation (#213959)
This PR introduces evaluation functionality to Defend Insights, enabling
us to trigger LangSmith experiments directly from Kibana.
Additionally, we’ve migrated to the new prompt storage system used in
Attack Discovery (see commit bcbb12b732).
2025-03-18 13:28:49 +02:00
Ievgen Sorokopud
3f0f461d4e
[Attack Discovery][Scheduling] Add tabs to Attack Discovery settings flyout (#12007) (#214808)
## Summary

Main ticket ([internal
link](https://github.com/elastic/security-team/issues/12007))
Filgma link: ([internal
link](https://www.figma.com/design/1AEgYCsQjCsWxAKoErYfL3/9.1-%5BAttack-Discovery%5D-Scheduling-%26-notifications?node-id=3421-195207&t=Y9ejBkDCojHD95qw-4))

With these changes we introduce tabs in Attack Discovery settings
flyout: Settings and Schedule.

## Settings tab

Settings tab contains all current filtering settings applied to the
manually triggered Attack Discovery generations.

<img width="643" alt="Screenshot 2025-03-17 at 16 46 09"
src="https://github.com/user-attachments/assets/4b43f304-2c73-497a-8112-d024a6b04623"
/>

## Schedule tab

Schedule tab will have Attack Discovery scheduling rules management. As
a first step it shows empty state with no existing schedules and the
"Create" button.

<img width="645" alt="Screenshot 2025-03-17 at 16 45 57"
src="https://github.com/user-attachments/assets/f8a952b3-452f-4281-b41a-18a5023440f3"
/>

## NOTES

The feature is hidden behind the feature flag:

> xpack.securitySolution.enableExperimental:
['assistantAttackDiscoverySchedulingEnabled']

### 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-18 12:20:19 +01:00
Sergi Romeu
dbb2aeda4d
[APM] Fix entry item in waterfall shouldn't be orphan (#214700)
## Summary

Closes #213074

This PR fixes the scenario where the entry waterfall transaction is
treated as an orphan, causing it to reparent itself and be duplicated
multiple times.

---------

Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
2025-03-18 11:02:30 +01:00
Mykola Harmash
68a25a423e
[Obs Onboarding] Add page rendering performance monitoring (#213769)
Closes https://github.com/elastic/observability-dev/issues/4238 🔒
Closes https://github.com/elastic/observability-dev/issues/3513 🔒

This change add logic for triggering [the page rendering performance
metrics](https://docs.elastic.dev/kibana-dev-docs/tutorial/performance/adding_custom_performance_metrics#report-kibanaplugin_render_time-metric-event)
for:
* Onboarding home screen
* Host auto-detect flow
* Host OTel flow
* Host K8S flow
* K8S OTel flow
* Firehose flow

## How to test
1. Run Kibana locally
2. Open browser dev tools
3. Navigate to one of the above mentioned onboarding screens
4. Observe `kibana:plugin_render_time` EBT event emitted in the Network
tab of the dev tools

Events emitted from local Kibana end up in the Staging Telemetry
cluster, there is a [dedicated rendering performance
dashboard](f240fff6-fac9-491b-81d1-ac39006c5c94?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-24h%2Fh,to:now))),
onboarding events can be filtered using `observabilityOnboarding`
application ID. (note that it takes some time for events to be indexed
and they appear in the cluster with a significant delay)
2025-03-18 09:50:38 +01:00
christineweng
48df091c71
[Security Solution] Fix session view error from alerts tab (#214887)
## Summary

Related: https://github.com/elastic/kibana/issues/130641

When session view is opened on non-alert pages, if alert index is not
passed, an error shows up when opening alert flyout.
https://github.com/elastic/kibana/pull/196422 addressed this by passing
an `alertsIndex` to the index name. However, it only addressed the
alerts from the canvas area, when clicking view alerts from the alert
panel, the error still occurs. This PR fixed that by passing alerts
index in the panel as well.

The bug only applies to alerts opened from alerts tab, and when
`visualizationinFlyout` is enabled. This video shows the alerts flyout
is showing correctly with the advanced setting on and off.


https://github.com/user-attachments/assets/8dca4568-4645-4718-9605-17baa0691ed0

- [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-18 03:57:36 +00:00