Commit graph

84288 commits

Author SHA1 Message Date
kibanamachine
355b859fcd
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' 2025-03-10 21:54:09 +00:00
kibanamachine
ed5e4fed7f
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' 2025-03-10 21:53:30 +00:00
kibanamachine
dd626d8266
[CI] Auto-commit changed files from 'node scripts/notice' 2025-03-10 21:53:30 +00:00
Kenneth Kreindler
58e6e1eded
prevent too many ESQl generation attempts 2025-03-10 21:53:30 +00:00
Kenneth Kreindler
c76a4469ae
esql self healing graph 2025-03-10 21:53:30 +00:00
Kenneth Kreindler
ad3dce1179
attempt 1 2025-03-10 21:53:20 +00:00
Kenneth Kreindler
b79e33db32
init 2025-03-04 20:25:24 +00: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
Carlos Crespo
8e5b8580f4
[Infra] Fix hosts total count query (#212749)
Fixes [#212745](https://github.com/elastic/kibana/issues/212745)

## Summary

Fix for the hosts total count query, which was not correctly filtering
hosts from system integration and APM

<img width="584" alt="image"
src="https://github.com/user-attachments/assets/05c3b244-3a0f-425a-82db-3498c1a6dbb7"
/>


### How to test
- Connect Kibana to an edge cluster
- Navigate to Infrastructure > Hosts
- The total number of items on the table should be equal to the number
in the hosts count KPI

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 16:46:21 +01:00
Konrad Szwarc
dfe542bd8e
[EDR Workflows] Workflow Insights - insights generating script (#213094)
This PR introduces a new script for loading parameterized workflow
insights into a data stream. It enables UI/UX testing without requiring
an agent installation or generating insights manually.

Arguments

```
--endpointId       Required. The endpoint ID to use for generating workflow insights.
--elasticsearch    Optional. The URL to Elasticsearch. Default: http://localhost:9200
--username         Optional. The username to use for authentication. Default: elastic
--password         Optional. The password to use for authentication. Default: changeme
--count            Optional. The number of workflow insights to generate. Default: 5
--os               Optional. The OS to use for generating workflow insights. Default: linux
--antivirus        Optional. The antivirus to use for generating workflow insights. Default: ClamAV
--path             Optional. The executable path of the AV to use for generating workflow insights. Default: /usr/bin/clamscan
```
Example usage:

* Load 5 workflow insights, using the default values - Linux, ClamAV,
/usr/bin/clamscan on the endpoint with ID
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6
 
`node ./load_workflow_insights.js --endpointId
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6`
 
* Load 10 workflow insights for Malwarebytes with path of C:\\Program
Files\\Malwarebytes\\Anti-Malware\\mbam.exe on Windows endpoint with ID
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6
        
`node ./load_workflow_insights.js --endpointId
8ee2a3a4-ca2b-4884-ae20-8b17d31837b6 --count 10 --os windows --antivirus
Malwarebytes --path 'C:\\Program
Files\\Malwarebytes\\Anti-Malware\\mbam.exe'`
2025-03-04 16:09:35 +01:00
Vitalii Dmyterko
847be917a6
[Security Solution][Detection Engine] adds bulkGetUserProfiles privilege to Security Feature (#211824)
## Summary

- addresses https://github.com/elastic/kibana/issues/202051

Few observations, based on ticket
[description](https://github.com/elastic/kibana/issues/202051):

1. User can update assignees in alert(i.e. update any alert details,
which is handled by **SecuritySolution** priv)
2. User can see suggested users in searchbox
3. User **can not** see assignees details(name, avatar) in alerts table
column and alerts flyout(that's where error toast originates from)

Why this happens?
2 different APIs used to show users in searchbox and user details in
alerts table column:

1. API to show users in searchbox:
[/internal/detection_engine/users/_find](https://github.com/elastic/kibana/blob/8.18/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#L24)
It requires `securitySolution` privilege
2. API for alerts table cell:
[/internal/security/user_profile/_bulk_get](https://github.com/elastic/kibana/blob/8.18/x-pack/platform/plugins/shared/security/server/routes/user_profile/bulk_get.ts#L20)
It requires `bulkGetUserProfiles` privilege

User was configured with read only Security Feature, that covers only
first API, that's why we see error
> API [POST /internal/security/user_profile/_bulk_get] is unauthorized
for user, this action is granted by the Kibana privileges
[bulkGetUserProfiles] (403)

However `bulkGetUserProfiles` is covered by `Cases` feature already. If
Cases access will be set to read, user would be able to see assignees
details through `/internal/security/user_profile/_bulk_get` API.
It happens, because cases API tags include `bulkGetUserProfiles`
privilege:
https://github.com/elastic/kibana/blob/8.18/x-pack/platform/plugins/shared/cases/common/utils/api_tags.ts#L32,
https://github.com/elastic/kibana/blob/8.18/x-pack/solutions/security/packages/features/src/cases/types.ts#L7

This PR includes `bulkGetUserProfiles` privilege in Security Feature:
https://github.com/elastic/kibana/pull/211824. Since, it's already
present in Cases feature, and user profiles available through Security
Solution `/internal/detection_engine/users/_find` API
2025-03-04 15:08:41 +00:00
Nicolas Chaulet
601e4de6b8
[Fleet] Fix space selector space color,label for readonly spaces (#212941) 2025-03-04 16:08:25 +01:00
Tim Sullivan
52bbc24387
Fix toggling of the secondary panel for non-landing page nav item buttons (#211852)
## Summary

Closes https://github.com/elastic/kibana-team/issues/1514

**Release note:** Fixed an issue with the side navigation of solution
projects where clicking the nav item label would open but not close the
secondary navigation panel.

### 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 08:05:26 -07: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
Sergi Romeu
b2dd88ec55
chore: remove react-syntax-highlighter leftovers (#213076)
## Summary

Removes leftovers of react-syntax-highlighter removed in [this
PR](https://github.com/elastic/kibana/pull/204902)
2025-03-04 15:35:34 +01:00
Katerina
a16dc711fb
[Perfomance] Add Inline documentation for TTFMP (#212393)
## Summary

closes https://github.com/elastic/observability-dev/issues/4101 

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/4937722f-f05b-404b-9844-930e80c8e15e"
/>


### ⚠️ Instrumentation

Pass the `description` as metadata. The prefix [TTFMP] is required. 

### How to test

- Checkout the PR
- make sure you run `yarn kbn bootstrap`
- go to any page that has onPageReady function instrumented (ex
services)
2025-03-04 15:33:38 +01:00
Patryk Kopyciński
f74b6b52dc
Skip 'No connectors or conversations exist' on serverless (#213078)
## Summary

Fixes
https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-gen-ai/builds/2139#_


![image](https://github.com/user-attachments/assets/0e2db8db-28d8-4097-968c-52a42b2e9b07)
2025-03-04 15:28:12 +01:00
Colleen McGinnis
1814c60017
[docs] Migrate docs from AsciiDoc to Markdown (#212558)
Migrate docs from AsciiDoc to Markdown. The preview can be built after
#212557 is merged.

@florent-leborgne please tag reviewers, add the appropriate label(s),
and take this out of draft when you're ready.

Note: More files are deleted than added here because the content from
some files was moved to
[elastic/docs-content](https://github.com/elastic/docs-content).

**What has moved to
[elastic/docs-content](https://github.com/elastic/docs-content)?**

Public-facing narrative and conceptual docs have moved. Most can now be
found under the following directories in the new docs:
- explore-analyze: Discover, Dashboards, Visualizations, Reporting,
Alerting, dev tools...
- deploy-manage: Stack management (Spaces, user management, remote
clusters...)
- troubleshooting: .... troubleshooting pages

**What is staying in the Kibana repo?**

- Reference content (= anything that is or could be auto-generated):
Settings, syntax references
- Release notes
- Developer guide

---------

Co-authored-by: Florent Le Borgne <florent.leborgne@elastic.co>
2025-03-04 14:56:07 +01:00
Marco Vettorello
b43558db48
Update Sample Dashboards images to Borealis (#212012)
## Summary

Updates the sample dashboard images to Borealis theme.
2025-03-04 14:49:09 +01: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
Alex Prozorov
17931c5c5b
[Cloud Security ]update csp README.md file i18n instructions (#213068)
## Summary
update i18 instructions regarding how to add and remove translations.
2025-03-04 14:49:53 +02:00
Tomasz Kajtoch
4dd8de807a
Make Amsterdam an opt-in theme (#212787)
## Summary

This PR updates `DEFAULT_THEME_TAGS` used to determine what theme tags
are bundled in Kibana by default to only include the Borealis theme,
specifically `borealislight` and `borealisdark` theme tags. This change
is expected to decrease bundle sizes significantly and get back to
bundling a single theme, not two (4 → 2 theme tags).

Now that Serverless, `9.0`, and `main` all run with Borealis, there's no
risk in removing Amsterdam from the bundle and decreasing Kibana bundle
sizes.

We need to keep the feature flag in code for the time being to easily
test future Borealis iterations.

Amsterdam will still be available as an opt-in theme and is meant to be
used locally when testing changes to be backported to 8.x versions that
use Amsterdam. To do so, Kibana needs to be started/built with
`KBN_OPTIMIZER_THEMES` environment variable set and the feature flag
overridden in `kibana.dev.yml`.

```yml
# config/kibana.dev.yml
feature_flags.overrides.coreRendering.defaultThemeName: amsterdam
```

```shell
# Run dev server with both borealis and Amsterdam theme tags
KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn start
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 13:40:06 +01:00
Marco Vettorello
14b18ac8de
[deps] move redux-thunk to correct owners (#206232)
## Summary

The `redux-thunk` dependency was assigned to the `kibana-visualization`
team but we are not even using it in our code.

The current PR proposes a change, moving the ownership/dependency review
to @elastic/kibana-presentation, @elastic/kibana-management, and
@elastic/security-solution because they are the main and only consumers
of that library.
2025-03-04 12:31:14 +00:00
Marco Vettorello
4b4c15a943
Fix vega tooltip color in dark mode (#212042)
## Summary

This PR fixes the text color of the vega tooltip.
The Vega tooltip is always dark because uses the euiTooltip style for
it. There was the `lightShade` color used within this tooltip before
that result in an invisible text color when running in dark mode.
The PR removes the custom colors and makes the tooltip inherits the
colors from the euiTooltip style.
2025-03-04 12:07:52 +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
Alberto Blázquez
2473d5951a
Refactor Asset Inventory page (#212436)
## Summary

Refactors code in Asset Inventory page for simplicity and consistency.

### Changes

- Centralized constants for consistency
- Simplified `<AllAssets>` page, removed unused props, renamed
variables, etc...
- Encapsulated technical preview stuff into `<TechnicalPreviewBadge>`
- Removed deprecations in EUI components and styling

Also, this PR **deletes the mocked data** that was used before
integrating the UI with the backend.

### Questions

- Do we see value in centralizing all strings in a new file such as
`localized_strings.ts`?

### Out of scope

Hooks in `hooks/use_asset_inventory_data_table` and field selector
components were all duplicated from the CSP plugin. I haven't put effort
in refactoring those since we'll need to remove the duplication and make
them reusable

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

### Risks

No risk since code is still hidden behind the *Enable Asset Inventory*
advanced setting and the beta *Cloud Asset* integration must be
installed.
2025-03-04 12:28:12 +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
Kibana Machine
8b8b0ae258
[api-docs] 2025-03-04 Daily api_docs build (#213033)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1001
2025-03-04 07:17:49 +00: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
christineweng
6b6eb43183
[Security Solution] Alert flyout - fix suppressed alerts alignment (#213029)
## Summary

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

Before

![image](https://github.com/user-attachments/assets/d578194a-aaf4-45c1-bccb-42d02110be28)


After

![image](https://github.com/user-attachments/assets/b183a2ae-dd73-47d8-8319-984246309d98)


### Checklist

- [ ] 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 06:01:51 +00:00
christineweng
bac5c30e1c
[Security Solution][Document Flyout] Fix alert insights color order (#212980)
## Summary

Updated order of the insights, following from left to right `Low` to
`Critical`


![image](https://github.com/user-attachments/assets/3b40bca0-4f29-421d-af34-fbacb49486dc)

### 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-03 22:16:15 -06: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
Michael Olorunnisola
750e156c26
[Performance][Security Solution][1/4] - Field Browser Performance (#212469)
## Summary
Part 1 of https://github.com/elastic/kibana/pull/212173

### Testing
For setup see testing section here:
https://github.com/elastic/kibana/pull/212173#issue-2870522020

**Areas to test:**
- Alert Table (Alerts, Rule Detail, Rule Preview pages)
- Security solution field browser component
- Flyout table tab.

### Background

When investigating the performance of the security solution application,
one of the issues that was observed was locking of the page and field
browser component when the total number of fields returned were
significantly high.

This led to cell values not rendering in the alert table, and the field
browser in all the security solution pages causing the page to crash.
The relevant images can be seen at the bottom of this description

In short: The `push(...fields)` is non-performant at scale, and at a
significant enough scale (Testing was done with 500k mapped fields),
fails to run due to excessive arguments provided to the `push` method.
In this PR improvements are made in the `browserFields` transformations
that are done for the field browser component, expandable flyout table
tab, and alert/rule tables via `CellValue` component.

This work was done to get immediate improvements in the security
solution UI, but a longer term consideration will be whether or not the
`browserFields` is even necessary anymore as a concept based on what is
available via the `fields` api. We will revisit once our Sourcerer
refactoring work is done.

<img width="1728" alt="Screenshot 2025-02-26 at 10 15 29 AM"
src="https://github.com/user-attachments/assets/a25f577f-f758-415e-9c93-5452eadb8020"
/>

<img width="1445" alt="Screenshot 2025-02-26 at 10 18 36 AM"
src="https://github.com/user-attachments/assets/d70970d3-991a-47ba-b617-5862d18101b6"
/>

<img width="1469" alt="Screenshot 2025-02-26 at 10 19 48 AM"
src="https://github.com/user-attachments/assets/1767aa9b-66ab-46be-bc1a-5311630c2765"
/>


![image](https://github.com/user-attachments/assets/5d746b21-fa9b-425b-826a-cc7abd444f21)


![image](https://github.com/user-attachments/assets/4dff2378-d61b-4770-b46b-41cb37d6ead4)


### After the fix
(Done on [this branch](https://github.com/elastic/kibana/pull/212173)
that has the other changes as well)


https://github.com/user-attachments/assets/da992296-4eb8-49d4-96ca-b0a19a00f1f0


### 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
2025-03-03 20:22:25 -05:00
Christophe Alladoum
e9813b8c72
[Elastic Defend] Add windows.ransomware.dump_process for endpoint advanced policy setting (#212439)
## Summary

This PR exposes `windows.ransomware.dump_process` as an advanced policy
option for Elastic Defend.
If enabled, this option will make the endpoint generate a memory dump of
the ransomware process before killing it, assisting the ransomware
investigation process.


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-03 16:57:20 -08:00
Viduni Wickramarachchi
ec127e271c
[Obs AI Assistant] Improve instructions for the summarize function (#212936) 2025-03-03 18:56:55 -05:00
Nathan Reese
decf5feba5
[controls] remove id from explicit input (#211851)
Part of `EmbeddableInput` type removal.

PR removes `EmbeddableInput` from controls plugin. Part of this effort
is removing `id` key from `controlConfig/explicitInput`.

While investigating this PR, I found it odd that
`ControlGroupApi.serializeState` returned controls in shape `[ { ...rest
} ]` while `ControlGroupFactory.deserializeState` expected to receive
controls in the shape `[ { id, ...rest }]`. The only reason this works
is that
src/platform/plugins/shared/dashboard/server/content_management/v3/transform_utils.ts
`controlGroupInputOut` adds `id` to each object in `controls`. This PR
also resolves this and updates `ControlGroupApi.serializeState` to
return controls in shape `[ { id, ...rest } ]`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-03 14:31:42 -07:00
Tiago Costa
bee6ba88c9
skip flaky suite (#206204) 2025-03-03 21:20:02 +00:00
Michael Olorunnisola
98b52804d5
[Performance][Security Solution][3/4] - Sourcerer performance (#212482)
## Summary
Part 3 of https://github.com/elastic/kibana/pull/212173

### Testing
For setup see testing section here:
https://github.com/elastic/kibana/pull/212173#issue-2870522020

Testing this work is a bit more `console.log` related, as the primary
aim of many of these changes was to limit the amount of re-renders
caused by state changes within many of the sourcerer utils. React is
relatively fast at handling many of these re-renders, but considering
the widespread usage of `useSourcererDataView` and the top level
location of `useInitSourcerer`, it was worth taking care of some low
hanging fruit.

### Background

The changes in this PR centered around limiting the number of re-renders
that were being caused unnecessarily in `useSourcererDataView` and
`useInitSourcerer` by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-03 16:06:38 -05:00
Steph Milovic
095fc222aa
[Security Assistant] Conversation pagination refactor (#211831) 2025-03-03 13:41:20 -07:00
Drew Tate
f2a91732d8
[ES|QL] Separate ENRICH autocomplete routine (#211657)
## Summary

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

Gives `ENRICH` autocomplete logic its own home 🏡

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

### Identify risks

- [ ] As with any refactor, there's a possibility this will introduce a
regression in the behavior of commands. However, all automated tests are
passing and I have tested the behavior manually and can detect no
regression.

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-03-03 20:24:23 +00: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
Stratoula Kalafateli
f6978eaf7b
[ES|QL] Makes the clear control button optional (#212848)
## Summary

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

Here we are removing the clear button from the ES|QL control as clearing
will result in wrong charts. I also considered the reset but when there
is no changes should be hidden or disabled. This seems to me as a
smaller change and taken under consideration that dashboard already
allows resetting I think it is ok to remove it.

We can always reconsider if any user complains.

Although by removing the clearSelections from the control config removes
the button the `DefaultControlApi ` was marking it as required. So I had
to tweak a bit the types.
2025-03-03 19:03:57 +01:00