Commit graph

60356 commits

Author SHA1 Message Date
Jason Stoltzfus
04d7a0d8a3 Fixed type issue 2023-02-06 14:53:19 -05:00
Jason Stoltzfus
f8ca59cf40 Fixed tests 2023-02-06 14:19:04 -05:00
Jason Stoltzfus
85a1eac2ac Fix tests 2023-02-06 12:07:08 -05:00
Jason Stoltzfus
ca505c5cfc Update i18n 2023-02-02 17:17:47 -05:00
Jason Stoltzfus
7c3a41c214 Updated to @elastic/eui v74.1.0 2023-02-01 16:32:57 -05:00
Jonathan Budzenski
ded9f9f4ca skip flaky suite (#145204) 2023-02-01 15:06:44 -06:00
Thomas Watson
a858201aa1
Code cleanup: Remove unnecessary Promise.all (#150094) 2023-02-01 21:52:21 +01:00
Jonathan Buttner
6b790e7994
[Cases] Fix failing migration tests (#148808)
This PR fixes a failing migration test. The test was likely failing
because we're using es archiver to add saved objects to the kibana index
instead of using the kbn archiver. Since we support importing cases
saved objects I converted most of the places to use the kbn archiver. We
don't export the case configuration type so it cannot be imported so I
had to remove the integration tests and moved them to unit tests
instead.

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

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1855
🟢
2023-02-01 15:50:15 -05:00
Lola
33f7509c78
Address PR comments from merge (#150089)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.
Merged [PR](https://github.com/elastic/kibana/pull/149716) before seeing
Or's comments. I created a follow-up chore PR to clean and address his
comments.

*  Rename `getResourceFindingsTableFixture` to `getFindingsFixture`
*  Update other `getFindingsFixture`
*  Update unit test description
*  Revert typing to `ResourceFindingsResponseAggs` with an undefined 
*  Clean up translation
2023-02-01 15:40:15 -05:00
renovate[bot]
e45f91897c
Update dependency react-hook-form to ^7.41.5 (main) (#148698) 2023-02-01 21:34:15 +01:00
Or Ouziel
bac71cb9fb
[Cloud Posture] Use extension point to replace integration configuration (#149137) 2023-02-01 21:55:20 +02:00
Tiago Costa
87efefc603
skip flaky suite (#150071) 2023-02-01 19:47:00 +00:00
Ignacio Rivas
b576fea5bf
[Cross Cluster Replication] Update jest matcher (#150046) 2023-02-01 20:21:20 +01:00
Nathan Reese
2f39242610
fix Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/group2/sync_colors·ts (#150087)
Fixes https://github.com/elastic/kibana/issues/148557 and
https://github.com/elastic/kibana/issues/148558

Flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1854

See
https://github.com/elastic/kibana/issues/148557#issuecomment-1412415539
for explanation of failure. PR resolves flakiness by adding retry in
clickCreateNewLink, ensuring clickCreateNewLink opens lens or else
retries.
2023-02-01 11:43:17 -07:00
Tiago Costa
b8f640ca3f
skip flaky suite (#149937) 2023-02-01 18:42:32 +00:00
Jonathan Buttner
6ecac198f1
[Cases] Refactor the getConnectors push field (#149983)
This PR moves all the optional fields from the get connectors API into a
single optional field. This better communicates that the API will return
all the fields as undefined for they will all be defined.

Example response
```
{
    "4175c370-9cd4-11ed-975e-43fe3caaded6": {
        ...
        "push": {
            "needsToBePushed": false,
            "hasBeenPushed": true,
            "details": {
                "externalService": {
                    ...
                },
                "latestUserActionPushDate": "2023-01-25T17:18:47.819Z",
                "oldestUserActionPushDate": "2023-01-25T17:18:47.819Z"
            }
        }
    }
}
```
2023-02-01 13:36:50 -05:00
Thomas Watson
3fbbbd4c24
Improve script URL detection logic (#150045) 2023-02-01 19:24:28 +01:00
Paulo Henrique
fea634d9a4
[Cloud Posture] Dashboard navigation to the Findings page using filter (#149906)
## Summary

closes #149956

This PR modifies the Dashboard navigation to use filter parameters
instead of queries. This makes the search bar clean, allowing the user
more freedom over the search bar. It also uses the user's preferred
language in the search bar.


## Screenshots



![Capture-2023-01-31-075735](https://user-images.githubusercontent.com/19270322/215812002-0a8d51e9-b437-47eb-9530-c231bca07dd9.png)


<img width="1218" alt="image"
src="https://user-images.githubusercontent.com/19270322/215670028-d47affd9-8ddf-4f03-8603-25b9c03ad8ba.png">
2023-02-01 10:16:07 -08:00
Kevin Qualters
beeec00a17
[Filters] Remove any from Filter['meta']['params'] in kbn/es-query (#148681)
## Summary
This pr removes the the type from
https://github.com/elastic/kibana/blob/main/packages/kbn-es-query/src/filters/build_filters/types.ts#L67
to make interoperability of the security solution DataProvider type
https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/data_provider.ts#L35
easier with the Filter type used throughout Kibana. With the addition of
nested Filters, these two types are functionally equivalent. No logic
changes were intended in this pr, so if something looks wrong, please
let me know.

### 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
2023-02-01 13:15:51 -05:00
Julia Rechkunova
37ef9a274d
[Discover] Fix flaky test in field list (#150073)
Closes https://github.com/elastic/kibana/issues/149852
2023-02-01 19:15:16 +01:00
Lola
fa44667f95
[Cloud-Posture][Findings] disable sortable columns except compliance score (#149883)
Issue #146521
## Summary

Before each column is clickable when sorting by Compliance Score. We
decided to only sort by Compliance Score for sorting constraints

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

- Disable sortable  property in `base_columns` config object  

##Screenshots
Sort by Compliance Score
<img width="1443" alt="image"
src="https://user-images.githubusercontent.com/17135495/215582324-81585a73-b49d-4787-9c68-e2a734457489.png">
Non-sortable/non-clickable column titles
<img width="1462" alt="image"
src="https://user-images.githubusercontent.com/17135495/215582703-30575c7d-5973-4f3a-87d7-110a17104042.png">
2023-02-01 12:53:55 -05:00
Antonio
7ae33a75ac
[Cases] Create internal endpoint to get user action stats (#149863)
Fixes #149390

## Summary

This PR creates an internal API to get the count of the different user
actions associated with the current case.

This will be used to help filter and paginate the case activity.

<img width="1025" alt="aux"
src="https://user-images.githubusercontent.com/1533137/215549427-373f1626-3f7a-417d-ad95-ddb47b259617.png">

**Endpoint:**
`GET /internal/cases/<case_id>/user_actions/_stats`

Example Response:

```
{
    total: 3
    total_comments: 2
    total_other_actions: 1
}
```

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

- [x] 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)
2023-02-01 18:50:53 +01:00
Abdul Wahab Zahid
4795910ef3
[Synthetics] Overview and Management filters (#149469)
Closes #135160
Fixes https://github.com/elastic/kibana/issues/146075

## Summary

Adds the Frequency and Project filter on Management page and all the
filters on Overview page as well.

The PR doesn't show the filters on a dialog as in the design, for the
sake of utilizing existing available component and the fact that opening
a dialog adds one additional step to reach filters. The applied filter
pills/tags (as in the design) are also not implemented as the filter
components show a highlighted number if any filter is applied. Incase
this implementation is not sufficient, the same components can be
converted to match the design easily.

<img width="1482" alt="Screenshot 2023-01-25 at 23 18 30"
src="https://user-images.githubusercontent.com/2748376/214705768-78b431a5-d0fd-4141-82f2-0e9d3af0d8ee.png">

<img width="1484" alt="Screenshot 2023-01-25 at 23 19 12"
src="https://user-images.githubusercontent.com/2748376/214705792-bf62004d-7666-408b-8ca1-4f0f7520a950.png">

---------

Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
2023-02-01 18:34:27 +01:00
Rodney Norris
e8eb04420e
[Enterprise Search] Replace Engines UI Settings feature flag (#149996)
## Summary

Replaced the Engines UI Settings feature flag with product access field
from the client config. Then removed the Engines UI Setting.

We opted for a backend feature flag instead of the UI setting so that a
single feature flag could be used to gate both the UI and the API for
engines for the 8.7 release, since this work will not be completed until
8.8.
2023-02-01 10:24:08 -07:00
Or Ouziel
f002889cca
[Fleet] Create a new UIExtensionPoint to replace the integration define step (#149653) 2023-02-01 18:28:44 +02:00
renovate[bot]
0a6edd8501
Update react-query to ^4.23.0 (main) (#148944)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@tanstack/react-query](https://tanstack.com/query)
([source](https://togithub.com/tanstack/query)) | [`^4.20.9` ->
`^4.23.0`](https://renovatebot.com/diffs/npm/@tanstack%2freact-query/4.22.0/4.23.0)
|
[![age](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query/4.23.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query/4.23.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query/4.23.0/compatibility-slim/4.22.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query/4.23.0/confidence-slim/4.22.0)](https://docs.renovatebot.com/merge-confidence/)
|
| [@tanstack/react-query-devtools](https://tanstack.com/query)
([source](https://togithub.com/tanstack/query)) | [`^4.20.9` ->
`^4.23.0`](https://renovatebot.com/diffs/npm/@tanstack%2freact-query-devtools/4.22.0/4.23.0)
|
[![age](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query-devtools/4.23.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query-devtools/4.23.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query-devtools/4.23.0/compatibility-slim/4.22.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@tanstack%2freact-query-devtools/4.23.0/confidence-slim/4.22.0)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>tanstack/query</summary>

###
[`v4.23.0`](https://togithub.com/TanStack/query/releases/tag/v4.23.0)

[Compare
Source](https://togithub.com/tanstack/query/compare/v4.22.4...v4.23.0)

Version 4.23.0 - 1/24/2023, 10:53 AM

##### Changes

##### Feat

- client components: add `use client` directive at the top of files
having client components
([#&#8203;4738](https://togithub.com/tanstack/query/issues/4738))
([`f57c8dc`](f57c8dc1)) by
Girish Sontakke

##### Docs

- add readme.md to react adapter
([`ea67377`](ea673770)) by
Dominik Dorfmeister
- add QueryClient import
([#&#8203;4856](https://togithub.com/tanstack/query/issues/4856))
([`69a7d72`](69a7d72d)) by
Joël Kuijper
- useMutation: correct docs for mutate function callbacks
([#&#8203;4601](https://togithub.com/tanstack/query/issues/4601))
([`4ac7c1a`](4ac7c1a8)) by Qz

##### Packages

-
[@&#8203;tanstack/react-query-devtools](https://togithub.com/tanstack/react-query-devtools)[@&#8203;4](https://togithub.com/4).23.0
-
[@&#8203;tanstack/react-query-persist-client](https://togithub.com/tanstack/react-query-persist-client)[@&#8203;4](https://togithub.com/4).23.0
-
[@&#8203;tanstack/react-query](https://togithub.com/tanstack/react-query)[@&#8203;4](https://togithub.com/4).23.0

###
[`v4.22.4`](https://togithub.com/TanStack/query/releases/tag/v4.22.4)

[Compare
Source](https://togithub.com/tanstack/query/compare/v4.22.3...v4.22.4)

Version 4.22.4 - 1/22/2023, 3:57 PM

##### Changes

##### Fix

- core: do not call mutate callbacks if mutation started after unmount
([#&#8203;4848](https://togithub.com/tanstack/query/issues/4848))
([`901e826`](901e826f)) by
Jan

##### Packages

-
[@&#8203;tanstack/query-core](https://togithub.com/tanstack/query-core)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/react-query](https://togithub.com/tanstack/react-query)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/query-persist-client-core](https://togithub.com/tanstack/query-persist-client-core)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/query-async-storage-persister](https://togithub.com/tanstack/query-async-storage-persister)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/query-broadcast-client-experimental](https://togithub.com/tanstack/query-broadcast-client-experimental)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/query-sync-storage-persister](https://togithub.com/tanstack/query-sync-storage-persister)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/react-query-devtools](https://togithub.com/tanstack/react-query-devtools)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/react-query-persist-client](https://togithub.com/tanstack/react-query-persist-client)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/solid-query](https://togithub.com/tanstack/solid-query)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/svelte-query](https://togithub.com/tanstack/svelte-query)[@&#8203;4](https://togithub.com/4).22.4
-
[@&#8203;tanstack/vue-query](https://togithub.com/tanstack/vue-query)[@&#8203;4](https://togithub.com/4).22.4

###
[`v4.22.3`](https://togithub.com/TanStack/query/releases/tag/v4.22.3)

[Compare
Source](https://togithub.com/tanstack/query/compare/v4.22.0...v4.22.3)

Version 4.22.3 - 1/21/2023, 2:54 PM

##### Changes

##### Fix

- svelte-query: Fix createMutation for functions that take no arguments
([#&#8203;4847](https://togithub.com/tanstack/query/issues/4847))
([`4f515de`](4f515dec)) by
Lachlan Collins

##### Chore

- fix duplicated example package name
([#&#8203;4823](https://togithub.com/tanstack/query/issues/4823))
([`365fdf3`](365fdf3b)) by
Michal Tecza
- Add sandbox.config.json
([#&#8203;4812](https://togithub.com/tanstack/query/issues/4812))
([`e33bda3`](e33bda31)) by
Lachlan Collins

##### Docs

- useMutation: clarify `mutationFn` option default
([#&#8203;4837](https://togithub.com/tanstack/query/issues/4837))
([`61c3d94`](61c3d94a)) by
[@&#8203;louis-young](https://togithub.com/louis-young)
- clarify the documentation on running examples
([#&#8203;4818](https://togithub.com/tanstack/query/issues/4818))
([`07f144a`](07f144a2)) by
Michal Tecza
- update tkdodos blog
([#&#8203;4820](https://togithub.com/tanstack/query/issues/4820))
([`532b90a`](532b90ac)) by
Dominik Dorfmeister
- svelte-query: Add recommended defaults to prefetchQuery setup
([#&#8203;4815](https://togithub.com/tanstack/query/issues/4815))
([`86161ca`](86161ca6)) by
Lachlan Collins
- fix typo (quey -> query)
([#&#8203;4813](https://togithub.com/tanstack/query/issues/4813))
([`832d4fb`](832d4fb0)) by
Masaki Koyanagi
- svelte-query: Rework SvelteKit setup
([#&#8203;4811](https://togithub.com/tanstack/query/issues/4811))
([`2cd92ef`](2cd92ef3)) by
Lachlan Collins
- clarify interaction of query filter predicates with other criteria
([#&#8203;4532](https://togithub.com/tanstack/query/issues/4532))
([`3a3d871`](3a3d871a)) by
Ben Longo
- Update devtools.md with note that mutations are not tracked
([#&#8203;4810](https://togithub.com/tanstack/query/issues/4810))
([`6772333`](67723337)) by
Joseph Markus
- svelte-query: Expand SSR docs
([#&#8203;4809](https://togithub.com/tanstack/query/issues/4809))
([`c05bb91`](c05bb910)) by
Lachlan Collins

##### Test

- stabilize various tests
([#&#8203;4825](https://togithub.com/tanstack/query/issues/4825))
([`ff77512`](ff77512b)) by
Michal Tecza

##### Packages

-
[@&#8203;tanstack/react-query](https://togithub.com/tanstack/react-query)[@&#8203;4](https://togithub.com/4).22.3
-
[@&#8203;tanstack/svelte-query](https://togithub.com/tanstack/svelte-query)[@&#8203;4](https://togithub.com/4).22.3
-
[@&#8203;tanstack/react-query-devtools](https://togithub.com/tanstack/react-query-devtools)[@&#8203;4](https://togithub.com/4).22.3
-
[@&#8203;tanstack/react-query-persist-client](https://togithub.com/tanstack/react-query-persist-client)[@&#8203;4](https://togithub.com/4).22.3

</details>

---

### Configuration

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

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

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

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

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

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/elastic/kibana).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-01 17:08:57 +01:00
Thomas Watson
4f37604524
Enable GitHub Code Scanning on the 7.17 branch (#150035) 2023-02-01 17:00:50 +01:00
Anton Dosov
30ed57628e
fix banner overlap in dashboard embed and fullscreen mode (#150012)
## Summary

Fix https://github.com/elastic/kibana/issues/116103,
https://github.com/elastic/kibana/issues/149112
Better version of the initial attempt
https://github.com/elastic/kibana/pull/149197


Fixes banner overlap in dashboard embed and fullscreen mode. The fix
follows `chaos`'s suggestion
https://github.com/elastic/kibana/issues/116103#issuecomment-957599532.
The bug root cause is described in
https://github.com/elastic/kibana/issues/116103#issuecomment-953252893
and
https://github.com/elastic/kibana/issues/116103#issuecomment-957369465

To reproduce and test: 

Simple way to reproduce locally (no need for an iframe):

1. Add to  kibana.dev.yml

```
xpack.banners:
  placement: 'top'
  textContent: 'P-System'
  textColor: '#FFFFFF'
  backgroundColor: '#FF0000'
```

2. Enable platinum license trial through Stack Management > Stack >
License Management (banners are not available in basic)

3. Fullscreen: View a dashboard and switch to fullscreen mode

4. Embed mode: Open a dashboard, copy the URL, open that URL in a new
window appending `embed=true` to the URL. e.g.:
`edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b?embed=true&_g=()`


fixed fullscreen (no panel title overlap): 

![Screenshot 2023-02-01 at 11 29
23](https://user-images.githubusercontent.com/7784120/216018466-b49ef056-48fd-47d4-a503-bcc17ff87c3e.png)

fixed embed (no controls overlap):

![Screenshot 2023-02-01 at 11 29
39](https://user-images.githubusercontent.com/7784120/216018547-a4735ee2-5306-4ae6-bd25-a79d651691bf.png)
2023-02-01 16:55:24 +01:00
Kevin Delemme
a7cec2200c
fix(slo): use fake timer in tests (#150066) 2023-02-01 08:39:55 -07:00
Cristina Amico
c8c27d7def
[Fleet] Add a visual indication of selected subcategory in Integrations page (#149954)
Closes https://github.com/elastic/kibana/issues/149306

## Summary
Display a clear indication of selected subcategory in Integrations page


https://user-images.githubusercontent.com/16084106/215807007-63dbea8d-4496-497f-b4f4-673825a21049.mov

To test it locally, enable feature flag `showIntegrationsSubcategories`.

Some screenshots:

<img width="2040" alt="Screenshot 2023-01-31 at 16 12 35"
src="https://user-images.githubusercontent.com/16084106/215807361-382eb4fa-736c-4073-bf44-79d1d9a3109c.png">

<img width="1563" alt="Screenshot 2023-01-31 at 16 36 38"
src="https://user-images.githubusercontent.com/16084106/215807406-f7d52c44-d1d1-4f4a-b32a-26122ab8cfbe.png">

<img width="1507" alt="Screenshot 2023-01-31 at 16 36 51"
src="https://user-images.githubusercontent.com/16084106/215807430-00189482-2dd3-418c-99b9-0651b82305b7.png">

I also split some of the components in `packageList` since that file is
becoming too big and extracted another hook from `useAvailablePackages`,
this hook only deals with the URL and the history.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-01 16:36:07 +01:00
Luke Gmys
612b8e7d8a
[TIP] Ensure non-primitive values are not rendered (#150015)
## Summary

Should fix https://github.com/elastic/security-team/issues/5856

Right now, it will just render the complex fields as empty. Should these
be ommited or something?

### 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
2023-02-01 16:29:22 +01:00
Maryam Saeidi
78992c6ca7
[AO] Use EuiLoadingChart for AlertSummaryWidget loading state (#150052)
## Summary

Improve loading state of AlertSummaryWidget component.

Compact


https://user-images.githubusercontent.com/12370520/216062356-94af9af8-1e4b-444d-8574-9b627004ef2e.mov

Full-size


https://user-images.githubusercontent.com/12370520/216062410-e15ee215-ca1c-478a-a7f1-c96b6cb46b5a.mov
2023-02-01 16:26:09 +01:00
Chris Cowan
6e70bdb347
Custom equation editor for Metric Threshold Rule (#148732)
## Summary

This PR closes #145444 by adding a custom equation editor to the Metric
Threshold rule. I also added support for custom metrics to the Metric
Explorer API which powers the preview chart on the rule editor.
Eventually we could do a follow up PR to the Metrics Explorer UI to
expose this new functionality; which is outside the scope of this PR.

### Notable changes with this PR

I changed the reason message for Metric Threshold rules which do not
have a group by. The original message would say something like
`system.cpu.user.pct is 82% in the last 1 min for all hosts. Alert when
> 81%.` I removed the `for all hosts` portion because the Metric
Threshold rule is not limited to just the concept of hosts, our users
rely on this rule as their "Swiss Army Knife" rule for all types of
data.

I also had to change the format of the `currentPeriod` bucket for the
Metric Threshold aggregation to support the "document count with KQL
filter" use case. One of the requirements of a `filter` aggregation is
that it must be a child of a multi-bucket aggregation. This is why I
converted it from a 'filter' aggregation to a `filters` aggregation with
an `all` key for the time range query.

I added basic validation for the equations with a regular expression
that just limits the characters to the allowable: `A-Z, +, -, /, *, (,
), ?, !, &, :, |, >, <, =`. I feel like for now this is good enough. If
we want to expose some of the Painless `Math.*` libraries then we can
follow up in a later release with a PegJS parser which would do some
syntax validation as well.

### Rule with custom equation

<img width="538" alt="image"
src="https://user-images.githubusercontent.com/41702/213583128-1adbc405-828e-4571-aeb4-9900baeaabee.png">

### Rule with custom ratio equation

<img width="538" alt="image"
src="https://user-images.githubusercontent.com/41702/213583239-a39d15d2-7023-4daf-af97-cb25a9965433.png">


### Reason message with custom label


![image](https://user-images.githubusercontent.com/41702/211936062-4b696f0c-dfec-4e48-b89c-b0462fb5f7f0.png)

---------

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
2023-02-01 07:59:50 -07:00
Ashokaditya
9b85acb49e
[Security Solution][Endpoint] Fix and unskip flaky test (#149841)
> **Note**
> **Merge after elastic/kibana/pull/149839**

## Summary

Fixes flaky test elastic/kibana/issues/145204

flaky test runners 
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1817
x 50 (failed on a single [unrelated
](92cb000a2f/x-pack/test/security_solution_endpoint/apps/endpoint/artifact_entries_list.ts (L75))flaky
test)
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1826
x 150 (failed on a single run for an
[unrelated](92cb000a2f/x-pack/test/security_solution_endpoint/apps/endpoint/artifact_entries_list.ts (L87))
flaky test)
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1834
x 200 (successful on all runs)
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1847
x 100 (successful on all runs)

### 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
2023-02-01 15:57:05 +01:00
Chris Cowan
0d6c113ab1
Add context.originalAlertState to the Metric Threshold and Inventory Threshold recovery context (#147928)
## Summary

This PR adds the `ALERT_ACTION_GROUP` to the Alerts-As-Data documents
for both the Metric Threshold and Inventory Threshold rules. It then
uses that value from the alert document in the recovery context to set
`context.originalAlertState`. This also adds
`context.originalStateWasALERT`, `context.originalStateWasWARNING`, and
`context.originalStateWasNO_DATA` (Metric Threshold Only) to allow for
conditional Mustache templates. I also fixed the types for
`getAlertByAlertUuid()` to be more accurate.

#### Metric Threshold Example
```
{{#context.originalAlertStateWasALERT}}
This is a recovery for an ALERT
{{/context.originalAlertStateWasALERT}}

{{#context.originalAlertStateWasWARNING}}
This is a recovery for a WARNING
{{/context.originalAlertStateWasWARNING}}

{{#context.originalAlertStateWasNO_DATA}}
This is a recovery for NO_DATA
{{/context.originalAlertStateWasNO_DATA}}
```

#### Inventory Threshold Example
```
{{#context.originalAlertStateWasALERT}}
This is a recovery for an ALERT
{{/context.originalAlertStateWasALERT}}

{{#context.originalAlertStateWasWARNING}}
This is a recovery for a WARNING
{{/context.originalAlertStateWasWARNING}}
```

Fixes  #145418

### How to test

1. Start Kibana and ingest some data (Metricbeat or whatever)
2. Create a rule (one for each), for the Metric Threshold rule you will
need to group by something like `host.name`
3. Set the conditions to something you can trigger, I used `NO_DATA`
4. Add a server log action for the recovery action group with
`{{context}}`, alternatively you can use the examples above to see the
Mustache logic work
5. Save the rules
6. Stop ingesting data and allow the rule to trigger a `NO DATA` alert
7. Start ingesting data so that it recovers
8. Observe the log message with `originalAlertState` as `NO DATA` for
Metric Threshold and `ALERT` for Inventory Threshold.
2023-02-01 15:36:59 +01:00
Søren Louv-Jansen
a1251a93c2
[Fleet] Move callbacks from http methods to package policy service (#149272)
Closes https://github.com/elastic/kibana/issues/129383

This PR ensures that fleet callbacks are called regardless if operations
on a package policy are performed via the api or directly using the
package policy service.
2023-02-01 08:32:59 -06:00
Lola
eabf08bbab
[Cloud Posture] [Findings] Fix Findings empty state results error (#149716)
Issue #144981

## Summary

This PR fixes the resource findings error pop-up when a query filter
yields no results. Suppose a filter query produces zero results then the
aggregations.key.buckets will return an empty array. In the
`assertNonEmptyArray`, we throw an error if the bucket is not an array
or if the bucket's array.length is 0. We shouldn't throw an error if
there are no results or if buckets is an empty array`[]`. To solve this
issue, we need to remove the `arr.length === 0` condition check from
`assertNonEmptyArray`.

The following changes were also introduced:
- Removed `arr.length === 0` check to show an empty state.
- Added unit tests for Resource Findings Table for cases empty state or
table data
- Added a safety check and provided a default value for the first bucket
key.
-  Update translations for Findings page title

## Screenshot
Success state
<img width="1435" alt="image"
src="https://user-images.githubusercontent.com/17135495/215153634-bbb447db-6d2d-4ce3-b188-e3fc445d16d6.png">


Empty State
<img width="1436" alt="image"
src="https://user-images.githubusercontent.com/17135495/215526796-e02ce0d1-2998-4e2a-b3e8-b67d32893bc2.png">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-01 09:26:53 -05:00
Mark Hopkin
59366f1317
[Fleet] Add getStatusSummary query parameter to GET /api/fleet/agents API (#149963)
## Summary

`getAgentStatus` will return a status breakdown for the given `kuery`.
The breakdown is returned in the `statusSummary` response key.

This allows us to remove an API call on the agents list page, I also
think this kind of facet is a good thing to have for our API.

We seem to have a mix of camel case and snake case in our API responses,
for this API all the response params are camel case so I kept consistent

- integration test added
- API docs updated


Example request and response:

```
GET  kbn:/api/fleet/agents?getStatusSummary=true&showInactive=true&perPage=0

{
  "list": [],
  "items": [],
  "total": 1001,
  "page": 1,
  "perPage": 0,
  "statusSummary": {
    "online": 1,
    "error": 0,
    "inactive": 500,
    "offline": 0,
    "updating": 0,
    "unenrolled": 500,
    "degraded": 0,
    "enrolling": 0,
    "unenrolling": 0
  }
}
```
2023-02-01 14:02:26 +00:00
Thomas Watson
13853a4a5b
Fix escaping of double quote (#150039)
The previous version of `escapeSearchQueryPhrase` didn't escape
anything.
2023-02-01 07:00:22 -07:00
Nav
cb39822a80
Supprt custom scheduling in Connectors (#149815) 2023-02-01 06:57:49 -07:00
Marco Antonio Ghiani
a2c3a3682f
[Infrastructure UI]: Use dateRange as source of truth for Hosts View (#150029)
## 📓 Summary

Closes #150027 

This PR removes from the URL state the `dateRangeTimestamp` filter and
keeps as a unique source of truth the `dateRange`, derivating from this
one the expected timestamp conversion on each update or page refresh.

## 🧪 Testing

1. Go To Hosts view
2. Select `Last 1 hour` time range.
3. Verify the only saved param in the URL is the `dateRange`
4. Wait for a couple of minutes
5. Refresh the page

You should see the data is updated to the last real hour since the
moment the page has been reloaded.
You can more specifically verify this by checking what timestamp range
is sent with the snapshot request payload.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-01 14:52:50 +01:00
Dzmitry Lemechko
71a2bf9195
[ftr] split alerting_api_integration/spaces_only/config.ts into small fast configs (#149854)
## Summary

Trying to address slow config issue:

```
The following "Functional Tests" configs have durations that exceed the maximum amount of time desired for a single CI job. This is not an error, and if you don't own any of these configs then you can ignore this warning.If you own any of these configs please split them up ASAP and ask Operations if you have questions about how to do that.

x-pack/test/alerting_api_integration/spaces_only/config.ts: 41.4 minutes
```

by splitting it into multiple groups.

_1 round (splitting main index file with 3 index suites where each one
has its own setup/tearDown + alerting suite into 4 groups)_

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts
7m 1s

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/config.ts
**15m 10s**

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/config.ts
**21m 40s**

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts
5m 30s

x-pack/test/alerting_api_integration/spaces_only/tests/action_task_params/config.ts
2m 31s

x-pack/test/alerting_api_integration/spaces_only/tests/actions/config.ts
4m 22s

_2 round (rebalance groups 1-4 to be more time equal)_

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts
12m 46s

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/config.ts
8m 46s

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/config.ts
17m 30s

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts
9m 5s

Here `Alerting eventLog alerts should generate expected alert events for
normal operation` test started to fail, probably there is a dependency
on the previous tests.

_3 round (rebalance groups 1-4, to keep tests order in group 1 up until
`event_log.ts` suite)_

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts
17m 12s

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/config.ts
8m 28s

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/config.ts
16m 15s

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts
6m 21s

_4 round (rebalancing groups 3-4 to be more time equal)_

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts
**17m 14s**

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/config.ts
**8m 37s**

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/config.ts
**12m 40s**

x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts
**9m 49s**

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-01 14:49:34 +01:00
Nicolas Chaulet
7bb6ad17b9
[Fleet] Do not verify package policy unique name if not updated (#149944) 2023-02-01 08:02:36 -05:00
Ashokaditya
b47cbf7b83
[Security Solution][Endpoint][Response Actions] response action history execute action filter behind FF (#150016)
> **Note**
> **This PR ensures `execute` action filter doesn't show in `8.7`**

## Summary

![Screenshot 2023-02-01 at 11 37
54](https://user-images.githubusercontent.com/1849116/216020161-fda46fee-80b2-49af-b923-49aa2576e501.png)

This PR hides the `execute` action in the response action history filter
dropdown.
Small leftover from elastic/kibana/pull/149589

The [unit tests still use the updated list of
commands](a373ac7336/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx (L688))
and do not need to change.
2023-02-01 05:36:46 -07:00
Sander Philipse
5389639943
[Enterprise Search] Update sitemaps copy (#150010)
This updates the copy for the Elastic Web Crawler sitemaps feature.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-01 05:26:21 -07:00
Efe Gürkan YALAMAN
ef00463019
[Enterprise Search] Delete engine from Engine Overview (#149124)
## Summary

Adds delete functionality on Engine overview.
![Screenshot 2023-01-18 at 15 14
14](https://user-images.githubusercontent.com/1410658/213194949-3f76a769-e634-47ff-8c7e-e2391d427ff4.png)
![Screenshot 2023-01-18 at 15 14
19](https://user-images.githubusercontent.com/1410658/213194955-f0a9c693-a618-423e-94fe-4e1c38c7beea.png)


### Checklist

Delete any items that are not applicable to this PR.

- [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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] 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))
- [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)
2023-02-01 05:00:15 -07:00
Søren Louv-Jansen
0575f43377
[APM] Remove host.name correlation (#150005)
Closes https://github.com/elastic/kibana/issues/148788
2023-02-01 04:36:40 -07:00
Julia Rechkunova
6f3b29df5d
[Discover] Add a way to quickly expand time range from "No results" screen (#147195)
Related to issue https://github.com/elastic/kibana/issues/12608
A part of Spacetime project
https://github.com/elastic/kibana/pull/146729 but only for "No results"
UI, excluding the time picker changes.

## Summary

This PR extends the "No results matches your search criteria. Expand
your time range..." message to allow users quickly expand the time range
by clicking on a link.

<img width="1492" alt="Screenshot 2022-12-07 at 14 38 45"
src="https://user-images.githubusercontent.com/1415710/206221177-1a466b98-6cd3-494d-b7fe-09fdd43b1222.png">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-01 04:24:45 -07:00
Shahzad
abfe96ff89
[Synthetics] Step metrics (#149481)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Fixes https://github.com/elastic/kibana/issues/145392
2023-02-01 04:19:22 -07:00
Thomas Watson
f296abb6c9
[@kbn/handlebars] Support custom decorator return value (#149392)
Fixes #149327
2023-02-01 11:57:22 +01:00