Commit graph

62326 commits

Author SHA1 Message Date
Cauê Marcondes
2f46929805
[Profiling] updating empty state page links. (#154678) 2023-04-11 20:35:18 -04:00
Quynh Nguyen (Quinn)
682e2ed6ae
[ML] Add execution context to Field statistic table for Discover and Index data visualizer (#154404)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 13:52:08 -07:00
Nathan Reese
ebac694612
[maps] fix raster layer is missing in pdf/png exports (#154686)
Fixes https://github.com/elastic/kibana/issues/154657 (Also heatmap
layer has the same problem)

ILayer has 2 methods to determine loading state:
* isInitialDataLoadComplete
* isLayerLoading

When `isInitialDataLoadComplete` returns true for all layers, the map
signals that it's ready for reports to be captured. The root cause of
the problem is that the raster layer implementation did not provide an
`isInitialDataLoadComplete` implementation for tiled maplibre sources.
Therefore raster_tile_layer.ts would return true before all raster
images are loaded, allowing reporting to capture an image with missing
tiles.

Having `isInitialDataLoadComplete` and `isLayerLoading` and spreading
duplicate tiled implementations across layer classes contributed to the
problem.

PR:
* removes `isInitialDataLoadComplete` from ILayer interface (supports
long term goal of making ILayer simpler).
* updates `isLayerLoading` to signal loading when layer is not
initialized yet. This required calls to ensure layer is visible and
displayed at zoom level before calling `isLayerLoading`, since
`isLayerLoading` will now return true if no data has been loaded for a
layer.
* renames `areLayersLoaded` -> `isMapLoading` to be more symmetrical
with ILayer.isLayerLoading method name and return value.

<img width="400" alt="Screen Shot 2023-04-10 at 2 04 28 PM"
src="https://user-images.githubusercontent.com/373691/230987781-2dfc68b7-f9bb-4ba6-8ab3-aaff5ea36859.png">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 14:25:39 -06:00
Angela Chuang
67af39ab0c
[SecuritySolution] Setup dashboard view page (#153040)
## Summary

https://github.com/elastic/kibana/issues/152955

Demo link:
6294c960-ce35-11ed-b8ca-51636b04063c?sourcerer=(default:(id:security-solution-default,selectedPatterns:!(%27auditbeat-*%27,%27logs-*%27)))


https://p.elstc.co/paste/pOFVo-fV#Zgp3hnsnijsDHbki4y9Cy5F+apet-hYEcedpDzsc+f7

This create a single dashboard view under Security Solution:

- Add dashboard view path: `/app/security/dashboards/:dashboardId`
- Move the dashboards landing page to this new sub-plugin.
- Check users' read permission to render a dashboard.
- Render a dashboard with the given saved object id.
- Show the dashboard name in the breadcrumbs.

Dashboard not found:

<img width="2363" alt="Screenshot 2023-03-23 at 13 44 01"
src="https://user-images.githubusercontent.com/6295984/227477728-8d4984f2-3d8f-4f92-88ae-3337e6b3e5be.png">

Dashboard rendered:

<img width="2539" alt="Screenshot 2023-03-23 at 13 44 28"
src="https://user-images.githubusercontent.com/6295984/227477761-b1301b5c-1c4f-4970-bf8f-e077342c317f.png">


Interact with filters and query:


https://user-images.githubusercontent.com/6295984/227477735-dc53bb85-31fb-4043-8355-22866296ebf9.mov




Interact with `Open in Lens` and `Investigate in timeline`



https://user-images.githubusercontent.com/6295984/228217900-5055a5d1-46f2-4d2f-98a8-289eb0f1939a.mov




**Steps to verify**:
1. Create a dashboard from `/app/dashboards#/list`, save it and copy the
dashboard saved object id from url.
2. Visit `/app/security/dashboards/:dashboardId`



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

---------

Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 21:15:37 +01:00
Bhavya RM
6294b1b4b8
Adding additional verification for checking that 6.8.x dashboard (upgraded to 7.17.x) rendering correctly (#154384) 2023-04-11 16:05:44 -04:00
Adam Demjen
d2f7860cff
[ML Inference] Multi-field selector for ELSER (#154598)
## Summary

This PR adds UI components for creating multiple field mappings for an
inference pipeline. In the field configuration step existing source
fields can be selected from the mapping, or non-existent fields can be
typed in. Clicking the Add button sets the mapping; the target field
name is derived from the source field name as
`ml.inference.<source_field_name>_expanded`.

The selected mappings are listed in a table on the same screen. The
trashcan icon can be used to remove a mapping.

This field configuration screen only shows if an ELSER model was
selected for the pipeline. For any other model types the classic "single
source and target field" screen is shown (the target field can be set by
the user).

Attaching an existing ELSER pipeline is disabled - supporting this will
be in scope for a separate PR.

I also added the logic to modify the pipeline generator logic in case
multiple field mappings are selected. In this case a `remove` and an
`inference` processor are generated for each selected mapping.

![Screenshot 2023-04-10 at 5 46 24
PM](https://user-images.githubusercontent.com/14224983/231008803-26a0c5ba-748d-4377-87c5-a40717426c4c.png)
![Screenshot 2023-04-10 at 5 46 34
PM](https://user-images.githubusercontent.com/14224983/231008804-a6f7e508-afcd-4227-87cb-9fac5f607132.png)
![Screenshot 2023-04-10 at 5 46 44
PM](https://user-images.githubusercontent.com/14224983/231008805-0ba61948-c8b6-411a-8969-f6aeaa820c39.png)
![Screenshot 2023-04-10 at 6 01 55
PM](https://user-images.githubusercontent.com/14224983/231008808-70ab3b10-dab6-41aa-a2e6-e46bdc259ca3.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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 16:02:37 -04:00
Coen Warmer
26f65b3262
[Observability] Add Observability Shared app (#154716)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 21:51:59 +02:00
Tiago Costa
962e91556c
skip flaky suite (#154182) 2023-04-11 20:40:43 +01:00
Tiago Costa
da3c06c447
skip failing es promotion suites (#154740) 2023-04-11 20:36:39 +01:00
Zacqary Adam Xeper
56796db2c0
[RAM] [FE] Add conditional actions UI for timeframe (#153944)
## Summary

Adds the conditional timeframe to the actions UI. **Currently only
enabled in the Security Solution alerts UI using the
`showActionAlertsFilter` prop**

Part of https://github.com/elastic/kibana/issues/152026 and
https://github.com/elastic/kibana/issues/152611

<img width="880" alt="Screenshot 2023-03-29 at 4 15 24 PM"
src="https://user-images.githubusercontent.com/1445834/228567116-a0fa80ac-7664-411f-9757-41aa81b52857.png">

### UPDATED UI
<img width="857" alt="Screenshot 2023-03-31 at 3 58 12 PM"
src="https://user-images.githubusercontent.com/1445834/229140790-11aeea9b-6db9-46bc-8f35-47f9afabb606.png">


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 12:13:54 -07:00
Kyle Pollich
e469ece932
[Fleet] Improve network error handling + add tests for Fleet agent versions build step (#154649)
## Summary

Ref https://github.com/elastic/kibana/pull/154110

- Ensure we throw when the product versions API responds with an
unsuccessful status code
- Add tests for various success/failure cases around the agent versions
list build step.

cc @jen-huang
2023-04-11 12:02:36 -07:00
Cristina Amico
a5de314687
[Fleet] Logstash Output - prevent updating data_output_id for preconfigured policies (#154445)
Closes https://github.com/elastic/kibana/issues/154326

## Summary

After the merge of https://github.com/elastic/kibana/pull/153226, when
creating/updating a Logstash output as default, the `Elastic Cloud agent
policy` preconfigured on Cloud gets reassigned to the "default" ES
policy instead than keeping the `Elastic Cloud internal output`.

<img width="1418" alt="Screenshot 2023-04-04 at 12 51 21"
src="https://user-images.githubusercontent.com/16084106/230112067-a2767d1a-1191-4877-8dec-546d1590e41f.png">

Tee bug is fixed by checking if any given fleet server policy is
`preconfigured` or if it has already an assigned `data_output_id`, in
which cases it doesn't get updated.

### Testing
- Create an ES output additional to the default one
- Create a preconfigured fleet server policy and make sure it has
`fleet-server` integration (this is to simulate the preconfigured cloud
policy)
- Assign the previous output to the preconfigured policy
- Now create a new `logstash` output and make it default
- Check that the preconfigured policy maintains the custom output
previously assigned

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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2023-04-11 20:38:17 +02:00
Jen Huang
2636262e09
[Fleet] Fix "Advanced options" toggle in policy editor always showing (#154612)
## Summary

_Please review with [whitespace
ignore](https://github.com/elastic/kibana/pull/154612/files?diff=unified&w=1)!_

In #143097 the conditional for showing `Advanced options` was removed as
we introduced experimental indexing toggles which are always shown.
However in #148418 (8.7) we put the indexing toggles behind a feature
flag. This caused the `Advanced options` toggle to always be shown
regardless of there is any content underneath. I spotted this while
testing something unrelated.

This PR fixes that by adding a condition back that is based on
aggregating the conditionals of everything underneath (existence of
advanced vars, whether pipelines & mappings are shown, and if
experimental indexing toggles are enabled).
2023-04-11 11:32:05 -07:00
Walter Rafelsberger
ab277e4cb4
[ML] Explain Log Rate Spikes: Support to filter fields from grouping (#153864)
- Adds a `Filter fields` popover selector inspired by EUI's data grid
column picker to toggle inclusion of fields into grouping.
- Moves the `Group results` switch and the `Filter fields` popover on
the same level as the progress controls.
- Adapts the `explain_log_rate_spikes` API endpoint to support
retrieving a grouping update only.
- Hides the pagination footer for the results tables if there's less
results than the current page size.
2023-04-11 20:24:27 +02:00
Hannah Mudge
ddd44b859b
[Dashboard] Fix unsaved changes badge React error (#154607)
## Summary

### Before

Since adding the tooltip to the unsaved changes badge in
https://github.com/elastic/kibana/pull/154253, React was throwing an
error to the console because the element in the top nav no longer had a
unique key:


https://user-images.githubusercontent.com/8698078/230927494-7cc931f8-68c6-4904-b99e-99b1b2872f94.mov

<br>


![image](https://user-images.githubusercontent.com/8698078/230925422-32f8ea9d-8c22-470e-a94e-0aa9eda0b4de.png)


### After

This PR fixes this by adding the key **to the tooltip** if the badge has
one; if it doesn't have a tooltip, then the key is added directly to the
`EuiBadge` as expected. It also ensures that the tooltip has the proper
a11y support (cc @elastic/kibana-accessibility) by adding the badge to
the tab order and using the <a
href="https://github.com/elastic/eui/blob/main/wiki/component-design.md#pass-through-props">pass-through-props</a>
to ensure that the tooltip shows up on focus:



https://user-images.githubusercontent.com/8698078/230929396-5a423c18-4a5f-410c-a3d3-9005022f8060.mov



### Checklist

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



### 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)
2023-04-11 11:51:31 -06:00
Karl Godard
db5ad71637
[D4C] Further cloud_defend policy validation work (#154616)
## Summary

Adds some additional validation to the yaml editor for both string byte
length checks as well as combined maximum allowed selectors and
responses by type.

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

### Screenshots


![image](https://user-images.githubusercontent.com/16198204/230976116-881bf152-6af9-45ac-9c09-f8ad05d69795.png)

![image](https://user-images.githubusercontent.com/16198204/230976299-e7128486-a4a4-42d4-b979-3507b429535b.png)

![image](https://user-images.githubusercontent.com/16198204/230977899-61b66109-ded3-4c1d-9de9-3fa55699f5ae.png)
2023-04-11 10:47:58 -07:00
Jeramy Soucy
6431787de1
Bump ssri 6.0.1 to 6.0.2 (#154595)
Bumps the `ssri 6.0.1 `dev dependency to version `6.0.2`.
2023-04-11 13:19:41 -04:00
Karl Godard
edfa8b3ab5
[Automated PR] Sync cloud_defend plugin policy schema with cloud-defend repo (#154706)
Automated by https://buildkite.com/elastic/cloud-defend/builds/809

Co-authored-by: sec_cloudnative_integrations <sec-cloudnative-integrations@elastic.co>
2023-04-11 09:34:06 -07:00
Shahzad
3ebc372cc2
[Uptime] Remove legacy monitor management (#154471)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 12:22:16 -04:00
Tiago Costa
c39031e3da
skip failing es promotion suite (#154741) 2023-04-11 17:01:15 +01:00
Paulo Henrique
73a0233af2
[Cloud Posture] Change integration default name based on Policy Template (#154495) 2023-04-11 09:55:02 -06:00
Tiago Costa
e2e630f252
skip failing es promotion suite (#154740) 2023-04-11 16:54:26 +01:00
Walter Rafelsberger
239a981a10
[ML] Random sampler utils package (#154520)
- Refactors individual helpers to manage the `random_sampler`
aggregation into a single reusable wrapper. The helper's factory can be
supplied with either a sample probability right away or a document count
to generate a dynamic sample probability based on it.
- Applies random sampling to the main date histogram chart.
2023-04-11 17:50:06 +02:00
Yulia Čech
7daa791c32
[Watcher] Remove deprecated savedObjectsClient (#154172)
## Summary
Fixes https://github.com/elastic/kibana/issues/154035

This PR removes the saved objects client from the client-side code of
the Watcher plugin. It seems not to be used anywhere so the removal
should not cause any changes to the UI.
To test this PR, it should be enough to create/update/delete a couple of
simple and advanced watches.
2023-04-11 17:46:50 +02:00
Tiago Costa
5feeb175a2
skip failing es promotion suite (#154739) 2023-04-11 16:45:44 +01:00
Devon Thomson
7b26e7ce7d
[Dashboard] Fix z index of toolbar items (#154501)
Adds EUI theme props for zindex and reposition on scroll to the `select
type` and `controls` dashboard toolbar items so that they reposition
properly and don't overlap the header.
2023-04-11 11:23:06 -04:00
Georgii Gorbachev
cdb908fc54
[Security Solution] Skip flaky Cypress tests for bulk editing rule actions (#154722)
## Summary

The `detection_rules/bulk_edit_rules_actions.cy.ts` Cypress suite seems
to be flaky. Example build:


https://buildkite.com/elastic/kibana-pull-request/builds/118828#01876d53-8312-4590-8e88-dc2fdb4841a7

Follow-up issue: https://github.com/elastic/kibana/issues/154721
2023-04-11 17:22:21 +02:00
Sloane Perrault
b8d251e639
[Enterprise Search] ML Inference - ELSER Call Out (#154603)
## Summary

- adds (optionally) dismissable call out for new ELSER model
- includes ELSER call out as a dismissable call out in the ml inference
pipeline card
- includes ELSER call out as a non-dismissable call out in the add
inference pipeline fly out
- only shows the ELSER call out if `text_expansion` isn't an option yet

<details>
<summary>🖼️ Screenshots</summary>

![Screen Shot 2023-04-11 at 09 22
37](https://user-images.githubusercontent.com/1699281/231176400-3bdc39b9-b200-4638-b9f4-4b98316aa73b.png)

![Screen Shot 2023-04-11 at 09 22
41](https://user-images.githubusercontent.com/1699281/231176415-b4e433bb-6023-41b1-8b7c-b93a012f2d88.png)


</details>

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

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2023-04-11 08:17:08 -07:00
GitStart
2ca823d688
[Security Solution] Rule Details navigation breadcrumb for Deleted Rules doesn't allow navigation back to Rules page when no previous alerts exist (#150322)
[Security Solution] Rule Details navigation breadcrumb for Deleted Rules
doesn't allow navigation back to Rules page when no previous alerts
exist

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

### Loom/Screenshot Demo 
* **How to reproduce the issue:**
https://www.loom.com/share/7e4b59de092b44b8b248e3e3c5160882
* **Fix:** https://www.loom.com/share/c24bd15eb67841489c4f5ddc5cae6bad

---
This code was written and reviewed by GitStart Community. Growing future
engineers, one PR at a time.

---------

Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev>
Co-authored-by: gitstart_bot <gitstart_bot@users.noreply.github.com>
Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 17:07:59 +02:00
Christos Nasikas
c1de7aaa6e
[Cases] Make the alerts table in cases GA (#154626)
## Summary

Security solution changed recently their alert tables to the alert table
provided by ResponseOps. For this reason, I removed the experimental
badge from the cases alerts table in the security solution and mark it
as GA.

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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 17:32:18 +03:00
Alexi Doak
331eb60a8b
[ResponseOps] Allow users authenticated with an API keys to manage alerting rules (#154189)
Resolves https://github.com/elastic/kibana/issues/152140

## Summary
Updates the following functions in the Rules Client to re-use the API
key in context and avoid having the system invalidate them when no
longer in use:

- bulk_delete
- bulk_edit
- clone
- create
- delete
- update
- update_api_key

Also adds a new field to the rule SO to help determine when whether an
api key was created by a user or created by us.

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

### To verify

- Follow these
[instructions](https://www.elastic.co/guide/en/kibana/master/api-keys.html#create-api-key)
to create an api key. Make sure to copy your api key
- Run the following 
```
curl -X POST "http://localhost:5601/api/alerting/rule/" -H 'Authorization: ApiKey ${API_KEY}' -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
{
  "rule_type_id": "example.pattern",
  "name": "pattern",
  "schedule": {
    "interval": "5s"
  },
  "actions": [
  ],
  "consumer": "alerts",
  "tags": [],
  "notify_when": "onActionGroupChange",
  "params": {
    "patterns": {
      "instA": " a - - a "
    }
  }
}'
```
- Verify that the request returns a rule
with`"api_key_created_by_user":true`
- Try this with the other rules clients functions listed above to verify
that you can manage alerting rules when authenticated with an api key
- Verify that `"api_key_created_by_user":false` when you remove the api
key header and add `-u ${USERNAME}:${PASSWORD}` to authenticate
2023-04-11 07:29:56 -07:00
Stratoula Kalafateli
60fe5af19c
[Unified search] Not fail in wrong custom timerange (#154643)
## Summary

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

In unified search timepicker you can set your own custom timeranges for
reusability. It is very easy to make a mistake such as the one described
in the issue. This fails on the usePrettyDuration function of eui. I
wrapped the function on a try catch to not fail (it will instead default
to the default timerange 15 minutes).


![2](https://user-images.githubusercontent.com/17003240/230848628-b3930455-d8a8-40b0-b699-d604454859cb.gif)

### 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-04-11 17:28:01 +03:00
Jonathan Buttner
a8341d984a
[Cases] File improvements and other clean up (#154011)
This PR does some clean up and adds some validation.

Notable changes
- Removes unused operation code
- Adds check to ensure that only a single file can be contained in a
file attachment
- Adds some testing
- Modifies the LimitChecker to use the file service to determine how
many files are attached to a case
2023-04-11 09:58:22 -04:00
Peter Pisljar
2459819c62
[unified search] allowing to pass additional filters used for suggestions (#154522) 2023-04-11 15:43:58 +02:00
Marco Vettorello
ed4d49b59c
[Lens] Fix timezone used in normalize by unit (#154472)
This commit fixes an issue introduced in
https://github.com/elastic/kibana/pull/142741 where the time bounds were
computed in an expression `time_scale` that can be run on both the
server and the client.
Computing time-related information on each side (server/client), means
that we need to align temporarily with the client timezone to make an
effective calculation.
This temporary alignment had a bug when executed on the client: the
the first time it gets completed, the restored timezone was the wrong
timezone, in particular, the function used to get the current configured
timezone `moment().zoneName()` return abbreviated zone names and in some
cases also non-unique abbreviations (see
https://momentjs.com/timezone/docs/#/using-timezones/formatting/) making
the restoration a bit difficult and problematic.

The fix instead did the following:
- replace the `moment().zoneName()` with `moment.defaultZone?.name` even
this is not typed, this property is exposed by moment [since years
now](2448cdcbe1/moment-timezone.js (L603))
and is the only way to get the `defaultZone` configured through the
`setDefault`.
- replace the try/catch/finally block with a more readable
implementation: using a "safe" implementation to update the timezone in
moment we can get rid of the try/catch and we can make it more linear.
 

fix #154309

The unit test was firstly tested with the old implementation (and it was
failing because the `zoneName` was returning `EDT` which is not a valid
IANA timezone and the timezone were set to `undefined`. With the new
implementation, it returns the specified timezone correctly. I haven't
tested the function itself because I don't know the internal details and
this is also out of the scope of the fix.
2023-04-11 06:37:55 -07:00
Dario Gieselaar
79c493c69a
[APM] Make sure scoring is applied by ES (#154627) 2023-04-11 15:02:36 +02:00
Paul Tavares
46ba80efb9
[Security Solution][Endpoint] Execute response action output UI adjustments (#154660)
## Summary

Adjusts the `execute` response action output:

- File deletion notification is in yellow text on the Download button
component
- Execution Error output is not added if it's empty (only Execute
context and STDOUT would be shown)
- Execution Error output is expanded by default if it's included. Error
accordion will be positioned below the execution context accordion.
- Add some space between the download link and the rest of execution
accordions
- Zip file truncation is displayed in context under the output and error
accordions if applicable
- Execution output accordion is at the bottom
- current working directory text will say "Executed from: /path/path"


In addition:

- Endpoint Emulator CLI too was enhanced to recognize two additional
tokens in the action's `comment` that will impact the `execute` response
output:
    - `EXECUTE:FAILURE` - will respond with an `execute` error output
    - `EXECUTE:SUCCESS` - will respond with an `execute` success output
2023-04-11 08:58:19 -04:00
Kevin Delemme
450e19598e
chore(slo): require customkql timestamp field (#154654) 2023-04-11 08:31:53 -04:00
Kevin Delemme
a727ba183a
fix(slo): fulltext search on name (#154666) 2023-04-11 08:31:27 -04:00
Yngrid Coello
628db34d8a
[APM] Display latest agent version in agent explorer (#153643)
Closes https://github.com/elastic/kibana/issues/152326.

### Changes
- `fetchWithTimeout` function was added, so we can fetch the external
bucket where the versions are with a timeout. This is mostly useful for
air-gapped environments.
- `fetchAgentsLatestVersion` was introduced an it's in charge of
fetching the bucket and handling the errors accordingly.
- `getAgentsItems` now returns `latestVersion` property for each agent.
- New column was created in the UI to list the latestVersion per agent.

When no timing out


https://user-images.githubusercontent.com/1313018/227519796-e5569475-451d-4c04-8243-d18c8e7126c3.mov

When timing out


https://user-images.githubusercontent.com/1313018/227520011-ae616a07-e87b-4d0f-bd29-4b3338aa5df2.mov

### Pending

- [ ] Replace bucket URL with production bucket url

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 14:31:13 +02:00
Abdul Wahab Zahid
e29265e51c
[Synthetics] Adjust disrupted UI elements on small screens and when flyout is open (#152812)
Fixes #150615
Fixes #147944

## Summary

Takes care of wrapping and overflowing of panels on small screens or
when monitor test run flyout is open in push mode.

The PR addresses the Monitor Overview, Management, Monitor Details and Monitor Add/Edit
pages.
2023-04-11 13:56:22 +02:00
Angela Chuang
b06400373c
[SecuritySolution] Migrate away from browser-side SO client (#154174)
## Summary

Issue: https://github.com/elastic/kibana/issues/154040


Apis added: 

1. Get all the tags with name `Security Solution` or Create a Security
Solution tag if no results found
#### GET /internal/tags
```
[
    {
        "id": "ba964280-d211-11ed-890b-153ddf1a08e9",
        "name": "Security Solution",
        "description": "Security Solution auto-generated tag",
        "color": "#2c7b82"
    }
]
```
2. Get dashboards with Security Solution tags
#### GET /internal/dashboards
```
[
    {
        "type": "dashboard",
        "id": "7de391b0-c1ca-11e7-8995-936807a28b16-ecs",
        "namespaces": [
            "default"
        ],
        "attributes": {
            "description": "Overview of kernel executions",
            "hits": 0,
            "kibanaSavedObjectMeta": {
                "searchSourceJSON": "{\"filter\":[],\"highlightAll\":true,\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"version\":true}"
            },
            "optionsJSON": "{\"darkTheme\":false,\"useMargins\":false}",
            "panelsJSON": "[{\"version\":\"7.3.0\",\"type\":\"visualization\",\"gridData\":{\"h\":12,\"i\":\"1\",\"w\":16,\"x\":16,\"y\":0},\"panelIndex\":\"1\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_1\"},{\"version\":\"7.3.0\",\"type\":\"visualization\",\"gridData\":{\"h\":12,\"i\":\"3\",\"w\":16,\"x\":32,\"y\":0},\"panelIndex\":\"3\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_3\"},{\"version\":\"7.3.0\",\"type\":\"visualization\",\"gridData\":{\"h\":12,\"i\":\"5\",\"w\":16,\"x\":0,\"y\":0},\"panelIndex\":\"5\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_5\"},{\"version\":\"7.3.0\",\"type\":\"search\",\"gridData\":{\"h\":20,\"i\":\"6\",\"w\":48,\"x\":0,\"y\":12},\"panelIndex\":\"6\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_6\"}]",
            "timeRestore": false,
            "title": "[Auditbeat Auditd] Executions ECS",
            "version": 1
        },
        "references": [
            {
                "name": "1:panel_1",
                "id": "20a8e8d0-c1c8-11e7-8995-936807a28b16-ecs",
                "type": "visualization"
            },
            {
                "name": "3:panel_3",
                "id": "f81a6de0-c1c1-11e7-8995-936807a28b16-ecs",
                "type": "visualization"
            },
            {
                "name": "5:panel_5",
                "id": "2efac370-c1ca-11e7-8995-936807a28b16-ecs",
                "type": "visualization"
            },
            {
                "name": "6:panel_6",
                "id": "d382f5b0-c1c6-11e7-8995-936807a28b16-ecs",
                "type": "search"
            },
            {
                "name": "tag-ref-ba964280-d211-11ed-890b-153ddf1a08e9",
                "id": "ba964280-d211-11ed-890b-153ddf1a08e9",
                "type": "tag"
            }
        ],
        "coreMigrationVersion": "8.8.0",
        "typeMigrationVersion": "8.7.0",
        "updated_at": "2023-04-03T11:38:00.902Z",
        "created_at": "2023-04-03T11:20:46.473Z",
        "version": "WzE4NzMsMV0=",
        "score": 0
    }
]
```

<img width="2557" alt="Screenshot 2023-03-31 at 16 10 49"
src="https://user-images.githubusercontent.com/6295984/229166859-6d765332-aa04-4da2-acde-456b04682914.png">


<img width="2547" alt="Screenshot 2023-03-31 at 16 09 28"
src="https://user-images.githubusercontent.com/6295984/229166834-0b61c1cd-53a8-4c5c-892e-94f19deb95f2.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
2023-04-11 12:55:47 +01:00
Dima Arnautov
5636060d11
[ML] Script to generate a content page for the ML Kibana API (#154538)
## Summary

- Adds a script to generate a content page with ML Kibana API groups
- Updates the `apiDocs` npm command
2023-04-11 13:35:54 +02:00
Stratoula Kalafateli
d9d535ee67
[TSVB] Use the empty label for / terms (#154647)
## Summary

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

In case there is a single `/` in the markdown it uses the (empty) label
as we are doing in other cases.

<img width="808" alt="image"
src="https://user-images.githubusercontent.com/17003240/230896158-fbdb2f73-76c3-44a0-8e69-041dadd379a6.png">


### 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
2023-04-11 13:22:49 +03:00
Dima Arnautov
7db297bec5
[ML] Change point detection: fix applying filters and query to the charts (#154707) 2023-04-11 12:15:40 +02:00
Garrett Spong
4072cf2d3d
[Security Solution] Skips flakey Rules Table tests (#154695)
## Summary
As detailed in https://github.com/elastic/kibana/issues/154694, need to
address some follow-up flake in addition to
https://github.com/elastic/kibana/issues/154663. This includes the Rules
Table auto-refresh and rule selection suites:


[rules_table_auto_refresh.cy.ts](ca696ac50c/x-pack/plugins/security_solution/cypress/e2e/detection_rules/rules_table_auto_refresh.cy.ts (L46))
Failed builds:
*
https://buildkite.com/elastic/kibana-pull-request/builds/118556#018762fd-eb9b-4210-a1a7-f28a36e304e7
*
https://buildkite.com/elastic/kibana-pull-request/builds/118310#018756a3-4f98-4404-81e5-b55b9644c651


[rules_selection.cy.ts](3d146298a4/x-pack/plugins/security_solution/cypress/e2e/detection_rules/rules_selection.cy.ts (L34))
Failed builds:
*
https://buildkite.com/elastic/kibana-pull-request/builds/118310#01875708-6710-47a9-bd3f-892e878bbeb1
*
https://buildkite.com/elastic/kibana-pull-request/builds/118700#01876bfe-e766-42b7-a99d-bcdd3c02823a
2023-04-11 10:55:49 +02:00
Stavros Kroustouris
1d67f4c924
TLS-291: Update pipeline that update the controller (#154641)
## Summary
This commit uses a new pipeline to update the kibana-controller service

I removed the other sections because they did not really apply 😬
2023-04-11 10:44:09 +02:00
Georgii Gorbachev
798fb4dde2
[Security Solution] Remove the name field from the security-rule SO mappings (#154473)
**Related to:** https://github.com/elastic/security-team/issues/6268
(internal)

## Summary

For each of our Saved Object types, we must:

1. Remove any SO field mappings with `index: false` (or `enabled:
false`, although a first pass was done in
https://github.com/elastic/kibana/pull/149102) from our SO `mappings`
declarations
2. Audit and remove any _unused_ SO fields to minimize our footprint

This PR addresses these two requirements for this `security-rule` saved
object type (prebuilt rule asset).

## Details

Specifically, the PR removes the `name` field from the mappings because:

- We don't filter, sort, search, or aggregate by it.
- We might need to do it in the future for our prebuilt rule
upgrade/installation workflows, but for now we're going to implement
filtering, sorting, and pagination on the client side, thus there's no
need for this mapping server-side.

<img width="1295" alt="Screenshot 2023-04-05 at 15 19 10"
src="https://user-images.githubusercontent.com/7359339/230094740-706a9a78-fec3-469e-a4ad-e8b7d7309c78.png">

Also, we may need to add more fields to this mapping in the future to
implement further improvements for the prebuilt rule installation,
upgrade, or deprecation workflows.

### 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
  - [x] The unit test for SO mapping hashes has been updated.
- [ ] More tests will be added as part of
https://github.com/elastic/kibana/issues/148176 and
https://github.com/elastic/kibana/issues/148192
2023-04-11 10:26:06 +02:00
Abdul Wahab Zahid
ddea494b21
[Synthetics] Waterfall Chart design update and custom marks (#154510)
## Summary

- Adds a toggle for custom marks (`perfromance.mark()`) on synthetics
waterfall chart.
- Updates the design per design feedback.

<img width="1689" alt="Screenshot 2023-04-05 at 21 01 54"
src="https://user-images.githubusercontent.com/2748376/230267962-1d87a4d7-7229-4657-9bfb-f587dbb80613.png">
2023-04-11 09:58:19 +02:00
renovate[bot]
4d9c3cd5e9
Update dependency elastic-apm-node to ^3.44.0 (main) (#154693)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-11 03:55:11 -04:00