Commit graph

83446 commits

Author SHA1 Message Date
elastic-renovate-prod[bot]
fac5b8dc2a
Update dependency monaco-editor to ^0.52.2 2025-02-03 16:46:21 +00:00
Elena Stoeva
96e3d55638
[Data Streams] Unskip API integration tests (#209102)
Closes https://github.com/elastic/kibana/issues/209014

## Summary

This PR unskips and updates the Data streams API integration tests to
reflect the recent changes to Elasticsearch
(https://github.com/elastic/elasticsearch/pull/121049). Previously, the
`cluster.logsdb.enabled` setting was always `false` by default in
stateful Kibana. With the new changes, it is `true` by default if the
`logsdb.prior_logs_usage` setting is `false` (which is the case for new
test clusters, hence the test failure), and `true` otherwise. Therefore,
we need to update the tests so that we test both cases.

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7821
2025-02-03 17:24:58 +01:00
Stratoula Kalafateli
b25f23674b
[ES|QL] [Discover] Keeps the histogram config on time change (#208053)
## Summary

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


![meow](https://github.com/user-attachments/assets/2cb2ff53-49f9-414e-985f-c0acd3945078)


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-02-03 17:01:23 +01:00
Dario Gieselaar
dac6600268
[Server Route Repository] Verify keys are handled for zod (#208166)
Closes https://github.com/elastic/kibana/issues/207709

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2025-02-03 16:57:49 +01:00
Philippe Oberti
4886061950
[Security Solution][Threat Intelligence] - fix Cypress tests (#209195)
## Summary

This PR fixes the few Threat Intelligence Cypress tests which started
failing recently.

[This PR](https://github.com/elastic/kibana/pull/208990)
([commit](296c452345)
on `main`) which was a basic bump PR started had to skip a few Threat
Intelligence Cypress tests that started failing.

I tried to understand what happened but did not find the origin of the
issue. The indicators table was previously showing data sorted from
oldest to newest (but only on Cypress, not when running the application
locally, really weird). After the commit mentioned above, the Cypress
tests are now sorting the data from newest to oldest.
Looking at the code, nothing mentions sorting, the
`threatIntelligenceSearchStrategy` is identical between the application
running locally and the Cypress tests.

#### Payload

| Local run  | Cypress |
| ------------- | ------------- |
| ![Screenshot 2025-01-31 at 2 20
33 PM](https://github.com/user-attachments/assets/7095eeef-3ceb-4a3c-85ee-7fee7e07b9ba)
| ![Screenshot 2025-01-31 at 2 21
39 PM](https://github.com/user-attachments/assets/7bce82d2-12ff-483f-bf85-ad8f0ce45054)
|

#### Result

The results are different, one sorted ascending, the other descending.

| Local run  | Cypress |
| ------------- | ------------- |
| ![Screenshot 2025-01-31 at 2 22
19 PM](https://github.com/user-attachments/assets/09715344-0c6e-44e9-8abd-d0b56ae8c984)
| ![Screenshot 2025-01-31 at 2 22
03 PM](https://github.com/user-attachments/assets/b66412fc-0018-4a84-9ddf-98b90c200878)
|

No code changes have been done to the Threat Intelligence plugin in many
months. Fetching the data is done using `useQuery` (see
[here](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts#L101))
and the logic to fetch the actual data is
[here](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts#L71).
Both haven't been touched in months...

Nothing in the commit mentioned above seems to give any details on why
these tests just started failing. Resetting to the commit right before
makes the tests pass...

The solution to fix the tests was to ensure that the data_archive files
had the correct timestamps, to know exactly which ones we select in the
Cypress tests to test against...

https://github.com/elastic/kibana/issues/209050
https://github.com/elastic/kibana/issues/209039
https://github.com/elastic/kibana/issues/209051

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 09:03:32 -06:00
Maxim Palenov
bcc0f4d5f6
[Security Solution] Sort rule upgrade flyout fields according to the state (#208553)
**Relates to:** https://github.com/elastic/kibana/issues/171520

## Summary

This PR adds logic to sort fields in rule upgrade flyout. Fields are sorted based on the state where fields with conflicts are shown before the other fields users should pay attention to. 

## Screenshot

**Before:**

https://github.com/user-attachments/assets/c4ee56c7-9bfe-4b6f-a7d4-94b0fc946425

**After:**

https://github.com/user-attachments/assets/c2c43a57-8ec0-4537-823f-4244306b9553
2025-02-03 15:57:45 +01:00
Kenneth Kreindler
0f62fa1d30
[Security Solution] [AI Assistant] Clean up content references code (#208902)
## Summary

This PR addressed the remaining comments left in:
https://github.com/elastic/kibana/pull/206683. This PR does not contain
any material changes. It is just fixing some types and variable naming.

Changes:
- Fix the
[type](https://github.com/elastic/kibana/pull/208902/files#diff-9f3f1c92910d7207ed15dd7bc3289d0a8a6bd7f656584fce33cfbad40823a32bL52)
of the optional content reference store. Once the feature flag is
removed, the content reference store will no longer be optional.
- Rename `contentReferencesStoreFactory()` to
`newContentReferencesStore()` because it is not actually a factory
method and was named poorly.
- Update [structured system
prompt](https://github.com/elastic/kibana/pull/208902/files#diff-1efcb0cc37b72d43ee9ff1036fad33f143c577a9c9818e3c8ace2efbfc9e64b0R26)
to include instructions for citations too.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

### Identify risks

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

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

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 14:53:43 +00:00
Ying Mao
4e0c0a785a
[Response Ops][Alerting] Switch to logger.warn for no_shard_available_action_exception encountered when collecting telemetry (#205520)
Resolves https://github.com/elastic/response-ops-team/issues/221

## Summary

Looking through the logs for this, the majority of these errors have the
following stack trace (14,000+ in the last 7 days):

```
ResponseError: search_phase_execution_exception
	Root causes:
		no_shard_available_action_exception: [es-es-search-686bf6b747-xldl8][100.65.77.183:9300][indices:data/read/search[phase/query]]
		no_shard_available_action_exception: null
    at KibanaTransport._request (/usr/share/kibana/node_modules/@elastic/transport/lib/Transport.js:543:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /usr/share/kibana/node_modules/@elastic/transport/lib/Transport.js:641:32
    at KibanaTransport.request (/usr/share/kibana/node_modules/@elastic/transport/lib/Transport.js:637:20)
    at KibanaTransport.request (/usr/share/kibana/node_modules/@kbn/core-elasticsearch-client-server-internal/src/create_transport.js:60:16)
    at ClientTraced.SearchApi [as search] (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/api/api/search.js:72:12)
    at getTotalAlertsCountAggregations (/usr/share/kibana/node_modules/@kbn/alerting-plugin/server/usage/lib/get_telemetry_from_alerts.js:42:21)
    at async Promise.all (index 6)
    at TaskManagerRunner.run (/usr/share/kibana/node_modules/@kbn/task-manager-plugin/server/task_running/task_runner.js:325:22)
```

Looking through the code, we are already catching these errors and
returning a default response for that telemetry object. The
`no_shard_available_action_exception` is not an issue with Kibana, it's
an ES issue, so this PR catches these types of errors and log them at a
debug level instead of a warn level to avoid polluting the logs with
errors we have no control over.

Excluding those results, we see a different and less frequent stack
trace (100+ in the last 15 days):

```
TypeError: Cannot read properties of undefined (reading 'by_rule_type_id')
    at getTotalAlertsCountAggregations (/usr/share/kibana/node_modules/@kbn/alerting-plugin/server/usage/lib/get_telemetry_from_alerts.js:49:109)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 6)
    at TaskManagerRunner.run (/usr/share/kibana/node_modules/@kbn/task-manager-plugin/server/task_running/task_runner.js:325:22)
```

For actions telemetry, the volume of these errors is much lower.
Unfortunately, we are not logging the stack trace for these errors so
it's harder to track down the source. I've updated the code to store the
stack trace as well as adding the same handling for
`no_shard_available_action_exception` under the assumption that it could
also be getting these errors.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 09:44:03 -05:00
Elena Shostak
504510b92b
[Hardening] Kibana Feature API Privileges Names (#208067)
## Summary

As part of our effort to harden API action definitions and enforce
standards this PR adds an utility `ApiPrivileges` class.
It is supposed to be used for both feature registration and API route
definition to construct the privilege name.
```ts
plugins.features.registerKibanaFeature({
  privileges: {
    all: {
      app: [...],
      catalogue: [...],
      api: [ApiPrivileges.manage('subject_name')],
      ...
    },
    read: {
      ...
      api: [ApiPrivileges.read('subject_name')],
      ...
    },
  },
})
....

// route definition
router.get(
  {
    path: 'api_path',
    security: {
      authz: {
        requiredPrivileges: [ApiPrivileges.manage('subject_name')],
      },
    },
  },
  async (ctx, req, res) => {}
);
```

`require_kibana_feature_privileges_naming` eslint rule has been added to
show warning if the API privilege name doesn't satisfy the naming
convention.

### Naming convention

- API privilege should start with valid `ApiOperation`: `manage`,
`read`, `update`, `delete`, `create`
- API privilege should use `_` as separator

 `read-entity-a`
 `delete_entity-a`
 `entity_manage`
 `read_entity_a`
 `delete_entity_a`
 `manage_entity`

> [!IMPORTANT]  
> Serverless ZDT update scenario:
>
> - version N has an endpoint protected with the `old_privilege_read`.
> - version N+1 has the same endpoint protected with a new
`read_privilege`.
> 
> There might be a short period between the time the UI pod N+1 passes
SO migrations and updates privileges and the time it's marked as
ready-to-handle-requests by k8s, and when UI pod N is terminated.
>
> After discussion with @legrego and @azasypkin we decided to ignore it
due to the perceived risk-to-cost ratio:
> 1. The time window users might be affected is very narrow because we
register privileges late in the Kibana startup flow (e.g., after SO
migrations).
> 2. The transient 403 errors users might get won't result in session
termination and shouldn't lead to data loss.
> 3. The roll-out will be performed in batches over the course of
multiple weeks and implemented by different teams. This means the impact
per release shouldn't be significant.

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

__Relates: https://github.com/elastic/kibana/issues/198716__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 15:22:29 +01:00
Yan Savitski
78606e0fcf
[Search] [Playground] Hide create index button when plugin not available (#209165)
## Summary

Hide create index button when elastisearch feature is disabled
2025-02-03 15:15:42 +01:00
Milton Hultgren
73d46c7d1f
[EEM] Add limits to ES|QL queries (#209247)
To suppress deprecation warnings in Kibana logs.
2025-02-03 14:58:12 +01:00
Steve Gordon
1d1599ebf8
Update .NET documentation (#203391)
## Summary

This PR updates our quick starts for .NET to use the latest preferred
methods. I have been unable to get this running locally. If it's
possible for an approver to check it renders correctly, that would be
ideal. Otherwise, I can look at getting a VM set up so I can try to
build Kibana and run it in that environment.

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

None
2025-02-03 14:55:34 +01:00
elastic-renovate-prod[bot]
be67570731
Update dependency moment-timezone to ^0.5.47 (main) (#208526)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [moment-timezone](http://momentjs.com/timezone/)
([source](https://togithub.com/moment/moment-timezone)) | dependencies |
patch | [`^0.5.46` ->
`^0.5.47`](https://renovatebot.com/diffs/npm/moment-timezone/0.5.46/0.5.47)
|

---

### Release Notes

<details>
<summary>moment/moment-timezone (moment-timezone)</summary>

###
[`v0.5.47`](https://togithub.com/moment/moment-timezone/blob/HEAD/changelog.md#0547-2025-01-28)

[Compare
Source](https://togithub.com/moment/moment-timezone/compare/0.5.46...0.5.47)

-   Updated data to IANA TZDB `2025a`.

</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://togithub.com/renovatebot/renovate).

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

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 14:27:58 +01:00
Marco Vettorello
7260564f6a
[Vega] Fix highlight for HJSON (#208858)
## Summary

This PR fixes the missing highlight theme for HJSON specs in Vega.
The issue https://github.com/elastic/kibana/issues/205711 was caused by
https://github.com/elastic/kibana/pull/182348 that inadvertently
specified the code-editor package as sideEffect free. This cause the
compiler to exclude every import without exported and used methods.
This was the case for the code-editor that registered some language
highlighters in that way.

The solution adopted here is to mark the register_language.ts file as a
file with side effects, the alternative solution can be to register
these directly from within the code_editor component.
A third option is to move these registration within the monaco package
where other languages are also registered.
I'd like to leave to @elastic/appex-sharedux the preference to followup
with a better fix for the future.

I'd also like to have the opinion from @elastic/kibana-operations
because the misconfigured package issue can be seen only in production
and not in development mode. Is it possible that webpack doesn't apply
treeshaking when in development mode?

fix https://github.com/elastic/kibana/issues/205711
Should also fix the same issue but for TSVB Markdown

The fix was tested on CI by running at first only the CI FT with the
`sideEffects:false` to verify the failure (see
[build](https://buildkite.com/elastic/kibana-pull-request/builds/272375))
and then with the fix specifying the actual file that contains side
effects.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-03 14:18:35 +01:00
Gergő Ábrahám
158a077731
[EDR Workflows] Fix invalid event filter for cloud workloads (#208974)
## Summary

Fixes the bug of the invalid event filter created automatically when
creating a cloud workloads endpoint integration. The issue was a type
issue: `undefined` or an object is expected, instead an array was
passed.

To make sure this does not happen again, the type for the `meta` field
was updated from the deprecated `t.object` to `t.UnknownRecord`, which
is able to catch similar issues as a type error:
ca0c01b63b

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 14:15:17 +01:00
Elena Shostak
e890494ea7
[FTR] Skipped prebuilt rules test suite for FIPS (#209091)
## Summary

Skipped prebuilt rules test suite for FIPS.
We intentionally need to skip this test for FIPS due to [FIPS
overrides](542a56b482/packages/kbn-test/src/functional_tests/lib/fips_overrides.ts).

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 13:25:53 +01:00
Maxim Kholod
778f70cf5f
Remove setup_access from gcp package policy (#209126)
## Summary

`setup_access` doesn't exist on GCP input type manifest [on CSPM
integration
](https://github.com/elastic/integrations/blob/main/packages/cloud_security_posture/data_stream/findings/manifest.yml#L200)
but being added by the client-side code. This works atm in the UI but
generates incorrect Preview API request which is used by automation. In
general we shouldn't pass variables that don't exist on the input
manifest as it can break in any future version of the stack. AWS and
Azure already don't have this logic, bringing GCP on par with them

Relates to:
- https://github.com/elastic/kibana/issues/172687 

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [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)
2025-02-03 13:22:44 +01:00
Kibana Machine
c1104ac681
[ES|QL] Update function metadata (#209231)
This PR updates the function definitions and inline docs based on the
latest metadata from Elasticsearch.

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-02-03 13:21:36 +01:00
Jean-Louis Leysens
6bcdac4571
[Upgrade Assistant] Critical Kibana API deprecations should not block upgrades (#209128)
## Summary

Filters out any deprecated Kibana API usages from blocking upgrade
status.


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

### Risks

Should be mitigated by E2E tests
2025-02-03 12:29:05 +01:00
Julia Bardi
07a61abfd4
[Fleet] Add sync integrations fields to remote ES output (#208516)
## Summary

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

Added `sync_integrations` flag to remote elasticsearch output to the API
and UI with the Remote Kibana URL and API key (secret).

To test:
- enable feature flag: `xpack.fleet.enableExperimental:
['enableSyncIntegrationsOnRemote']`
- add/edit output and enable Synchronize integrations switch
- When the switch is enabled, Kibana URL and API key is required,
otherwise optional (but still has to be valid URL)
- test preconfigured output with the new fields

<img width="724" alt="image"
src="https://github.com/user-attachments/assets/5cf4c0b1-f8c3-4447-a0ef-a8aa8e362277"
/>

Example preconfig:
```
  - name: 'Preconfiged remote output'
    type: 'remote_elasticsearch'
    id: 'remote-output2'
    hosts: ["http://192.168.64.1:9200"]
    sync_integrations: true
    kibana_url: "http://localhost:5601"
    secrets:
      service_token: token
      kibana_api_key: key
```

Added callout to help create the API key (privileges have to be
confirmed when https://github.com/elastic/kibana/issues/192363 is done)

<img width="714" alt="image"
src="https://github.com/user-attachments/assets/5a5e7a8c-0a56-4234-ad66-b15f5f53de76"
/>


### 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-02-03 12:27:34 +01:00
Maryam Saeidi
8fe5738b24
[Custom threshold] Fix using data view runtime fields during rule execution for the custom threshold rule (#209133)
Fixes #200772

## 🐉  Summary


This PR fixes supporting data view runtime fields during rule execution
for the custom threshold rule.

## 🧪 How to test

1. Create a runtime field as shown below:

    |Runtime field| Preview|
    |---|---|

|![Image](e93efad5-bc3b-4306-b820-8b096dbba360)|

2. Make sure alerts are generated as expected both for regular and
no-data alerts:

![image](https://github.com/user-attachments/assets/a2174e40-11a4-4d75-8500-bfce126ba7cd)

### TODO
- [x] Add an API integration test
    - [x] Test on MKI
2025-02-03 12:09:29 +01:00
Vadim Kibana
5600f2b675
[ES|QL] Show common fields source indices and join index (#208681)
## Summary

Partially addresses https://github.com/elastic/kibana/issues/206939

This PR introduces the following changes in the `JOIN` command
autocomplete.

Shows intersection of source index and join index fields, moves those
fields to the very top of the list. In the below example the `currency`
field appears in both indices, hence, it is at the very top and with a
different icon:

<img width="786" alt="Screenshot 2025-01-28 at 21 29 52"
src="https://github.com/user-attachments/assets/2c1a058f-80a2-4060-a20e-4a0681043dde"
/>

Adds join index fields to the total list of all fields. In the below
example, the `continenet` field is available only in the joined index,
but it is added to the total list.

<img width="713" alt="Screenshot 2025-01-28 at 21 30 08"
src="https://github.com/user-attachments/assets/7cd44ebf-5fe9-4051-a6eb-3feb28801fa5"
/>


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-02-03 12:09:12 +01:00
Ash
59a15be977
[SecuritySolution][Endpoint] Update request docs for isolate/release/processes (#209097) 2025-02-03 11:38:14 +01:00
Pierre Gayvallet
1c218f9846
Introduce the InferenceChatModel for langchain (#206429)
## Summary

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

This PR introduces the `InferenceChatModel` class, which is a langchain
chatModel utilizing the inference APIs (`chatComplete`) under the hood.

Creating instances of `InferenceChatModel` can either be done by
manually importing the class from the new `@kbn/inference-langchain`
package, or by using the new `createChatModel` API exposes from the
inference plugin's start contract.

The main upside of using this chatModel is that the unification and
normalization layers are already being taken care of by the inference
plugin, making sure that the underlying models are being used with the
exact same capabilities. More details on the upsides and reasoning in
the associated issue.

### Usage

Usage is very straightforward

```ts
const chatModel = await inferenceStart.getChatModel({
  request,
  connectorId: myInferenceConnectorId,
  chatModelOptions: {
    temperature: 0.2,
  },
});

// just use it as another langchain chatModel, e.g.
const response = await chatModel.stream('What is Kibana?');
for await (const chunk of response) {
     // do something with the chunk
}
``` 

### Important

This PR is only adding the implementation, and not wiring it anywhere or
using it in any existing code. This is meant to be done in a later
stage. Merging that implementation first will allow to have distinct PRs
for the integration with search (playground) and security (assistant +
other workflows), with proper testing

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-03 11:32:16 +01:00
Achyut Jhunjhunwala
91ce0ba9e8
[Dataset Quality] Fix flaky tests discover navigation (#208909)
## Summary

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

- The PR adds a retry logic while getting the Datasource Selector text
on the Discover page.
- Also renames the tests as they were missed when migration of links
from Log Explorer to Discover were done


### Why do we need retry logic

We navigate using locators.

**Without retry** - The link generated has a hash and thus the check for
`dataSelectorId` fails

```
https://achyut-mki-test-runner-e64297.kb.eu-west-1.aws.qa.elastic.cloud/app/r?l=DISCOVER_APP_LOCATOR&v=9.0.0&lz=N4IgLglgtgpgSgQwHYHMYgFygGYCcD2UmIS%2BA7gLQBMALABYgA04%2BxpZIAvs7jHjAGc6ASSRgYuAG4IANplAAHBAFcB6DGFzKYzaTO2YAbAAZTx7iAAmCMAgBqEGGWGXiM%2FCgEUESgMZ0YADoEX19BLwAqJisbe0cyAGUFGF95EAhXDBB3T28%2FAODQ8Ioo5kgwGXVsjy8fEIKQsIFI6MhYADFHGUsAOQRYYgABNsFbKAUuZgBHbVwATzSZZBRlBDRiAGtZhent4gB9CBRSXksMAAIoi198fSgkAUwAbQBdZmwIGXFcR4wn0FgtjSECQlhgAA83DU8vUgo1ilddhIFlgQFAbP59go6LgEGo0tZbPsBJoYP1Akh%2BoI%2FFUFARLMpfJB8EguJxOG90mIJHpiCowKxmAJ8LgwM8niBhtBRv0JswwQJUi8XpwgA%3D%3D%3D
```

**With retry** - This link then redirects to as Discover Locator
resolves it to

```
https://achyut-mki-test-runner-e64297.kb.eu-west-1.aws.qa.elastic.cloud/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-24h,to:now))&_a=(columns:!(),dataSource:(dataViewId:%27logs-apache.access-*%27,type:dataView),filters:!((meta:(index:%27logs-apache.access-*%27),query:(match_phrase:(data_stream.namespace:production)))),interval:auto,query:(language:kuery,query:%27_ignored:%20*%27),sort:!(!(%27@timestamp%27,desc)))
```

**Tested on MKI before and after the fix to confirm the issue is
evidently reproducible and with the fix goes away**
2025-02-03 10:46:41 +01:00
Sonia Sanz Vivas
b922481773
[Index Management] Verify if isLoading before showing warning in add lifecycle confirm modal (#209108)
Fixes https://github.com/elastic/kibana/issues/208958

## Summary
In this modal, we show a warning banner if there is no policies. The
problem was that the modal was render before the policies are loading.
This PR adds a `isLoading` state that ensures that this warning only is
shown if the policy list is empty after it has been fully loaded.


### How to test

1. Navigate to Index Management.
2. Create an index.
3. Select the index --> Click "Manage index" --> Click "Add lifecycle
policy"
4. Verify that no warning flashes before the policy shows.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-03 10:01:54 +01:00
Peter Pisljar
762fd8c4d0
lens esql generation (#196049) 2025-02-03 09:53:24 +01:00
Kibana Machine
e0fa8468a7
[api-docs] 2025-02-03 Daily api_docs build (#209232)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/972
2025-02-03 08:17:37 +01:00
Kibana Machine
fb4629ca60 skip failing test suite (#209056) 2025-02-03 11:52:14 +11:00
Tiago Costa
c81540fa3a
skip flaky suite (#184681) 2025-02-02 19:11:02 +00:00
elastic-renovate-prod[bot]
8c2f21e06c
Update dependency @launchdarkly/node-server-sdk to ^9.7.3 (main) (#208807) 2025-02-02 18:12:41 +01:00
Alejandro Fernández Haro
e01208030b
[ES body removal] @elastic/observability-ui (#204873) 2025-02-02 18:10:02 +01:00
Kibana Machine
777897cfa7
[api-docs] 2025-02-02 Daily api_docs build (#209220)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/971
2025-02-02 08:11:30 +01:00
Tiago Costa
dee13d1193
chore(NA): unskip x-pack/solutions/security/plugins/security_solution/public/management cypress e2e tests (#209199)
Closes https://github.com/elastic/kibana/issues/209183

This PR re-enables the suites previously disabled on Defend Workflows
cypress tests.
The that led us to skip those suites are now resolved.
2025-02-01 05:30:47 +00:00
Jon
6cea13003e
[ci] Increase Checks disk size (#209198) 2025-01-31 20:02:03 -06:00
Tiago Costa
07a3eec482
skip flaky suite (#209064) 2025-02-01 01:42:18 +00:00
Kibana Machine
1758ffeb9c skip failing test suite (#209063) 2025-02-01 12:35:46 +11:00
Kibana Machine
d2be67f12f skip failing test suite (#207423) 2025-02-01 12:35:22 +11:00
Steph Milovic
0d415a6d3a
[Security AI] Bedrock prompt tuning and inference corrections (#209011) 2025-01-31 16:14:34 -07:00
Tiago Costa
48a69daccf
chore(NA): skip x-pack/solutions/security/plugins/security_solution/public/management cypress e2e tests (#209160)
This PR skips Defend Workflows test suites to unblock main.
2025-01-31 22:39:04 +00:00
Kibana Machine
5952b042ab skip failing test suite (#209065) 2025-02-01 09:33:16 +11:00
Kibana Machine
a6df3bd750 skip failing test suite (#209066) 2025-02-01 09:32:16 +11:00
elastic-renovate-prod[bot]
2468329db4
Update jquery (main) (#206180)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[@types/jquery](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery)
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery))
| devDependencies | minor | [`^3.3.31` ->
`^3.5.32`](https://renovatebot.com/diffs/npm/@types%2fjquery/3.3.31/3.5.32)
|
| [jquery](https://jquery.com)
([source](https://togithub.com/jquery/jquery)) | dependencies | minor |
[`^3.5.0` ->
`^3.7.1`](https://renovatebot.com/diffs/npm/jquery/3.6.0/3.7.1) |

---

### Release Notes

<details>
<summary>jquery/jquery (jquery)</summary>

### [`v3.7.1`](https://togithub.com/jquery/jquery/releases/tag/3.7.1):
jQuery 3.7.1 Released: Reliable Table Row Dimensions

[Compare
Source](https://togithub.com/jquery/jquery/compare/3.7.0...3.7.1)


https://blog.jquery.com/2023/08/28/jquery-3-7-1-released-reliable-table-row-dimensions/

### [`v3.7.0`](https://togithub.com/jquery/jquery/releases/tag/3.7.0):
jQuery 3.7.0: Staying in Order

[Compare
Source](https://togithub.com/jquery/jquery/compare/3.6.4...3.7.0)


https://blog.jquery.com/2023/05/11/jquery-3-7-0-released-staying-in-order/

### [`v3.6.4`](https://togithub.com/jquery/jquery/releases/tag/3.6.4):
jQuery 3.6.4 Released: Selector Forgiveness

[Compare
Source](https://togithub.com/jquery/jquery/compare/3.6.3...3.6.4)


https://blog.jquery.com/2023/03/08/jquery-3-6-4-released-selector-forgiveness/

### [`v3.6.3`](https://togithub.com/jquery/jquery/releases/tag/3.6.3):
jQuery supports CSS.supports in jQuery 3.6.3

[Compare
Source](https://togithub.com/jquery/jquery/compare/3.6.2...3.6.3)


https://blog.jquery.com/2022/12/20/jquery-3-6-3-released-a-quick-selector-fix/

### [`v3.6.2`](https://togithub.com/jquery/jquery/releases/tag/3.6.2):
jQuery 3.6.2 :has arrived!

[Compare
Source](https://togithub.com/jquery/jquery/compare/3.6.1...3.6.2)

https://blog.jquery.com/2022/12/13/jquery-3-6-2-released/

### [`v3.6.1`](https://togithub.com/jquery/jquery/releases/tag/3.6.1):
jQuery 3.6.1 Maintenance Release

[Compare
Source](https://togithub.com/jquery/jquery/compare/3.6.0...3.6.1)

https://blog.jquery.com/2022/08/26/jquery-3-6-1-maintenance-release/

</details>

---

### Configuration

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

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

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

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

---

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

---

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

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

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
2025-01-31 23:15:26 +01:00
Viduni Wickramarachchi
50b8776b1f
[Obs AI Assistant] Fix multiple flyouts (#209158) 2025-01-31 14:59:01 -05:00
Davis McPhee
b457cddfc5
Revert "[SKIP ON MKI] 4 files from .../security/common_configs/config.group5" (#209138)
## Summary

This reverts commit ff0781834c.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-01-31 15:45:23 -04:00
Nicolas Chaulet
ef77adf686
[Fleet] Include removed agent policies agent count in confirm modal multiple integration policies (#209137) 2025-01-31 14:37:48 -05:00
Kibana Machine
1b61f389f0 skip failing test suite (#209056) 2025-02-01 05:49:01 +11:00
Shahzad
5c350b4492
[Synthetics] Fix monitor status rule for empty kql query results !! (#208922)
## Summary

Fixes https://github.com/elastic/kibana/issues/208915 !!

Fix monitor status rule for empty kql query results !!

1. Made sure if kql filter return no configs ids, rule break early to
not cover all monitors

### Testing

Create a synthetics rule with a kql filter which matches no monitors and
make sure rule doesn't trigger for other down monitors in the system
<img width="661" alt="image"
src="https://github.com/user-attachments/assets/ed0b3a1f-e8d1-4e22-a77d-1237ce557ac5"
/>


### Before

Create a rule and you can observe that rule would get triggered for all
monitors down in the system with matching condition criteria
2025-01-31 18:45:41 +01:00
Krzysztof Kowalczyk
9112044369
[Dashboard] Add tabindex to panel header tooltip, make it sibling to h2 (#208391)
## Summary
This PR makes tooltip on dashboard panel header keyboard focusable and
moves the tooltip to be a sibling of the `<h2>`.
Closes: #117233
2025-01-31 18:01:17 +01:00
Tiago Costa
0227642b4d
skip flaky suite (#209056) 2025-01-31 16:53:33 +00:00