Commit graph

84671 commits

Author SHA1 Message Date
Kibana Machine
2c93a349f3
[api-docs] 2025-03-10 Daily api_docs build (#213673)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1007
2025-03-10 07:11:00 +01:00
Davis McPhee
c398102c79
[Discover] Enable consistent-type-imports eslint rule (#212293)
## Summary

This PR enables the `@typescript-eslint/consistent-type-imports` eslint
rule for the Discover and saved search plugins. The benefits are that it
keeps things a bit cleaner, but more importantly ensures we aren't
accidentally importing more than types when all we need is types, which
can cause side effects.

I've added `backport:prev-major` and `backport:prev-minor` labels to the
PR because I figure backporting this is safe and would reduce merge
conflicts in future backports.

We should consider enabling this for all of our plugins and packages,
although that list might harder to maintain. I'm also curious if anyone
knows of other eslint rules we don't currently use that we'd benefit
from enabling.

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-10 00:09:57 -03:00
Kibana Machine
8388710236
[api-docs] 2025-03-09 Daily api_docs build (#213667)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1006
2025-03-09 08:09:21 +01:00
Zacqary Adam Xeper
fffc18cfc4
[Response Ops] [Rule Form] Remove V1 Rule Form Flyout (#209171)
## Summary

Closes #195211 

Removes all old rule form flyout code, which should no longer be
referenced at all after https://github.com/elastic/kibana/pull/206685/

### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-08 14:26:54 +02:00
Kenneth Kreindler
166efa0c83
[Security Solution] [Attack discovery] Fix mistake in default attack discovery graph state (#213651)
## Summary

Fix mistake instroduced in [this
PR](https://github.com/elastic/kibana/pull/205553/files#diff-7a3a06cc740e97fe6941bb05a878a18561ed194946d3f28fadeb3f2f38dc1013R50).
The default state of continuePrompt was not migrated correctly.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

### Identify risks

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

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

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
2025-03-08 11:21:37 +01:00
Kibana Machine
bda4c78c53
[api-docs] 2025-03-08 Daily api_docs build (#213647)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1005
2025-03-08 08:19:44 +01:00
Devin W. Hurley
b64be404b0
[Security Solution] [Detections] Support user error tagging for eql rule types (#213470)
## Summary

adds support for tagging user errors in eql rule type and tags missing
data view id as user error
2025-03-08 01:24:05 +01:00
Jen Huang
3f90203406
[UII] Support searchAfter and PIT (point-in-time) parameters for get agents list API (#213486)
## Summary

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

This PR adds the following query parameters to the agent list API (`GET
/api/fleet/agents`) in order to enable fetching beyond the first 10,000
hits:
```
    searchAfter?: string;
    openPit?: boolean;
    pitId?: string;
    pitKeepAlive?: string;
```

The list agent API response can now include the following properties
```
    // the PIT ID used
    pit?: string;

    // stringified version of the last agent's `sort` field,
    // can be passed as `searchAfter` in the next request
    nextSearchAfter? string;
```

* `searchAfter` can be used with or without a `pitId`. If using
`searchAfter`, `page` parameter is not accepted.

* `searchAfter` expects a stringified array. (Reviewers: I couldn't get
the Kibana request schema to accept a multi-part query param and convert
it to an array... I think this would be better, please let me know if
you know how to get that to work 🙏)

* `pitKeepAlive` duration (i.e. `30s`, `1m`, etc) must be present when
opening a PIT or retrieving results using a PIT ID.

* These can be used with the existing `sortField` and `sortOrder`
params. They default to `enrolled_at` and `desc` respectively.

### Example using only `searchAfter`:

```
# Retrieve the first 10k hits
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000'

# Grab the `nextSearchAfter` param from the response
# Pass it to the new request to retrieve the next page of 10k hits
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000&searchAfter=<nextSearchAfter>'
```

### Example using `searchAfter` with point-in-time parameters:
```
# Retrieve the first 10k hits and open a PIT
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000&openPit=true&pitKeepAlive=5m'

# Grab the `pit` ID from the response
# Grab the `nextSearchAfter` param from the response
# Pass both to the new request to retrieve the next page of 10k hits
curl -X GET 'http://<user>:<pass>@<kibana url>/api/fleet/agents?perPage=10000&searchAfter=<nextSearchAfter>&pitId=<pit id>&pitKeepAlive=5m'
```

## Testing
I recommend using `scripts/create_agents` to generate bulk agents and
testing the above requests. You can generate new agents between PIT
requests to test that using a PIT ID retains the original state. (An API
functional test was added for this)

Note: you may need to add `&showInactive=true` to all requests if your
fake agents become inactive.

TBD

### 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] 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-07 16:01:49 -08:00
Rodney Norris
c9969e798a
[Search] test: remove navigation skip in mki (#213256)
## Summary

The navigation test was skipped in MKI because opening the maps page
caused a modal that then prevented navigating away from maps to continue
the test.

Opening the maps page has previously been removed from the navigation
test suite and therefore this test doesn't need to be skipped in MKI any
longer.

Closes #196823

### Checklist

- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2025-03-08 00:57:46 +01:00
Lisa Cawley
147ccae730
Add examples for APM source map APIs (#212449) 2025-03-08 00:18:35 +01:00
Nicolas Ruflin
9689c7e05a
Fix installation of EDOT Collector for Mac (#212606)
When running the download script, the following error was printed in the
end:

```
Warning: Got more output options than URLs
```

This fixes the warning by removing the -O option. Removing `--output`
does not work as the file on disk has not the same file name as the own
on the remote server.

As the issue exists for Mac and Linus, both were fixed. I did a quick
manual test on Debian and OS X, both worked as expected.

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

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-07 22:11:26 +01:00
Tiago Costa
bc32269787
skip flaky suite (#213422) 2025-03-07 18:48:03 +00:00
elastic-renovate-prod[bot]
95081f2150
Update docker.elastic.co/wolfi/chainguard-base:latest Docker digest to 10f7cda (main) (#213511)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| docker.elastic.co/wolfi/chainguard-base | digest | `6dcddd8` ->
`10f7cda` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOk9wZXJhdGlvbnMiLCJiYWNrcG9ydDpza2lwIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-07 12:38:46 -06:00
Sergi Massaneda
723a33b7de
[Security Solution][Connectors] Torq connector allow EU hooks hostname (#212563)
## Summary

From: https://github.com/elastic/kibana/issues/212511

Add support for EU domains

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-07 18:43:24 +01:00
Mike Côté
5041031b5d
Wait for Elasticsearch cluster health to be green/yellow on task manager index before starting the poller (#212785)
I've noticed some serverless projects would encounter `503` errors
shortly after "resuming". When this happens, Elasticsearch needs time to
restore indices and their data before it can fulfill requests
successfully. It was recommended to wait for the cluster / index to have
a healthy green (serverless) / yellow (stateful) status before starting
to run background tasks. This way the task manager will not encounter
503 errors as often which reflect into the metrics.

There are a few functional details to the changes I've made:
- Narrows the health call to the task manager index only
- Waits for green on serverless and yellow on stateful
- Has a timeout of 30s
- Will start claiming tasks after the timeout or when an error is
returned by the API call - to prevent a node not claiming tasks at all
(reduce risk, smoother introduction to this new constraint)

## To verify
- Ensure code reflects functional requirements
- Verify unit tests validate the functionality on various code paths
- Ensure Kibana starts claiming tasks on startup once the health API
responds (can also check on serverless and ECH. I spun up one of each
with this PR)

---------

Co-authored-by: Ying Mao <ying.mao@elastic.co>
2025-03-07 18:38:16 +01:00
Marshall Main
a78f9c2efe
[Security Solution] Extract common shared security params into object (#212694)
## Summary

Replaces many long lists of parameters with `sharedParams` - a list of
commonly used inputs from the shared security rule wrapper.
`sharedParams` should be treated as immutable throughout the entire rule
execution to eliminate confusion about which params are specific to
certain code paths and which ones are simply passed through from the
shared wrapper.

More refactoring will follow to further reduce the pass through param
passing. I attempted to limit the scope of changes in this PR by
destructuring `sharedParams` into the expected param format for some
functions. This also sets us up to remove function passing of
`wrapHits`, `bulkCreate`, etc, which would have required passing more of
these individual shared params deep into rule execution logic.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-07 12:30:35 -05:00
Kibana Machine
e7c71937d5 skip failing test suite (#202564) 2025-03-08 04:23:50 +11:00
Kibana Machine
db7761efc1 skip failing test suite (#207045) 2025-03-08 03:58:01 +11:00
Rodney Norris
a3e4312462
[Search] fix(index_details): reduce sample documents from 50 to 10 (#213297)
## Summary

Reduced the number of documents we show on the index details page from
50 to 10 to reduce the memory footprint of polling with this query.
Additionally I refactored some of the server code to be have less
intermediate variables that were unnecessary.

### Alternative

This is the easier approach, I did consider updating the endpoint to
stream the response instead which could also solve this problem. But
that would require a lot of custom handling for pagination etc. so I
opted for this simpler solution for now if it is acceptable.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2025-03-07 10:41:45 -06:00
Arturo Lidueña
5d0e0f48ad
Fixing - Failing test: Stateful Observability - Deployment-agnostic A… (#213530)
Closes [#213209](https://github.com/elastic/kibana/issues/213209)

### Ordering Issue
- The instruction about `retrieve_elastic_doc` appears before the
`get_dataset_info` instruction.
- The content is the same, but the order of instructions has changed,
causing a failure in an exact string match.
### Minor Formatting Differences
- Even slight variations in spacing, newlines, or indentations can cause
a test failure.

## Solution
use `systemMessageSorted` - order of instructions can vary, so we sort to compare them
2025-03-07 17:10:09 +01:00
Nathan Reese
ea266bcd7e
[dashboard] fix map center change shows unsaved change after clicking reset (#213445)
Closes https://github.com/elastic/kibana/issues/213444

The problem is setting the view with the globe view may not set the view
to the exact value. For example setting zoom to 1.74 may move the map to
zoom 1.77. PR resolves this problem by adding a margin of error for
comparing zoom differences.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-07 08:15:21 -07:00
Tre
da4ab47ff6
[SKIP ON MKI] .../create_monitor_project_private_location.ts (#213578)
## Summary
see details: https://github.com/elastic/kibana/issues/213576
2025-03-07 16:08:41 +01:00
Mykola Harmash
33f71ae678
[Onboarding] Hide card labels in search results (#213417)
Closes https://github.com/elastic/kibana/issues/200917

Looking at the code in Fleet search results screen, cards would also
have the `Unverified` badges. ([this
check](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/home/card_utils.tsx#L101)
would return `true` because this specific page doesn't provides
`packageVerificationKeyId` to the `isPackageUnverified()` function, this
only happens on the individual integration details page. Fleet search
just [hides the
badges](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx#L188)
for cards in search results.

This change aligns Onboarding search results with Fleet search results
and hides the card labels which fixes the issue with `Unverified` badge
appearing for installed integrations.

| Before | After |
| --- | --- |
|
![388110694-bd6abaf4-15ac-4d56-b556-fddb11c85ba7](https://github.com/user-attachments/assets/751a6572-192c-45f6-bfa8-82433b73398d)
| ![CleanShot 2025-03-07 at 14 35
53@2x](https://github.com/user-attachments/assets/d1588d7d-eec8-4207-a1e6-9a53272bbddf)
|
2025-03-07 15:40:39 +01:00
jennypavlova
9a3d83415d
[APM] Playwright initial setup (#212970)
Closes https://github.com/elastic/kibana/issues/210178
## Summary

This PR adds the initial setup for playwright APM test (follow up of
[#211430](https://github.com/elastic/kibana/pull/211430), I am keeping
it for reference ). It includes only parallel test setup, which is the
recommended way of testing, and uses a `globalSetup` - currently has
only APM fixture, but it will be extended in the future. This first step
show cases 2 suites running in parallel: service inventory and service
map.

## Testing
- to run the tests refer to the
[README](https://github.com/elastic/kibana/pull/212970/files#diff-2c7f781789afa56f24d630b74f5068e279f8ecbbf3c98ab08ebb135074f7ee9b)

---------

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-07 15:32:34 +01:00
jennypavlova
36e930c273
[APM][Errors] Fix: Missing summary data in in error sample (#213430)
Closes #213418 
## Summary

This PR fixes the missing error sample summary by adding the missing
fields

Bug (Before) | Fix (After)
|-----------------------|-----------|
| <img width="1912" alt="image"
src="https://github.com/user-attachments/assets/f7a9b007-529d-422d-b0e2-eac2e06c26b1"
/> |
![image](https://github.com/user-attachments/assets/c31ef1f6-44fd-442f-a12e-d3df0790cdc5)
|

## Testing
- Find a service with errors (using edge oblt data or any data that
includes the field values shown)
- Click on the service and navigate to Errors tab 
- The Error sample should include the summary data 

![image](https://github.com/user-attachments/assets/c86fdc3e-cd88-46b5-a59a-e1b8c7d44bef)
2025-03-07 15:08:39 +01:00
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
Irene Blanco
e62cb6a37a
[Discover][APM] Add icon to transaction name badge in summary column (#213428)
## Summary

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

As part of the Traces in Discover initiative, we’ve added
`transaction.name` and `span.name` badges to the summary column. Some
documents can contain both, making it unclear which one represents the
transaction or the span name, and that's hot helpful for the filtering
experience the badges provide.

This PR addresses that by adding an icon as a prefix to the transaction
name, similar to the one used in the APM trace waterfall.


|Before|After|
|-|-|
|![Screenshot 2025-03-06 at 17 07
50](https://github.com/user-attachments/assets/2cd57f57-d430-418e-a727-7345fd65befc)|![Screenshot
2025-03-06 at 17 07
58](https://github.com/user-attachments/assets/6f618b3a-fcb8-4957-b3ab-93bd937761f7)|

We have two types of icons, the `merge` one by default or the `globe`
for rum agents.

![Screenshot 2025-03-06 at 16 04
45](https://github.com/user-attachments/assets/071050f3-2d86-4b96-b597-01338e5443af)

 ### Boy scouting

While playing around with the cell renderers, I realized that for long
values, the content was floating outside of the popover container.

![Screenshot 2025-03-06 at 14 05
03](https://github.com/user-attachments/assets/302dc6a9-9885-431e-a8f1-04d063ccb061)
So I've decided to add the same behaviour we have for the actions
popover in the flyout.
|Table|Flyout|
|-|-|
|![Screenshot 2025-03-06 at 16 41
04](https://github.com/user-attachments/assets/4a287c6e-6375-4afd-9b51-0e63bff12b27)|![Screenshot
2025-03-06 at 16 16
30](https://github.com/user-attachments/assets/c73d0dd7-a4ac-4d4c-8634-a2bfad771c0e)|

### How to test

Add this to your kibana.dev.yml:

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

- Go to Discover page
- Select APM data view
- Check your traces data
2025-03-07 11:15:15 +01:00
Kibana Machine
4f2edcef97 skip failing test suite (#204069) 2025-03-07 20:52:38 +11:00
Gonçalo Rica Pais da Silva
4a8a9aceab
[Discover][APM] Show event.outcome badge only on failure outcomes (#213268)
## Summary

Changes the `event.outcome` badge to no longer have an icon, instead
appearing only when the `event.outcome` value is `failure`, and showing
as a `danger` colored badge.

<img alt="Event Outcome Discover Traces Screenshot 2025-03-04 173032"
src="https://github.com/user-attachments/assets/7c5ffc84-e483-4667-abed-d38461362351"
/>

Closes #213207

### How to Test

Ensure the following is added to your kibana.dev.yml:

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

- Go to Discover page, select the APM static data view when on the
oblt-cli cluster.
- On the data grid, all the summary cells for trace data should only
show 3 badges when the `event.outcome` is either `success` or `unknown`.
Only a red badge is shown for traces that have `event.outcome` as
`failure`.
2025-03-07 10:49:41 +01: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
Kibana Machine
6b764fb414
[api-docs] 2025-03-07 Daily api_docs build (#213514)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1004
2025-03-07 08:26:06 +01:00
Stratoula Kalafateli
1c8cb1b2e4
[ES|QL] Updates the validation json (#213322)
## Summary

Updates the validation json. (I forgot to do it when I added _score in
the json)
2025-03-07 08:16:49 +01: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