Commit graph

87412 commits

Author SHA1 Message Date
Arturo Lidueña
e2a833785b
[Obs AI Assistant] [Anonymization] Update system prompt to inform about anonymization (#224211)
Closes https://github.com/elastic/observability-dev/issues/4563
## Summary

This PR updates the Obs AI Assistant system prompt to explicitly inform
the LLM about the presence of anonymized entities (e.g., hashes or
placeholder tokens). The goal is to prevent the LLM from attempting to
interpret or hallucinate the meaning of these anonymized tokens.

What Changed
- Modified the system prompt to include a new instruction:
```txt
Some entities in this conversation (like names, locations, or IDs) have been anonymized using placeholder hashes (e.g., `PER_123`, `LOC_abcd1234`). These tokens should be treated as distinct but semantically unknown entities. Do not try to infer their meaning. Refer to them as-is unless explicitly provided with a description.
```
- This instruction is now included in all prompts sent to the LLM as
part of the chat completion setup when there are anonymization rules.
2025-06-22 21:11:18 +02:00
Kibana Machine
9201bad4e1
[api-docs] 2025-06-22 Daily api_docs build (#224779)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1111
2025-06-22 07:32:48 +01:00
Jared Burgett
1b7cb0f29b
Security Entity Analytics - Privileged user monitoring - Privileged access detection support (#224008)
# Overview

This pull request adds capabilities associated with the [Privileged
Access Detection (PAD) anomaly integration
package](https://www.elastic.co/docs/reference/integrations/pad) as a
first-class-citizen into the Entity Analytics Privileged User Monitoring
feature.

# How to test

- Pull this branch into your local machine
- Ensure that the security experimental flag
`privilegeMonitoringEnabled` has been enabled, for example by setting
`xpack.securitySolution.enableExperimental:
[privilegeMonitoringEnabled]` in your `config/kibana.dev.yml` file
- Start Elasticsearch and Kibana
- From the
[security-documents-generator](https://github.com/elastic/security-documents-generator)
repository, run the following command: `yarn start
privileged-user-monitoring` (ensuring your config is pointing to your
locally running Elastic cluster). This will load "source" events that
are anomalous in nature. You can run this command more than once if
desired to upload more than 10 users.
- Grab the CSV file that the generator created in its console output.
- Open the Entity analytics page and navigate to dashboards (by clicking
"Go to dashboards")
- Add the privileged users from the previous step to the privileged
users index using the CSV File Upload option.
> [!NOTE]  
> Any errors regarding risk scoring are unrelated to this PR, and are
being resolved separately
- You should see a panel that says "Enable Privileged access detection".
Click "Install", and you'll meet a loading state.
- Once complete, you shouldn't see any results. That's because, even
though we **install** the ML jobs by default, we don't **run** them by
default.
- Click "ML Job Settings", and note that only `pad` jobs should be
displaying in this callout. Feel free to test this callout's links and
filtering options.
- Click "Run job" next to the job called
`pad_linux_high_count_privileged_process_events_by_user`. This is the
job for which we have anomaly data.
- Click away from the callout. **You still shouldn't see data.** That's
because there just aren't any anomalies "today".
- Change the global date filter at the top of the screen to "Last 30
days".
- You should see something similar to this:

<img width="1441" alt="Screenshot 2025-06-16 at 12 50 25 AM"
src="https://github.com/user-attachments/assets/2b3f11f2-f45d-4716-bb8e-79d2b585aa3e"
/>

- Congrats for making it this far! Some things to play around with:
- Click around on the anomaly filters (i.e., click 25-50), and notice
that the results will change.
- Ensure that the ordering of the users is based on the **highest single
anomaly score in any visible bucket**. Meaning, if user `samwise` has
only one anomaly, but its score is 99, and user `frodo` has dozens of
anomalies, but no higher than, say, 80, `samwise` will be on the top of
the list.
  - Click the user names to open the appropriate user flyout
- Change the global time filter to change ranges, and ensure the data
shows up appropriately. The buckets will try to roughly show 30 buckets
total, but will have a maximum of 3 hours, meaning if your range is too
small, it may show fewer than 30 buckets. This is intentional behavior,
as the PAD jobs have an anomaly job window of 3 hours.
- Click the button that says "View all in Anomaly Explorer", which uses
the currently selected global time range, and compare results
> [!WARNING]  
> Remember that the users in the privileged user monitoring table are
only those that you designated as privileged users in a previous step.
In contrast, the Anomaly Explorer page shows **all** users.
Additionally, note that there may be very slight differences between the
swimlanes, because ES|QL calculates the bucket dates slightly
differently than the Anomaly Explorer. **This should not affect the
results themselves, only the buckets that an individual anomaly score
might fall in.** You might see a single anomaly fall into one visual
bucket instead of another, but the date should be correct.

# Helpful hints

If you'd like an easy way to "reset" the Privileged Access Detection
package and delete its associated jobs (and anomaly data), so that you
can redo the onboarding flow, you can run the below commands (changing
any credentials as necessary):

```shell
curl "http://localhost:5601/api/fleet/epm/packages/pad/0.5.0" \
  -X 'DELETE' \
  -H 'elastic-api-version: 2023-10-31' \
  -H 'kbn-xsrf:true' \
  --user elastic:changeme

curl "http://localhost:5601/internal/ml/jobs/delete_jobs" \
  -H 'kbn-xsrf:true' \
  --user elastic:changeme \
  -X 'POST' \
  -H 'elastic-api-version: 1' \
  -H 'x-elastic-internal-origin:kibana' \
  -H 'Content-Type: application/json' \
  --data-raw '{
    "jobIds": [
      "pad_linux_high_count_privileged_process_events_by_user",
      "pad_linux_high_median_process_command_line_entropy_by_user",
      "pad_linux_rare_process_executed_by_user",
      "pad_okta_high_sum_concurrent_sessions_by_user",
      "pad_okta_rare_host_name_by_user",
      "pad_okta_rare_region_name_by_user",
      "pad_okta_rare_source_ip_by_user",
      "pad_okta_spike_in_group_application_assignment_changes",
      "pad_okta_spike_in_group_lifecycle_changes",
      "pad_okta_spike_in_group_membership_changes",
      "pad_okta_spike_in_group_privilege_changes",
      "pad_okta_spike_in_user_lifecycle_management_changes",
      "pad_windows_high_count_group_management_events",
      "pad_windows_high_count_special_logon_events",
      "pad_windows_high_count_special_privilege_use_events",
      "pad_windows_high_count_user_account_management_events",
      "pad_windows_rare_device_by_user",
      "pad_windows_rare_group_name_by_user",
      "pad_windows_rare_privilege_assigned_to_user",
      "pad_windows_rare_region_name_by_user",
      "pad_windows_rare_source_ip_by_user"
    ],
    "deleteUserAnnotations": true,
    "deleteAlertingRules": false
  }
'
```

# What's left?
- This PR does not implement "proactive" permissions checks. Instead,
relevant permission issues will cause requests/queries to fail, which
are appropriately shown in the UI for troubleshooting. This proactive
check will be tackled in [this (private) followup
issue](https://github.com/elastic/security-team/issues/12822).
- There is not yet a way to "upgrade" the package directly from the
Privileged User Monitoring screen. This would be a nice addition later
on, instead of requiring users to navigate to the integration page. This
behavior will be tackled in [this (private) followup
issue](https://github.com/elastic/security-team/issues/12823).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-06-22 00:36:09 -05:00
Kibana Machine
5d696d579d
[api-docs] 2025-06-21 Daily api_docs build (#224768)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1110
2025-06-21 07:13:37 +01:00
Paulo Silva
917d2cf09f
[Asset Inventory] Handling Asset Criticality soft delete mechanism (#224630)
## Summary

This PR updates Asset Inventory Grouping and Datagrid functionalities to
accommodate the `asset.criticality` soft delete mechanisms, which sets
the value of `asset.criticality` to "delete" once an entity is manually
"Unassigned" after having a value before:

- Added condition on grouping to treat both "deleted" and "missing
value" as Unassigned.
- Added rendering condition on the datatable to display the Unassigned
badge when `asset.criticality` value is either missing or "deleted".

### Recording


https://github.com/user-attachments/assets/37d7e44f-cb57-4c29-b49d-cda9b341497d

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-21 00:04:42 +01:00
elastic-renovate-prod[bot]
22f115e476
Update dependency form-data to ^4.0.3 (main) (#223590)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [form-data](https://redirect.github.com/form-data/form-data) |
devDependencies | patch | [`^4.0.2` ->
`^4.0.3`](https://renovatebot.com/diffs/npm/form-data/4.0.2/4.0.3) |

---

### Release Notes

<details>
<summary>form-data/form-data (form-data)</summary>

###
[`v4.0.3`](https://redirect.github.com/form-data/form-data/compare/v4.0.2...v4.0.3)

[Compare
Source](https://redirect.github.com/form-data/form-data/compare/v4.0.2...v4.0.3)

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

🔕 **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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOm9icy11eC1tYW5hZ2VtZW50IiwiYmFja3BvcnQ6YWxsLW9wZW4iLCJjaTphbGwtY3lwcmVzcy1zdWl0ZXMiLCJyZWxlYXNlX25vdGU6c2tpcCJdfQ==-->

---------

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 17:03:19 -05:00
Marta Bondyra
1845f76637
[Unified Search] rewrite scss to emotion (#223025)
## Summary

Part of https://github.com/elastic/kibana/issues/207852 

There are very minor changes to styling to use the brand colors instead
of shaded or tinted scss helpers (for filters negate 'red' color and for
autocomplete suggestions)

<img width="442" alt="Screenshot 2025-06-10 at 13 58 22"
src="https://github.com/user-attachments/assets/a4eda133-13e9-4241-8f51-923e9803dca8"
/>


<img width="601" alt="Screenshot 2025-06-10 at 13 55 24"
src="https://github.com/user-attachments/assets/8b1c9d37-b747-4ea8-bc52-8af31b76bf83"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 22:49:31 +02:00
Jared Burgett
bda0dc5d3e
Privileged User monitoring cleanup (#224632)
# Overview

This PR does various small things regarding the Privileged user
monitoring and Entity Analytics workflow, including:
- Adds technical preview labels where appropriate
- Adds in the screenshots for the navigation
- Removes the onboarding video in favor of an onboarding illustration
- Temporarily removes the integration cards from onboarding

# How to test

- Pull the code down and ensure the `privilegeMonitoringEnabled`
experimental flag is set
- Go to the "Entity Analytics" navigation menu in classic nav, and see
the new screenshots
- See that the Privileged user monitoring onboarding page should show
"Technical Preview"
- See that the Privileged user monitoring onboarding page should not
show Integration cards
- See that the video in the onboarding has been replaced with an
illustration
- Click "Go to dashboards =>", and see that the Privileged user
monitoring onboarding page should show "Technical Preview"
2025-06-20 15:49:25 -05:00
Marta Bondyra
de3604c905
Create @kbn/css-utils package (#223933)
## 🧵 Summary

This PR introduces a few structural and cleanup improvements:

1. Moves core Emotion CSS helpers (`useMemoizedStyles` renamed as
`useMemoCss`, `kbnFullBodyHeightCss`, `kbnFullScreenBgCss`) from
`core/public` to a new package: `@kbn/css-utils`.
2. Removes a significant portion of legacy SCSS from the core plugin. 
3. Replaces scss mixin with emotion `kbnFullScreenBgCss` across Kibana
(we have scss and emotion version, but emotion version wasn't widely
used yet).
4. As a result of (3), some plugin tests were migrated to React Testing
Library. This was necessary because Emotion-generated snapshots in
Enzyme were difficult to read and maintain when moving to emotion.

### Considerations
I initially tried to add the package to the [shared-deps
bundle](8e15517ddd),
but couldn’t get the SVG imports for `kbnFullScreenBgCss` to work
correctly in that setup.

As a workaround, I opted to import the helpers directly from their
source files.

An alternative approach could be to convert the used SVGs into React
components and use those within the shared package. Or explore something
like a static package and try to somehow wire in that in the webpack
internal compilers, but it doesn't seem to be worth the effort at the
moment.


### 💡 Motivation

- These utils don’t need to live in Core and are now decoupled to
improve performance and flexibility.
- Importing from `core/public` (even just for a small hook) was adding
noticeable overhead to test runs:
  - ~1–2s delay on first Jest execution
  - ~200ms added on subsequent runs
  - Occasional CI timeouts due to deep import graph

### 👥 Ownership

I assigned this package to sharedux team. Thank you!

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 22:48:44 +02:00
Yara Tercero
f2d4278086
[Detections Response] Remove unused test (#224108)
## Summary

Addresses https://github.com/elastic/kibana/issues/151636 .

This test was leftover from migration. Does not appear to be used.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 12:39:25 -07:00
Ying Mao
025aacd302
[Response Ops][Reporting] Scheduled report API license check (#224737)
## Summary

Adding license check for list and disable scheduled report APIs

## To Verify

1. Run ES with basic license
2. Try accessing the scheduled report list and disable APIs from the Dev
Console. You should get a 403 error.
2025-06-20 14:56:51 -04:00
Kevin Qualters
9af4a749d0
[Security Solution][SIEM Migrations] Add name field to rule migrations ui and data model (#223860)
## Summary
This pr adds the ability to set and edit the name field for automatic
rule migrations, done in either the initial data upload workflow, or at
any step thereafter in the migration list cards. Also adds logic to
migrate existing migration metadata docs if they do not have a name,
intended to match what the user saw previously, the string 'SIEM
Migration \#{$indexNumber}' users saw before this change.

Kibana logs when migrating a migration lacking a name:

![image](https://github.com/user-attachments/assets/53e0a2ac-eea9-43cb-ac2e-5bb1858ac257)
Edit an existing migration name:

![image](https://github.com/user-attachments/assets/2c71b773-cadb-48a3-8363-24ce1988070e)

![image](https://github.com/user-attachments/assets/2d83c23c-4d9d-4eef-ba86-252abf6f1dea)
New sub step in rules upload form:

![image](https://github.com/user-attachments/assets/2fc59cf4-e72b-463a-9968-8c36345e5a16)
Migrated name:

![image](https://github.com/user-attachments/assets/b8543957-0c1b-44bc-a68f-2b5663263010)
(shown in dev tools because the migration does not have any rules
associated, and so the card list does not include it)


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] 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.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
2025-06-20 19:51:24 +01:00
Tiago Vila Verde
33a6307b11
[Entity Analytics][Privmon] Remove the GET user route (#223618)
This PR removes the current GET user route as it works with IDs and we
do not use IDs in privmon.
We'd rather remove this before it gets documented and pushed out. We can
revert this PR later if needed

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
2025-06-20 18:23:06 +01:00
Paul Tavares
bad1717168
[Security Solution][Endpoint] New internal ref. data type and associated private APIs for use with orphan response actions (#224491)
## Summary

The following changes are in support of space awareness:

- A new reference data item type to store the space ID that should be
used to display orphaned response actions
- With space awareness, where the visibility of response actions is tied
to the Fleet integration policy associated with the agents, its possible
that response actions (older one) may become unaccessible when the
associated integration package policy is deleted. To mitigate this for
customer that may want to continue to see them, we will allow for a
specific space ID to be defined where these should be made visible
- Two new **internal** APIs to read and update the space id where orphan
response actions should be visible
- Both APIs are currently only allowed to be used by any user having the
`superuser` role
- Read API: `GET /internal/api/endpoint/action/_orphan_actions_space`
- Update API: `POST /internal/api/endpoint/action/_orphan_actions_space`
        -  with a `body` of `{ spaceId: "space_id_here" }`
- `spaceId` can also be set to an empty string (default out of the box),
which results in the orphan response actions not being display in any
space
- A new internal `ReferenceDataClient` for managing reference data
items.
2025-06-20 19:00:08 +02:00
Marco Antonio Ghiani
bef3a1effd
[Streams 🌊] Fix broken tests (#224706)
## 📓 Summary

Fix broken tests by https://github.com/elastic/kibana/pull/224461, which
were not executed during CI.
2025-06-20 18:44:35 +02:00
Trent Mick
228db1a229
[APM] Add 'deactivate_...' agent configuration settings for EDOT Node.js (#224502)
This makes the existing 'deactivate_all_instrumentations' and
'deactivate_instrumentations' agent configuration settings
available to EDOT Node.js agents (`agent.name:
opentelemetry/nodejs/elastic`).
2025-06-20 09:19:52 -07:00
Rodney Norris
f72bf857e7
[Search] fix: move app menu z index down (#224708)
## Summary

Currently the app menu z index is header - 1, which makes it below the
header and standard flyout, but it is then above the embeddable dev
console which is level1 - 2 to not conflict with flyouts.

Updating the AppMenuBar to be header - 10 (990) here to give more
flexibility for other layers specifically the embeddable dev console to
have a z index between the AppMenuBar and flyouts.

This is fixing an issue seen when using the search solution navigation
where the header actions are put into an additional header that is not
accounted for in the fixed header offset. Which then causes the embedded
dev console to render below the AppMenu bar and be more difficult to
close:


![image](https://github.com/user-attachments/assets/cb57314a-ca84-4998-b7dd-47a8b1808d14)

With this change the `AppMenuBar` is moved down to allow the embedded
dev console room to open above. The other option would be to introduce a
CSS variable for the height of the `AppMenuBar` when it's rendered and
update the embedded dev console to account for that height as well as
the `--euiFixedHeadersOffset` with it's total maximum height.

After fix:

![image](https://github.com/user-attachments/assets/6762eb99-1a7b-4dbf-a5f4-b34363a3bd0e)

### 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)
2025-06-20 18:08:29 +02:00
Maxim Palenov
98aaf50be2
[Security Solution] Actualize prebuilt rule customization test plan (#222188)
**Addresses:** https://github.com/elastic/kibana/issues/202068

## Summary

This PR actualizes prebuilt rule customization test plan with the current feature state and desired test coverage we expect for prebuilt rule customization sub-feature.

## Details

The changes include

- Adding an extra test scenario for prebuilt rule customization via public API
- Fixing a scenario under Licensing section
- Fixing wording to make scenarios simpler
2025-06-20 15:16:59 +00:00
Elena Stoeva
88ef1ac8b2
[Console] Add ESQL autocomplete support in single quotes (#224601)
Closes https://github.com/elastic/kibana/issues/223954
Closes https://github.com/elastic/kibana/issues/223921

## Summary

This PR adds support for ESQL autocompletion inside single quotes, which
allows suggestions that include triple quotes such as `KQL(``````)`.
 
<img width="1165" alt="Screenshot 2025-06-19 at 13 39 51"
src="https://github.com/user-attachments/assets/8ff59bf7-534e-4539-8cf8-2a1145dbf842"
/>

**Changes include:**
- The lexer rules have been updated to recognize single-quote query as
ESQL so that the highlighting is correct
- We escape and unescape characters that are invalid in a Console string
when we suggest inside single quotes so that we don't cause errors in
Console

**How to test:**
Make sure that ESQL suggestions are displayed inside both `"query":
"...` and `"query": """...` and that suggestions that contain quotes are
correctly escaped inside single-quote queries.

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-06-20 15:58:54 +01:00
Lola
f6cf1dd827
[Cloud Security] Fix elastic resource id to use kibana component id instead of deployment id (#224499)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

On cloud connector, cloud formation redirection kibana replaces the
value of the parameter param_ElasticResourceId=RESOURCE_ID with:

We used the deployment ID for hosted. While in ESS, we need to replace
with Kibana Component ID for hosted, instead of Deployment ID. We
extract `cloud.cloudId` base64 and decode `cloudId` in the following
format
`deployment_name:base64(<host>$<es_cluster_id>$<kibana_component_id>)`
and get the Kibana Component ID
2025-06-20 10:55:12 -04:00
Tim Rühsen
5885e15173
[Profiling] Add executable name tab to TopN view (#224291)
## Summary

This PR adds an "Executables" tab to the TopN view in Universal
Profiling.
It is the default tab now, prior it was "Threads".

**Screenshot**

![Screenshot_20250617_174758](https://github.com/user-attachments/assets/714d7500-7f6e-445f-987d-a4b408d1278b)

@cauemarcondes Can you help with adding tests?
2025-06-20 16:45:30 +02:00
Ersin Erdal
723fcc3352
Validate interval when a task is updated (#222486)
Resolves: #213391

This PR adds validation for task interval where it is updated.

There are 5 places in the TaskStore that we update the interval:
`schedule`, `bulkSchedule`, `update`, `bulkUpdate` and
`bulkPartialUpdate`

For the bulk operations we just skip the task with invalid interval, for
schedule and update throw an error and stop the execution.

## To verify:
Create a rule with connector.
Let it run for a while.
Then update the rule.

There shouldn't be any error.
2025-06-20 16:45:08 +02:00
Maxim Palenov
a013929fda
[Security Solution] Fix time duration normalization at rule schedule for day units (#224083)
**Addresses:** https://github.com/elastic/kibana/issues/223446

## Summary

This PR fixes an issue when time duration normalized to day(s) is shown as 0 seconds. The fix is performed by allowing using days time unit at rule schedule.

## Details

The issue happens when rule schedule's look-back gets normalized to day(s). The reason is that look-backs input doesn't support Days time unit. It leads to inability to parse the value and displaying the default value which is 0 seconds.

Rule schedule is shown to the users as rule `interval` and `look-back` while rule's SO saves the schedule by using three fields `interval`, `from` and `to`. Where `look-back` represents a logical value calculated as `lookback` = `to` - `from` - `interval`. Taking that into account it's becomes harder to maintain the original time duration unit value during prebuilt rules upgrade workflow (See https://github.com/elastic/kibana/pull/204317 for more details).

The easiest way to fix this issue is to allow Days time unit in rule schedule inputs. On top of that 24 hours are always 1 day making hours the largest simply convertible time unit. The PR allows hours in rule schedule.

**Before:**

https://github.com/user-attachments/assets/4f2038f1-4a6a-4a88-b86e-381a5b717605

**After:**

https://github.com/user-attachments/assets/74875bf2-9341-425f-a35f-c8b088c1ef6a
2025-06-20 16:42:42 +02:00
Gerard Soldevila
8efc526314
APEX-72 Enforce Kibana >= 8.18.0; Remove switchToModelVersionAt (#220985)
## Summary

* Address https://github.com/elastic/kibana/issues/217145 - Put in place
a check to ensure we're upgrading from Kibana 8.18.0 or newer.
* Address https://github.com/elastic/kibana/issues/220521 - New attempt
at removing the `switchToModelVersionAt` property, inspired on
https://github.com/elastic/kibana/pull/219029.

The previous attempt caused a regression: index meta information started
storing _modelVersions_ that were older than the previously stored ones,
which were defaulting to 10.0.0 for SO types that did NOT define
`modelVersions`.

This was due to the removal of the applyTypeDefaults, which was ensuring
all SOs had the `switchToModelVersionAt` property set.

This flag was then used by
`src/core/packages/saved-objects/base-server-internal/src/model_version/version_map.ts`
to determine whether to use `modelVersions` or the legacy `migrations`
property in order to determine the latest model version for a given
type.

When removing the `switchToModelVersionAt` flag (and its default
backfill), the logic started defaulting to the latest `migrations`
version for those SO types that were not defining any `modelVersion`,
resulting in older versions that those stored in the SO indices. This
caused incident https://elasticco.atlassian.net/browse/INC-3818.

This regression has been shipped in 9.0.0 (the PR was
[backported](https://github.com/elastic/kibana/pull/219329)), so in top
of the cleanup, we now need to address
https://github.com/elastic/kibana/issues/220521 to ensure a smooth
transition _OnPrem => Serverless_.

---------

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 16:41:54 +02:00
Irene Blanco
92ed032ee2
[Discover] Register traces recommended ES|QL queries in Observability (#224614)
## Summary

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

In this PR, we're using the new feature that allows us to register
recommended queries by plugin.

I’ve followed the [same approach as the logs
team](https://github.com/elastic/kibana/pull/224054/files), so the
implementation should be easy to merge.

The reasoning behind the query format is explained in [this
comment](https://github.com/elastic/kibana/issues/222908#issuecomment-2984919662),
but in short, we had to adapt and limit our queries to ensure they work
well across multiple data sources like ECS and OTel indexes.

|Index|Editor|ES\|QL help menu|
|-|-|-|
|**traces-***|![Screenshot 2025-06-19 at 19 24
54](https://github.com/user-attachments/assets/5abd272f-c4fb-4b17-9c8b-243cdcf7f486)|![Screenshot
2025-06-19 at 19 26
53](https://github.com/user-attachments/assets/4404b728-164a-4cc7-93c3-366a688f8bc5)|
|**logs-***|![Screenshot 2025-06-19 at 19 27
11](https://github.com/user-attachments/assets/3e939d81-16c7-4c13-9f0b-800560abf328)|![Screenshot
2025-06-19 at 19 27
32](https://github.com/user-attachments/assets/a190ac64-0c56-4368-be36-fa1ab81043a6)|

There's also a description for each of the queries that looks like this:
![Screenshot 2025-06-19 at 19 25
11](https://github.com/user-attachments/assets/639a4e7f-3807-45fa-8b8c-bc30b0db1296)


This is just the first batch of recommended queries, we’re definitely
planning to keep improving them and add more over time.

## How to test
- Access any Observability solution space
- Go to Discover in ES|QL mode
- Type `FROM logs-*` or `FROM traces-*` and hit space, the recommended
queries should appear
- Or go to ES|QL help > Recommended queries
2025-06-20 16:38:51 +02:00
Tim Rühsen
7935931eb3
[Profiling] Omit displaying +0x0 in ExeFileName (#224096)
## Summary

In Universal Profiling views, avoid to display the 0 value address
appended to executable file names.

Planned improvements on aggregations in the ES profiling plugin require
to reset the address for unsymbolized or partly symbolized frames.

For example, aggregating Kernel frames from two different hosts with
different kernel versions will currently end up with two distinct
entries in the TopN functions:
```
vmlinux: _raw_spin_unlock_irqrestore
vmlinux+0x124

vmlinux: _raw_spin_unlock_irqrestore
vmlinux+0x542
```
When aggregating these into a single line, displaying the address would
be misleading or wrong.
So the ES plugin may set the address to 0 for the aggregated entry
```
vmlinux: _raw_spin_unlock_irqrestore
vmlinux+0x0
```
Now, the `+0x0` seems superfluous and is not helpful to the user.
This PR would drop the address.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 16:38:23 +02:00
Charis Kalpakis
ce0d605fb4
Move apps/security and apps/spaces tests under platform 2025-06-20 17:17:48 +03:00
Julian Gernun
411ab215a5
[Response Ops][Connectors] New xpack.actions.email.services.enabled Kibana setting (#223363)
## Summary

Closes #220288

## Release note
New kibana setting `xpack.actions.email.services.enabled` to
enable/disable email services for email connector.
2025-06-20 16:10:43 +02:00
Jatin Kathuria
028660e4e1
[Automatic Migrations] Adds Tag based on vendor when custom rules are installed. (#224350)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

Fixes https://github.com/elastic/security-team/issues/12832

This PR adds tags based on vendor when custom rules are installed as
shown in the demo below.



https://github.com/user-attachments/assets/9b3cf3eb-176c-40a4-aa76-9941c9479298





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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-06-20 15:50:54 +02:00
Irene Blanco
d8f4454764
[Discover] Update "isSpan" logic in span waterfall flyout (#224654)
## Summary

Related to https://github.com/elastic/kibana/issues/221521

This PR updates the logic that determines whether a clicked node in the
waterfall is a span or a transaction, making it compatible with
non-processed OTel traces data.

The approach used is the same as in the document profile enablement:


d80885a454/src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_document_profile/span_document_profile/profile.ts (L70-L79)

**Extra fix**
- Added a focus trap to the flyout because without it, focus sometimes
stayed on the waterfall behind, causing unexpected behavior when trying
to filter in the "Table" tab.

## How to test

- Enable the discover profiles by adding this to the` kibana.yml `file:
```discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
  - observability-traces-transaction-document-profile
  - observability-traces-span-document-profile
```
- Make sure your space has Observability as Solution View.
- Open Discover and query non-processed OTel traces
- Open any flyout and go to the full screen waterfall
- Click on any node of the trace, it should be opened as "Span document"
2025-06-20 15:39:50 +02:00
Irene Blanco
88e32532ee
[Discover][Trace waterfall] Update link to relate errors to use QSTR (#224637)
## Summary

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

The “View related errors” link in the full-screen waterfall was
resolving to an invalid ES|QL query in some specific scenarios (it
worked fine in edge-oblt, for example).

To work around this and make the query less restrictive for ES|QL, we’ve
updated it to use `QSTR` instead. It provides the same type of search
and gives us the expected results without triggering errors.

**Before**
![Screen Recording 2025-06-20 at 09 46
13](https://github.com/user-attachments/assets/4d1c0c19-dbc0-42b2-aba9-194f121eb1c5)
**After**
![Screen Recording 2025-06-20 at 09 43
32](https://github.com/user-attachments/assets/69e0f580-84b8-4c0e-93e7-ebc907e975b0)


## How to test

- Enable the discover profiles by adding this to the` kibana.yml `file:
```discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
  - observability-traces-transaction-document-profile
  - observability-traces-span-document-profile
```
- Make sure your space has Observability as Solution View.
- Open Discover and query a trace with errors
- Open any flyout and go to the full screen waterfall
- Click on "View related links" on any of the nodes
2025-06-20 15:39:36 +02:00
Kibana Machine
ce2fd06342 skip failing test suite (#224475) 2025-06-20 15:26:54 +02:00
Robert Stelmach
4741e67d5c
[Streams 🌊] Listing and overview page improvements (#223603)
## 📝 Summary
Closes: [#238](https://github.com/elastic/streams-program/issues/238)

This pull request introduces enhancements to the classic streams,
focusing on visual updates, improved user interface elements, and the
addition of new assets. Things that were done in this PR :

- Improve page template to have transparent background and short
description
- Replaced old images with new ones
- Introduced new empty state for streams list
- Added sorting to streams list table 
- Improved loading indicators
- Aligned streams tree table with designs and added loading indicators
- Added tooltips to modify streams tabs as well as retention badge and
stream-type badge
- Modified `Component templates` table according to new designs



##  🎨 Previews
Empty State Before: ![empty state
before](https://github.com/user-attachments/assets/120b36b7-ff7b-4cb4-ab70-40908aa62f95)
Empty State After: ![empty_state
after](https://github.com/user-attachments/assets/f3f7529a-f2f8-4900-86b0-1bc938ed5264)

Streams List with no data Before: 
![streams list no data
before](https://github.com/user-attachments/assets/c98d6095-88b0-4eaf-8c04-d1934cd1406a)
Streams List with no data After:
![streams list no
data](https://github.com/user-attachments/assets/00612e5d-5abb-48b0-9837-ca769bd96b66)


Streams List Before:
![streams list with data
before](https://github.com/user-attachments/assets/2f66bc32-3cf8-43ce-989c-91d5b72d4622)
Streams List After:
![streams_list with
data](https://github.com/user-attachments/assets/4f6a5987-de75-49b2-8e0e-86dfef130557)

Component Templates Before:
![Component templates
before](https://github.com/user-attachments/assets/5091eaa2-7983-48f0-ba68-808692235be4)
Component Templates After:
![component templates
after](https://github.com/user-attachments/assets/cc590c88-6170-4bc1-a18d-faf870163098)

### Small demo of streams being loaded 


https://github.com/user-attachments/assets/f4a9ec48-ee01-4791-b874-03afeb7f719a

## 🔧   How to test 

- In dev console in kibana run POST kbn:/api/streams/_enable. This will
enable the streams UI and put mappings and pipelines for the main logs
stream into place
- Reload the page
- Navigate to the streams app in navigation
- Ingesting data through synthrace: `node scripts/synthtrace.js
sample_logs --live --kibana=http://elastic:changeme@localhost:5601
--target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000`

For more info check this
[README](https://github.com/elastic/streams-program) file

Also please check the [issue and
discussion](https://github.com/elastic/streams-program/issues/238) for
more context

##  Discussion 

if you think that there is something else that needs improvements for
classic streams, let me know so we can include it in this PR

## 🖌  Designs 

[Figma](https://www.figma.com/design/MgwQzRrh2CWFSE711GEW1o/Streams-Index-and-Onboarding?node-id=1343-139771&m=dev&focus-id=1344-51082)
[New Images

](3199369221)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 15:24:17 +02:00
Elena Stoeva
b572bf42e3
[Console] Add custom context menu (#217865)
Fixes https://github.com/elastic/kibana/issues/204668

## Summary

This PR adds a custom context menu to Console that correctly copies,
cuts, and pastes the selected text in the editor. Previously, when we
did right click (or Ctrl + click), the native browser context menu is
open but only the word on which we clicked was selected, rather than the
whole selected text in the editor. This is because the native browser
context menu is not aware of Monaco's selection and treats the text in
the editor as regular text in the browser. To fix this, we add a custom
context menu that is aware of Monaco editor's selection, which correctly
copies and cuts the selected text.

**Note for changes in CodeEditor component**: In order to enable the
custom context menu, we need to add the `import
'monaco-editor/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js';`
import, which would enable the Monaco context menu in all code editors
in Kibana unless we explicitly disable it with `contextmenu: false`,
which we do in the CodeEditor component as a default behavior. This
ensures that all other code editors in Kibana still have the native
browser context menu. @elastic/appex-sharedux please let us know if you
would like us to add this custom context menu to the Code editor
component so that all editors in Kibana have the same context menu with
a correct behaviour.


https://github.com/user-attachments/assets/ceb65438-a17e-46fd-be6a-a1cce4d98df7
2025-06-20 15:02:26 +02:00
elastic-renovate-prod[bot]
197284cebb
Update docker.elastic.co/wolfi/chainguard-base-fips:latest Docker digest to d55453a (main) (#223586)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| docker.elastic.co/wolfi/chainguard-base-fips | digest | `799fc6d` ->
`d55453a` |

---

### 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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOk9wZXJhdGlvbnMiLCJiYWNrcG9ydDpza2lwIiwiY2k6YnVpbGQtZG9ja2VyLWZpcHMiLCJyZWxlYXNlX25vdGU6c2tpcCJdfQ==-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-06-20 07:54:05 -05:00
Brijesh Khunt
3fcdc062fa
XSOAR Connector (#212049)
## Summary

XSOAR action connector, enabling users to send alerts generated by the
rule detection engine to Palo Alto XSOAR for automation and remediation.

### **create connector**

![xsoar-connector](https://github.com/user-attachments/assets/14d9791b-0242-42b5-b9e4-975d7f6826cc)

### **test connector**
1. **test page**

![xsoar-params-test](https://github.com/user-attachments/assets/2bdd3b79-7f5f-4d52-836b-f458c390e55c)

2. **select playbook**

![xsoar-select-playbook](https://github.com/user-attachments/assets/23787b24-31b0-4f56-b451-0e8b42c79797)

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

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-06-20 14:50:07 +02:00
Sergi Massaneda
31fe87ae06
[Security Solution][Auto migrations] Implement migration stop/resume UI (#224102)
## Summary

Implement migration task stop/resume functionality in the UI.

The _stop_ process takes a bit longer than the _resume_, that's because
we ensure the aborted langGraph invocation completely settles, and the
background process is terminated, before showing the _resume_ action,
which involves polling for the migration state for a while.

## Screenshots


![ready](https://github.com/user-attachments/assets/12a15a79-974d-4ee7-97cd-70d7ce185e89)

Stop feature demo: 


https://github.com/user-attachments/assets/37727d0c-c248-45ff-b9c7-220a59c153f6
2025-06-20 08:48:13 -04:00
Paul Tavares
f5d8d9a1db
[Security Solution][Endpoint] Adds logic to the Fleet Package Policy delete extension point to update response actions (#224336)
## Summary

This change is in support of space awareness which is currently behind a
feature flag:

- Adds new processing logic to the Fleet package policy delete extension
point to update response action that reference that package policy with
a tag indicating that policy was deleted
- This check is done for all packages that support response actions -
currently `endpoint`, `crowdstrike`, `microsoft_defender_endpoint` and
`sentinel_one`




### 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-06-20 08:32:32 -04:00
Paul Tavares
e93b16be18
[Security Solution][Endpoint] Add support for a new tags fields for response actions requests in support of space awareness (#224329)
## Summary

The following changes are being done in support of space awareness:

- Ensure that a `tags` field is added to the response actions request DS
index
- FYI: the elastic defend package will soon also be updated with this
new field
- Update migration of response actions to populate the new `tags` field
with `INTEGRATION-POLICY-DELETED` for cases where the migration is
unable to determine the policy information associated with the agent(s)
the action was sent to
- Update internal response action utilities that retrieve action request
to ensure `tags` is an array


### 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-06-20 08:30:33 -04:00
Vitalii Dmyterko
93c09fbe8d
[Security Solution][Detection Engine] fixes EQL logged requests preview (#224403)
## Summary

- fixers issue when EQL request body was not properly logged in preview
logged requests

### Before

<img width="667" alt="Screenshot 2025-06-18 at 11 33 37"
src="https://github.com/user-attachments/assets/e9d62c7e-bd4f-49fc-8642-fb961a3113fd"
/>


### After

<img width="689" alt="Screenshot 2025-06-18 at 11 30 20"
src="https://github.com/user-attachments/assets/ebcd1040-15f7-48e2-880a-5cc8ea1cba62"
/>
2025-06-20 14:29:55 +02:00
Angela Chuang
fde7604f47
[Security Assistant] Add the option to delete bulk conversations for the AI Settings page (#223136)
## Summary

This PR adds a new api for deleting all conversations without providing
conversation ids. It takes excluded ids to skip the conversations that
are not going to be deleted.

example: Deleting all conversations except the latest one.

<img width="2558" alt="Screenshot 2025-06-19 at 10 28 19"
src="https://github.com/user-attachments/assets/eef4c9ef-1415-47b4-ad84-957bfd7f6874"
/>

```
delete `/app/management/kibana/securityAiAssistantManagement`
{"excludedIds":["7X-Dh5cBzHjHjpq0iVDH"]}
```

To test: (Test env:
https://p.elstc.co/paste/UjwhcpLK#-Bi4EAfwWwrJNg0kCHz4mZVDy8k16HtNlf9FdJgUM7K)
1. Add some conversations from dev tools:


<details>
  <summary><i>mock conversations:</i></summary>

```
POST .kibana-elastic-ai-assistant-conversations-default/_bulk
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 3",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T08:20:00Z",
      "content": "Tell me a joke.",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T08:20:01Z",
      "content": "Why did the chicken cross the road? To get to the other side!",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T08:20:01Z",
    "confidence": "low",
    "content": "User asked for a joke, assistant provided one.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-003",
    "value": "value-003"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 4",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T08:30:00Z",
      "content": "What is the capital of France?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T08:30:01Z",
      "content": "The capital of France is Paris.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T08:30:01Z",
    "confidence": "high",
    "content": "User asked about the capital of France, assistant answered correctly.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-004",
    "value": "value-004"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 5",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T08:40:00Z",
      "content": "How do I reset my password?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T08:40:01Z",
      "content": "To reset your password, go to settings and click 'Reset Password'.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T08:40:01Z",
    "confidence": "medium",
    "content": "User asked how to reset password, assistant provided instructions.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-005",
    "value": "value-005"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 6",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T08:50:00Z",
      "content": "What is the meaning of life?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T08:50:01Z",
      "content": "The meaning of life is subjective and varies for each individual.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T08:50:01Z",
    "confidence": "low",
    "content": "User asked philosophical question, assistant provided general answer.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-006",
    "value": "value-006"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 7",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T09:00:00Z",
      "content": "Can you help me with my homework?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T09:00:01Z",
      "content": "Sure! What subject is your homework in?",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T09:00:01Z",
    "confidence": "high",
    "content": "User asked for homework help, assistant offered to assist.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-007",
    "value": "value-007"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 8",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T09:10:00Z",
      "content": "What is the best programming language?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T09:10:01Z",
      "content": "It depends on your needs, but Python is a great choice for beginners.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T09:10:01Z",
    "confidence": "medium",
    "content": "User asked about programming languages, assistant provided recommendation.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-008",
    "value": "value-008"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 9",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T09:20:00Z",
      "content": "How do I improve my writing skills?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T09:20:01Z",
      "content": "Practice regularly, read widely, and seek feedback.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T09:20:01Z",
    "confidence": "high",
    "content": "User asked about writing skills, assistant provided tips.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-009",
    "value": "value-009"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 10",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T09:30:00Z",
      "content": "What is the best way to learn a new language?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T09:30:01Z",
      "content": "Immersion, practice speaking, and using language learning apps are effective.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T09:30:01Z",
    "confidence": "medium",
    "content": "User asked about language learning, assistant provided methods.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-010",
    "value": "value-010"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 11",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T09:40:00Z",
      "content": "What are some tips for public speaking?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T09:40:01Z",
      "content": "Practice, know your material, and engage with your audience.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T09:40:01Z",
    "confidence": "high",
    "content": "User asked about public speaking, assistant provided tips.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-011",
    "value": "value-011"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 12",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T09:50:00Z",
      "content": "How can I improve my time management skills?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T09:50:01Z",
      "content": "Prioritize tasks, set deadlines, and use tools like calendars.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T09:50:01Z",
    "confidence": "medium",
    "content": "User asked about time management, assistant provided strategies.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-012",
    "value": "value-012"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 13",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T10:00:00Z",
      "content": "What are some effective study techniques?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T10:00:01Z",
      "content": "Active recall, spaced repetition, and summarization are effective.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T10:00:01Z",
    "confidence": "high",
    "content": "User asked about study techniques, assistant provided methods.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-013",
    "value": "value-013"
  }
}
{ "create": {}}
{
  "@timestamp": "2025-06-10T08:00:00Z",
  "title": "Example Conversation 14",
  "api_config": {
      "action_type_id": ".inference",
      "connector_id": "elastic-llm"
    },
  "messages": [
    {
      "@timestamp": "2025-06-10T10:10:00Z",
      "content": "How can I enhance my critical thinking skills?",
      "is_error": false,
      "role": "user",
      "metadata": {
        "content_references": {}
      }
    },
    {
      "@timestamp": "2025-06-10T10:10:01Z",
      "content": "Engage in debates, analyze arguments, and reflect on your reasoning.",
      "is_error": false,
      "role": "assistant",
      "metadata": {
        "content_references": {}
      }
    }
  ],
  "summary": {
    "@timestamp": "2025-06-10T10:10:01Z",
    "confidence": "medium",
    "content": "User asked about critical thinking, assistant provided tips.",
    "public": true
  },
  "users": [
    {
      "name": "elastic",
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
    }
  ],
  "replacements": {
    "uuid": "repl-014",
    "value": "value-014"
  }
}
```

</details>

2. Visit `/app/management/kibana/securityAiAssistantManagement` and try
deleting conversations.

If it's a delete all request, the request should look like this:
```
delete `/app/management/kibana/securityAiAssistantManagement`
```


<img width="1281" alt="Screenshot 2025-06-16 at 12 59 01"
src="https://github.com/user-attachments/assets/9f9562f3-b5d8-4c3b-9418-8550ce24a6b0"
/>



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 13:24:23 +01:00
Kibana Machine
c019b59b41
[ES|QL] Update grammars (#224562)
This PR updates the ES|QL grammars (lexer and parser) to match the
latest version in Elasticsearch.

Changes:

- moves sample on tech preview
<img width="818" alt="image"
src="https://github.com/user-attachments/assets/24441300-72c5-4055-b316-6e9ad3939d0a"
/>

- Sample now supports variables
- Fork is on tech preview but I didn't do this at this PR, I will do on
a follow up PR
- there is a breaking change in from, we dont allow anymore
"index"::"selector", fixed the tests and the parsers
- small changes in like, rlike expressions

---------

Co-authored-by: Stratoula <efstratia.kalafateli@elastic.co>
2025-06-20 14:08:51 +02:00
Khristinin Nikita
22ad75055c
Enable FF for gaps by default (#224659)
## Enable FF for gaps by default
2025-06-20 14:05:14 +02:00
Mark Hopkin
32820f965b
[Entity Analytics][Privmon] swap labels.monitoring.privileged_users (string) to user.is_privileged (boolean) (#224623)
## Summary

We have [this RFC](https://github.com/elastic/ecs/pull/2493) in, I think
this is a safer bet and might save us a migration in the future:

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 12:39:49 +01:00
Viduni Wickramarachchi
1fbbe2922e
[Obs AI Assistant][Anonymization] Update SLO starter prompt (#224493) 2025-06-20 07:21:08 -04:00
Søren Louv-Jansen
49d366c70a
[Obs AI Assistant] Disable in Logs Essentials mode (#223236)
Closes https://github.com/elastic/observability-dev/issues/4498
Closes https://github.com/elastic/obs-ai-assistant-team/issues/257
2025-06-20 12:47:25 +02:00
Pierre Gayvallet
04b294e67d
[onechat] add first set of base tools (#223367)
## Summary

Fix https://github.com/elastic/search-team/issues/10121

Add a base set of retrieval oriented tools, and expose them to the
default agent.

## Tools

**Warning: names are still TBD**

We're starting to see two different "layers" of tool appear: "simple"
tools, which are doing a simple programmatic (understand: no LLM) task,
and "smart" tools, which are more like workflows, with some of the steps
relying on a LLM.

This PR introduces the following tools:

### Simple tools

Simple tools (name TBD) are "programmatic" tools not relying on an LLM
for their execution.

This PR introduces this base set of tools:

- `get_document_by_id`: resolve a full document based on its id/index.
- `list_indices`: list the indices the current user has access to.
- `get_index_mappings`: retrieve the full mappings based for a given
index.
- `execute_esql`: executes a provided ES|QL query

### Smart tools

Smart tools can have multiple internal steps (even if it remains an
implementation detail), and are using LLM calls for some, or all, of
them.

*Note: there are huge potential areas of improvement in the current
implementation of all those smart tools. One of the intent of this work
is precisely to identify such areas of improvement*

#### `index_explorer`

Based on a natural language query, returns a list of indices that should
be searched, and their corresponding mappings.

<img width="984" alt="Screenshot 2025-06-17 at 16 44 32"
src="https://github.com/user-attachments/assets/edff3964-31e3-40ea-a761-adf7c45fcb17"
/>


#### `generate_esql`

Based on a natural language query, generates an ES|QL query.

- use the `nl-2-esql` task under the hood
- optional use `index-explorer` if `index` is not specified.

<img width="891" alt="Screenshot 2025-06-17 at 16 51 56"
src="https://github.com/user-attachments/assets/ce141d6b-dd4f-4eb9-ab32-823b81bc810b"
/>


#### `relevance_search`

Perform a "full-text search" based on given term and returns the most
relevant highlights.

<img width="1071" alt="Screenshot 2025-06-17 at 16 59 49"
src="https://github.com/user-attachments/assets/1f873e70-e277-424d-93e4-24b269a554e5"
/>

#### `natural_language_search`

Retrieve data based on a natural language query.

Converts a natural language query to an ES|QL one then executes it,
useing `generate_esql` and `execute_esql` under the hood.

<img width="768" alt="Screenshot 2025-06-18 at 08 31 52"
src="https://github.com/user-attachments/assets/cb319831-17ed-4ad7-9e1f-2fe90c2472fa"
/>

## Researcher assistant

The second part of this PR is implementing a researcher agent for deep
research tasks.

The researcher assistant is following a very classic
"act->process->reflect" cycle.

<img width="960" alt="Screenshot 2025-06-18 at 09 16 17"
src="https://github.com/user-attachments/assets/c24be323-ecf2-4c43-88fb-eaf874b18afc"
/>

The implementation of the cycle is currently as follow:

**1. Act**

Given a research topic, the research history and a list of tools, select
the tool best suited to search for this topic, and call it.

The tools exposed to the agent in this phase are:
- `index_explorer`
- `relevance_search`
- `nl_search`

*Note: later the whole `act` step could evolve to instead call sub
search agent with planning and multi-step execution.*

**2. Process**

Process the results from the latest `act` phase and create a
corresponding entry in the search log.

At the moment, we're simply storing the whole tool call + results to the
search log in a LLM-friendly format.

**3. Reflect**

Based on the main research query and the search log, identify where the
information collected are enough to answer the question. If not,
identify follow-up questions or sub-problems that it would be useful to
solve to gather more information

## What is out of scope of the current PR

- Figuring out which set of tools should be exposed by default to the
main agent (right now, all the tools listed in this PR are)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 12:19:34 +02:00
Abdul Wahab Zahid
d80885a454
[Dataset Quality] Fix ES Promotion forward compatibility test failures for ES 9.0 (#224629)
The PR skips test suites for ES `9.0.*` which were failing when these
tests ran in Kibana `8.19` branch against ES `9.0.*` in forward
compatibility runs. The tests were failing because the index privilege `read_failure_store` isn't available available in ES 9.0.
2025-06-20 12:11:59 +02:00
Christos Nasikas
61113a0c46
[ResponseOps][Alerting] Do not return alerts from internally managed rule types (#223453)
## Summary

This PR introduces the concept of internally managed rule types. The
purpose of this PR is to hide alerts in the alerts table in the UI
produced by internally managed rule types. In following PRs, we will
enhance the framework to handle more cases when the product requirements
are clearer. If, in the future, the streams team wants to use the alerts
table to show stream alerts, we could introduce a new parameter in the
alerting API to allow alerts produced by internally managed rule types
to be returned.

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

cc @kdelemme @dgieselaar 

### 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: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-06-20 11:42:01 +02:00
Umberto Pepato
b0aa031994
[ResponseOps][Cases] Add timing metrics to cases SO (#219070)
## Summary

- Adds the `in_progress_at` timestamp to Cases Saved Objects
- Adds the `time_to_acknowledge`, `time_to_investigate` and
`time_to_resolve` timing metrics to Cases Saved Objects

## References

Closes #217638

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed (passed )

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
2025-06-20 12:34:37 +03:00