Commit graph

7808 commits

Author SHA1 Message Date
Rickyanto Ang
28b1f96d47
[Cloud Posture] Fix for Flaky test Column Sort (#154877)
## Summary
This PR for fixing the 'Flakiness' for our FTR Column Sort test cases.
The fix includes adding a 1 second delay or sleep between the test
clicking on the column its trying to sort and the test getting values
for that column.

There seems to be a problem from time to time where the values on that
column is not correct for a split second after clicking on the column to
sort it. Adding 1 second delay allows enough time for the column to sort
and show the correct value before we get the value for comparison with
the sorted (using our sorting function on the test)

This delay also fix the issue where the test fails because it checks for
an element while the page is still loading. I ran this 'fix' on our
flaky test runner for over 1000 runs and it hasn't fail so far, whereas
back then It would fail 3-4 times out of 450 runs

### Some other stuff that I tried before choosing this fix includes:

- Breaking the Column sort test cases into smaller test, currently we
test all Column sort in 1 test thus when 1 fail it might fail the next
one too.
- wait until loading element doesn't exist but I seem to be encountering
some issue when i use waitFor. Thus, I switch it to check if loading
element don't exist but It doesnt seem to help that much on fixing
column sort issue

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-17 15:18:27 -07:00
Nicolas Chaulet
ce912a9231
[Fleet] Fix request diagnostics tests (#155092) 2023-04-17 18:06:35 -04:00
Kibana Machine
22956209ac skip failing test suite (#154578) 2023-04-17 13:59:15 -04:00
Kibana Machine
55d5f11d13 skip failing test suite (#154726) 2023-04-17 13:58:58 -04:00
Kibana Machine
3925e93dbc skip failing test suite (#154640) 2023-04-17 13:13:57 -04:00
Kibana Machine
8360064a39 skip failing test suite (#154958) 2023-04-17 12:54:35 -04:00
Kibana Machine
6259bb9098 skip failing test suite (#154913) 2023-04-17 12:03:49 -04:00
Kibana Machine
644e0a81d4 skip failing test suite (#154452) 2023-04-17 11:44:58 -04:00
Kibana Machine
404ec58660 skip failing test suite (#137032) 2023-04-17 11:44:31 -04:00
Patrick Mueller
bcfe4b0005
[ResponseOps] provide config to turn off email action footer (#154919)
resolves https://github.com/elastic/kibana/issues/135402

Allows deployments to not have the default footer added to alerting
emails via the new `xpack.actions.enableFooterInEmail` config setting.
The default value is `true`, which renders the footer.  Setting the
value to `false` will cause no footer to be rendered.

Also changes the footer separator from `--` to `---`, which renders
nicer in HTML, as a `<hr>` element.
2023-04-17 11:19:16 -04:00
Kibana Machine
07a341277e skip failing test suite (#151636) 2023-04-17 10:55:17 -04:00
Coen Warmer
035d28e757
Remove Has Data check from Alerts page so page is always accessible (#154851)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-17 15:15:15 +02:00
Mike Côté
046d97c357
Require config, secrets and params validation for connector types (#153969)
Resolves https://github.com/elastic/kibana/issues/153769

In this PR, I'm making `config`, `secrets` and `params` require a
validation in their connector type definition. Even in scenarios no
values are used, an empty object validation is required. This prevents
arbitrary data from being passed through.

Only `ES Index`, `Server Log` and `Teams` had some empty validators.
Adding them won't be a breaking change because the HTTP API defaults
missing `config` and `secrets` to `{}` ([see
here](https://github.com/elastic/kibana/blob/main/x-pack/plugins/actions/server/routes/create.ts#L19-L24)).

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-17 05:22:13 -07:00
Dominique Clarke
dcfff4fd56
[Synthetics] report error when synthetics agent sends an invalid location (#154876)
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
2023-04-17 14:02:11 +02:00
Michael Dokolin
a9ea301a8a
[Migrations] Remove migrationVersion mappings (#154711) 2023-04-17 09:53:22 +02:00
Jen Huang
73be560e29
[Fleet] Re-enable skipped tests on main (#154960)
## Summary

Closes #154739. Re-enables skipped suites now that #154741 is resolved.
2023-04-14 17:05:09 +02:00
Jiawei Wu
3b07f96b44
[RAM] Window Maintenance Client/Saved Object and Mapping/REST APIs (#153411)
## Summary
Resolves: https://github.com/elastic/kibana/issues/152270
Specs:
https://docs.google.com/document/u/1/d/1-QblF6P19W9o5-10Us3bfgN80GRfjSIhybHrvJS_ObA/edit

This PR implements the following:
- New maintenance window SO
- New maintenance window client in the alerting plugin (generates and
queries maintenance window events, and other CRUD functionality around
the SO)
- New maintenance window REST APIs 
- Kibana privileges for reading/writing maintenance window

This PR does not include integration with task runner, a new PR will be
created to do that work.
 
## APIs:

```
Find all maintenance windows in current space
GET `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/_find`
body: {}
```

```
Create maintenance window:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window`
body: {
  title: string,
  duration: number,
  r_rule: RRule
}
```

```
Update maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
body: {
  title?: string,
  duration?: number,
  enabled?: boolean,
  r_rule?: RRule,
}
```

```
Get maintenance window by ID:
GET `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
```

```
Delete maintenance window by ID:
DELETE `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
```

```
Archive maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}/_archive`,
body: {
  archive: boolean
}
```

```
Finish maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}/_finish`,
```


## Maintenance window response schema:
```
{
  id: string;
  title: string;
  enabled: boolean;
  duration: number;
  expirationDate: string;
  events: DateRange[];
  rRule: RRuleParams;
  status: 'running' | 'upcoming' | 'finished' | 'archived';
  startDate: string | null;
  endDate: string | null;
  createdBy: string | null;
  updatedBy: string | null;
  createdAt: string;
  updatedAt: string;
}
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-13 13:02:28 -07:00
Coen Warmer
7199327bca
[Cases] Remove no-data gate for Cases page (#154909) 2023-04-13 18:48:28 +02:00
Kibana Machine
b1882495f0 skip failing test suite (#154916) 2023-04-13 10:52:29 -04:00
Kibana Machine
b07203d937 skip failing test suite (#154917) 2023-04-13 10:50:10 -04:00
Melissa Alvarez
c7c5a21680
[ML] Data Frame Analytics: support custom urls in jobs (#154287)
## Summary

Related meta issue: https://github.com/elastic/kibana/issues/150375

This PR:
- adds the ability to create custom urls for data frame analytics job -
accessible in the 'Edit' flyout in the jobs list
- adds access to the created custom urls in the data frame analytics
results table (in the 'Actions' column)
- moves the custom url component to a shared directory and is used in
both anomaly detection and data frame analytics



https://user-images.githubusercontent.com/6446462/229624946-b860c13d-19bb-4951-aeac-e7409864b56c.mp4

<img width="1023" alt="image"
src="https://user-images.githubusercontent.com/6446462/229625754-6a9277be-0da3-4f69-8a9a-f4a6fd1b632c.png">



### 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)
- [ ] [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
- [ ] 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))
- [ ] 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-13 08:47:44 -06:00
Christos Nasikas
9cc51bf65b
[Cases] Do not add already attached alerts to the case (#154322)
## Summary

This PR filters out all alerts that are already attached to the selected
case. To avoid breaking changes and not confuse the users (trying to
find which alert is attached to which case) the UI will not produce any
error.

### 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-04-13 07:29:20 -07:00
Stratoula Kalafateli
07a7e765f6
[TSVB][AggBased] Transfer panel title and description to the converted Lens panels (#154713)
## Summary

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

There are 2 ways to convert a legacy visualizations to Lens
1. Go to the legacy editor and click the Visualize in Lens top nav
button
2. Open the panel menu on the dashboard level and click Convert to Lens

On the first case the panel title and description was not passed to the
converted panel
On the second case the panel title was passed but not the description

This PR fixes all the aforementioned scenarios


![2](https://user-images.githubusercontent.com/17003240/230878612-a0ace371-5f17-419e-bad0-37ea7e571c91.gif)

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-13 15:21:00 +03:00
Jonathan Budzenski
d83f1fe5c1 skip failing suite (#154859) 2023-04-12 17:58:40 -05:00
Kevin Logan
935a16d44f
[Security Solution] Unskip tests after ES promotion fixes (#154863)
## Summary

Resolves https://github.com/elastic/kibana/issues/154740
https://github.com/elastic/kibana/issues/154741

These tests were skipped due to an ES promotion block. This PR:
https://github.com/elastic/elasticsearch/pull/95187 was added on the ES
side and another snapshot was promoted which should allow us to un skip
these tests.


### 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>
2023-04-12 17:47:58 -04:00
Lola
b07743b269
[Cloud Posture] onboarding prompts for vul_mgmt (#154118)
## Summary

This PR adds onboarding prompts for when vulnerability management
integration is not installed and when vulnerability management is
installed then show scanning empty prompt.

A `<NoVulnerabilitesState/>` component checks for `vuln_mgmt` status. If
the status is `not-deployed` or `indexing` then show
<ScanningVulnerabilitiesEmptyPrompt/>

The packageNoInstalledRender component will listen for the current tab
and renders on `useLocation().pathname`. If `currentTab` is
'vulnerabilities' then we show
`<VulnerabilitiesFindingsInstalledEmptyPrompt/>`. If `currentTab` is
`configurations` then show
`<ConfigurationFindingsInstalledEmptyPrompt/>`


Installed Prompt
<img width="1728" alt="Screen Shot 2023-03-30 at 3 45 35 PM"
src="https://user-images.githubusercontent.com/17135495/229010609-51a8f009-0fe1-45f3-8452-02bdd4234367.png">
Scanning Envioronment
<img width="1724" alt="Screen Shot 2023-03-30 at 3 45 20 PM"
src="https://user-images.githubusercontent.com/17135495/229010649-2d8c8482-c7d2-4040-927d-310354f99a94.png">

---------

Co-authored-by: Kfir Peled <kfir.peled@elastic.co>
2023-04-12 14:55:21 -04:00
Christos Nasikas
bb73249d81
[Cases] Filter out alerts already attached to the case on the backend (#154629)
## Summary

This PR filters out alerts already attached to a case on the backend.
The schema of the alerts in a case is:

```
{
  alertId: string | string[]
  index: string | string[]
}
```

So the `alertId` can contain multiple alert ids. In this case, if an ID
is attached to the case it will be removed from the `alertId` array. If
all alerts are attach to the case no attachment will be created.

### 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-04-12 08:59:48 -07:00
Tiago Costa
22015b470f
skip flaky suite (#119267) 2023-04-12 16:16:34 +01:00
Julia Bardi
0efdf351e6
[Fleet] fix pr condition to unblock prs if available versions not available (#154808)
## Summary

Fixing pr condition in https://github.com/elastic/kibana/pull/154649

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
2023-04-12 07:56:54 -07:00
Nick Peihl
fe3f9ac4fe
[Maps] Enable skipped test (#154760)
## Summary

This test was failing due to a transient network issue caused by an
unexpected certificates rotation on Elastic Maps Service.

Fixes #153960 


[Flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2109)
2023-04-12 09:59:03 -04:00
Kevin Logan
665c9dd690
[Security Solution] Skip Defend Workflows Cypress tests due to package installation issue (#154813)
## Summary

Skipping additional cypress tests due to ES promotion issue here:
https://github.com/elastic/kibana/issues/154741

Will re-enable once ES issue is resolved.

### 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-12 08:44:55 -05:00
Marco Liberati
41170fe64b
[Lens] Enable report sharing (#153429)
## Summary

Fixes #130438

This PR introduces the PNG/PDF reporting feature within Lens editor.
**Note** each reporting tasks is generating a shortURL SO in addition of
the reporting job SO. There's a reusing mechanism but it applies only to
the same config within the same session.

* [x] Enable reporting for ~~`lens_visualization` type~~ `lens` type
  * [x] Introduce disabled state within the reporter logic
  * [x] Extends the logic to support the custom URL types in Lens
* [x] Make reporting list page to support `lens_visualization` object
type
    * migrated `lens_visualization` to `lens` and used the app icon
* [x] Extends the custom CSS styling to handle specific Lens editor
layout
* [x] Introduce logic for `renderComplete` within the Lens editor
  * [x] Loading logic
  * [x] Trigger `renderComplete` event for the right node
* [x] Add `.hide-for-sharing` class where needed
  * [x] Add the `.stretch-for-sharing` where needed
* Improve layout settings to have a better fit of some charts
  * Maybe this can be addressed as separate issue? 
* Check the `renderComplete` for the RegionMap external plugin =>
separate issue
* Write tests
  * [x] Functional tests

Reporting page:
<img width="1255" alt="Screenshot 2023-03-24 at 15 25 12"
src="https://user-images.githubusercontent.com/924948/227552385-1b52a0ae-8902-4972-acf3-323093a7b840.png">



**Note**: at the moment the reporting name follows the CSV naming
convention of `unsaved` for unsaved Lens visualizations. The legacy
Agg-based editor uses instead a namming pattern as follow:
`Visualization <timestamp>.png`.

Final results:
| Chart type | PNG result |
| ------ | ----- |
| Stacked bar chart |
![unsaved](https://user-images.githubusercontent.com/924948/226881443-05b862c0-6637-4b7f-a461-160a69f2bb6c.PNG)
|
| Vertical bar chart | ![unsaved
(1)](https://user-images.githubusercontent.com/924948/226881523-10c0e91a-6ca3-4161-bd11-738d5f6465db.PNG)
|
| Horizontal stacked bar chart | ![unsaved
(2)](https://user-images.githubusercontent.com/924948/226881585-06fe2904-cba1-402f-a67c-549ce09cd83e.PNG)
|
| Horizontal bar chart | ![unsaved
(3)](https://user-images.githubusercontent.com/924948/226881619-0d135b19-d401-4b13-934e-b7aa23ab2792.PNG)
|
| Datatable | ![unsaved
(4)](https://user-images.githubusercontent.com/924948/226881716-f7543803-bd00-433a-85bc-09b0a2c2c7c5.PNG)
|
| Horizontal gauge | ![unsaved
(5)](https://user-images.githubusercontent.com/924948/226881766-54fccf0c-3266-411b-ac43-8c37855a44eb.PNG)
|
| Vertical gauge | ![unsaved
(6)](https://user-images.githubusercontent.com/924948/226881981-f3b5e007-2637-476a-ab43-1c5efa5e44e5.PNG)
|
| Legacy metric | ![unsaved
(7)](https://user-images.githubusercontent.com/924948/226882220-0c456c2d-8fc7-470e-94e1-f22e5ddcb052.PNG)
|
| Metric | ![unsaved
(8)](https://user-images.githubusercontent.com/924948/226882283-03f10b5b-fa36-402b-a3e0-70f49b2b5968.PNG)
|
| Metric with breakdown | ![unsaved
(9)](https://user-images.githubusercontent.com/924948/226882347-a4f53dfd-8c43-4432-b4c8-eea879c897d3.PNG)
|
| Area chart | ![unsaved
(10)](https://user-images.githubusercontent.com/924948/226882381-b7a81a05-9163-4582-8892-ef25bd803778.PNG)
|
| Line chart | ![unsaved
(11)](https://user-images.githubusercontent.com/924948/226882736-8ce49e82-31a1-435b-9ef9-19ea8e885993.PNG)
|
| Bar chart with annotation + reference lines | ![unsaved
(13)](https://user-images.githubusercontent.com/924948/226882841-0aeb5863-4ccb-426d-aae3-9e0afe19e599.PNG)
|
| Heatmap | ![unsaved
(14)](https://user-images.githubusercontent.com/924948/226883059-31ab11a2-7d9a-461c-a38c-158b03e916e1.PNG)
|
| Donut chart | ![unsaved
(15)](https://user-images.githubusercontent.com/924948/226883107-e7cd922e-a488-4ab5-add6-6aac8657f295.PNG)
|
| Pie chart | ![unsaved
(17)](https://user-images.githubusercontent.com/924948/226883158-d7f285a6-63e7-4bf5-9839-ee5c48b25e22.PNG)
|
| Treemap | ![unsaved
(18)](https://user-images.githubusercontent.com/924948/226883250-2b770885-6275-4f07-8eee-1a4d98aef974.PNG)
|
| Mosaic | ![unsaved
(16)](https://user-images.githubusercontent.com/924948/226883328-96cd2461-06e5-4995-8d38-1235b8774781.PNG)
|
| Waffle | ![unsaved
(19)](https://user-images.githubusercontent.com/924948/226883373-c2f7e041-f45d-44ac-982c-8355b44e5fbf.PNG)
|
| Region Map | ![Lens Visualization 2023-03-31T12_47_48
392+02_00](https://user-images.githubusercontent.com/924948/229101825-dc54a9e8-f89b-4901-b7e7-76a983bc3bd0.PNG)
|

### 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
- [ ] 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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-12 09:38:29 +02: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
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
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
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
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
Tiago Costa
e2e630f252
skip failing es promotion suite (#154740) 2023-04-11 16:54:26 +01:00
Tiago Costa
5feeb175a2
skip failing es promotion suite (#154739) 2023-04-11 16:45:44 +01: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
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
Dario Gieselaar
79c493c69a
[APM] Make sure scoring is applied by ES (#154627) 2023-04-11 15:02:36 +02: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
Nathan Reese
4d31e302be
[Visualize] fix tile_map visualization (#154392)
Fixes https://github.com/elastic/kibana/issues/154375
### background
https://github.com/elastic/kibana/pull/105326 replaced tile_map
visualization implementation with a new implementation that is a wrapper
around MapEmbeddable.

https://github.com/elastic/kibana/pull/152952 removed geohash_grid
aggregation. This causes a regression where existing tile_map
visualizations no longer work. Even though geohash_grid aggregation is
no longer used, the AggType is still needed so that new tile_map
visualization wrapper can access aggregation configuration state.

This PR adds back geohash_grid AggType in `legacyAggs` for this purpose.
PR also adds a functional test to better prevent regressions with
tile_map

### Test
* install web logs sample data
* install legacy tile_map saved objects from 
    ```

{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"7.17.5","id":"90943e30-9a47-11e8-b64d-95841ca0b247","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2022-08-17T20:25:52.585Z","version":"WzEzMDQsMV0="}

{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"region_map","uiStateJSON":"{}","version":1,"visState":"{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"geo.dest\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"addTooltip\":true,\"colorSchema\":\"Yellow
to
Red\",\"emsHotLink\":\"https://maps.elastic.co/v7.16?locale=en#file/world_countries\",\"isDisplayWarning\":true,\"legendPosition\":\"bottomright\",\"mapCenter\":[0,0],\"mapZoom\":2,\"outlineWeight\":1,\"selectedJoinField\":{\"description\":\"ISO
3166-1 alpha-2
code\",\"name\":\"iso2\",\"type\":\"id\"},\"selectedLayer\":{\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"http://www.naturalearthdata.com/about/terms-of-use\\\">Made
with NaturalEarth</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\",\"created_at\":\"2020-10-28T16:16:08.720286\",\"fields\":[{\"description\":\"ISO
3166-1 alpha-2
code\",\"name\":\"iso2\",\"type\":\"id\"},{\"description\":\"ISO 3166-1
alpha-3 code\",\"name\":\"iso3\",\"type\":\"id\"},{\"description\":\"ISO
3166-1 numeric
code\",\"name\":\"iso_numeric\",\"type\":\"id\"},{\"description\":\"name\",\"name\":\"name\",\"type\":\"property\"}],\"format\":\"topojson\",\"id\":\"world_countries\",\"isEMS\":true,\"layerId\":\"elastic_maps_service.World
Countries\",\"meta\":{\"feature_collection_path\":\"data\"},\"name\":\"World
Countries\",\"origin\":\"elastic_maps_service\"},\"showAllShapes\":true,\"wms\":{\"enabled\":false,\"options\":{\"attribution\":\"\",\"format\":\"image/png\",\"layers\":\"\",\"styles\":\"\",\"transparent\":true,\"version\":\"\"},\"selectedTmsLayer\":{\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://openmaptiles.org\\\">OpenMapTiles</a> | <a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\",\"id\":\"road_map\",\"maxZoom\":20,\"minZoom\":0,\"origin\":\"elastic_maps_service\"},\"url\":\"\"}},\"title\":\"region_map\",\"type\":\"region_map\"}"},"coreMigrationVersion":"7.17.5","id":"64a5b9f0-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"visualization":"7.17.0"},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2022-08-17T20:30:50.288Z","version":"WzE0MDIsMV0="}

{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"tile_map","uiStateJSON":"{\"mapZoom\":2,\"mapCenter\":[13.64385981167601,-135.97675761558068]}","version":1,"visState":"{\"title\":\"tile_map\",\"type\":\"tile_map\",\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"params\":{},\"schema\":\"metric\"},{\"id\":\"2\",\"enabled\":true,\"type\":\"geohash_grid\",\"params\":{\"field\":\"geo.coordinates\",\"autoPrecision\":true,\"precision\":2,\"useGeocentroid\":true,\"isFilteredByCollar\":true},\"schema\":\"segment\"}],\"params\":{\"colorSchema\":\"Yellow
to Red\",\"mapType\":\"Scaled Circle
Markers\",\"isDesaturated\":true,\"addTooltip\":true,\"heatClusterSize\":1.5,\"legendPosition\":\"bottomright\",\"mapZoom\":2,\"mapCenter\":[0,0],\"wms\":{\"enabled\":false,\"url\":\"\",\"options\":{\"version\":\"\",\"layers\":\"\",\"format\":\"image/png\",\"transparent\":true,\"attribution\":\"\",\"styles\":\"\"},\"selectedTmsLayer\":{\"origin\":\"elastic_maps_service\",\"id\":\"road_map\",\"minZoom\":0,\"maxZoom\":20,\"attribution\":\"<a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.openstreetmap.org/copyright\\\">OpenStreetMap
contributors</a> | <a rel=\\\"noreferrer noopener\\\"
href=\\\"https://openmaptiles.org\\\">OpenMapTiles</a> | <a
rel=\\\"noreferrer noopener\\\"
href=\\\"https://www.elastic.co/elastic-maps-service\\\">Elastic Maps
Service</a>\"}}}}"},"coreMigrationVersion":"7.17.5","id":"4b073190-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"visualization":"7.17.0"},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2022-08-17T20:29:28.769Z","version":"WzEzNDksMV0="}

{"attributes":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"version\":\"7.17.5\",\"type\":\"visualization\",\"gridData\":{\"x\":24,\"y\":0,\"w\":24,\"h\":15,\"i\":\"ad02c99b-8bae-42e0-8a43-d27762f1e607\"},\"panelIndex\":\"ad02c99b-8bae-42e0-8a43-d27762f1e607\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_ad02c99b-8bae-42e0-8a43-d27762f1e607\"},{\"version\":\"7.17.5\",\"type\":\"visualization\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\"},\"panelIndex\":\"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee\"}]","timeRestore":false,"title":"dash
with legacy map
visualizations","version":1},"coreMigrationVersion":"7.17.5","id":"97437d70-1e6b-11ed-833b-a105e9534fa9","migrationVersion":{"dashboard":"7.17.3"},"references":[{"id":"64a5b9f0-1e6b-11ed-833b-a105e9534fa9","name":"ad02c99b-8bae-42e0-8a43-d27762f1e607:panel_ad02c99b-8bae-42e0-8a43-d27762f1e607","type":"visualization"},{"id":"4b073190-1e6b-11ed-833b-a105e9534fa9","name":"8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee:panel_8412ffc8-b94c-4bbd-aa55-fa670f3fb4ee","type":"visualization"}],"type":"dashboard","updated_at":"2022-08-17T20:31:36.656Z","version":"WzE0MzEsMV0="}

{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":4,"missingRefCount":0,"missingReferences":[]}

    ```
* Open dashboard and verify tile_map renders

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-10 19:06:48 -06:00
Cee Chen
31b50a3906
Upgrade EUI to v77.0.0 (#154379)
> ⚠️ Synthetic failures are not related to any EUI changes and are
likely already failing on main. Please ignore the failing CI status when
reviewing.

## [`77.0.0`](https://github.com/elastic/eui/tree/v77.0.0)

**Bug fixes**

- Fixed named `EuiBadge` colors to reflect custom theme overrides
([#6659](https://github.com/elastic/eui/pull/6659))
- Fixed user-defined SCSS variables failing to override variables
defined in Amsterdam typography overrides.
([#6665](https://github.com/elastic/eui/pull/6665))
- Fixed bold `EuiCode` tokens to actually be bold
([#6666](https://github.com/elastic/eui/pull/6666))

**Breaking changes**

- Success- and accent-colored `EuiBadge`s and `EuiButton`s have had
their fill colors tinted slightly on light mode to be more readable
([#6659](https://github.com/elastic/eui/pull/6659))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2023-04-10 17:06:26 -05:00
Kyle Pollich
b7017b27ab
[Fleet] Loosen validation for experimental data stream features (#154661)
## Summary

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

Allow `PUT`ing partial request bodies for experimental features, which
ensures we don't break package policies from prior versions of Kibana
where not all experimental features were available.

Added an FTR test to catch the error, which is an API schema validation
one. Verified the test fails before the schema changes are made.

### 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-04-10 12:11:12 -07:00
Jonathan Buttner
b6a113ccfa
Cases delete files case deletion (#153979)
This PR extends the case deletion functionality to delete any files that
are attached to the case when a case is deleted.

To avoid attempting to delete too many files at once I chunk case ids
into 50 at a time such that we're at most only deleting 5000 (50 case *
100 files per case) at once. That way we don't exceed the 10k find api
limit.

## Testing
Run the python script from here:
https://github.com/elastic/cases-files-generator to generate some files
for a case

Deleting the case should remove all files
2023-04-10 12:20:58 -04:00
Stratoula Kalafateli
b3b4441111
[TSVB] Fix flaky test (#154519)
## Summary

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

Runner 100 times
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2094

I dont think that this test is super flaky. I just added the waiting
after clicking the seriesOption as I guess it might make it even more
stable
2023-04-10 08:57:18 +03:00