Commit graph

801 commits

Author SHA1 Message Date
James Gowdy
308e1815da
[ML] File upload lite UI customizations (#213275) 2025-03-06 15:12:39 +00:00
Julia Bardi
198b99ee10
[Fleet] unskip test (#213365)
Closes https://github.com/elastic/kibana/issues/192793
Closes https://github.com/elastic/kibana/issues/192792
2025-03-06 15:20:39 +01:00
Robert Jaszczurek
ae74cc35a9
[ML] Anomaly Explorer: Fix incorrect overall swim lane height in Anomaly Explorer (#213245)
Fix for: https://github.com/elastic/kibana/issues/211017

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

After the fix:

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

![image](https://github.com/user-attachments/assets/19073e4d-b600-4333-8c85-cf7939a071ac)
2025-03-06 14:33:20 +01:00
Marco Liberati
48926e5173
[Lens] Do not crash when editing a Lens chart with a by reference annotation layer (#213090)
## Summary

Fixes #212917

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

New tests have been added to smoke test this scenario.

### Checklist

Check the PR satisfies following conditions. 

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

---------

Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
2025-03-06 12:44:30 +01:00
Nathan Reese
04ee5fc4f3
[embeddable] remove EmbeddableInput type (#211949)
EmbeddableInput type is part of the legacy embeddable system. The legacy
embeddable system is being removed and as such, the EmbeddableInput type
is being removed.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-05 18:41:00 -07:00
Pete Harverson
a1c520c49d
[ML] Migrate anomaly explorer components from SCSS to Emotion (#212793)
## Summary

Part of: https://github.com/elastic/kibana/issues/140695
Migrates SCSS to emotion for several of the components used across the
Anomaly Explorer and Single Metric Viewer.

Removes the following SCSS files:

```
- x-pack/platform/plugins/shared/m/public/application/components/annotations/annotation_description_list/_index.scss
- x-pack/platform/plugins/shared/ml/public/application/components/entity_cell/_index.scss
- x-pack/platform/plugins/shared/ml/public/application/components/entity_cell/entity_cell.scss
- x-pack/platform/plugins/shared/ml/public/application/components/help_popover/help_popover.scss
- x-pack/platform/plugins/shared/ml/public/application/components/detector_description_list/_detector_description_list.scss
- x-pack/platform/plugins/shared/ml/public/application/components/rule_editor/components/detector_description_list/_index.scss
- x-pack/platform/plugins/shared/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/_explorer_chart_label_badge.scss
- x-pack/platform/plugins/shared/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/entity_filter/_entity_filter.scss
```

Components edited:
- Help popover

<img width="759" alt="Screenshot 2025-02-28 at 16 28 27"
src="https://github.com/user-attachments/assets/bc182d45-465b-406c-b122-921576ae8304"
/>

- Annotation description list:

<img width="952" alt="Screenshot 2025-02-28 at 16 29 16"
src="https://github.com/user-attachments/assets/71cae50c-41be-4299-8362-92567b73188e"
/>


- Rule editor detector description list:

<img width="674" alt="Screenshot 2025-02-28 at 16 30 02"
src="https://github.com/user-attachments/assets/f94a6878-3063-488f-85c5-2e6ee77bf1ad"
/>

- Anomalies table entity filters:

<img width="506" alt="Screenshot 2025-02-28 at 16 30 53"
src="https://github.com/user-attachments/assets/f074f175-9310-4a70-97b6-09be44af2ad2"
/>

- Explorer chart label badge and entity filters:

<img width="362" alt="Screenshot 2025-02-28 at 16 31 37"
src="https://github.com/user-attachments/assets/dd46ab81-e115-4e8c-ae00-864c83127c16"
/>

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-05 17:27:03 +00:00
Luke Gmys
529a8573fa
[Case Observables] Implement server side validation (#209706)
## Summary

This PR introduces validation rules for Case Observables, shared between
client and the server.

### Testing

- Create a case
- Add on observable to it, picking up the ipv4 as an observable type
(for instance)
- Verify that only the valid values are allowed.
- Try updating the observable after it is created, same validation rules
apply.
- Do the same thing using API routes.
2025-03-05 17:03:45 +01:00
Nicolas Chaulet
680bf587df
[Fleet] Tabular UI for installed integrations (#212582) 2025-03-05 08:56:02 -05:00
Ievgen Sorokopud
85555042be
[Attack Discovery][Scheduling] Add a new feature flag to hide scheduling feature (#12005) (#213148)
## Summary

Feature description: [internal
link](https://github.com/elastic/security-team/issues/10142)
Addresses: [internal
link](https://github.com/elastic/security-team/issues/12005)

These changes introduce a new feature flag to control visibility of the
Attack Discovery Scheduling feature.

To enable the flag:

> xpack.securitySolution.enableExperimental:
['assistantAttackDiscoverySchedulingEnabled']
2025-03-05 12:18:49 +01:00
Søren Louv-Jansen
0fb83efd82
[Obs AI Assistant] Add API test for get_alerts_dataset_info tool (#212858)
Follow-up to: https://github.com/elastic/kibana/pull/212077

This PR includes an API test that covers `get_alerts_dataset_info` and
would have caught the bug fixed in
https://github.com/elastic/kibana/pull/212077.

It also contains the following bug fixes:

- Fix system message in `select_relevant_fields`
- Change prompt in `select_relevant_fields` so that the LLM consistently
uses the right format when responding.
2025-03-05 09:09:22 +01:00
Patryk Kopyciński
5e742f0425
[Security Assistant] Fix use default inference endpoint (#212191)
## Summary

Removes internal feature flag responsible for switching to Kibana's
internal inference endpoint instead of using a dedicated one.

How to test:

**Clean cluster:**
**1. Setup KB**
**2. Make sure the `.kibana-elastic-ai-assistant-knowledge-base-*` Data
Stream is using default Inference endpoint**
```
http://localhost:5601/app/management/data/index_management/component_templates/.kibana-elastic-ai-assistant-component-template-knowledge-base
```
<img width="1656" alt="image"
src="https://github.com/user-attachments/assets/84fda205-6272-4393-8f7d-a449fae2a090"
/>

<img width="1086" alt="image"
src="https://github.com/user-attachments/assets/19e562ec-da5f-4ec2-ab64-7bfb1d64789c"
/>

**3. Make sure there is no inference endpoint on the list**
<img width="1875" alt="image"
src="https://github.com/user-attachments/assets/3465df8b-7c0d-4faf-b113-df897694521e"
/>

**4. Make sure Security Labs content exists on KB list and you can add
and edit Document/Index entry
```
http://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=knowledge_base
```

Migration:
**1. Setup KB on at least 2 Kibana spaces on `main` branch**
**2. Switch to this PR's branch and start Kibana**
**3. Make sure there is no inference endpoint on the list**
```
http://localhost:5601/app/elasticsearch/relevance/inference_endpoints
```
<img width="1875" alt="image"
src="https://github.com/user-attachments/assets/3465df8b-7c0d-4faf-b113-df897694521e"
/>

**4. Make sure that the Data stream was rolled over**
```
http://localhost:5601/app/management/data/index_management/indices?filter=know&includeHiddenIndices=true
```
Should see two indices per Kibana space:
<img width="1741" alt="Zrzut ekranu 2025-03-3 o 15 37 55"
src="https://github.com/user-attachments/assets/e6da48c8-59e9-43b8-8eac-c2b5e0059954"
/>

The older index per space should have mapping:
<img width="1083" alt="image"
src="https://github.com/user-attachments/assets/01f6e422-77d1-4f8b-8b7e-9c541a7ea47c"
/>

Newer index per space:
<img width="1086" alt="image"
src="https://github.com/user-attachments/assets/19e562ec-da5f-4ec2-ab64-7bfb1d64789c"
/>

**4. Make sure Security Labs content exists on KB list and you can add
and edit Document/Index entry
```
http://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=knowledge_base
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-05 02:14:08 +01:00
Krzysztof Kowalczyk
c3c8f7befb
[Global Search] Register custom integrations search provider (#213013)
## Summary

This PR creates search provider for custom integrations so they show up
in Global Search.
Closes: #115778
2025-03-05 00:00:33 +01:00
Arturo Lidueña
b331fa1c53
[Observability AI Assistant] duplicate conversations (#208044)
Closes #209382

### Summary:

#### Duplicate Conversation  
- **Readonly** → Public conversations can only be modified by the owner.
- Duplicated conversations are **owned** by the user who duplicates
them.
- Duplicated conversations are **private** by default `public: false`. 
  

https://github.com/user-attachments/assets/9a2d1727-aa0d-4d8f-a886-727c0ce1578c

UPDATE:


https://github.com/user-attachments/assets/ee3282e8-5ae8-445d-9368-928dd59cfb75

### 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)
2025-03-04 23:15:37 +01:00
Kevin Delemme
df59c26083
feat(slo): update preview data API to show groups (#211801) 2025-03-04 17:04:10 -05:00
Joey F. Poon
647a183e3b
[Security Solution] defend insights langgraph upgrade (#211038)
## Summary

This is intended to be a "minimal" migration for Defend Insights to
langgraph + output chunking. Other than the increased events due to the
context increase from output chunking, the functionality is unchanged.

* migrates defend insights to langgraph
* adds output chunking / refinement


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-03-04 19:43:28 +01:00
Nicolas Chaulet
d3d44defa4
[Fleet] Use streaming for package install instead of an assetsMap with everything loaded in memory (#211961) 2025-03-04 13:15:34 -05:00
Krzysztof Kowalczyk
4447a7050a
[Global Search] Add ILM keyword (#213122)
## Summary

This PR adds an `ILM` keyword to the ILM application, so searching for
the keyword in Global Search would match it.
![Screenshot 2025-03-04 at 16 23
52](https://github.com/user-attachments/assets/36b12d59-62df-41c9-be48-5e2615aad299)
Closes: #150424
2025-03-04 18:31:52 +01:00
Mason Herron
5903c7a552
[Fleet] Improve validation for dynamic Kafka topics (#212422)
Closes #206194 


## Summary

- Removed hardcoded wrapping of user-entered topics with `%{[]}` to fix
issues arising from the user pre-wrapping, and also allow greater
flexibility in naming
- Added validation rules to check for unclosed brackets & brackets with
missing `%` preceding
- Added the auto-wrapping to the `value` field of items chosen from the
dropdown to ensure they were always wrapped as intended
### 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

n/a

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 18:18:35 +01:00
Joe Reuter
02b9f8f249
🌊 Streams: Disable AI suggestions button if there is no sample data (#213113)
This PR makes the AI suggestions button more stable in case of
misconfigured fields:
* Only make the button clickable if there are sample values
* Filter out sample documents that don't have the required field on the
server (would have broken the request before)

<img width="344" alt="Screenshot 2025-03-04 at 15 43 23"
src="https://github.com/user-attachments/assets/12045985-cfac-4a13-a23c-595ac6503c1a"
/>
2025-03-04 17:46:14 +01:00
Viduni Wickramarachchi
ad8c3e7be5
[Obs AI Assistant] Update date category label (#213108) 2025-03-04 17:20:12 +01:00
Nathan Reese
b213eb6bb2
[embeddable] replace Embeddable ViewMode with presentation-publishing ViewMode (#211960)
Embeddable ViewMode is part of legacy embeddable architecture. This PR
removes Embeddable ViewMode and replaces its usage with
presentation-publishing ViewMode. presentation-publishing ViewMode is a
string literal type so an enum is no longer needed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 09:05:23 -07:00
Nicolas Chaulet
601e4de6b8
[Fleet] Fix space selector space color,label for readonly spaces (#212941) 2025-03-04 16:08:25 +01:00
Bharat Pasupula
715a72fa18
[Automatic Import] Fix unstructured syslog flow (#213042)
## Summary

This PR fixes the Unstructured syslog flow. It picks up 5 samples send
them to LLM to create a pattern and tests all the samples against the
pattern , collects the unparsed samples [ if any ] , send them in for
next round of pattern check and so on.

This creates a list of patterns that matches all the samples and creates
a grok processor with those patterns and it breaks the syslogs down into
a JSON for ECS mapping , categorization and related graphs.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-03-04 16:02:14 +01:00
Zacqary Adam Xeper
367ff8dbec
[Response Ops] [Rule Form] Add Rule Form Flyout v2 (#206685)
## Summary

Part of #195211

Replaces the create/edit rule flyout with the new rule flyout

<img width="1032" alt="Screenshot 2025-01-14 at 3 12 30 PM"
src="https://github.com/user-attachments/assets/9cbcf4f8-1078-4f7e-a55a-aacc2d877a14"
/>
<img width="1383" alt="Screenshot 2025-01-14 at 3 12 52 PM"
src="https://github.com/user-attachments/assets/2270d57b-9462-4898-9dd0-41baefcc02d4"
/>

Restores the confirmation prompt before canceling or saving a rule
without actions defined.

Also fixes most of the design papercuts in the Actions step:

<img width="494" alt="Screenshot 2025-01-14 at 3 11 06 PM"
src="https://github.com/user-attachments/assets/3cf21d43-88e0-4250-b290-a545e1ebdbcf"
/>
<img width="494" alt="Screenshot 2025-01-14 at 3 11 01 PM"
src="https://github.com/user-attachments/assets/00ef3f95-c91b-4bb7-aead-a3e23c02f7df"
/>





### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 16:52:58 +02:00
Julia Bardi
72d760e5c3
[Fleet] fix telemetry test (#213050)
## Summary

Fix https://github.com/elastic/kibana/issues/211514

It seems the failure is because of the order difference in
`agent_logs_top_errors`.

The other differences shouldn't matter because we are using `
expect.objectContaining` on the result object.
2025-03-04 14:43:51 +01:00
James Gowdy
b26d85bd98
[ML] File upload enable consistent-type-imports eslint rule (#212044)
Enabling `consistent-type-imports` rule and running `node scripts/eslint
--no-cache --fix` to fix every type import.

Every other ML owned plugin has this rule enabled. Originally added in
https://github.com/elastic/kibana/pull/176921

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-04 12:57:23 +00:00
Ievgen Sorokopud
7db897a539
[Bug] [Assistant API] - Do not allow empty conversation ID in chat/complete route (#11783) (#213049)
## Summary

BUG: https://github.com/elastic/security-team/issues/11783

This PR fixes the behaviour of the
`/api/security_ai_assistant/chat/complete` route where the
`conversationId` can be passed as an empty string. This may lead to
unexpected results described in
https://github.com/elastic/security-team/issues/11783#issuecomment-2696529040.

### Expected behaviour

We should throw a bad request (400) http error when empty
`conversationId` has been passed.

### Testing

* Use this `curl` command to test the endpoint.

```
curl --location 'http://localhost:5601/api/security_ai_assistant/chat/complete' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data '{
  "connectorId": "{{my-gpt4o-ai}}",
  "conversationId": "",
  "isStream": false,
  "messages": [
    {
      "content": "Follow up",
      "role": "user"
    }
  ],
  "persist": true
}'
```

You should see next error as a response:

```
{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "[request body]: conversationId: String must contain at least 1 character(s), conversationId: No empty strings allowed"
}
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-04 13:05:51 +01:00
Bharat Pasupula
8970b99d4f
Fix Incomplete string escaping or encoding (#212847)
Fix for
[https://github.com/elastic/kibana/security/code-scanning/546](https://github.com/elastic/kibana/security/code-scanning/546)

To fix the problem, we need to ensure that backslashes are also escaped
in the `trim_key` and `trim_value` properties of the `kvInput` object.
This can be done by adding an additional replace call to escape
backslashes before escaping single and double quotes. The best way to
fix this without changing existing functionality is to use a regular
expression with the `g` flag to replace all occurrences of backslashes
with double backslashes.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-03-04 13:05:05 +01:00
Stratoula Kalafateli
e24c1c3ee5
[ES|QL] Correct the lens_map_to_columns function call arguments (#213038)
## Summary

The else is being called atm only in Discover ES|QL mode, when the user
is typing stats or keep.
The `isTextBased` flag is missing which means that we don't call the
`mapToOriginalColumnsTextBased` but the one for the dsl mode which might
cause bugs.

I don't think that Peter had any reason to do so, it seems more as it
slipped.
2025-03-04 11:58:27 +01:00
Cristina Amico
aae11b0161
[Fleet] Remove wrong incorrect import from fleet server host service (#212918)
## Summary

Small follow up of https://github.com/elastic/kibana/pull/208091 

The editor autocompletion added an incorrect import and so I'm removing
it, plus a few comments that should have been removed.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 09:37:42 +01:00
Marco Antonio Ghiani
6e2a1033b8
[Streams 🌊] Enrichment - Fix broken results due to condition and add skipped metric (#212757)
## 📓 Summary

When the condition is not met, the processing simulation reports wrong
metrics and fails on a unhandler error.

This work fix the issue and also update the document simulation metrics,
reporting how many documents are skipped by a processor during the
simulation.

A follow-up work will update the filters on the date to better reflect
the available states of the documents (parsed, partially parsed,
skipped, failed).

<img width="701" alt="Screenshot 2025-02-28 at 12 47 10"
src="https://github.com/user-attachments/assets/1b6979e4-78a1-4db3-af72-faaf06c0e249"
/>
2025-03-04 07:43:30 +01:00
Jen Huang
8854433830
[UII] Add internal api that allows to create agent policy and its package policies (#212977)
## Summary

Resolves #206488. This PR introduces a new internal API that allows an
agent policy and its package policies to be created in one request:

<details>
<summary>⤵️ Expand for console snippet ⤵️</summary>

```
POST kbn:/internal/fleet/agent_and_package_policies
{
  "id": "jens-awesome-policy",
  "name": "awesome policy",
  "description": "",
  "namespace": "default",
  "package_policies": [
    {
      "policy_ids": [
        "jens-awesome-policy"
      ],
      "package": {
        "name": "log",
        "version": "1.1.2"
      },
      "name": "log-for-awesome-policy",
      "description": "",
      "namespace": "",
      "inputs": {
        "logs-logfile": {
          "enabled": true,
          "streams": {
            "log.log": {
              "enabled": true,
              "vars": {
                "paths": [
                  "/tmp/some-path"
                ],
                "data_stream.dataset": "generic",
                "tags": [],
                "custom": ""
              }
            }
          }
        }
      }
    },
    {
      "id": "fixed-id-for-filestream",
      "package": {
        "name": "filestream",
        "version": "1.0.1"
      },
      "name": "filestream-1",
      "description": "",
      "namespace": "",
      "inputs": {
        "filestream-filestream": {
          "enabled": true,
          "streams": {
            "filestream.generic": {
              "enabled": true,
              "vars": {
                "paths": [
                  "/var/log/*.log"
                ],
                "data_stream.dataset": "filestream.generic",
                "parsers": "#- ndjson:\n#    target: \"\"\n#    message_key: msg\n#- multiline:\n#    type: count\n#    count_lines: 3\n",
                "exclude_files": [
                  "\\.gz$"
                ],
                "include_files": [],
                "tags": [],
                "recursive_glob": true,
                "clean_inactive": -1,
                "harvester_limit": 0,
                "fingerprint": true,
                "fingerprint_offset": 0,
                "fingerprint_length": 1024,
                "exclude_lines": [],
                "include_lines": []
              }
            }
          }
        }
      }
    }
  ]
}
```
</details>

If successful, the response will be the agent policy with the full
nested package policies.

`id`s can be specified or omitted for either the agent or package
policy. If necessary, the resulting package policy's `policy_id` /
`policy_ids` will be updated with final ID of the created agent policy.

If any of the package policies fail to be created for any reason, there
is a rollback mechanism to delete the agent and package policies that
were already created.

The API also supports any query params that are supported by the create
agent policy and create package policy endpoints:
```
sys_monitoring: boolean; // passed to agent policy creation
format: 'simplified' | 'legacy; // passed to package policy creation
```

### Dev note
The new `createAgentAndPackagePoliciesHandler()` is unique in that it
acts mostly as a passthrough to other handlers,
`createAgentPolicyHandler` and `createPackagePolicyHandler`. This means
all the checks (spaces, rbac, etc) performed on the other handlers are
triggered appropriately.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-03-04 02:22:19 +00:00
Nathan Reese
037e8f58e0
[maps] globe projection (#212437)
<img width="600" alt="Screenshot 2025-02-25 at 11 35 32 AM"
src="https://github.com/user-attachments/assets/2567e20c-1223-4001-9866-edbe8c534350"
/>

PR does the following
* Updates maplibre to 5.1.1. Maplibre 5.0 introduced the globe
projection
* Updates sample data maps to use new globe projection
* Existing maps will use existing "mercator" projection
* Adds globe projection to newly created maps
* Adds `projection` setting, allowing users to switch between classic
"mercator" and new "globeInterpolate" projection
<img width="400" alt="Screenshot 2025-02-25 at 11 35 41 AM"
src="https://github.com/user-attachments/assets/5c55003b-dbe9-4adc-835c-0a2911c81074"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-03 18:31:05 -07:00
Patryk Kopyciński
f0d66691b8
[Security Assistant] Fix Product documentation installation banner (#212463)
## Summary

Fixes logic on fresh cluster where the ELSER was not started yet, in
this case API reports `status` as `uninstalled`, but it doesn't mean
that the Product documentation was actually uninstall, but rather it's a
default state.
Added internal `product_documentation_status` to KB status API to make
sure we keep track of the status internally and present the banner only
if the docs were intentionally uninstalled

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-04 02:28:35 +01:00
Viduni Wickramarachchi
ec127e271c
[Obs AI Assistant] Improve instructions for the summarize function (#212936) 2025-03-03 18:56:55 -05:00
Steph Milovic
095fc222aa
[Security Assistant] Conversation pagination refactor (#211831) 2025-03-03 13:41:20 -07:00
Julia Bardi
d2913395af
[Fleet] fix latest_executed_state error (#212935)
Fix schema validation error when `latest_executed_state: {}`.

The logic sets an empty object here:
63394e6bfd/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts (L63)
This caused an error on the Integration Details page:

`Failed output validation: [response
body.items.4.installationInfo.latest_executed_state.name]: expected
value of type [string] but got [undefined]`

Tested locally by manually updating `latest_executed_state` to `{}`, now
the `/epm/packages` API works as expected.

<img width="1459" alt="image"
src="https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637"
/>
2025-03-03 18:07:28 +00:00
Julia
6ce22f4a33
[ResponseOps][MW] Allow users to delete MWs (#211399)
Resolve: https://github.com/elastic/kibana/issues/198559
Resolve: https://github.com/elastic/kibana/issues/205269

Here I used the existing DELETE
/internal/alerting/rules/maintenance_window/{id} API to delete MWs from
the UI.
I added an action to the MW table so users can delete MWs. And show a
delete confirmation modal when users delete a MW from the UI.

### 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
- [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
2025-03-03 16:20:31 +01:00
Alberto Blázquez
ed30926f0f
Remove page and links to Cloud Defend from Assets (#212753)
## Summary

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

Continues work on:
- https://github.com/elastic/kibana/pull/200895.

### Acceptance criteria

- `9.0` / `Serverless`: 
- Removes links to Cloud Defend from Assets page in Security Solution.
- Disables navigation to `app/security/cloud_defend/` redirecting to the
default `app/security/get_started/`.
- `8.x` / `8.18`: 
- No changes (impact is minimal, only affects 4 customers who were told
to uninstall the plugin)

### Screenshot

<details><summary>Before - Assets page</summary>
<img width="1749" alt="Screenshot 2025-02-27 at 19 35 38"
src="https://github.com/user-attachments/assets/0bb076bc-984a-45be-bff8-63fe62ba6571"
/>
</details> 

<details><summary>Before - Cloud Defend page</summary>
<img width="1736" alt="Screenshot 2025-02-27 at 19 36 57"
src="https://github.com/user-attachments/assets/3f4f80b0-869d-48a9-90a3-70d03a37c7f6"
/>
</details>

<details><summary>After - Assets page</summary>
<img width="2006" alt="Screenshot 2025-02-28 at 12 12 11"
src="https://github.com/user-attachments/assets/3ef4bfb2-6b0b-4a77-83ea-cc7b9f54e37f"
/>
</details> 

<details><summary>After - Cloud Defend page redirects to
get_started/siem_migrations </summary>
<img width="2011" alt="Screenshot 2025-02-28 at 11 25 43"
src="https://github.com/user-attachments/assets/2ddafd46-7629-44fe-9234-049f09bc6b71"
/>
</details>

### How to test

Authenticate to Docker Registry with
```bash
docker login -u <YOUR_USER> -p <YOUR_PASSWORD> docker.elastic.co
```

Then run ES with

```bash
yarn es serverless --projectType security --kill
```

In a second terminal, run Kibana with
```bash
yarn serverless-security
```

### 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
- [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)
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

We should not show more links to Cloud Defend in other parts of the app
because the feature was deprecated and it might confuse end users. But
there's no risk of breaking the app because navigation is handled
correctly.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-03 14:52:04 +00:00
Julia Bardi
3e2373fd08
[Fleet] sync integrations from follower index (#212371)
## Summary

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

Implemented installing integrations from the doc in the follower index.
Can be tested locally by creating the ccr index locally or setting up 2
local clusters and set up ccr between them.

To test:
- Requires https://github.com/elastic/elasticsearch/pull/123493,
checkout and run es from source
```
yarn es source --license trial -E xpack.security.authc.api_key.enabled=true -E xpack.security.authc.token.enabled=true  --source-path=/Users/juliabardi/elasticsearch  -E path.data=/tmp/es-data -E xpack.ml.enabled=false
```
- Enable feature flag `xpack.fleet.enableExperimental:
['enableSyncIntegrationsOnRemote']`
- Create doc in ccr index, `hosts` should match local elasticsearch host
```
POST fleet-synced-integrations-ccr-remote1/_doc
{
  "id": "fleet-synced-integrations",
 "remote_es_hosts": [
            {
              "hosts": [
                "http://192.168.64.1:9200"
              ],
              "name": "remote1",
              "sync_integrations": true
            }
          ],
          "integrations": [
            {
              "package_version": "1.25.0",
              "package_name": "nginx",
              "updated_at": "2025-02-24T09:03:51.936Z"
            }
          ]
}
```
- Wait 1m until the task runs, verify that the integrations from the doc
are installed


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-03-03 14:21:25 +01:00
Cristina Amico
151fa26a5f
[Fleet] Add SSL options to fleet server hosts settings (#208091)
Fixes https://github.com/elastic/kibana/issues/207322

## Summary
Show SSL options for fleet server host in Fleet server settings section
and in add fleet server host flyout
- Registered fleet server host as a encrypted save object and the new
mappings added under `ssl` property, mirroring what's already existing
for `logstash` and `kafka` outputs
- The new options are displayed in the UI, both when adding a new fleet
server host from the flyout and when editing an existing one.
- The values are then added to the full agent policy
- The values for `ssh.key` and `ssh.es_key` can additionally be saved as
secrets but for now this option is not enabled until [fleet server
supports it](https://github.com/elastic/fleet-server/issues/4470) - I
used the feature flag `enableSSLSecrets`

<details>
  <summary>Screenshots</summary>
<img width="803" alt="Screenshot 2025-02-14 at 10 23 41"
src="https://github.com/user-attachments/assets/e1bf8c93-e8c0-4351-b86b-a7f8a8b0ec72"
/>
<img width="801" alt="Screenshot 2025-02-14 at 10 23 36"
src="https://github.com/user-attachments/assets/f96d2a5c-0285-41d1-953b-e662ccdcd514"
/>
<img width="780" alt="Screenshot 2025-02-04 at 14 34 52"
src="https://github.com/user-attachments/assets/e854fc28-d4aa-4b01-8634-e1f37f70419b"
/>
<img width="804" alt="Screenshot 2025-02-04 at 14 35 00"
src="https://github.com/user-attachments/assets/f507c34a-774e-4aa1-94b2-b912539d6143"
/>
<img width="791" alt="Screenshot 2025-02-04 at 09 25 28"
src="https://github.com/user-attachments/assets/82c1f761-7ee5-42d0-8b8f-23848cfc0391"
/>

Generated policy:
<img width="795" alt="Screenshot 2025-02-24 at 16 43 58"
src="https://github.com/user-attachments/assets/5ef4e34f-5850-4449-8a70-7de10750bb84"
/>
<img width="796" alt="Screenshot 2025-02-24 at 16 44 15"
src="https://github.com/user-attachments/assets/bdcf70fe-72f0-4df0-9a9e-40346407a1df"
/>




</details>

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-03 13:23:00 +01:00
Gerard Soldevila
3fcd11ce4d
Decouple some modules from 'webpack' (#212746)
## Summary

Remove extraneous dependencies:
* `canvas` was depending on 'webpack' purely for a type (dev-time).
* `@kbn/optimizer-webpack-helpers` (canvas depends on it 🤨) was
depending on 'webpack' solely for a function that could be defined in
`@kbn/optimizer` (devOnly).
2025-03-03 13:21:50 +01:00
Robert Jaszczurek
d9c3072207
[ML] Trained Models: Telemetry for deployment creation (#211719)
Part of https://github.com/elastic/kibana/issues/200725
To track all relevant data:

> * User-facing deployment params, i.e. optimized for, VCPU level usage,
etc.
> * Resulting API params, e.g. number of allocations, etc.

This PR introduces
[EBT](https://docs.elastic.dev/telemetry/collection/event-based-telemetry)
event tracking, as ML is not currently using EBT events for data
collection, it includes the creation of `Telemetry Service`, accessible
via the `useMlKibana` hook.
I have already triggered some events for staging, which are visible
[here](https://telemetry-v2-staging.elastic.dev/s/ml/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-4M,to:now))&_a=(columns:!(timestamp),dataSource:(dataViewId:'74c6b7f0-3037-423f-a531-c736c70813b0',type:dataView),filters:!(),interval:auto,query:(language:kuery,query:'event_type:%20%22Trained%20Models%20Deployment%20Created%22%20'),sort:!(!(timestamp,desc)),viewMode:documents)).
Additionaly, I've created a test
[dashboard](b61d06af-4b3d-4550-8e5e-da6464652371/page/p_rssl6vh8ld/edit)
in Looker Studio to visualize the collected data.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-03 12:25:22 +01:00
Stratoula Kalafateli
dab569b70a
[ES|QL] Introduces a new package for esql types (#212754)
## Summary

The esql types are around many packages and plugins creating problems
either with the bundle size or cyclic dependencies.

This PR is moving some of them on the esql-types package. I am going to
move more there in follow up PRs.

(I decided to rename it as it makes more sense to have a generic one for
esql rather one only for the variables)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
2025-03-03 11:04:32 +00:00
Ido Cohen
58e25b564e
Deprecate Cloud Defend Telemetry 2025-03-03 12:28:37 +02: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
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
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