Commit graph

32621 commits

Author SHA1 Message Date
Stratoula Kalafateli
788e9b34dd
[ES|QL] Initialize with time named params for dataviews without @timestamp (#189367)
## Summary

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

For indices with no @timestamp, when the users are transitioning from
the dataview mode to the ES|QL mode then we are defaulting to
```
from dataviewIndex | where dataviewTimefield <= ?end and dataviewTimefield >= ?start
```

![meow](https://github.com/user-attachments/assets/d55e17d1-d867-400a-b6eb-b7cf7047d070)

which will :
1. Train the users for the named params
2. Enable the histogram
3. Enable the datepicker

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

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2024-08-01 17:39:46 +02:00
Carlos Crespo
9189208b5e
[Infra] Move apm common types to a package (#189649)
part of [#188752](https://github.com/elastic/kibana/issues/188752)

## Summary

Move some types to `kbn-apm-types`. These types will be used later in
the `apm-data-access` plugin
https://github.com/elastic/kibana/pull/189654.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-01 17:14:42 +02:00
Melissa Alvarez
b6b5a89fa4
[ML] Job selection flyout: UX improvements (#189239)
## Summary

Related meta issue: https://github.com/elastic/kibana/issues/182042
Fixes https://github.com/elastic/kibana/issues/186228

This PR makes some small UX improvements to the Job selection flyout:

- replaces the callout with the EuiEmptyPrompt
- the Primary action (Apply) is now on the right of the footer and the
Secondary action (Close) is aligned left

<img width="725" alt="image"
src="https://github.com/user-attachments/assets/3469106b-33a4-4060-b0a0-cbfe582187aa">

<img width="717" alt="image"
src="https://github.com/user-attachments/assets/9aae9bc3-04dd-426d-a5ea-9f059dc64e0e">

In dashboard, shows the empty prompt when no jobs in the panel config
flyout:

<img width="779" alt="image"
src="https://github.com/user-attachments/assets/b6526e28-fbaf-43f2-a0d1-27e60bac5cb0">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-01 08:53:05 -06:00
jennypavlova
fec2318ee3
[Infra] Create new formulas for rx and tx metrics (#189281)
Closes #188641

## Summary

This PR adds new formulas for rx and tx metrics for hosts. In inventory
we show the old metrics as legacy and the new ones with the old metrics
labels (this affects only hosts):

<img width="1788" alt="image"
src="https://github.com/user-attachments/assets/d3e5bf26-e521-4ff8-b00b-1d78eebd56f9">

All old alerts should work - The only difference is that it will show
the metric as "Legacy" and it still can be used in the rules. The hosts
view and the lens charts are using a new formula

## Testing
- Check the network metrics in the inventory / alert flyout (both the
new ones and the old ones)
- Check the network metrics and charts in the hosts view (only the new
ones should be available)


https://github.com/user-attachments/assets/886fd5a0-858c-458b-9025-eb55913b1932



https://github.com/user-attachments/assets/7752939f-f693-4021-bf23-89e264ef0c2d

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-01 09:51:39 -05:00
Davis Plumlee
687df5188f
[Security Solution] Adds diff algorithm and unit tests for data_source field (#188874)
## Summary

Related ticket: https://github.com/elastic/kibana/issues/187659

Adds the diff algorithm and unit test coverage for the `data_source`
field we use in the prebuilt rules customization workflow. This field is
a custom grouped field that combines the `data_view_id` field and
`index_pattern` field that are used interchangeably of one another on
the rule type for a rule's data source.


### Checklist

Delete any items that are not applicable to this PR.

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


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-08-01 10:15:06 -04:00
Sébastien Loix
93378d9e37
[Stateful sidenav] Add telemetry (#189275) 2024-08-01 09:10:00 -05:00
jennypavlova
a18d60c8c1
[Infra] Remove additional indexFields related functions (#189706)
Relates to https://github.com/elastic/kibana/issues/180690

## Summary

This PR is a follow-up to https://github.com/elastic/kibana/pull/189541
and removes additional functions related to the `indexFields` that are
no longer needed

## Testing

Check `metricIndicesExist` and `remoteClustersExist` in the request by
changing the settings (in the first video I use metricbeat and no oblt
cluster and in the second one I am connected to oblt cluster)



https://github.com/user-attachments/assets/59920479-5a42-4a6a-a66a-307ddfc48fd8



https://github.com/user-attachments/assets/ef04120c-6873-4b0c-813c-388147c2b741
2024-08-01 15:38:42 +02:00
Eyo O. Eyo
6a2d0147fb
[Reporting] upgrade puppeteer to v22.13.1 (#189485)
## Summary

Update for puppeteer, the following changeset updates puppeteer to
version `22.13.1`.

The chromium version required for this version of puppeteer is
`126.0.6478.182` from revision `1300313`, as such the chromium binary
included for windows and darwin platforms either match or were the
closest revision to the expectation. The linux headless binary was built
from commit `5b5d8292ddf182f8b2096fa665b473b6317906d5` of the same
revision.

<!--
### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

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


### How to verify linux headless build
- clone the following repo
https://github.com/tsullivan/kibana-dev-docker
- pull this particular PR
- follow the steps outlined in the repo, replacing any occurrence of
`kibana-8.13.0-SNAPSHOT-linux-aarch64.tar.gz` from the repo above's step
with the output of running build on this changeset.
- before running step 4, modify the `kibana.yml` file from the
`kibana-dev-docker` repo and include the following so we might be able
to verify the version of chromium running;
   ```yaml
     logging.loggers:
       - name: plugins.reporting
         level: debug
   ```
- complete the steps outlined in the README, you'll have a linux distro
of kibana running on port `5601`
- Attempt creating exports of PDF and PNG reports, in dashboard, canvas,
and visualizations, on report creation attempt we would see a log output
that prints out the chromium version exactly matching this;

<img width="1645" alt="Screenshot 2024-07-30 at 16 07 10"
src="https://github.com/user-attachments/assets/930a05fa-385b-4429-89e8-7b846043be59">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-01 15:32:19 +02:00
Cauê Marcondes
bd5c273032
[APM][ECO] renaming log error rate to log error % (#189700)
closes https://github.com/elastic/kibana/issues/189354

<img width="188" alt="Screenshot 2024-08-01 at 09 28 47"
src="https://github.com/user-attachments/assets/9be41354-6c26-4752-bcb6-22c6226cf6b6">
<img width="608" alt="Screenshot 2024-08-01 at 09 30 00"
src="https://github.com/user-attachments/assets/11e83898-5d0a-4a99-8174-fa6e46705e7a">
2024-08-01 13:42:22 +01:00
Sid
63a1cbe25e
[Role Mappings] Warn when empty any or all rule role mappings are added (#189340)
Closes https://github.com/elastic/kibana/issues/187752

## Summary

Display a warning to users when a role mapping is created/updated to
include empty `any` or `all` rules

### Screenshots

<img width="1480" alt="image"
src="https://github.com/user-attachments/assets/6cb7e505-95d9-43c6-b8b7-a1f9114cdcda">


### Release notes

Display a warning to users whenever role mappings with empty `any` or
`all` rules are created or updated.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-01 05:33:36 -05:00
Joe McElroy
e39c182c06
[Search] [Playground] Fix cloud streaming (#189677)
## Summary

Three major changes:
- Created my own streaming function
- If on cloud, fill up the response so that exceeds the network buffer
that cloud puts into place
  - this buffer entry is ignored on the frontend
- use abortController instead of a variable. Subscribe to changes to the
network request to abort controller signal
- there was a random wait timeout for each chunk. This was introduced
with the error handling though im unsure why its needed. This causes a
big delay in the responses.

### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-01 05:12:48 -05:00
christineweng
5fd6a486e8
[Security Solution][Alert Details] Remove alert type charts feature flag (#189437)
## Summary

Removing an unused feature flag called `alertTypeEnabled`. The feature
was added in 8.7 (https://github.com/elastic/kibana/pull/152872) but was
never enabled.

This PR removed unused components and renamed directory from
`alert_by_type_panel` to `alerts_by_rule_panel`.


### 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
2024-07-31 17:18:15 -05:00
Patryk Kopyciński
0be8295ed0
[Security Assistant] Fix langgraph issues (#189287)
## Summary

- Fixed `Regenerate` button for Gemini
- Fixed auto title functionality
- Enabled `assistantBedrockChat` by default

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 15:32:29 -05:00
Philippe Oberti
deb69fb948
[Security Solution][Alert details] - move table tab content to flyout folder (#189140) 2024-07-31 15:26:43 -05:00
Kyle Pollich
b40beb17a6
[Fleet] Retry transient errors in agent status API (#189563)
## Summary

Use `retryTransientEsErrors` when fetching agent status to avoid flaky
ES errors throwing a 500.

I'd love to add tests for this, but it's a bit challenging as these
methods rely heavily on an ES runtime field to populate the status
values. The amount of mocking necessary to add Jest tests for these was
getting a bit ridiculous, so maybe FTR is a better way to go?
2024-07-31 14:13:59 -04:00
Stratoula Kalafateli
cf3c4056a3
[ES|QL][Lens] Sends the dashboard filters in the request (#189611)
## Summary

Passes the dashboard context (query, filters, timerange) to the ES|QL
query in order to calculate the results correctly
2024-07-31 19:56:23 +02:00
Maxim Palenov
f5aec5de29
[Security Solution] Reapply Auto-bundle Timeline API OpenAPI specs (#189315)
**Addresses**: https://github.com/elastic/kibana/issues/184428
**Relates to:** https://github.com/elastic/kibana/pull/188844

## Summary

The original [PR](https://github.com/elastic/kibana/pull/188844) was
rolled back by @Ikuni17 due to CI failures in `main` branch. It turned
the problem was caused by a bug in `check_for_changed_files()` which is
fixed in https://github.com/elastic/kibana/pull/189316.

This PR reapplies https://github.com/elastic/kibana/pull/188844 and it
also includes changes to reduce CI reruns (has to be rerun manually in
draft PRs) caused by changes to generated files. It's achieved by
reducing a number of `check_for_changed_files()` invocations.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 11:48:44 -05:00
Agustina Nahir Ruidiaz
8d4f579466
[Security Solution] Create new feature flag - dataIngestionHubEnabled (#189620)
## Summary

New feature flag added: `dataIngestionHubEnabled` and implemented in
`onboarding` page.


### Checklist

Delete any items that are not applicable to this PR.

- [ ] [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
2024-07-31 18:00:10 +02:00
Cauê Marcondes
305d7f4586
[APM][ECO] Hide feedback modal/remove search bar (#189526)
closes https://github.com/elastic/kibana/issues/189385
- [x] Don't show the feedback modal after it has been dismissed.


https://github.com/user-attachments/assets/894430cf-cc3b-407d-8ff6-50a189d31f4b

closes https://github.com/elastic/kibana/issues/189364
- [x] Remove the KQL bar for log-only services.
<img width="1555" alt="Screenshot 2024-07-30 at 15 49 49"
src="https://github.com/user-attachments/assets/deec8956-1e8a-4517-aa5c-ea3f3225f2e6">

- [x] Remove icon from the breadcrumb, it was breaking the page title.
<img width="1402" alt="Screenshot 2024-07-30 at 16 35 58"
src="https://github.com/user-attachments/assets/360ec82b-aef5-463c-9673-54a6c70ee2c0">
2024-07-31 16:11:11 +01:00
Jiawei Wu
c73bbc99c4
[Response Ops] Remove "Rule" icontypes (#189342)
## Summary
Fixes: https://github.com/elastic/kibana/issues/189212

Removes `rule` icon type, which is invalid, with valid icons

<img width="489" alt="Screenshot 2024-07-29 at 12 41 53 AM"
src="https://github.com/user-attachments/assets/ea5d158b-85ea-4465-83ba-fcb14486dbfa">

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-31 08:06:24 -07:00
Katerina
263f00c9de
[APM][ECO] Fix splash screen with the custom no data page (#189607)
## Summary

closes https://github.com/elastic/kibana/issues/189479






https://github.com/user-attachments/assets/889a5778-23c1-4e55-9757-b0df29738fc3
2024-07-31 09:32:35 -05:00
Saikat Sarkar
0cc079a50c
Replace 'model_id' with 'inference_id' for inference endpoints (#189545)
This PR resolves https://github.com/elastic/search-team/issues/7993

Recently, a backend https://github.com/elastic/elasticsearch/pull/111366
was merged to elasticsearch which basically replaces 'model_id' with
'inference_id' in the GET inference api. This change was also backported
to v8.15. Due to this change, the frontend works related to
semantic_text UI and Inference Endpoints view are broken.

---------

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
2024-07-31 08:26:16 -06:00
Philippe Oberti
9e4b353897
[Security Solution][Notes] - fix infinite look refresh note with investigation query (#189606) 2024-07-31 09:25:39 -05:00
Alexi Doak
e828f7508d
[ResponseOps] Remove tech preview from ES query ES|QL rule type (#189568)
Resolves https://github.com/elastic/kibana/issues/189566

## Summary

This PR removes tech preview from the ES query ES|QL rule form


### To verify

- Create an ES query ES|QL rule and verify that the tech preview badge
is removed from the ui.
2024-07-31 07:00:01 -07:00
Dominique Clarke
65a99a5115
[Uptime] only check index status on plugin register if the user has uptime privileges (#189540)
## Summary

Resolves https://github.com/elastic/kibana/issues/186838

Prevents checking for Uptime data on plugin register when the user does
not have Uptime privileges

## Background Context
Uptime is hidden by default. However, there are two ways that the Uptime
app can become accessible.
1. Turning on the Uptime app in the advanced settings
2. If you have data in your Uptime indices within the past 7 days.

The data check present in Uptime plugin register is intended to enable
Uptime if there is Uptime data within the past 7 days. However, there's
no need to check this data if the user does not have privileges.

### Testing
1. Create a user without Uptime Kibana privileges
2. Open up the network tab in dev tools
3. Refresh any page in Kibana
4. You should not see a call to `internal/uptime/index_status`
2024-07-31 09:55:37 -04:00
Ahmad Bamieh
8e10d0eff2
[EBT] Use analytics module (#189052)
The EBT pacakge has been moved to a separate NPM package
([@elastic/ebt](https://www.npmjs.com/package/@elastic/ebt))

The npm package is on version `0.0.x` until we finish the reviews then
i'll publish the `1.0.0` version before merging this PR.

The PR is mostly code deletes after moving the code to the public ebt
github repo https://github.com/elastic/ebt

The significant changes are:
1. removed the `packages/analytics/ebt` package from kibana
2. remove @kbn/ebt references in favor of the npm package.
3. Added a util package to provide the package with the telemetry
endpoint and headers
This was previously backed into the package but now i've rewired it be
provided from Kibana, this way we have more control over the URL and
headers we use to send EBT telemetry for our elastic endpoint, which
will probably be different between users of this package and this way
we'll also avoid republishing the package if we ever want to change
these details.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2024-07-31 08:31:20 -05:00
Maryam Saeidi
5219a1f14d
[Custom threshold] Respect query:allowLeadingWildcards in optional query filter (#189488)
Partially fixes.   #189072

## Summary

In this PR, we pass the `query:allowLeadingWildcards` for the optional
filter to the custom threshold (specifically
`getSearchConfigurationBoolQuery` function that generates the related ES
Query).

|Before|After|
|----|---|

|![image](a0190f81-d137-4b75-95f2-7358ece99468)|

#### Rule

<img
src="https://github.com/user-attachments/assets/70d2de37-2285-450f-88bf-45aa88954019"
width=500 />

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 15:29:04 +02:00
Kevin Lacabane
1e23b6dc3d
[eem] add default lookback (#189395)
Closes https://github.com/elastic/kibana/issues/187348

This changes adds an optional `history.settings.lookbackPeriod` property
that will default to `1h` if none is provided. The main point is to
prevent accidental processing of the entire dataset when creating a
definition.

I took the opportunity to do some refactoring:
- `durationSchema` was transforming a literal duration (eg `1h`) into a
`moment.Duration` with overriden `toJSON` property. since we don't use
any of the `moment` functionalities in consuming code the schema now
returns the raw string after regex validation
- split the `generateHistoryTransform` in `generateHistoryTransform` and
`generateBackfillHistoryTransform`
2024-07-31 14:13:39 +02:00
Julia Rechkunova
22de72d022
[Discover] Allow to select/deselect all rows in the grid at once (#184241)
- Closes https://github.com/elastic/kibana/issues/175943

## Summary

This PR adds a checkbox which allows now to select all rows at once (or
deselect all) on the current page.

- [x] A new checkbox was added to the grid header
- [x] "Compare documents" button was moved under "Selected" menu
- [x] "Compare documents" button gets disabled if user selects more than
100 rows
- [x] "Selected" menu button got a new look
- [x] A new "Select all X" button was added next too "Selected" menu
button

<img width="1554" alt="Screenshot 2024-07-18 at 14 45 00"
src="https://github.com/user-attachments/assets/631cd350-be7d-43be-bc07-c0f6a943bacb">
<img width="563" alt="Screenshot 2024-07-18 at 14 45 10"
src="https://github.com/user-attachments/assets/d49d18f2-d255-401f-b157-3892e6f78d7c">
<img width="443" alt="Screenshot 2024-07-18 at 14 47 02"
src="https://github.com/user-attachments/assets/154c8292-c9b3-409d-b9f6-f78ac83527e9">


### 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/packages/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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 13:25:03 +02:00
Dmitry Gurevich
c0b60fef4c
[Cloud Security] Add test subjects for controls used in UI Sanity tests (#189510) 2024-07-31 14:03:52 +03:00
James Gowdy
f52275cd1d
Adding ml-ui as file upload code owner (#189603)
The ML team should be a code owner of the file upload plugin.
This [PR](https://github.com/elastic/kibana/pull/148130) removed them by
accident while removing duplicate entries.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 05:59:58 -05:00
jennypavlova
11446470e3
[Infra] Remove indexFields from /api/metrics/source endpoint (#189541)
## Summary

This PR removes `indexFields` from `/api/metrics/source endpoint`


![image](https://github.com/user-attachments/assets/496710da-55b8-4ec4-aadc-7bab794a8cfb)

## Testing

Check all infra pages (try creating an alert, open a host as page, etc.)
it should work as before
2024-07-31 05:55:15 -05:00
Carlos Crespo
b009ea0011
[Infra] Fix duplicate requests (#189505)
fixes: [#189484](https://github.com/elastic/kibana/issues/189484)

## Summary

Fix duplicate request during hosts view mounting cycle.


https://github.com/user-attachments/assets/dce73b2a-77e8-461a-bd9e-661fc40afe7a



https://github.com/user-attachments/assets/0e8c41b4-1a36-470f-855d-c189221ad1f6


The problem happened because the `buildEsQuery` returns a complex
object, making the `useFetcher` to treat every payload, as a new one,
triggering duplicate requests.

### Extra

I have refactored the `use_unified_search` and
`use_unified_search_url_state`. It was misusing `useReducer` and there
was some magic happening with `rxJS`. I tried to make the code easier to
understand

### How to test

- Start a local Kibana and es instances
- run `node scripts/synthtrace infra_hosts_with_apm_hosts --live `
- Navigate to Infrastructure > Hosts
- Open the dev tools and check if there is more than one call to
`api/metrics/infra` endpoint

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-31 12:53:12 +02:00
Alejandro Fernández Haro
4a63054366
[Serverless/Logstash] Hide suggestion to revisit roles or enable Stack Monitoring (#189480)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 11:46:01 +01:00
Kevin Lacabane
c0fa819927
[eem] return 403 if user is not authorized to enable entity discovery (#189423)
Return 403 if user is not authorized to enable or disable entity
discovery
2024-07-31 12:41:19 +02:00
Ash
1949fa6c4b
[Security Solution] Update scan response actions error codes (#189539)
## Summary

The correct error code info was not being shown when `scan` action
failed. This PR fixes that.

closes elastic/kibana/issues/188053

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2024-07-31 05:16:17 -05:00
Umberto Pepato
b5f617c891
[ResponseOps][Cases] Disable md5 algo in cases files when fips mode enabled (#189074)
## Summary

Disables the `md5` hashing algorithm in cases files when Kibana is
running in FIPS mode.

## References

Closes #185600

### 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
2024-07-31 11:29:22 +02:00
Janki Salvi
9eaae12825
[ResponseOps][Connectors] Fix ServiceNow ITSM connector for security detection rules (#189408)
## Summary

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

<img width="669" alt="image"
src="https://github.com/user-attachments/assets/4101f136-5efc-461f-8a49-c2b232d8b16a">

**How to test:**
- Add service now itsm connector to security solution's detection rules.
verify it works as expected.
- Add service now itsm connector to observability / stack rules. verify
it works as expected.
- Verify connector works as expected in test tab

### 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
2024-07-31 09:56:56 +01:00
Cauê Marcondes
20a9d4b045
[APM][ECO] Start tour after modal dismissed (#189504)
closes https://github.com/elastic/kibana/issues/189386

FYI: The service groups tour is still visible here because it'll be
removed on another PR.


https://github.com/user-attachments/assets/0ff85a78-1ebc-48a1-ad0c-aafa1b7766e5
2024-07-31 09:36:24 +01:00
Panagiota Mitsopoulou
1d406182e2
[Investigate] disable investigate plugin by default (#189359)
Disable feature flag `xpack.investigate.enabled` by default.
2024-07-31 03:36:05 -05:00
Maxim Palenov
51c8949af9
[Security Solution] Allow to specify custom servers and security for the result OpenAPI bundle (#189348)
**Resolves:** https://github.com/elastic/kibana/issues/189269
**Resolves:** https://github.com/elastic/kibana/issues/189270

## Summary

This PR adds an ability to specify OpenAPI `servers` and security requirements (`security`) to be used in the result bundle. `servers` and/or `security` in the source OpenAPI specs are be dropped when custom  `servers` and/or `security` provided.

## Details

Kibana is usually deployed at a single access point and manages authentication in a central way. That way it's much more convenient to have control on what `servers` and `security` are present in the result bundles. It will help to avoid conflicts, duplicates and update them in centralized way.

This PR extends OpenAPI bundler configuration options with `prototypeDocument`. "Prototype" in the name means it's a prototype for the result. The bundler uses certain properties from that prototype OpenAPI document to add them to the result OpenAPI bundle. The following properties are used

- `info` representing OpenAPI Info object (former `options.specInfo`)
- `servers` OpenAPI Server Object Array
- `security` + `components.securitySchemes` OpenAPI Security Requirement Object Array + OpenAPI Security Schemes Object (validation checks that both fields are set otherwise an error is thrown)

For convenience `prototypeDocument` could be specified as a string path to a file containing prototype OpenAPI document.

## How to test?

`prototypeDocument` can be specified for `bundle` and `merge` utilities like the following

**bundle**
```js
const { bundle } = require('@kbn/openapi-bundler');

(async () => {
  await bundle({
    sourceGlob: 'source/glob/*.yaml',
    outputFilePath: 'output/bundle.yaml,
    options: {
      prototypeDocument: {
        info: {
          title: 'Some title',
          description: 'Some description',
        },
        servers: [{
          url: 'https://{kibana_url}',
          variables: {
            kibana_url: {
              default: 'localhost:5601',
            }
          }
        }],
        security: [{ ApiKeyAuth: [] }],
        components: {
          securitySchemes: {
            ApiKeyAuth: {
              type: 'apiKey',
              in: 'header',
              name: 'Authorization',
            }
          }
        }
      },
    },
  });
```

**bundle** with external prototype document
```js
const { bundle } = require('@kbn/openapi-bundler');

(async () => {
  await bundle({
    sourceGlob: 'source/glob/*.yaml',
    outputFilePath: 'output/bundle.yaml,
    options: {
      prototypeDocument: 'path/to/prototype_document.yaml',,
    },
  });
```

**merge**
```js
const { merge } = require('@kbn/openapi-bundler');

(async () => {
  await merge({
    sourceGlobs: [
      'absolute/path/to/file.yaml`,
      'some/glob/*.schema.yaml',
    ],
    outputFilePath: 'output/file/path/bundle.yaml',
    options: {
      prototypeDocument: {
        info: {
          title: 'Some title',
          description: 'Some description',
        },
        servers: [{
          url: 'https://{kibana_url}',
          variables: {
            kibana_url: {
              default: 'localhost:5601',
            }
          }
        }],
        security: [{ ApiKeyAuth: [] }],
        components: {
          securitySchemes: {
            ApiKeyAuth: {
              type: 'apiKey',
              in: 'header',
              name: 'Authorization',
            }
          }
        }
      },
    },
  });
})();
```

**merge** with external prototype document
```js
const { merge } = require('@kbn/openapi-bundler');

(async () => {
  await merge({
    sourceGlobs: [
      'absolute/path/to/file.yaml`,
      'some/glob/*.schema.yaml',
    ],
    outputFilePath: 'output/file/path/bundle.yaml',
    options: {
      prototypeDocument: 'path/to/prototype_document.yaml',
    },
  });
})();
```

The result bundles will contain specified `servers` and `security` while source `servers` and `security` will be dropped.
2024-07-31 10:29:11 +02:00
Antonio
60e1257d31
[ResponseOps][Cases] Fix custom fields flaky test. (#189475)
fixes #188133

## Summary

I simplified the failing test a bit to make it less likely to timeout.
1. We checked for the test **and** the `id` to make sure the component
was rendered, it was redundant.
2. We looked for all custom fields(4) and I reduced the check to just
2(which have different types).
3. Updated another test that looked for a label to look for an `id`(for
consistency).
2024-07-31 09:49:03 +02:00
Antonio
20912a70f9
[ResponseOps][Cases] Fix category flaky test. (#189473)
fixes #177792

## Summary

Updated the tests to use `await screen.find` instead of `get`.
2024-07-31 09:48:46 +02:00
Antonio
7f42e2cb92
[ResponseOps][Cases] Fix useGetSeverity for resilient connector flaky test. (#189477)
fixes #187456

## Summary

Following @JiaweiWu 's classic advice I replaced `waitForNextUpdate`
with `waitFor` 😁

I looked for other places in cases that did the same and fixed them too.
2024-07-31 09:48:23 +02:00
Antonio
3e994aec3a
[ResponseOps][Cases] Unskip flaky test (#189478)
fixes #178457
fixes #187554

## Summary

I think this test was skipped by mistake.

The [failing
build](https://buildkite.com/elastic/kibana-on-merge/builds/42401#018e2f40-5109-4a2a-a877-f0aeed20f20f)
points to
`x-pack/plugins/cases/public/components/create/custom_fields.test.tsx`
but this file does not exist anymore.

[In the commit where the pipeline
failed](cd16d03ca9)
the file
`x-pack/plugins/cases/public/components/create/template.test.tsx` did
not exist.

The `renders correctly` test is **very** different between these two
files so I think there was some mistake here.

Additionally, there is [this skipped
test](https://github.com/elastic/kibana/issues/188133) which IMO is the
correct one. I fix that in a different PR.

PS: I kept looking into our flaky test list and I think the same is the
case for #187554 the file skipped there does not match the one in the
failing pipeline and it did not exist at the time of that commit. I
think there was some confusion and time difference between the failing
tests and the tests being skipped. When the tests were skipped the
original file did not exist anymore and prob all custom field related
`renders correctly` tests were skipped indiscriminately 🤷
2024-07-31 09:48:05 +02:00
Lisa Cawley
e4a0658225
[OAS][DOCS] Deprecate saved object APIs (#189223) 2024-07-30 21:38:04 -05:00
Tiago Costa
42d0c6e975
skip flaky suite (#189293) 2024-07-31 02:11:41 +01:00
Tiago Costa
6a75d74462
skip flaky suite (#174682) 2024-07-31 02:08:37 +01:00
Tiago Costa
9a06b3c257
skip flaky suite (#189530) 2024-07-31 02:07:34 +01:00
Tiago Costa
42010e3efd
skip flaky suite (#174571) 2024-07-31 02:06:36 +01:00