Commit graph

46731 commits

Author SHA1 Message Date
Søren Louv-Jansen
175e9066d0
[Obs AI Assistant] Add test for get_dataset_info (#213231)
- Add API test for `get_dataset_info`
- Add apache synthtrace scenario
- Search local and remote clusters unless otherwise specified
2025-03-07 13:53:10 +01:00
Antonio
2ead636ebd
[ResponseOps][MW] Use date format from settings in MW UI (#211576)
Closes #199315

## Summary

This PR changes the Maintenance Window UI to respect the date format
configured in Kibana's advanced settings.

3 places needed changing:
- Maintenance window list.
- Maintenance window creation page.
- Event popover in the maintenance window list(for recurring MWs).
2025-03-07 13:45:48 +01:00
Sonia Sanz Vivas
521f34511e
Fix bug in Index Management ILM details (#213101)
## Summary
We had a bug in Index Management. When the user clicks Index Management
> Index details > Index lifecycle, the page was unable to load. After
refreshing, the info was displayed correctly.

![image](https://github.com/user-attachments/assets/924e59cc-2912-4e3c-aaf3-8e2cc3adfe33)
 
This error was caused because the hook invariant violation rule was not
being fulfilled: https://react.dev/errors/310?invariant=310.

The lifecycle tab is rendered through the extension service that comes
from the ILM plugin. In [this
PR](https://github.com/elastic/kibana/pull/204449/files#diff-021836407481af0b98d7d91abab452bed569e3197072713bdf57a065f43ef734R43)
we modified the ILM component introducing the `euiTheme` hook, which was
causing the the hook invariant violation error.

With this PR the hook is now rendered in the Index Management plugin and
passed to ILM to avoid the error.

### Demo
<details>
<summary>Video</summary>



https://github.com/user-attachments/assets/2c212d30-b7a9-42de-9869-cc10093f0f33


</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-07 13:43:09 +01:00
Tre
5d565abd02
[SKIP ON MKI] .../_data_view_create_delete.ts (#213533)
## Summary
see details: https://github.com/elastic/kibana/issues/213532
2025-03-07 13:24:18 +01:00
Rickyanto Ang
fb3537cfc9
Move Functions from CSP to Shared packages (#212663)
## Summary

As a part of Expandable Findings flyout, we will need to move some
Constants, Types, Functions, Components into Security Solution plugin or
Shared package

This PR is phase 2 for Findings (Misconfiguration flyout) which include
moving functions into shared package or security solution plugin

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-07 04:17:42 -08:00
Marco Antonio Ghiani
d0c62a20e9
[Streams 🌊] Enrichment state management improvements (#211686)
## 📓 Summary

Closes https://github.com/elastic/streams-program/issues/102
Closes https://github.com/elastic/streams-program/issues/159

This re-work of the enrichment state management introduces XState as
state library to prepare scaling the enrichment part for more processors
and improve performance reducing unnecessary side effects.

## 🤓 Reviewers note

**There is a lot to digest on this PR, I'm open to any suggestion and I
left some notes around to guide the review.
This is also far from perfect as there is margin for other minor DX
improvements for consuming the state machines, but it will all come in
follow-up work after we resolve prioritized work such as integrating the
Schema Editor.**

Most of the changes on this PR are about the state management for the
stream enrichment, but it touches also some other areas to integrate the
event-based flow.

### Stream enrichment machine

This machine handles the complexity around updating/promoting/deleting
processors, and the available simulation states.
It's a root level machine that spawns and manages its children machine,
one for the **simulation** behaviour and one for each **processor**
instantiated.

<img width="950" alt="Screenshot 2025-02-27 at 17 10 03"
src="https://github.com/user-attachments/assets/756a6668-600d-4863-965e-4fc8ccd3a69f"
/>

### Simulation machine

This machine handle the flow around sampling -> simulating, handling
debouncing and determining once a simulation can run or should refresh.
It also spawn a child date range machine to react to the observable time
changes and reloads.
It also derives all the required table configurations (columns, filters,
documents) centralizing the parsing and reducing the cases for
re-computing, since we don't rely anymore on the previous live
processors copy.

<img width="1652" alt="Screenshot 2025-02-27 at 17 33 40"
src="https://github.com/user-attachments/assets/fc1fa089-acb2-4ec5-84bc-f27f81cc6abe"
/>

### Processor machine

A processor can be in different states depending on the changes, not
this tracks each of them independently and send events to the parent
machine to react accordingly. It provide a boost in performance compared
to the previous approach, as we don't have to rerender the whole page
tree since the changes are encapsulated in the machine state.

<img width="1204" alt="Screenshot 2025-03-04 at 11 34 01"
src="https://github.com/user-attachments/assets/0e6b8854-b7c9-4ee8-a721-f4222354d382"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-07 12:34:30 +01:00
Jared Burgett
cfa2fb4aa8
Fixed entity-store enablement for API key saved object storage (#213516)
When enabling the entity store with a non-superuser with all required
credentials, it returns the following errors:

![Screenshot 2025-03-06 at 11 07
02](https://github.com/user-attachments/assets/01b8fe73-5c7a-44aa-9b04-2c7e16a9d656)

To fix it, we need to disable security for the saved object client.

While this change sounds scary (exclude security??) there are three
reasons I believe this is the appropriate fix:
* [It's what rules management/alerting/detections does for creating
their hidden/encrypted saved objects.
](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/alerting/server/rules_client_factory.ts#L140)I
view that as the canonical example for doing this kind of work.
* Even with this change, we actually still require the user to have
Saved Object Management capabilities, both in the UI (as a privilege
check) and in the init/enable routes, upstream of where we create the
saved object. You can try this out yourself, the init route will fail
without that privilege.
* We only use that particular Saved Object client in that particular
spot, not throughout the rest of our Saved Object usages.

### How to reproduce it
* On main branch
* With an empty cluster
* Generate data with doc generator
* Login with 'elastic' user and create a test role and user with
following credentials:
* cluster, all
* indices, all
* Kibana, all spaces, all
* Open an anonymous tab and login with the test user
* Enable the entity store with the test user

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-07 12:25:20 +01:00
Sergi Massaneda
2cdd20c497
[Security Solution][SIEM migrations] Add timeouts and surface execution errors (#212799)
## Summary

Implements controls to have more visibility over the errors, especially
in the initialization phase (populate ELSER indices)

### Changes
- Added timeout to the initialization phase (20 minutes).
- Added concurrency control for initialization tasks, only the first
concurrent migration will trigger it, and the rest will await it.
- Added proper error handling for the ES bulk index operations of
integrations and prebuilt rules ELSER indices.
- Added timeout for individual agent invocations (3 minutes)
- Added `migrationsLastError` server state to store the errors (not
ideal, this should be moved to the migration index when we implement it)
for now it's fine.
- Added the `last_error` in the _/stats_ API response.
- The UI displays the `last_error` if it's defined.

### Screenshots

Onboarding error:

![error_onboarding](https://github.com/user-attachments/assets/268633fe-94b1-40e6-9270-8d0f6b59923e)

Rules page error:

![error_rules_page](https://github.com/user-attachments/assets/e2c2ddc7-2668-4452-bf5c-b40132860e27)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-07 12:00:57 +01:00
Tomasz Ciecierski
81db1a127a
[AI_SOC] Add tier/add-on configuration (#213425) 2025-03-07 11:46:42 +01:00
Kibana Machine
4f2edcef97 skip failing test suite (#204069) 2025-03-07 20:52:38 +11:00
Khristinin Nikita
b0ad5424b2
Use search after for finding gaps (#211040)
## Use search after for finding gaps

Issue: https://github.com/elastic/security-team/issues/11860

To be able process more than 10.000 gaps per rule in one update cycle we
need to implement search after loop for all gaps.

For the API I keep from and size method, as it's much for client to use.

<img width="1250" alt="Screenshot 2025-02-17 at 15 25 27"
src="https://github.com/user-attachments/assets/806b2245-8aad-4960-84f4-d2a2818a4a12"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-07 10:23:37 +01:00
Jen Huang
555ed1901a
[UII] Remove scss usage (#213281)
## Summary

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

Removes Fleet's single usage of an `.scss` file to control page tab
position for integration details page. Replaces it with a passed down
css prop, UI looks the same:

<img width="1346" alt="image"
src="https://github.com/user-attachments/assets/b9d545b5-d062-4cde-9ace-6fdfe21376cd"
/>

### 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-07 09:51:45 +01:00
Charlotte Alexandra Wilson
c03b8bc661
Criticality badge medium impact bug / typo fixed (#213456)
## Summary

This PR fixes the colour on medium impact showing on asset criticality
badges across alerts table.


### Reproduce Bug
1. Kibana latest version 
2. Generate entity store data 
3. navigate to alerts page, with alerts generated 
4. Look at host criticality and user criticality columns
5. Observe that, the badges for these columns are transparent. Hover
over to see details.

### Screenshot: Bug


![image](https://github.com/user-attachments/assets/79796b92-18e8-4f58-b781-f82c0aeea463)


### Testing Fix 
Same steps as above, but with this PR, observe that the badged for
medium impact now have the relevent colouring enabled.

### Screenshots: Fix in Place

Host Criticality, Dark Theme             |  User Criticality, Dark Theme
:-------------------------:|:-------------------------:

!![image](https://github.com/user-attachments/assets/34ae6647-8333-4dd6-a3e7-24389ce4f3ea)
|
![image](https://github.com/user-attachments/assets/63045bdb-52a6-433b-b941-8c04e6242768)

Host Criticality, Light Theme | User Criticality, Light Theme
:-------------------------:|:-------------------------:

!![image](https://github.com/user-attachments/assets/8a1e6410-c565-4fc1-9829-bb4144f08cc8)
|
![image](https://github.com/user-attachments/assets/e8af0152-bfa3-4296-88ba-25fdf2624f38)
2025-03-07 08:31:54 +00:00
Viduni Wickramarachchi
6bb27b0400
[Obs AI Assistant] Improve error handling in the evaluation framework (#212991)
Closes https://github.com/elastic/obs-ai-assistant-team/issues/196

## Summary

This PR implements the follows:
- Slightly increase the backoff delay for `429` errors
- Improve `convertMessagesForInference` to surface errors related to
function calls
- Improve the KB retrieval scenario criteria

### 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-06 19:59:44 -05:00
Robert Jaszczurek
0210468548
[ML] Anomaly Explorer: Prevent crash on anomaly table filter (#213075)
Fix for: https://github.com/elastic/kibana/issues/212569
From what I found, the issue was with the `useUrlStateService` after
changes introduced in https://github.com/elastic/kibana/pull/203224,
which made the service more generic.

When filtering causes the `explorer` to remount the `AnomaliesTable`,
pagination state updates are triggered before the effect that sets
`setCallback.current` executes.

Initializing the ref with `setState` ensures its availability from the
first render.


https://github.com/user-attachments/assets/d1aa8409-56e5-4632-a5f2-82350b877db6
2025-03-07 00:18:49 +01:00
Paulo Silva
3fdb04d294
[Asset Inventory] Initializing onboarding screen (#213302)
## Summary

It closes https://github.com/elastic/kibana/issues/210714

This PR adds the Initializing screen shown during the initialization
step of the Asset Inventory onboarding.

## Recording


https://github.com/user-attachments/assets/01631884-60bb-417c-9f36-3b37ca8de4a4
2025-03-06 14:13:08 -08:00
Tiago Costa
b6c768e408
skip flaky suite (#213370) 2025-03-06 21:12:45 +00:00
Michael Olorunnisola
4abf1a151e
[Bug][Security Solution] - Reliably persist dataview selections for timeline (#211343)
resolves https://github.com/elastic/kibana/issues/198944

## Summary

Currently, the redux store can become out of sync with the state in the
UI, leading to the selected dataview not being preserved in the store,
and thereby not being saved when the timeline is saved. This PR sets the
selected dataview and patterns at the point of saving to ensure that
they are set and not overriden.

For additional background, see referenced issues.
2025-03-06 16:09:22 -05:00
Davis McPhee
ccae358d37
[Discover] Replace DiscoverInternalStateContainer with Redux based InternalStateStore (#208784)
## Summary

This PR replaces Discover's current `DiscoverInternalStateContainer`
(based on Kibana's custom `ReduxLikeStateContainer`) with an actual
Redux store using Redux Toolkit. It's the first step toward migrating
all of Discover's state management to Redux as part of the Discover tabs
project.

Part of #210160.
Resolves #213304.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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>
2025-03-06 17:08:58 -04:00
Yngrid Coello
989cf1ec34
[Logs] using All logs dataview in LOGS_LOCATOR (#211549)
Closes https://github.com/elastic/kibana/issues/209122.

### 🎥  Demo


https://github.com/user-attachments/assets/34d8b544-3ff6-4332-8856-57014fb1fc8a

### How to test?
1. Ingest some data using `logs_and_metrics` synthtrace scenario
2. Go to `/app/observability/overview` or `app/metrics/hosts`
3. Click `logs` link
4. You should be redirected to discover and `All logs` should be set by
default

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-06 21:38:00 +01:00
Jill Guyonnet
bdbc2ef43f
[Fleet] Add retry logic to automatic agent upgrades (#212744)
## Summary

Relates https://github.com/elastic/ingest-dev/issues/4720

This PR adds retry logic to the task that handles automatic agent
upgrades originally implemented in
https://github.com/elastic/kibana/pull/211019.

Complementary fleet-server change which sets the agent's
`upgrade_attempts` to `null` once the upgrade is complete.:
https://github.com/elastic/fleet-server/pull/4528

### Approach

- A new `upgrade_attempts` property is added to agents and stored in the
agent doc (ES mapping update in
https://github.com/elastic/elasticsearch/pull/123256).
- When a bulk upgrade action is sent from the automatic upgrade task, it
pushes the timestamp of the upgrade to the affected agents'
`upgrade_attempts`.
- The default retry delays are `['30m', '1h', '2h', '4h', '8h', '16h',
'24h']` and can be overridden with the new
`xpack.fleet.autoUpgrades.retryDelays` setting.
- On every run, the automatic upgrade task will first process retries
and then query more agents if necessary (cf.
https://github.com/elastic/ingest-dev/issues/4720#issuecomment-2671660795).
- Once an agent has completed and failed the max retries defined by the
retry delays array, it is no longer retried.

### Testing

The ES query for fetching agents with existing `upgrade_attempts` needs
the updated mappings, so it might be necessary to pull the latest `main`
in the `elasticsearch` repo and run `yarn es source` instead of `yarn es
snapshot` (requires an up-to-date Java environment, currently 23).

In order to test that `upgrade_attempts` is set to `null` when the
upgrade is complete, fleet-server should be run in dev using the change
in https://github.com/elastic/fleet-server/pull/4528.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Low probability risk of incorrectly triggering agent upgrades. This
feature is currently behind the `enableAutomaticAgentUpgrades` feature
flag.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-06 21:31:24 +01:00
Steph Milovic
1531849d6f
[Stack Connectors] Add organizationId and projectId OpenAI headers, along with arbitrary headers (#213117) 2025-03-06 12:59:15 -07:00
Steph Milovic
5b8fd8f5c7
[Security AI Assistant] Bedrock prompt updates (#213160) 2025-03-06 12:58:26 -07:00
Dmitrii Shevchenko
87e7cd94d1
[Security Solution] Account for missing base rule versions in is_customized calculation (#213250)
**Partially addresses: https://github.com/elastic/kibana/issues/210358**

## Summary

### Editing of prebuilt rules with missing base versions

**When the base version** of a currently installed prebuilt rule **is missing** among the `security-rule` asset saved objects, and the user edits this rule:

- We should mark the rule as customized, only if the new rule settings are different from the current rule settings.
  - For example, adding a new tag should mark the rule as customized. Then, if the user removes this tag, the rule should remain to be marked as customized. This matches the current behavior.
  - However, if the user saves the rule without making any changes to it, it should keep its `is_customized` field as is. This is different from the current behavior.

### Importing of prebuilt rules with missing base versions

**When the base version** of a prebuilt rule that is being imported **is missing** among the `security-rule` asset saved objects, and the user imports this rule:

- If this rule is not installed, it should be created with `is_customized` field set to `false`.
- If this rule is already installed, it should be updated.
  - Its `is_customized` field should be set to `true` if the rule from the import payload is not equal to the installed rule.
  - Its `is_customized` field should be be kept unchanged (`false` or `true`) if the rule from the import payload is equal to the installed rule.
2025-03-06 19:22:17 +01:00
Joe Reuter
a81e692556
🌊 Streams: Move routing into wired object in the API (#213121)
Since we decided we don't want to provide routing for classic streams,
it doesn't make sense to be on the level of the ingest stream in the
API. This PR moves routing next to fields to make clear that it's only
supported for wired streams.
2025-03-06 18:52:09 +01:00
Kibana Machine
20ec004a95 skip failing test suite (#207024) 2025-03-07 04:51:46 +11:00
Ersin Erdal
2bf0827fc6
Add pendingRecoveredCount field to AAD (#212162)
This PR adds pendingRecoveredCount field to AAD as a step to make ADD
source of truth.
In the next step we can build alerts in the alerting task runner from
AAD rather than task state.
2025-03-06 18:50:03 +01:00
Nicolas Chaulet
9b729b3a6c
[Fleet] Fetch only relevant assets for package policies operation (#213267) 2025-03-06 18:48:15 +01:00
Bailey Cash
34fa3135a2
[Obs-UX-Mgmt] Split Up SLO Details from Overview (#212826)
## Summary 

In an effort to make SLI charts more quickly visible on the SLO overview
page, remove SLO details that do not give users valuable insight into
key metrics and add them to a new tab. Retain some of the SLO details
above the tabs like SLI value, tags, and description (see figma for the
inspiration)


https://www.figma.com/design/91R0OtRZHy5xvaE8dGStBo/SLO%2FSLI-assets?node-id=4601-59103&t=K1vI6qtXbb48XPgr-1

<img width="1474" alt="Screenshot 2025-02-28 at 4 53 05 PM"
src="https://github.com/user-attachments/assets/3fdbe766-4047-45b5-a986-3a029c09bd1f"
/>

![Screenshot 2025-03-06 at 9 54
37 AM](https://github.com/user-attachments/assets/c3ab0bc7-5187-42d4-bf29-48865dd759e2)


## Release Notes

SLO overview should give users a clear, immediate picture into key
objective data. Previously, the user would have had to scroll past
static data that describes the SLO definition before seeing valuable
information about their SLIs. This static data has been moved to a
separate tab, making charts more easily accessible.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-06 12:43:57 -05:00
Maxim Palenov
f2077dbb31
[Security Solution] Allow bulk upgrade rules with solvable conflicts (#213285)
**Partially addresses:** https://github.com/elastic/kibana/issues/210358

## Summary
 
This PR implements functionality allowing users to bulk upgrade rules with solvable conflicts.

## Details

The main focus of this PR is to allow users to bulk upgrade rules with solvable conflicts. To achieve that the following was done

- `upgrade/_perform` dry run functionality was extended to take into account rule upgrade specifiers with resolved value
- `upgrade/_perform`'s `on_conflict` param was extended with `UPGRADE_SOLVABLE` to allow bulk upgrading rules with solvable conflicts
- UI logic updated accordingly to display rule upgrade modal when users have to make a choice to upgrade only rules without conflicts or upgrade also rules with solvable conflicts
- conflict state badges were added to the rule upgrade table

It includes changes from https://github.com/elastic/kibana/pull/213027 with some modifications.

## Screenshots

<img width="1723" alt="Screenshot 2025-03-06 at 12 13 04" src="https://github.com/user-attachments/assets/b786e813-268d-49a2-80cc-81fa95d14e85" />
<img width="1724" alt="Screenshot 2025-03-06 at 12 13 30" src="https://github.com/user-attachments/assets/e5e38bd9-78a3-4026-a7ea-892bd7153938" />
<img width="1723" alt="Screenshot 2025-03-06 at 12 13 51" src="https://github.com/user-attachments/assets/d58872c3-f197-49ad-b4f3-5f45fb1efac2" />
<img width="1723" alt="Screenshot 2025-03-06 at 12 14 04" src="https://github.com/user-attachments/assets/667a6ab2-2fdb-430d-9589-1c4a6e5cdc8b" />
<img width="1722" alt="Screenshot 2025-03-06 at 12 14 17" src="https://github.com/user-attachments/assets/07f4cffe-4398-4fd5-8350-a3a2978d7dcd" />
2025-03-06 18:39:58 +01:00
Jonathan Budzenski
e30b78eb6d fix skip failing test suite (#211517, #213290) 2025-03-06 10:32:57 -06:00
Shahzad
33f51f6d6e
[SLOs] Allow slo query wild card filters !! (#213119)
## Summary

Allow slo query wild card filters when kql filter and dsl filter both
are used.

For KQL filter, allowLeadingWildcards was true by default. introduces
the ability to use wildcard filters in SLO queries when DSL filters are
also used.

### Changes Made
1. **Updated `getElasticsearchQueryOrThrow` function:**
- Added support for `dataView` parameter in the `toElasticsearchQuery`
function.
   - Included additional options for `allowLeadingWildcards`.
- Enhanced error handling to differentiate between invalid KQL and KQL
queries with invalid filters.

2. **Test Coverage:**
- Added new test cases to cover scenarios with wildcard queries and
filters.
2025-03-06 17:45:23 +01:00
Nikita Indik
ebe90e5c80
[Security Solution] Allow prebuilt rules import and export (#212509)
**Resolves: https://github.com/elastic/security-team/issues/11502**
(internal)

This PR implements following changes and adds API integration tests for
them:
- [x] Users with any license can export prebuilt rules (with enabled
feature flag)
- [x] Users with Basic/Essentials license can import prebuilt rules only
if they are non-customized and the feature flag is enabled
- [x] Users with Enterprise/Complete license can import prebuilt rules
without restrictions

Flaky test runner (had to create 4 separate runs to test all configs):
-
[1](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7987)
-
[2](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7986)
-
[3](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7988)
-
[4](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7989)
2025-03-06 16:58:33 +01:00
Angela Chuang
56ea5cced3
[SecuritySolution] Register AI Assistant management settings according to productFeatureKeys (#213105)
## Summary

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

AI Assistant management is registered according to `productFeatureKeys`
set by security_solution_ess or security_solution_serverless plugin.

To verify:

- Security project

```
yarn es serverless --projectType security --kill --clean -E  —ssl xpack.security.authc.api_key.enabled=true
yarn serverless-security --no-base-path
```

Update xpack.securitySolutionServerless.productTypes in
config/serverless.security.yml to switch between `essentials` and
`complete` tier

Project essentials:

<img width="2140" alt="Screenshot 2025-03-04 at 17 05 59"
src="https://github.com/user-attachments/assets/c2df5d20-a0f8-4ee4-82d3-b04a47a47f53"
/>

Project complete:

<img width="2199" alt="Screenshot 2025-03-04 at 17 07 16"
src="https://github.com/user-attachments/assets/0e6f0c5d-f318-4db8-925b-01e46ed76a7b"
/>


- ESS 

License trial and enterprise:

```
yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E discovery.type=single-node -E network.host=0.0.0.0

```



https://github.com/user-attachments/assets/1771f51b-7b48-46e5-8bf6-3918c6e913c5


License basic and others:

```
yarn es snapshot --license basic -E xpack.security.authc.api_key.enabled=true -E discovery.type=single-node -E network.host=0.0.0.0

```



https://github.com/user-attachments/assets/fe00454c-10f6-4862-8eca-03179431ea6c

---------

Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-06 16:46:09 +01:00
James Gowdy
308e1815da
[ML] File upload lite UI customizations (#213275) 2025-03-06 15:12:39 +00:00
Kibana Machine
e2ad5816d4 skip failing test suite (#213324) 2025-03-07 01:55:38 +11:00
Kevin Delemme
4107d9809d
chore(slo): Add testing plan (#213392) 2025-03-06 09:54:23 -05:00
Kibana Machine
209afbabfc skip failing test suite (#213290) 2025-03-07 01:37:21 +11:00
Kibana Machine
fa673093a7 skip failing test suite (#213289) 2025-03-07 01:37:05 +11:00
Julia Bardi
198b99ee10
[Fleet] unskip test (#213365)
Closes https://github.com/elastic/kibana/issues/192793
Closes https://github.com/elastic/kibana/issues/192792
2025-03-06 15:20:39 +01:00
Arturo Lidueña
d2a19bd08a
fix conversation tests (#213338)
## Summary

FIX:
https://buildkite.com/elastic/appex-qa-serverless-kibana-ftr-tests/builds/4516
2025-03-06 14:48:36 +01:00
Julia Bardi
5010d1f0fa
[Fleet] fix fleet proxies test (#213350)
## Summary

Closes https://github.com/elastic/kibana/issues/207024
Closes https://github.com/elastic/kibana/issues/207022

Increased retries since the bump agent policies were made async and
takes longer than before.
2025-03-06 14:40:35 +01:00
Michael Olorunnisola
4db40eacde
[Performance][Security Solution] - Improve cell renderer performance (#212982)
## Summary

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

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


- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-03-06 08:35:04 -05:00
Robert Jaszczurek
ae74cc35a9
[ML] Anomaly Explorer: Fix incorrect overall swim lane height in Anomaly Explorer (#213245)
Fix for: https://github.com/elastic/kibana/issues/211017

We were using legacy theme which introduced some margins to the chart.
However, the issue is visible from `69.1.0` (introduced in Kibana `9.0`)
version of `@elastic/charts` as they have fixed heatmap margins and
paddings - https://github.com/elastic/elastic-charts/issues/2577.

After the fix:

![image](https://github.com/user-attachments/assets/18277a20-3bf0-44b4-adde-c876086c4a01)

![image](https://github.com/user-attachments/assets/19073e4d-b600-4333-8c85-cf7939a071ac)
2025-03-06 14:33:20 +01:00
José Luis González
c67a239e45
[Search] Removing elastic managed connectors misleading content (#213335)
## Summary

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


Connectors empty state page:

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

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

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



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

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

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

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
2025-03-06 14:24:11 +01:00
jennypavlova
f195570049
[ObsUX] [APM] [OTel] Runtime metrics show dashboards with different ingest path (#211822)
Closes #211783
Part of https://github.com/elastic/kibana/issues/195857

## Summary

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

Notice that the 'Manage' button is refocused

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

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

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

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

---------

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

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

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

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

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

Fixes #212917

The root problem is belongs into the annotation layer logic to produce
the reference id for the persisted saved object.
In the previous logic a new `uuid` was generated all the time leading to
a continuous flow of `setState` calls to update the "runtime" state of
the Lens object when inline editing: the fix was to produce a stable id
in the `extractReferences` logic to avoid the re-renders.
The logic has been tweaked a bit now with some extra explanations inline
to make it more understandable.

New tests have been added to smoke test this scenario.

### Checklist

Check the PR satisfies following conditions. 

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
2025-03-06 12:44:30 +01:00
Pablo Machado
2a32ed4755
[SecuritySolution] Delete obsolete enable risk score redirect test (#213327)
The component was replace by an enablement dialog

## Summary

Delete the obsolete "enable risk score redirect" test.
The redirect button was replaced by an enablement dialog.
2025-03-06 12:43:47 +01:00