Commit graph

84358 commits

Author SHA1 Message Date
Samiul Monir
ad52467e3d
[Search] Refactor Search Inference Endpoint (#210943)
## Summary

This PR includes:
- Delete unused code
- Remove duplicate type definition and use the types defined in
`elastic` node module
- Refactor the code as needed for the type definition.

Tested in Serverless QA environment:


https://github.com/user-attachments/assets/43777b09-70c6-48ec-8ba2-988a3ab7e029

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-28 16:14:35 -05:00
seanrathier
42e094189c
[Cloud Security] Fix installing agent-based CSP integrations not displaying Add Agent flyout (#212702) 2025-02-28 15:55:09 -05:00
Patryk Kopyciński
b5caf904e7
[Security Assistant] Fix initialization of Knowledge Base on undersized clusters (#212167)
## Summary

Show error to the user when trying to setup Knowledge base on undersized
cluster

<img width="1847" alt="Zrzut ekranu 2025-02-26 o 19 03 43"
src="https://github.com/user-attachments/assets/a42d8560-aebb-410e-a364-7a27074f62fc"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
Co-authored-by: Garrett Spong <garrett.spong@elastic.co>
2025-02-28 20:42:04 +00:00
Kibana Machine
d1031aa429 skip failing test suite (#211515) 2025-03-01 06:41:35 +11:00
Paul Tavares
7e79844925
[Security Solution][Endpoint] Add validations to Update and Delete artifact APIs in support of spaces (#212308)
## Summary

Adds additional validations to Artifact APIs _(via `lists` plugin
server-side extension points)_ for the following conditions:

- If user has the global artifact management privilege, then they are
able to update/delete the artifact with no restriction (same as today)
- If user does NOT have the new global artifact management privilege,
then the update/delete action should fail:
    - If it's a global artifact
- If it's a per policy artifact but it was created from a different
space than the active space the API is being called from


> [!NOTE]
> Functionality is currently behind the following feature flag:
`endpointManagementSpaceAwarenessEnabled`



### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-02-28 14:35:26 -05:00
Alberto Blázquez
0a562628b6
Enable Asset Inventory page via Kibana Advanced Settings (#211884)
## Summary

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

Adds an advanced setting to enable/disable the Asset Inventory page.
Replaces the old `assetInventoryUXEnabled` feature flag. The placement
of the setting is right below "Enable graph visualization", within the
Security Solution group.

### Screenshots

<details><summary>Setting off</summary>
<img width="943" alt="Screenshot 2025-02-21 at 09 38 43"
src="https://github.com/user-attachments/assets/c3b561cd-7dfa-4218-9004-cc89c5768551"
/>
</details>

<details><summary>Setting on</summary>
<img width="735" alt="Screenshot 2025-02-21 at 09 38 55"
src="https://github.com/user-attachments/assets/7a9ebf17-9339-49f2-820e-e26087f1c17c"
/>
</details>

<details><summary>Overriden setting - activated via
kibana.dev.yml</summary>
<img width="943" alt="Screenshot 2025-02-21 at 09 38 14"
src="https://github.com/user-attachments/assets/6ebb1e73-cffb-4bfd-ab21-631955574ce1"
/>
</details>

### How to test

Follow the instructions provided in the *README.md* file committed in
this PR.

### Definition of Done

- **Advanced Settings Integration**
- [x] Add a new setting under **Kibana Advanced Settings** for enabling
the Asset Inventory feature:
     - **Setting Name**: `Enable Asset Inventory`
     - **Setting Key**: `securitySolution:enableAssetInventory`
- **Description**: "Enable the Asset Inventory feature to view and
manage assets in the Security Solution plugin."
     - **Type**: Toggle (On/Off).
     - **Default Value**: Off.
- [x] Ensure the setting reflects the current status of the Asset
Inventory feature (On/Off).
- [x] Group the setting logically under the **Security Solution** in the
Kibana Advanced Settings page.
- [x] Ensure the toggle is discoverable and adheres to Kibana’s design
guidelines.

- **Implementation**
- [ ] ~~Update the `Asset Inventory` initialization logic to check the
new Kibana setting (`securitySolution:enableAssetInventory`) instead of
relying on the `assetInventoryUXEnabled` feature flag in
`kibana.dev.yml`.~~ For now we don't need to worry about initialization
- [ ] ~~Provide backward compatibility by allowing the `kibana.dev.yml`
flag (`xpack.securitySolution.assetInventoryUXEnabled`) to override the
setting in development environments.~~
- [x] The toggle should dynamically enable or disable the Asset
Inventory feature without requiring a Kibana restart.

- **Testing**
   - [x] Add unit tests to verify:
     - The toggle updates the setting value correctly.
- The Asset Inventory feature respects the toggle status
(enabled/disabled).
- [x] Add functional tests to validate the toggle’s behavior in the
Advanced Settings page.

- **Documentation**
- [x] Update the documentation to explain how to enable/disable the
Asset Inventory feature using Kibana Advanced Settings.
- [ ] ~~Provide details about the fallback behavior when using the
`kibana.dev.yml` flag.~~

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

Feature will get exposed to end users if combination of setting and
feature flag is not set up correctly.
2025-02-28 09:46:53 -08:00
Konrad Szwarc
2700a2a951
[EDR Workflows] OpenApi Missing Content - Response Actions (#212510)
## For reviewers:
Only `*.schema.yml` files were edited (excluding
`*.bundled.schema.yml`). Rest of the changes comes from auto generation
and can be ignored.

## Description

Part of DW team effort - elastic/security-team#11804

This PR aligns the property/schema descriptions and examples in
AsciiDocs with OpenAPI schemas. The primary goal of this PR was not to
extend or enhance the documentation but to migrate from one system to
another.

Ascii docs -
https://www.elastic.co/guide/en/security/8.17/management-api-overview.html
OpenApi generated docs -
https://www.elastic.co/docs/api/doc/kibana/operation/operation-endpointgetactionslist

Changes:

Copied missing property descriptions from AsciiDoc to OpenApi properties
Copied existing AsciiDoc examples for both requests and responses
Fixed falsy query object in some GET requests - in OpenApi it was
defined as an object, not as path query params.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
Co-authored-by: natasha-moore-elastic <137783811+natasha-moore-elastic@users.noreply.github.com>
2025-02-28 16:44:00 +00:00
Bailey Cash
5c0db3ed0d
[Obs-UX-Mgmt] Create navigation test plan (#212146) 2025-02-28 10:37:37 -05:00
Nick Peihl
08c4338a25
[Dashboards] Provide a method for fetching dashboards on the Dashboard server plugin contract (#209678)
Fixes #209695

## Summary

Adds a method from content management for exposing a server-side
Dashboard CRUD client.

Consumers who want to search, retrieve, or modify Dashboards from a
server plugin find themselves using the Saved Object client. This means
they need to handle JSON parse/stringify and reference handling
themselves. We could expose a CRUD functionality from content management
on the Dashboard server plugin contract to avoid re-creating all of this
boilerplate handling.

Commit c53f47d72a shows a crude
demonstration of how a plugin can use the methods available on the
Dashboard server plugin with a request to retrieve a list of dashboards.
You can test this in the Dev Tools:

```
GET kbn:/api/search_dashboards?spaces=*
```

This will use the Search method from content management to return a list
of dashboards across all spaces.

To allow the Search method to return all fields in the Dashboard, I
needed to remove the default fields. I updated all current uses of the
search method to specify the necessary fields. See
618e025210.


### 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-02-28 10:05:04 -05:00
Ilya Nikokoshev
ab46ddeef2
[Automatic Import] Fixes the CSV header bug (#212513)
Fixes https://github.com/elastic/kibana/issues/211911

The CSV processing is now a three-stage process: 

1. Parse the samples with the temporary column names of the form
`column1`.
2. Test parsing with the actual pipeline that parses into
`package.dataStream.columnName`.
3. Convert the samples into JSON form `{"columnName": "value", ...}` for
further processing.

Now the pipeline works as expected:

```yaml
  - csv:
      tag: parse_csv
      field: message
      target_fields:
        - ai_202502211453.logs._timestamp
        - ai_202502211453.logs.message
      description: Parse CSV input
  - drop:
      ignore_failure: true
      if: >-
        ctx.ai_202502211453?.logs?._timestamp == '@timestamp' &&
        ctx.ai_202502211453?.logs?.message == 'message'
      tag: remove_csv_header
      description: Remove the CSV header line by comparing the values
```

There are unit tests tests for the CSV functionality that include a mock
CSV processing pipeline.
2025-02-28 14:31:56 +00:00
Janki Salvi
83f787ac24
[ResponseOps][Rules] Do not show connector not registered in action connectors modal (#212660)
## Summary

Resolves https://github.com/elastic/kibana/issues/212584
Resolves https://github.com/elastic/kibana/issues/207185

<img width="1917" alt="image"
src="https://github.com/user-attachments/assets/0b50f829-60a2-435e-9b76-74231d0bb54c"
/>

### 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
2025-02-28 13:56:35 +00:00
Giorgos Bamparopoulos
6829f07fdb
[Observability Onboarding] Add instructions for testing to the README file (#212752)
## Summary
Add instructions for testing to the README file
2025-02-28 13:54:04 +00:00
Kylie Meli
0da5a87207
[Automatic Import] bug fixes around openapi spec parsing for CEL generation (#212145)
## Summary

This PR fixes a couple of things with regards to the parsing of the
OpenAPI spec for use in CEL generation:
1) fixes and greatly simplifies the parsing of the OpenAPI spec so that
we collect all the $ref tags in the response object
2) only collects the top level schemas from the response object (since
that's all we really need for the CEL program)
3) fixes it so that users cannot select 'Save configuration' if there is
a generation error
4) better error messaging if/when a spec parsing error occurs

Note re fix # 3, the 'Save configuration' button will still initially be
available upon an error occurring. Then when if the user tries to click
save after an error, it will then disable the save button and show the
message indicating they need a successful generation to save. This is
consistent with the UX philosophy in the rest of the flyout that all
buttons are enabled by default, and if the user does something 'wrong',
we then provide guidance for how to proceed.

Relates: https://github.com/elastic/kibana/issues/210271

## Screenshots

<details>
  <summary>parsing fix</summary>
<img width="450" alt="Screenshot 2025-02-21 at 2 15 34 PM"
src="https://github.com/user-attachments/assets/80fe8e56-ffe3-4d5c-b6ac-5a57e025b70b"
/>

</details>

<details>
  <summary>save disabled fix</summary>
<img width="450" alt="Screenshot 2025-02-21 at 2 13 45 PM"
src="https://github.com/user-attachments/assets/5220bad7-70b1-4ade-83f7-ce1f97d115d1"
/>

<img width="450" alt="Screenshot 2025-02-21 at 2 13 55 PM"
src="https://github.com/user-attachments/assets/427bb52c-6fa9-457f-ab28-f490be981094"
/>

</details>
2025-02-28 08:06:56 -05:00
Viduni Wickramarachchi
af6968bcb7
[Obs AI Assistant] Update delete confirmation modal (#212695)
Closes https://github.com/elastic/kibana/issues/210064

## Summary

Updates the delete confirmation modal based on the new designs

### Screen recording


https://github.com/user-attachments/assets/ba2a02ea-6751-497c-929f-2b38426deaf3

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] 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-02-28 07:56:57 -05:00
Viduni Wickramarachchi
57586077eb
[Obs AI Assistant] Show loader to fix the flicker in KB settings tab (#212678)
Closes https://github.com/elastic/kibana/issues/208431

## Summary

With the updates in https://github.com/elastic/kibana/issues/203309, the
knowledge base settings tab flickers between the welcome message and the
installed state.. on reload, it first shows the "Install knowledge base
button" and then quickly switches to the ready component based on the KB
status.

This PR implements a loader until we receive the KB status, so that we
don't flicker between 2 components.

Before:


https://github.com/user-attachments/assets/5478c0fc-648e-4f15-af7f-9fc95e423553

After:


https://github.com/user-attachments/assets/7d5bc350-02fa-4a12-b7ee-1cd36ee93f0f


### 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-02-28 07:56:38 -05:00
Viduni Wickramarachchi
6d862d72a2
[Obs AI Assistant] Enable syntax highlighting for ES|QL (#212669)
Closes https://github.com/elastic/kibana/issues/212384

## Summary

With https://github.com/elastic/eui/pull/8317, `EuiCodeBlock` supports
syntax highlighting for ES|QL.
This PR enables it for Obs AI Assistant

### Screenshots

Before:
![Screenshot 2025-02-27 at 11 00
39 AM](https://github.com/user-attachments/assets/ec9c6da9-c945-4a6b-b3aa-ece17533e877)

After:

![image](https://github.com/user-attachments/assets/7ed5232f-9b4c-45a3-a55f-22c2b6f56a98)

### 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-02-28 07:56:18 -05:00
Sander Philipse
7590205f9a
[Search] Don't error out on missing connectors permissions (#212622)
## Summary

This stops errors on missing connectors permissions when fetching
indices, which was preventing users without connectors permissions but
with listing and write permissions to indices generally from seeing
indices in the Search UI.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-28 12:36:37 +00:00
Kenneth Kreindler
7dce6e6e01
[Security Solution] [GenAi] Give the security AI assistant access to the current time (#211200)
## Summary

This PR adds a new tool that gives the LLM access to the current time.
The tool returns the time in the timezone configured on Kibana as well
as the UTC time.

Changes:
- Add time tool
- Also increased the speed of the assistant stream making the assistant
feel more snappy
([here](https://github.com/elastic/kibana/pull/211200/files#diff-d4dd2f3b250247285fee3300a6d38cf622f2724daa87947fe58111bae9d3d655R12)).
The reasons for keeping the small delay (of 10 ms) is because it helps
smooth out the stream.

<img width="500" alt="image"
src="https://github.com/user-attachments/assets/e613f9fb-a0f5-4559-88df-6d8ea0e5d042"
/>

## How to test
- Check that stack management > advanced settings > timezone is set to
"browser"
- Open the security assistant
- Ask "what is the current time". You should get back the time in your
local timezone + the equivalent GMT timezone (UTC and GMT are
equivalent)
- Go to stack management > advanced settings and set "Time zone" to a
different timezone (a timezone with a different timezone offset).
- Go to the assistant and ask again, "What is the current time". You
should get back the time in the timezone that you just configured and
the UTC equivalent.
- Other questions to try out:
- "What was the time exactly one week ago? Rounded to the nearest
hour.". The result should be correct depending on what you have
configured in advanced settings.
- "Write an esql query that gets 100 records from the .logs index from
the last week. Use the absolute time in the query." (may need to prompt
again to have the query include the absolute time)
- "When is my birthday", The assistant responds with "I don't know but
you can tell me". You reply with "It was exactly 3 weeks ago". The
assistant should create a KB document with the correct date.
 

## Considerations:
- When asked "Which security labs content was published in the last 2
months", gemini-1-5-pro-002 often responds incorrectly
([trace](6bfddf7b-1225-4e97-ac9f-6cdf9158ac35?timeModel=%7B%22duration%22%3A%227d%22%7D&peek=4f5244a3-68fd-45e3-b1df-6c80e739377f)).
GPT4o performs better and does not return an incorrect result when asked
this question
([trace](6bfddf7b-1225-4e97-ac9f-6cdf9158ac35?timeModel=%7B%22duration%22%3A%227d%22%7D&peek=61bc4c12-d5ea-48be-8460-3e891d2e243b)).
- You will notice that the formatted time string contains the time in
the user's timezone and in UTC timezone (e.g. `Current time: 14/02/2025,
00:33:12 UTC-07:00 (14/02/2025, 07:33:12 UTC+00:00)`). The reason for
this is that the weaker LLMs sometimes make mistakes when converting
from one timezone to another. Therefore I have included both in the
formatted message. * If the user is in UTC, then the UTC timezone will
not be repeated.

## How is the current time string formatted?

The formatted time string is added directly into the system prompt.
Bellow is the logic for how the string is formatted.

- If the user's kibana timezone setting is "Browser"
1. and their browser timezone is not UTC, then the format is `Current
time: Thu, Feb 13, 2025 11:33 PM UTC-08:00 (7:33 AM UTC)` (where the
first timezone is the client timezone, the one from the browser)
2. and their browser is in UTC, then the format is `Current time: Thu,
Feb 13, 2025 11:33 PM UTC+00:00`
- If the user's kibana timezone is set to something other than "Browser"
1. and the Kibana timezone setting is not UTC equivalent, then the
format is `Current time: Thu, Feb 13, 2025 11:33 PM UTC-08:00 (7:33 AM
UTC)` (where the first timezone is the one from the Kibana timezone
setting)
2. and their kibana timezone is UTC equivalent, then the format is
`Current time: Thu, Feb 13, 2025 11:33 PM UTC+00:00`

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

### Identify risks

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

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

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-28 12:04:12 +00:00
Saikat Sarkar
bbc3b451f1
[Onboarding] Hide the semantic_text banner if there exists a semantic_text field (#210676)
In this PR, we covered the following changes:

- Do not display the banner it after semantic text fields have been
added
- Update messaging to be more explicit on the automatic chunking that is
being handled in the background

<img width="1717" alt="Screenshot 2025-02-26 at 3 53 40 PM"
src="https://github.com/user-attachments/assets/f7aecf30-b7ca-4add-a543-a76f975e372a"
/>



- - - 

Closes https://github.com/elastic/search-team/issues/7874

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-02-28 11:25:30 +00:00
Mykola Harmash
8fe5d7f94b
[Obs Onboarding] [Ensemble Test] Run OTel collector in the background (#212255)
Right now OTel test fails in Ensemble because it waits for the collector
to exit before proceeding which never happens because collector runs on
the foreground. This change forces the collector to run in the
background and also redirects its logs into a dedicated file to make the
test output more clear.

[Successful run of the Nightly
job](3771906587)
🔒
2025-02-28 10:08:25 +00:00
Joe Reuter
a5c35b80a4
🌊 Streams: Improve routing condition building (#212661)
This PR fixes two cases for routing:
* Handle special characters in field names like `@` or whitespace
* Do not fail on object/scalar mismatch

It does this by pulling the relevant fields in a safe way into a local
hashmap instead of accessing them inline using the `.?` operator.
2025-02-28 11:05:09 +01:00
Joe Reuter
8d7f34e2b0
Move useDateRange into data plugin (#212548)
As discussed offline, the existing `useDateRange` hook integrating the
timefilter contract with the react lifecycle is a nice abstraction that
makes sense to be part of the data plugin directly.

This PR moves it into the timefilterclass:
```
const {
  timeRange,
  absoluteTimeRange,
  setTimeRange
} = data.query.timefilter.timefilter.useTimefilter(); 
```

All consumers have been changed to use this directly.
2025-02-28 11:04:53 +01:00
Khristinin Nikita
300e35012d
Add telemetry for gaps UI (#211929)
## Add telemetry for gaps UI


Add several events for:

- Fill gap
- Fill remaining gap
- Filter gaps table
- Show all rules with gaps


### How to test:

1. Pull pr locally
2. enable telemetry
```telemetry.optIn: true```
3. check that events appear [here](6e9919c0-d22e-11ee-8356-8b8a68fd8ef2?_g=())

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-28 09:53:37 +00:00
Joe Reuter
91b1ac0305
🌊 Streams: Remove back button (#212670)
The back button takes away a ton of vertical space and doesn't provide
that much value. This PR removes it and also reduced the vertical
padding of the header in accordance with the designs:
<img width="550" alt="Screenshot 2025-02-27 at 17 09 10"
src="https://github.com/user-attachments/assets/88969ecd-071a-45b4-9a8e-bad90f00dc4e"
/>
<img width="867" alt="Screenshot 2025-02-27 at 17 09 20"
src="https://github.com/user-attachments/assets/a174191b-b79d-493c-9c27-6566ac801d60"
/>
2025-02-28 09:07:34 +01:00
Kevin Lacabane
14067ca469
[streams] ui tweaks (#212701)
- make lifecycle source metadata text size consistent across the cases
- set stream overview chart base theme to the appropriate color
2025-02-28 09:05:52 +01:00
Kibana Machine
1ab723f31f
[api-docs] 2025-02-28 Daily api_docs build (#212719)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/997
2025-02-28 07:26:52 +00:00
Steve Gordon
e76a196898
Fix panel to remove query filter for .NET OTel runtime metrics on curated dashboard (#212529)
## Summary

One of the panels was applying a query to filter the results which
breaks the panel when using the EDOT SDK. This PR removes that query.

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

- [ ]
2025-02-28 07:02:41 +00:00
Jatin Kathuria
44a184c701
[ Siem Migrations ] Upsell Siem Migrations Start (#212607)
## Summary

This PR adds the Upsell section for SIEM Migration Start section.

- [Design
Source](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=8x9RlFegceXzwYQf-0)

SIEM migrations has below requirements in ESS and Serverless and if
these requirements are not met, We show the upsell sections.

- ESS
   - `Enterprise` license.
- Serverless
   - `Complete` Product tier

## Demo

|Instance|Demo|
|---|---|
|Serverless|<video
src="https://github.com/user-attachments/assets/58d3ce98-7108-4d74-9f5c-e270804f2666"/>|
|ESS|<video
src="https://github.com/user-attachments/assets/85b650a7-fa11-4855-9927-aab89a2ed8ef"/>|




### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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-02-28 04:51:31 +01:00
Paulo Silva
bdc4790272
Asset Inventory Onboarding and Context Integration (#212315)
### Summary

It closes #210713

This PR introduces the **onboarding flow for Asset Inventory**, ensuring
users are guided through an enablement process when accessing the Asset
Inventory page for the first time.

#### Changes:

**Asset Inventory API Forwarding**  
- The Asset Inventory API now proxies enablement requests to the
**Entity Store API** (`/api/entity_store/engines/enable`).
- This ensures that any future **enhancements for Asset Inventory
enablement** are already handled on the server side.

**Asset Inventory Context**  
- Introduced the `AssetInventoryContext` to centralize **Asset Inventory
status management** based on the `/api/entity_store/engines/status` data
(`disabled`, `initializing`, `ready`, etc.).
- Allows any component to **consume the onboarding state** and react
accordingly.

**"Get Started" Onboarding Experience**  
- Implemented a **new onboarding screen** that appears when Asset
Inventory is disabled.
   - Includes:
     - Informative **title and description** about the feature.
     - A **call-to-action button** to enable Asset Inventory.
     - **Loading states and error handling** for the API call.

**API Integration and Hooks**  
- Created `useEnableAssetInventory` to abstract and handle enablement
logic via **React Query**.
- Created `useAssetInventoryRoutes` to abstract API calls for fetching
and enabling Asset Inventory.

**HoverForExplanation Component**  
- Introduced `HoverForExplanation`, a **tooltip-based helper component**
that enhances the onboarding description.
- Provides **inline explanations** for key terms like **identity
providers, cloud services, MDMs, and databases**, ensuring users
understand **data sources** in Asset Inventory.


**Testing & Error Handling**  
   - Added **unit tests** for the onboarding component and hooks.  
- Implemented error handling for failed API requests (e.g., permission
errors, server failures).

#### Screenshots


![image](https://github.com/user-attachments/assets/b2e08497-6ca1-47bd-8627-f32b7c3172f3)



https://github.com/user-attachments/assets/1280404e-9cb3-4288-91a7-640f8f1b458a

#### How to test it locally

- Ensure the `assetInventoryUXEnabled` feature flag is enabled on
kibana.yml file:


```
xpack.securitySolution.enableExperimental: ['assetInventoryUXEnabled']
```

- Ensure the Entity Store is Off and data is removed (initial state), so
the onboarding is visible (If the Entity Store is installed by other
means the onboarding will direct users to the empty state component or
to the all assets page)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-28 02:01:07 +00:00
Patryk Kopyciński
f8ba372106
[Security Assistant] Fix markdown syntax highlighting (#212333)
## Summary
Implements https://github.com/elastic/eui/pull/8317 

Before: 
<img width="1007" alt="image"
src="https://github.com/user-attachments/assets/649a075a-7338-434b-9e2e-4c4fd0d6ca6f"
/>

After:
<img width="1484" alt="image"
src="https://github.com/user-attachments/assets/cdb27885-e009-49aa-9b1a-381e12c33727"
/>
2025-02-28 02:05:34 +01:00
Philippe Oberti
c0c64a8489
[Security Solution][Notes] show timeline bottom bar on the notes management page to allow user to visualize timeline (#212690)
## Summary

This previous [PR](https://github.com/elastic/kibana/pull/199374) that
unified the notes management links introduced a small issue where the
Timeline bottom bar was not shown anymore, and Timelines couldn't be
opened from the icon in the notes table.

This PR brings back the Timeline feature to that page, which fixes the
issue with Timeline not opening when clicking on the button in the
table.

#### Before


https://github.com/user-attachments/assets/ce3fdf1f-f7e4-43ff-b5c8-240f0e3a6770

#### After


https://github.com/user-attachments/assets/a8c7a39c-8913-4c12-8191-7e171ff5050e
2025-02-27 15:25:44 -06:00
elastic-renovate-prod[bot]
837667d342
Update @elastic/kibana-cloud-security-posture dependencies (main) (#208427)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [@mswjs/http-middleware](https://mswjs.io)
([source](https://redirect.github.com/mswjs/http-middleware)) |
devDependencies | patch | [`0.10.1` ->
`0.10.3`](https://renovatebot.com/diffs/npm/@mswjs%2fhttp-middleware/0.10.1/0.10.3)
| |
| [msw](https://mswjs.io)
([source](https://redirect.github.com/mswjs/msw)) | devDependencies |
minor | [`~2.5.2` ->
`~2.7.0`](https://renovatebot.com/diffs/npm/msw/2.5.2/2.7.0) | `2.7.3`
(+2) |

---

### Release Notes

<details>
<summary>mswjs/http-middleware (@&#8203;mswjs/http-middleware)</summary>

###
[`v0.10.3`](https://redirect.github.com/mswjs/http-middleware/releases/tag/v0.10.3)

[Compare
Source](https://redirect.github.com/mswjs/http-middleware/compare/v0.10.2...v0.10.3)

#### v0.10.3 (2025-01-12)

##### Bug Fixes

- remove unused `parserOptions`, fix handlers type
([#&#8203;51](https://redirect.github.com/mswjs/http-middleware/issues/51))
([`372fd85`](372fd85464))
[@&#8203;vivekmiyani](https://redirect.github.com/vivekmiyani)

###
[`v0.10.2`](https://redirect.github.com/mswjs/http-middleware/releases/tag/v0.10.2)

[Compare
Source](https://redirect.github.com/mswjs/http-middleware/compare/v0.10.1...v0.10.2)

#### v0.10.2 (2024-10-25)

##### Bug Fixes

- consume undisturbed request stream as-is
([#&#8203;39](https://redirect.github.com/mswjs/http-middleware/issues/39))
([`13cee76`](13cee76e5a))
[@&#8203;c0per](https://redirect.github.com/c0per)
[@&#8203;LeBenLeBen](https://redirect.github.com/LeBenLeBen)
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

</details>

<details>
<summary>mswjs/msw (msw)</summary>

###
[`v2.7.0`](https://redirect.github.com/mswjs/msw/releases/tag/v2.7.0)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.9...v2.7.0)

#### v2.7.0 (2024-12-17)

##### Features

- use `picocolors` instead of `chalk`
([#&#8203;2377](https://redirect.github.com/mswjs/msw/issues/2377))
([`85bdd82`](85bdd82dfe))
[@&#8203;Namchee](https://redirect.github.com/Namchee)
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.9`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.9)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.8...v2.6.9)

#### v2.6.9 (2024-12-16)

##### Bug Fixes

- support `SharedArrayBuffer` in `HttpResponse.arrayBuffer`
([#&#8203;2389](https://redirect.github.com/mswjs/msw/issues/2389))
([`41f00e1`](41f00e1a67))
[@&#8203;danilofuchs](https://redirect.github.com/danilofuchs)
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.8`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.8)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.7...v2.6.8)

#### v2.6.8 (2024-12-07)

##### Bug Fixes

- **setupServer:** reapply interception after calling `server.listen()`
after `server.close()`
([#&#8203;2383](https://redirect.github.com/mswjs/msw/issues/2383))
([`00da9ca`](00da9cad42))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.7`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.7)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.6...v2.6.7)

#### v2.6.7 (2024-12-06)

##### Bug Fixes

- **setupWorker:** correctly delete internal `accept` header on
passthrough
([#&#8203;2375](https://redirect.github.com/mswjs/msw/issues/2375))
([`3f40055`](3f40055b1d))
[@&#8203;smouillour](https://redirect.github.com/smouillour)
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.6`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.6)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.5...v2.6.6)

#### v2.6.6 (2024-11-22)

##### Bug Fixes

- **types:** support optional path parameters
([#&#8203;2368](https://redirect.github.com/mswjs/msw/issues/2368))
([`3b7b776`](3b7b776e8c))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.5`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.5)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.4...v2.6.5)

#### v2.6.5 (2024-11-16)

##### Bug Fixes

- support non-configurable responses
([#&#8203;2360](https://redirect.github.com/mswjs/msw/issues/2360))
([`5bf3e3b`](5bf3e3bf5f))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.4`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.4)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.3...v2.6.4)

#### v2.6.4 (2024-11-10)

##### Bug Fixes

- prevent infinite loop when bypassing `sendBeacon()` requests
([#&#8203;2353](https://redirect.github.com/mswjs/msw/issues/2353))
([`2fa98c3`](2fa98c327a))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)
- remove the internal bypass request header before performing the
request as-is in Node.js
([#&#8203;2353](https://redirect.github.com/mswjs/msw/issues/2353))
([`2fa98c3`](2fa98c327a))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.3`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.3)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.2...v2.6.3)

#### v2.6.3 (2024-11-10)

##### Bug Fixes

- **handleRequest:** remove `transformResponse` option
([#&#8203;2351](https://redirect.github.com/mswjs/msw/issues/2351))
([`74c4a3a`](74c4a3a899))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.2`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.2)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.1...v2.6.2)

#### v2.6.2 (2024-11-07)

##### Bug Fixes

- update `@bundled-es-modules/cookie` to 2.0.1
([#&#8203;2312](https://redirect.github.com/mswjs/msw/issues/2312))
([`c134352`](c134352e82))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.1`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.1)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.6.0...v2.6.1)

#### v2.6.1 (2024-11-06)

##### Bug Fixes

- prevent `instanceof` handler check failures between different MSW
versions
([#&#8203;2349](https://redirect.github.com/mswjs/msw/issues/2349))
([`28d26bd`](28d26bd7fa))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)

###
[`v2.6.0`](https://redirect.github.com/mswjs/msw/releases/tag/v2.6.0)

[Compare
Source](https://redirect.github.com/mswjs/msw/compare/v2.5.2...v2.6.0)

#### v2.6.0 (2024-10-29)

##### Features

- support mocking WebSocket APIs
([#&#8203;2011](https://redirect.github.com/mswjs/msw/issues/2011))
([`ae786f5`](ae786f59eb))
[@&#8203;kettanaito](https://redirect.github.com/kettanaito)
[@&#8203;DanielleHuisman](https://redirect.github.com/DanielleHuisman)

</details>

---

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNsb3VkIFNlY3VyaXR5IiwiYmFja3BvcnQ6YWxsLW9wZW4iLCJyZWxlYXNlX25vdGU6c2tpcCJdfQ==-->

---------

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Sean Rathier <sean.rathier@elastic.co>
Co-authored-by: seanrathier <sean.rathier@gmail.com>
2025-02-27 11:49:09 -08:00
Tiago Costa
f611f9548a
chore(NA): update versions after v7.17.29 bump (#212452)
This PR is a simple update of our versions file after the recent bumps.
2025-02-27 17:44:38 +00:00
Marius Iversen
117b2b2079
[Rule Migrations] Adding unit tests for graph execution (#212402)
## Summary

This PR adds general unit tests for the langgraph execution and tests
most of the possible variations in which the graph can route between
conditional edges
2025-02-27 18:32:13 +01:00
elastic-renovate-prod[bot]
aefdd86275
Update docker.elastic.co/wolfi/chainguard-base:latest Docker digest to 6387bd4 (main) (#212623)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| docker.elastic.co/wolfi/chainguard-base | digest | `c66fdaf` ->
`6387bd4` |

---

### 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-02-27 11:21:14 -06:00
Bryce Buchanan
6ce38c3c1b
fixes sorting in profiler storage explorer (#212583)
## Summary
fixes #197448
replaces `LabelWithHint` with new built-in `nameTooltip` prop
Also updated sorting function for hostName column, as the default
sorting doesn't take into account `host.id` when `host.name` is empty.


https://github.com/user-attachments/assets/4e3632bf-61d0-4045-babd-2917fa7a204a



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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-02-27 07:53:44 -08:00
Viduni Wickramarachchi
2704a71452
[Obs AI Assistant] Unify AI Assistant Nav Button (#212598)
## Summary

Unifies the display of the AI Assistant Button in classic and solution
navigations.
- Previously, the button only displayed an icon. Now it displays the
label as well
- Updated tooltip content to show keyboard shortcut to align with the
Security AI Assistant

## Stateful - Classic Navigation:


![image](https://github.com/user-attachments/assets/13d49bd2-08d4-44ff-9252-8e1fba261f1e)

## Serverless


![image](https://github.com/user-attachments/assets/8340194f-bfb1-4e0a-a4fa-6c8dfc7cfe65)


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] 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-02-27 09:35:16 -05:00
Bharat Pasupula
f579f2d637
[Automatic Import] Fix Structured log flow to handle different type of structured syslogs (#212611)
## Release note
Fix structured log flow to handle multiple types of structured logs.

## Summary
The structured log flow has some issues where the KV header validation
fails for some type of logs. This PR fixes the flow to match variety of
structured syslog messages.

A variety of logs are tested.

```
[2025-01-03T07:48:58.989821Z] [DEBUG] AuthService - EventID=361a5289eaf8e42b4c195b9b | Message="Session expired" | UserID=2882 | Duration=376ms
[2025-01-29T17:34:18.989830Z] [ERROR] InventoryService - EventID=acbb20d3c955edf718e691d9 | Message="Item restocked" | UserID=9656 | Duration=421ms
[2025-01-11T21:51:54.989839Z] [ERROR] APIGateway - EventID=9c273d43b946020d5fdbe36c | Message="Response sent" | UserID=1468 | Duration=409ms
[2025-01-20T08:40:22.989848Z] [WARN] PaymentService - EventID=ae8c1425079119b848fa451cb7a | Message="3D Secure required" | UserID=9353 | Duration=270ms
```

```
2021-10-22 22:11:32,131 DEBUG [org.keycloak.events] (default task-3) type=CODE_TO_TOKEN, realmId=test, clientId=security-admin-console, userId=ce637d23--4fca-9088-1aea1d053e19, ipAddress=10.1.2.1, token_id=561459c0-75f1-46d4-986d, grant_type=authorization_code, refresh_token_type=Refresh, scope=openid, refresh_token_id=07434488-ca99-412a-c2e47c93d6d1, code_id=bae6e56e-368f-4809-48cfb6279f5e, client_auth_method=client-secret
2021-10-22 22:12:09,871 DEBUG [org.keycloak.events] (default task-3) operationType=CREATE, realmId=test, clientId=7bcaf1cb-820a-40f1-75ced03ef03b, userId=ce637d23-b89c-4fca-1aea1d053e19, ipAddress=10.1.2.6, resourceType=USER, resourcePath=users/07972d16-b173-803d-90f211080f40
```

```
[18/Feb/2025:22:39:18 +0000] CONNECT conn=730729 from=10.2.2.9:56518 to=10.2.1.14:4389 protocol=LDAP
[18/Feb/2025:22:39:16 +0000] CONNECT conn=207223 from=10.2.1.24:55730 to=10.1.3.7:4389 protocol=LDAP
```

```
<134>1 1647479580.487048774 MX84_2 airmarshal_events type=rogue_ssid_detected ssid='' bssid='AA:17:C8:D8:51' src='AA:17:C8:D8:51' dst='FF:FF:FF:FF:FF' wired_mac='AC:17:C7:D8:51' vlan_id='0' channel='6' rssi='35' fc_type='0' fc_subtype='8'
<134>1 1647479604.334549372 MX84_5 airmarshal_events type=rogue_ssid_detected ssid='' bssid='92:17:C7:D8:51' src='92:17:C8:D8:51' dst='6A:3A:3E:85:F6' wired_mac='AC:17:C7:D8:51' vlan_id='0' channel='6' rssi='23' fc_type='0' fc_subtype='5'
```

### 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-02-27 13:32:17 +01:00
Konrad Szwarc
92867c697d
[EDR Workflows][Osquery] OpenApi Missing Content (#212032)
Part of DW team effort -
https://github.com/elastic/security-team/issues/11804

This PR aligns the property/schema descriptions and examples in
AsciiDocs with OpenAPI schemas. The primary goal of this PR was not to
extend or enhance the documentation but to migrate from one system to
another.

Ascii docs -
https://www.elastic.co/guide/en/kibana/8.17/osquery-manager-api.html
OpenApi generated docs -
https://www.elastic.co/docs/api/doc/kibana/operation/operation-osqueryfindlivequeries

Changes:
1. Copied missing property descriptions from AsciiDoc to OpenApi
properties
2. Copied existing AsciiDoc examples for both requests and responses
3. Fixed falsy query object in some GET requests - in OpenApi it was
defined as an object, not as path query params.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: natasha-moore-elastic <137783811+natasha-moore-elastic@users.noreply.github.com>
2025-02-27 12:29:04 +00:00
Maryam Saeidi
2f0bad7d39
Attempt to fix custom_threshold_preview_chart flaky test (#212028)
Fixes #209317

## Summary

Summary of
[Slack](https://elastic.slack.com/archives/C04HT4P1YS3/p1740054800086779)
discussion:

As shown below, we check if the `Create rule` button exists and then we
try to click it:
```
const clickCreateRuleButton = async () => {
    await testSubjects.existOrFail('createRuleButton');
    const createRuleButton = await testSubjects.find('createRuleButton');
    return await createRuleButton.click();
  };
```

It seems something goes wrong during click in this case and even after 2
mins, we don't see the modal:
```
[00:03:11]         │ debg --- retry.tryForTime error: [data-test-subj="ruleTypeModal"] is not displayed
...
[00:05:09]         └- ✖ fail: ObservabilityApp Custom threshold preview chart does render the empty chart only once at bootstrap
```

@dmlemeshko pointed to the implementation that we have for the button
and the fact that we need to first check if the user is authorized to
see this button, and something might have caused the click not to be
successful even though there is no error reported by WebDriver.

```
useEffect(() => {
    setHeaderActions?.([
      ...(authorizedToCreateAnyRules ? [<CreateRuleButton openFlyout={openRuleTypeModal} />] : []),
      <RulesSettingsLink />,
      <RulesListDocLink />,
    ]);
  }, [authorizedToCreateAnyRules]);
```

Long story short, we will add waiting for the global spinner to
hopefully make this test less flaky 🤞🏻

---------

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
2025-02-27 10:48:14 +00:00
Robert Oskamp
7a381afb17
FTR - optimize service initialization (#212421)
## Summary

This PR optimizes the FTR service initialization by not loading UI
service for API tests and by removing retries during test user setup

## Changes

- Remove loading of common UI services from common services (UI services
should not be loaded for API tests)
- Move `security` service from `@kbn/ftr-common-functional-ui-services`
to `@kbn/ftr-common-functional-services` as it should be available to
API tests as well
- Only try once to delete `testUser` during init (this user usually does
not exist on a fresh deployment - and if it does, a single delete
request is enough to get rid of it)

## Benchmark results

**These changes will reduce FTR CI runtime overall by ~100 minutes**
🚀
Due to parallel workers in CI, the effective runtime of the whole CI job
will be less than that.

- The removal of UI service loading (which includes starting a browser
instance) for API tests reduces init time by ~0.5 seconds. With 313 API
configs that are started on CI, this reduces the runtime overall by ~156
seconds / ~2.6 minutes.
- The removal of test user delete retries reduces init time by ~10
seconds. With 589 FTR configs that are started on CI, this reduces the
runtime overall by ~5890 seconds / ~98 minutes.
- These numbers have been taken on a local machine and since CI workers
are usually slower, we should see at least this amount of improvement if
not more in CI.
2025-02-27 11:35:47 +01:00
Julia Rechkunova
9726041503
[Data View Field] Fix popularity score bugs (#211201)
- Fixes https://github.com/elastic/kibana/issues/211109

## Summary

This PR fixes a number of bugs in fields popularity logic:
- [x] If field popularity was customized via UI form, the value will be
saved now as a number instead of a string
- [x] Same for runtime fields in another part of the code
- [x] Since the data was polluted with string values, this PR makes sure
that the incrementing would still work and the result would be converted
to number.
- [x] If user opened the field flyout, when selected/deselected fields
as columns in the table, then opened the field flyout again, the data
shown as Popularity was outdated. Now it should be fixed.
- [x] Prevents reseting of Popularity scores in other fields.
- [x] Functional tests in
`test/functional/apps/discover/group6/_sidebar.ts` and
`test/functional/apps/management/data_views/_index_pattern_popularity.ts`.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-02-27 10:34:22 +00:00
Aleh Zasypkin
7155c05bd9
chore(security,codeql): exclude **/stub/** folders from CodeQL scans (#212608)
## Summary

Eexclude `**/stub/**` folders from CodeQL scans.
2025-02-27 10:20:48 +00:00
Alberto Blázquez
aac841353d
Rename FindingsBaseEsQuery interface in CSP package (#212427)
## Summary

Rename the `FindingsBaseEsQuery` interface exposed by the
`@kibana/cloud-security-posture` package as well as all references where
it's imported.

Separating this renaming into its own PR also lets us tag it with
`backport:prev-minor` and avoid potential merge conflicts in the future.

### Depends on

- https://github.com/elastic/kibana/pull/210938

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

### Identify risks

No risk whatsoever.
2025-02-27 10:20:06 +00:00
Alberto Blázquez
f0584d9b90
Implement Asset Inventory Bar Chart (#210938)
## Summary

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

Implement "Top 10 Asset Types" bar chart. 
- The X-axis shows all assets grouped by category (`entity.category`
field), one category per bar
- Each bar shows stacked subgroups of assets by source (`entity.type`
field)
- The Y-axis shows the counts of assets

### Depends on

- https://github.com/elastic/kibana/pull/208417 so that the chart
renders data fetched dynamically. When it gets merged, this one will be
rebased and will only contain the last commit as changes.

### Screenshots

<details><summary>Loading state (animated spinner from <a
href="https://eui.elastic.co/#/display/loading#chart"
target="_blank">Elastic Charts</a>)</summary>
<img width="1378" alt="Screenshot 2025-02-25 at 18 14 39"
src="https://github.com/user-attachments/assets/553294e2-aaee-40c0-b1bb-de3e85f64d78"
/>
</details> 

<details><summary>Fetching state (animated progress bar)</summary>
<img width="1376" alt="Screenshot 2025-02-25 at 18 14 58"
src="https://github.com/user-attachments/assets/accdbc0e-40a2-4b30-9f4e-808a466be4d5"
/>
</details>

<details><summary>Chart with fetched data</summary>
<img width="1428" alt="Screenshot 2025-02-24 at 13 11 03"
src="https://github.com/user-attachments/assets/3c455bc8-5bdd-4ea2-a946-53e138ae081b"
/>
</details>

<details><summary>Chart with filtered, fetched data (by type:
"Identity")</summary>
<img width="1429" alt="Screenshot 2025-02-24 at 13 11 17"
src="https://github.com/user-attachments/assets/a1e75210-757e-42d1-b852-945de5f3f44b"
/>
</details>

<details><summary>Empty chart - no data</summary>
<img width="1258" alt="Screenshot 2025-02-13 at 09 47 08"
src="https://github.com/user-attachments/assets/c239a5a6-337e-41c9-a9a3-7cdc2c9b1e01"
/>
</details>

### Definition of done

- [x] Add a bar chart titled "Top 10 Asset Types" to the "Asset
Inventory" page.
- [x] Use the `@elastic/charts` library to implement the visualization.
- [x] Configure the chart with:
  - **X-axis:** Asset type categories
  - **Y-axis:** Count of assets
- **Legend:** A color-coded key linking each bar to a specific category.
- [x] Ensure the chart is responsive when resizing the screen and
adheres to the [visual
spec](https://www.figma.com/design/9zUqAhhglT1EGYG4LOl1X6/Asset-Management?node-id=2946-19648&t=FuD3BEY4FyxAKV38-4).
- [x] Integrate the chart so that it updates based on the filters
section and the Unified Header component.

### How to test

Follow the instructions from [this
PR](https://github.com/elastic/kibana/pull/208417) to prepare the local
env with data.

Alternatively, open the
`asset_inventory/components/top_assets_bar_chart.tsx` file and edit
yourself the `data` prop that we pass into `<BarSeries>` with mocked
data. The data must have the following shape:

```js
[
  { category: 'cloud-compute', source: 'gcp-compute', count: 500, },
  { category: 'cloud-compute', source: 'aws-security', count: 300, },
  { category: 'cloud-storage', source: 'gcp-compute', count: 221, },
  { category: 'cloud-storage', source: 'aws-security', count: 117, },
];
```

### Checklist

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

No risks whatsoever.
2025-02-27 09:01:00 +01:00
Kibana Machine
0907d5d339
[api-docs] 2025-02-27 Daily api_docs build (#212604)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/996
2025-02-27 07:32:06 +00:00
christineweng
f7b7a6cafa
[Security Solution][Alert flyout] Fix dual hover actions in table tab (#212316)
## Summary

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

This PR fixed a bug where the fields in the table tab have 2 hover
actions, by pruning an unused branch in formatted fields (the [original
logic](https://github.com/elastic/kibana/pull/207959/files#diff-ccbcd249520d7f127960805d59a0ebfd00613785a2dd5b047545bb8b4e565e26L331)
was if the field is not draggable, show the value as text)


![image](https://github.com/user-attachments/assets/f9922476-cd8b-43f5-9c35-6ad790357da7)


### 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)
- [ ] [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
- [ ] 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-02-27 02:03:35 +00:00
Lola
f8e31e5fcb
[Cloud Security] Add upgrade agentless deployment background task (#207143)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.
This PR add background task to upgrade Agentless Deployments after
Kibana Stack has been upgrade in ESS. Once the Kibana stack upgrades, the task will do following:
1.  Fetch agentless policies with package policies that have agents
2. Check if agentless agents version is upgradeable by use `semverLT`
which see if current agent version less than latest available upgrade
version and current kibana version
3. If agent version is upgradedable, then task will calls Agentless
Upgrade Endpoint to upgrade agentless deployment.
4.  Agent should be upgraded to latest available upgraded version


![image](https://github.com/user-attachments/assets/e1ad05bf-469e-4eb8-bef0-b4e2edcbb0a0)


**How to test PR:**

Prerequisite:
Install [QAF
Tool](https://docs.elastic.dev/appex-qa/qaf/getting-started)
Create EC cloud api key [QAF Elastic
Cloud](https://docs.elastic.dev/appex-qa/qaf/features/ec-deployments)

1. Go to Elastic Cloud and Create ESS Deployment in `8.17.0-SNAPSHOT`
```qaf elastic-cloud deployments create --environment production --region gcp-us-west2 --stack-version 8.17.0-SNAPSHOT --version-validation --deployment-name  <DEPLOYMENT_NAME> ```
2. Create an Agentless Integration
3. Upgrade stack to `8.18.0-SNAPSHOT` > `8.19.0-SNAPSHOT`
4. Run the following QAF command 
```qaf elastic-cloud deployments upgrade <DEPLOYMENT_NAME>
9.1.0-SNAPSHOT --kb-docker-image
docker.elastic.co/kibana-ci/kibana-cloud:9.1.0-SNAPSHOT-5e00106755e7084d1325e784eb27f91db9724c89```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-27 08:56:23 +07:00
Chris Cowan
b7976175e5
[Streams 🌊] Remove enablement check in PUT /api/streams/{id} for classic streams (#212289)
## Summary

The goal of this PR is to enable all the workflows for "Classic" without
enabling "Wired" streams. This PR changes the `isStreamsEnabled` check
for `PUT /api/streams/{id}` to allow for `PUT` requests for an
`UnwiredStreamDefinition`. This change will allow users to directly
navigate to `/app/streams` and use it to manage "classic" streams.
User's would still be required to call `POST /api/streams/_enable` to
work with "wired" streams.

This also includes a fix for the `i18n` paths that were missed when
moving from Observability to Platform.
2025-02-27 01:35:53 +00:00
Jon
d8d976efad
[kbn/es] Workaround arm64 container startup error (#212458)
Adds a temporary workaround for an issue with ES containers starting on
M4 based macs.
```
 info waiting for ES cluster to report a green status
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x0000ffff93d400a8, pid=7, tid=16
#
# JRE version:  (23.0+37) (build )
# Java VM: OpenJDK 64-Bit Server VM (23+37-2369, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, serial gc, linux-aarch64)
# Problematic frame:
# j  java.lang.System.registerNatives()V+0 java.base@23
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
```
2025-02-26 17:11:01 -06:00