Commit graph

3279 commits

Author SHA1 Message Date
Dzmitry Lemechko
bc44f524ac
[performance] use journey own ftr config to run scalability test (#152596)
While debugging scalability testing failure for
`cloud_security_dashboard` journey, I found that we hardcoded base FTR
config to `x-pack/performance/journeys/login.ts` and main issue is that
Kibana is not started properly.

This PR makes few changes:
- update `kbn-performance-testing-dataset-extractor` to save journey
path as `configPath` so it can be later used to start ES/Kibana in the
scalability run with the same configuration it was run for the single
user journey run.
- update scalability entry configuration to read base FTR config from
generated scalability json file (`configPath` property)

How to test:
- make sure to clone the latest
[kibana-load-testing](https://github.com/elastic/kibana-load-testing)
repo and build it `mvn clean test-compile`
- from kibana root directory run any api capacity test
```
node scripts/run_scalability.js --journey-path x-pack/test/scalability/apis/api.core.capabilities.json
```
Expected result: logs should display
```
debg Loading config file from x-pack/performance/journeys/login.ts
```
- download the latest artifacts from
[buildkite](https://buildkite.com/elastic/kibana-performance-data-set-extraction/builds/171#0186a342-9dea-4a9b-bbe4-c96449563269),
find `cloud_security_dashboard-<uuid>.json`
- from kibana root directory run scalability test for
`cloud_security_dashboard` journey
```
node scripts/run_scalability.js --journey-path <path to cloud_security_dashboard-<uuid>.json>
```
Expected result: logs should display 
```
debg Loading config file from x-pack/performance/journeys/cloud_security_dashboard.ts
```

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-07 13:20:21 +01:00
Gerard Soldevila
d2a329f88d
[Migrations] Improve naming on some states' names (#152441)
Some migration states have names that are a bit vague / not accurate.
This PR intends to update them to reduce confusion and make the flow
more clear.
2023-03-07 12:25:01 +01:00
Steph Milovic
8e2ea3ebea
[Security solution] Grouping package - state management (#152627) 2023-03-06 18:28:34 -07:00
Christiane (Tina) Heiligers
cf1fbc7c8a
[http] Add log for route path access (#152621)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-06 15:12:33 -07:00
Yara Tercero
4c682c71d8
[Security Solution][Exceptions] - Fix breadcrumbs text for shared exception list (#152629)
## Summary

Addresses https://github.com/elastic/kibana/issues/152540
2023-03-06 14:11:32 -07:00
renovate[bot]
310d6bb2d5
Update dependency core-js to ^3.29.0 (main) (#152656)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [core-js](https://togithub.com/zloirock/core-js) | [`^3.28.0` ->
`^3.29.0`](https://renovatebot.com/diffs/npm/core-js/3.28.0/3.29.0) |
[![age](https://badges.renovateapi.com/packages/npm/core-js/3.29.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/core-js/3.29.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/core-js/3.29.0/compatibility-slim/3.28.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/core-js/3.29.0/confidence-slim/3.28.0)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>zloirock/core-js</summary>

###
[`v3.29.0`](https://togithub.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#&#8203;3290---20230227-httpsgithubcomzloirockcore-jsreleasestagv3290)

[Compare
Source](https://togithub.com/zloirock/core-js/compare/v3.28.0...v3.29.0)

- Added `URLSearchParams.prototype.size` getter,
[url/734](https://togithub.com/whatwg/url/pull/734)
- Allowed cloning resizable `ArrayBuffer`s in the `structuredClone`
polyfill
- Fixed wrong export in `/(stable|actual|full)/instance/unshift`
entries,
[#&#8203;1207](https://togithub.com/zloirock/core-js/issues/1207)
-   Compat data improvements:
- [`Set` methods
proposal](https://togithub.com/tc39/proposal-set-methods) marked as
supported from Bun 0.5.7
    -   `String.prototype.toWellFormed` marked as fixed from Bun 0.5.7
    -   Added Deno 1.31 compat data mapping

</details>

---

### Configuration

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

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

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

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

---

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

---

This PR has been generated by [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:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTQuNyIsInVwZGF0ZWRJblZlciI6IjM0LjE1NC43In0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Budzenski <jon@elastic.co>
2023-03-06 15:02:10 -06:00
Steph Milovic
dd75719f8c
[Security solution] Grouping package - generic type argument (#152628) 2023-03-06 12:46:12 -07:00
Ievgen Sorokopud
ce9631850d
[Security Solution][Alerts] Update mapping conflicts warning message (#152726)
## Summary

These changes update warning message that we show to user to indicate
index mapping conflicts while selecting a field to build a Rule
Exception.

New tooltip message:

<img width="829" alt="Screenshot 2023-03-06 at 16 18 51"
src="https://user-images.githubusercontent.com/2700761/223154197-ee4ed680-5cc1-4b48-82d8-e225aa24519b.png">

[Main ticket](https://github.com/elastic/kibana/issues/146845)
Addition to [this PR](https://github.com/elastic/kibana/pull/149149)


cc @nastasha-solomon
2023-03-06 19:23:26 +01:00
Aleh Zasypkin
0bf0a40b90
Upgrade vega dependency (5.22.15.23.0). (#152541) (#152700) 2023-03-06 16:00:26 +01:00
Alejandro Fernández Haro
f10777e5d5
[Elasticsearch] Log queued requests (#152571)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-03-06 14:25:44 +01:00
Davis Plumlee
203fa3a955
[Security Solution] Exceptions TTL Follow-up (#151952) 2023-03-03 18:56:39 -05:00
Jonathan Budzenski
4e3cc20ca0 Revert "Upgrade vega dependency (5.22.15.23.0). (#152541)"
This reverts commit 54d6321246.
2023-03-02 13:58:32 -06:00
Devin W. Hurley
f95d4eae7f
[Security Solution] [Exceptions] change 'manage rules' to 'link rules' on exceptions pages (#151905)
Ref: https://github.com/elastic/kibana/issues/146268
2023-03-02 14:40:57 -05:00
Steph Milovic
2a1740d035
[Security solution] Grouping UI package (#152385) 2023-03-02 12:03:25 -07:00
Aleh Zasypkin
54d6321246
Upgrade vega dependency (5.22.15.23.0). (#152541) 2023-03-02 19:32:10 +01:00
Christiane (Tina) Heiligers
41f7e633a9
[http] Adds route config option access flag to indicate if an API is public or internal (#152404) 2023-03-02 08:14:59 -07:00
Oliver Gupte
35008c955e
[APM] Adds service map dsl to synthtrace (#152526)
Adds `serviceMap` helper to generate transaction and spans in synthtrace
by defining a set of traces from which a service map can be rendered.
This can be considered a follow-up to
https://github.com/elastic/kibana/pull/149900 where synthtrace was used
to generate service maps for api integration tests.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-03-02 09:49:14 -05:00
Gerard Soldevila
5dd8742d17
Allow for additive mappings update without creating a new version index (#149326)
Fixes [#147237](https://github.com/elastic/kibana/issues/147237)

Based on the same principle as
[#147371](https://github.com/elastic/kibana/pull/147371), the goal of
this PR is to **avoid reindexing if possible**.
This time, the idea is to check whether the new mappings are still
compatible with the ones stored in ES.
To to so, we attempt to update the mappings in place in the existing
index, introducing a new `CHECK_COMPATIBLE_MAPPINGS` step:
* If the update operation fails, we assume the mappings are NOT
compatible, and we continue with the normal reindexing flow.
* If the update operation succeeds, we assume the mappings ARE
compatible, and we skip reindexing, just like
[#147371](https://github.com/elastic/kibana/pull/147371) does.


![image](https://user-images.githubusercontent.com/25349407/216979882-9fe9f034-b521-4171-b85d-50be6a13e179.png)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-03-01 10:26:04 +01:00
Philippe Oberti
4aa0961613
[Security Solution] expanded flyout (#150240) 2023-02-27 21:02:03 -06:00
Ying Mao
dcf752e8df
[Response Ops][Alerting] Update common component template generation for framework alerts as data (#150384)
Resolves https://github.com/elastic/kibana/issues/150358

## Summary

In a previous [PR](https://github.com/elastic/kibana/pull/145581) we
started installing a common component template for framework alerts as
data when the `xpack.alerting.enableFrameworkAlerts` config flag is set
to true. In that PR we used a different naming pattern than what is used
by the rule registry for its component templates.

In this PR we are doing the following:
* Renaming the installed `alerts-common-component-template` to
`.alerts-framework-mappings`.
* Creating and installing `.alerts-legacy-alert-mappings` component
template when `enableFrameworkAlerts: true` on alerting plugin setup
* The combination of the two component templates creates the same set of
mappings as the rule registry technical component template
* Creating and installing `.alerts-ecs-mappings` component template when
`enableFrameworkAlerts: true` on alerting plugin setup (when
`enableFrameworkAlerts: false`, the rule registry continues to install
this component template
* Using the `@kbn/ecs` package provided by core to generate the ECS
field map. The rule registry will continue to install the existing ECS
field map which is actually a subset of ECS fields
* Adding `useLegacy` and `useEcs` flags that allow rule types to specify
whether to include the legacy alerts component template and the ECS
component template when registering with framework alerts-as-data.
* Moved some common functions to alerting framework from the rule
registry

## Things to note
* When generating the ECS field map, we are now including the
`ignore_above` setting from the `@kbn/ecs` package. This changes the ECS
component template to include those settings. I tested updating an index
with just `"type":"keyword"` mappings to add the `ignore_above` field to
the mapping and had no issues so this seems like an additive change to
the mapping that will hopefully prevent problems in the future.
* The rule registry ECS component template also includes the technical
fields which is redundant because the technical component template is
automatically installed for all index templates so the framework ECS
component template only contains ECS fields.

| Previous mapping      | Updated mapping |
| ----------- | ----------- |
| `{ "organization": { "type": "keyword" } }` | `{ "organization": {
"type": "keyword", "ignore_above": 1024 } }` |

## To Verify

### Verify that the generated component templates are as expected:

Get the following

**While running `main`:**

1. Get the ECS component template `GET
_component_template/.alerts-ecs-mappings`
2. Get the technical component template `GET
_component_template/.alerts-technical-mappings`
3. Create a detection rule that creates an alert and then get the index
mapping for the concrete security alert index `GET
.internal.alerts-security.alerts-default-000001/_mapping`

**While running this branch with `xpack.alerting.enableFrameworkAlerts:
false`:**

4. Get the ECS component template `GET
_component_template/.alerts-ecs-mappings`
5. Get the technical component template `GET
_component_template/.alerts-technical-mappings`
6. Create a detection rule that creates an alert and then get the index
mapping for the concrete security alert index `GET
.internal.alerts-security.alerts-default-000001/_mapping`

**While running this branch with `xpack.alerting.enableFrameworkAlerts:
true`:**

7. Get the ECS component template `GET
_component_template/.alerts-ecs-mappings`
8. Get the technical component template `GET
_component_template/.alerts-technical-mappings`
9. Create a detection rule that creates an alert and then get the index
mapping for the concrete security alert index `GET
.internal.alerts-security.alerts-default-000001/_mapping`
10. Verify that component templates exist for
`.alerts-framework-mappings` and `.alerts-legacy-alert-mappings`

**Compare the ECS component templates**
Compare 1 and 4 (ECS component template from `main` and installed by
rule registry in this branch). The difference should be:
* no difference in ECS fields
* because the rule registry ECS component template also includes
technical fields, you will see the 2 new technical fields in this branch

Compare 4 and 7 (ECS component template from rule registry & alerting
framework in this branch).
* some new ECS fields for alerting installed template
* each `keyword` mapped field for alerting installed template should
have `ignore_above` setting
* no `kibana.*` fields in the alerting installed template

**Compare the technical component templates**
Compare 2 and 5 (technical component template from `main` and installed
by rule registry in this branch). The difference should be:
* 2 new `kibana.alert` fields (`flapping_history` and `last_detected`)

Compare 5 and 8 (technical component template from rule registry &
alerting framework in this branch).
* there should be no difference!

**Compare the index mappings**
Compare 3 and 6 (index mapping from `main` and installed by rule
registry in this branch). The difference should be:
* 2 new `kibana.alert` fields (`flapping_history` and `last_detected`)

Compare 6 and 9 (index mapping from rule registry & alerting framework
in this branch).
* some new ECS fields
* each `keyword` mapped ECS field should have `ignore_above` setting

### Verify that the generated component templates work with existing
rule registry index templates & indices:

1. Run `main` or a previous version and create a rule that uses both ECS
component templates & technical component templates (detection rules use
both). Let it run a few times.
2. Using the same ES data, switch to this branch with
`xpack.alerting.enableFrameworkAlerts: false` and verify Kibana starts
with no rule registry errors and the rule continues to run as expected.
3. Using the same ES data, switch to this branch with
`xpack.alerting.enableFrameworkAlerts: true` and verify Kibana starts
with no alerting or rule registry errors and the rule continues to run
as expected. Verify that the mapping on the existing
`.internal.alerts-security.alerts-default-000001` has been updated to
include the latest ECS mappings and the two new technical fields.

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2023-02-27 14:24:44 -05:00
Yulia Čech
848b38721f
[Upgrade Assistant] Deletes telemetry saved object type (#151116)
## Summary
Fixes https://github.com/elastic/kibana/issues/64547 
Follow up to https://github.com/elastic/kibana/pull/150878 and
https://github.com/elastic/kibana/pull/151014

This PR removes the saved object type `upgrade-assistant-telemetry` from
the Upgrade Assistant plugin because it seems to not be used for
telemetry or UA functionality. There is a telemetry object to track UA
deprecation logging in this
[file](https://github.com/elastic/kibana/blob/main/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json#L13628),
I don't think that a saved object is needed for that.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-27 15:03:50 +01:00
Jean-Louis Leysens
5c15399ff4
[Migrations] Add migrator node role (#151978)
## Summary

Adds the `migrator` special role to the node roles config:


```yml
#            👇🏻 new
node.roles: ['migrator']
#             or
node.roles: ['background_tasks', 'ui']
#             or 
node.roles: ['*'] # this one is slightly weird now because it actually excludes 'migrator' so it is not truly "all roles", but "all combinable roles"...
```

## How to test

Start Kibana locally and add `node.roles: ['migrator']` to the
`kibana.dev.yml`. Kibana should start normally and log:

```
[2023-02-23T12:08:54.123+01:00][INFO ][node] Kibana process configured with roles: [migrator]
```

Note: this role currently does not do anything. This PR just adds the
ability to configure it.

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

## Slight improvement to error messages

When specifying known, accepted values but combining with either
`migrator` or `*` you will get a message like:

```
[config validation of [node].roles]: wildcard ("*") cannot be used with other roles or specified more than once
```

---------

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
2023-02-27 06:49:31 -07:00
Pierre Gayvallet
bbbf8d155b
Bootstrap ZDT migration algorithm (#151282)
## Summary

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

Purpose of the PR is to create the skeleton of the ZDT algorithm, in
order to make sure we're all aligned on the way we'll be managing our
codebase between the 2 implementation (and to ease with the review of
the follow-up PRs by not having the bootstrap of the algo to review at
the same time)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-27 13:36:16 +01:00
Boris Kirov
1adf644848
Replacing the alert icon for an error icon in erroneous situations (#151413)
## Summary

This PR is aiming to replace the `alert` icon that we use in error
states, with the `error` icon. It's important to differentiate them
clearly as errors and warning messages are semantically different
states. It's widely considered that errors maybe fatal errors and
warnings are never fatal.

You should receive an error message when the issue is terminal, this
doesn't always mean that the operation stops completely, but the task is
not complete.

You should receive a warning message when the program detects that
something is not behaving right, but it didn't cause any termination.


Before / After

![image](https://user-images.githubusercontent.com/13353203/219329971-50c95178-6fdd-48d6-b4b5-43e648e6fb9a.png)

Example of how it looks in the Profiling UI, when two errors appear:
<img width="1726" alt="image"
src="https://user-images.githubusercontent.com/13353203/219330082-6f638ffb-995b-40eb-88d7-cfc6026e006d.png">

![image](https://user-images.githubusercontent.com/13353203/219333118-1876b085-f7dc-46ed-bbea-e75675c928ad.png)

## Related to
https://github.com/elastic/eui/issues/6554

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-27 11:52:26 +01:00
Gerard Soldevila
754e8682d4
Introduce CLEANUP_UNKNOWN_AND_EXCLUDED step (#149931)
In the context of migrations,
https://github.com/elastic/kibana/pull/147371 avoids reindexing during
an upgrade, provided that `diffMappings === false`.

This _alternative path_ skips some key steps that are performed before
reindexing:
* `CHECK_UNKNOWN_DOCUMENTS`
* `CALCULATE_EXCLUDE_FILTERS`

These steps enrich a search query that is used during reindexing,
effectively filtering out undesired documents.

If the mappings [match](https://github.com/elastic/kibana/pull/147371)
(or they are
[compatible](https://github.com/elastic/kibana/pull/149326)) and we _no
longer reindex_, this cleanup operation does not happen, leaving
undesired documents in our system indices.

The goal of this PR is to add an extra step in the state machine
(`CLEANUP_UNKNOWN_AND_EXCLUDED`), which will actively cleanup a system
index if we're going the _skip reindexing_ path.


![image](https://user-images.githubusercontent.com/25349407/216979691-fef40638-f990-4850-bac8-ee3e58330a7f.png)

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-27 11:43:13 +01:00
Vadim Kibana
da4307e80e
[Files] Per file max upload size (#151993)
## Summary

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

- ~~This PR introduces `maxUploadSize` file kind setting, which allows
to enforce upload size per file, instead of using one value for the
whole file kind~~.
- ~~I left the `maxSizeBytes` as-is for now, because it is actually used
in two places: (1) in the Files client; (2) in HTTP routes. So, I didn't
find an easy way to reuse it~~.
- Allows to configure max upload size per file.
- This required separation of `FileKind` interface between browser and
server. And correspondingly changes to the file kind registry.


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-27 10:19:40 +01:00
Hannah Mudge
bb9bbf4086
[Dashboard] [Canvas] Replace deprecated SolutionToolbar with Shared UX Toolbar (#151381)
Closes https://github.com/elastic/kibana/issues/147263

## Summary

This PR fixes the styling of the Dashboard and Canvas toolbars by
migrating from the Presentation Util `SolutionToolbar` over to the
Shared UX `Toolbar` component:

- **Dashboard:**

![ToolbarBeforeAfter](https://user-images.githubusercontent.com/8698078/220703481-66429e79-fc85-43c2-9197-56f4aee12343.png)
- **Canvas:**

![CanvasToolbarBeforeAfter](https://user-images.githubusercontent.com/8698078/220707385-47ad3c81-ffea-4ecc-8423-84656a99ce21.png)




However, in order to keep the styling the same, this also required
editing the Shared UX `Toolbar` (and its related components) in order to
support non-primary buttons. When initially migrating, **only** primary
buttons were supported for the `Toolbar` component - this resulted in a
Dashboard toolbar that looked like this, which goes against the EUI
guideline of only having a single primary button:

<p align="center">
<img width="500px"
src="https://user-images.githubusercontent.com/8698078/220704118-fc8515b7-dbb6-43ce-99a7-1db2f41c915a.png"/>
</p>

I did this by removing the old `PrimaryButton` component and replacing
it with the more generic `ToolbarButton` - as part of this, I migrated
both the `ToolbarPopover` and the `AddFromLibrary` buttons to use this
new component. I updated the related Storybooks to reflect the
capabilities I added to each component, such as making the
`ToolbarPopover` **conditionally** take the `iconType` prop and, if not
given, it will default to an `arrowDown` icon on the right side of the
button:


![Feb-22-2023
10-30-48](https://user-images.githubusercontent.com/8698078/220708646-b42533db-21e9-49f5-b48e-21d759a2f085.gif)

Since only Dashboard and Canvas used the Presentation Util
`SolutionToolbar`, now that these have been migrated, I removed all the
old deprecated components from Presentation Util as a final clean up.


### 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))
- [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)
- Checked on Chrome, Firefox, and Safari to ensure that all styles were
applied



### 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-02-24 11:03:36 -07:00
Rachel Shen
d2453beee0
[Accessibility] Route changes announcement (#150461)
Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
2023-02-24 09:46:58 -07:00
Patryk Kopyciński
e7e66a8944
[Defend workflows] Add Cypress tests for Endpoint reassignment functi… (#151887) 2023-02-24 16:19:30 +01:00
Jatin Kathuria
1af75fd500
[Security Solution][Bug] Alert Table raises error when switchting to event rendered view (#151994)
## Summary

This PR handles: 

1. #151992 [Security Solution] Alert Table raises error when switching
to event rendered view.
- Issue was related `cellActions` package where changes in columns was
not leading to re-calculation of cell actions on those new columns.
3. Minor table width issue - Sometime table is not expanded to the 100%
of the container width.

## Before


https://user-images.githubusercontent.com/7485038/220914906-dcce7ba1-0318-44fd-a097-df86344f7727.mov

## After ( Resolved Issue 1 & 2)


https://user-images.githubusercontent.com/7485038/220921916-fa4b36ad-b8e1-4a8d-ad0d-a778c911bb5b.mov
2023-02-24 09:11:06 -05:00
Ahmad Bamieh
dc927d98ba
[core][http] add response file method (#151130)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-24 12:06:37 +03:00
Tiago Costa
ac26cec9d1
fix(NA): using repo root scope when validating package manifests (#151765)
This PR improves the detection of when a given plugin comes from inside
a build folder without including any external dependency for a local
package (not supported here due to kbn_pm).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-23 18:45:20 +00:00
Yara Tercero
56777859bf
[Security Solution][Exceptions] - Fix bug displaying empty view when no exception list search results found (#151530)
## Summary

Addresses https://github.com/elastic/kibana/issues/145717

Updated the all exceptions lists view to account for different possible
states (empty search, loading, no lists) using an existing component.
2023-02-23 09:01:32 +01:00
Yara Tercero
28f4f1b457
[Security Solution][Exceptions] - Fix empty combo box entry option for exception item condition (#151398)
## Summary

Addresses https://github.com/elastic/kibana/issues/145540

Filters out the empty default entry item from combo box option.
2023-02-22 19:10:38 -07:00
Dzmitry Lemechko
6c33644b53
[kbn-journeys] add optional beforeSteps hook (#151717)
## Summary

Related to #151613

There might be cases when we need to add extra wait for Kibana plugin to
be ready before starting loading test data with `esArchiver` /
`kbnArchiver`.

Currently journey lifecycle looks like this:

- `onSetup` wrapped with mocha `before` hook
  - in parallel 
    - `setupBrowserAndPage` (including EBT tracker setup)
    - load ES data / Kibana saved objects
  - `setupApm`
- steps execution (each step wrapped with mocha `it` function)
- `onTeardown` wrapped with mocha `after` hook
  - `tearDownBrowserAndPage` (including closing EBT tracker)
  - `teardownApm`
  - load ES data / Kibana saved objects

beforeSteps hook purpose is to make sure Kibana/ES state is ready for
journey execution and not load test data, since it won't be unloaded
during `after` hook:

- `onSetup` wrapped with mocha `before` hook
    - `setupBrowserAndPage` (including EBT tracker setup)
- run beforeSteps hook -> prepare Kibana/ES for data ingestion / steps
execution
    - load ES data / Kibana saved objects
    - `setupApm`

How to use:

```
export const journey = new Journey({
  beforeSteps: async ({ kibanaServer, retry }) => {
    retry.try(async () => {
      const response = await kibanaServer.request({
        path: '/internal/cloud_security_posture/status?check=init',
        method: 'GET',
      });
      return response.status === 200;
    });
  },
  esArchives: [...],
  kbnArchives: [...],
})
  .step({...})
  .step({...})
```
2023-02-22 18:53:00 +01:00
Christiane (Tina) Heiligers
a8f10ed6cb
[Saved Objects] Adds config flag to toggle hiddenFromHttpApis SO types conditionally (#151512)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-22 07:59:50 -07:00
Ersin Erdal
f562b3c289
Add UUID to RuleAction (#148038)
Resolves: [#149587](https://github.com/elastic/kibana/issues/149587)

This PR intends to add a `uuid` field to the rule actions.

A migration script add a uuid to all the existing actions.

Create method of the rule_client (and create endpoint) accepts a
rule.actions data without uuid and adds a new uuid to the all actions.

Update and bulkEdit methods of the rule_client (and update and bulk_edit
endpoints) accepts rule.actions data with and without uuid. As a user
can add a new action to an existing rule, UI should send the uuid of an
existing action back then update and bulkEdit methods would add the
uuid's to all the new actions.

All the get methods return uuid in the actions.

Since we don't query by the uuid of an action, I marked actions as
`dynamic: false` in the mappings so we don't need to add the uuid to the
mappings.

I tried not to modify the legacy APIs, therefore i used some type
castings there, but please let me know if they need to be modified as
well.

## To verify: 

Create a rule with some actions and save. 
Then add some more actions and expect all of them to have an
auto-generated uuid field and still work as they were.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-22 14:37:16 +00:00
Jean-Louis Leysens
acf7d0134e
[HTTP] Versioned API router designs (#151596)
## Summary

This PR contains the initial designs for our versioned router API. This
contribution contains only types, any implementation will come in later
PRs.

Previous PR https://github.com/elastic/kibana/pull/149943

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ahmad Bamieh <ahmadbamieh@gmail.com>
2023-02-22 05:33:43 -07:00
Lola
27f2eee64f
Csp aws text updates (#151237)
## Summary

Updating CSP aws texts in CSPM/KSPM Integration
Updates Security Solution Snapshot for Security Solutions Dashboards.
 -  Security-threat-hunting-team please review text change

`xpack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap`

 Updates Cloud Security text in the guided card component. 
- platform-onboarding please review text change

`packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.constants.tsx`


## Elastic setup guide

**Before**


![Image](https://user-images.githubusercontent.com/53792284/218277681-f02a1ddd-2e95-4195-94b3-fd1e030dcc2d.png)

**After**

<img width="1728" alt="csp-setup-guides-after"
src="https://user-images.githubusercontent.com/17135495/218892507-0b785ba0-bafa-4a37-8afb-b030fb58bfa8.png">


```[tasklist]
- [x] Update text on the elastic setup guide on the home page from "Secure my cloud assets with posture management" to "Secure my cloud assets with cloud security posture management (CSPM)"
```
## Security Dashboards

Before
<img width="1715" alt="image"
src="https://user-images.githubusercontent.com/17135495/219459184-39b3d97d-96a8-446d-a2f1-fa871f8a2d5d.png">

After
<img width="1724" alt="image"
src="https://user-images.githubusercontent.com/17135495/219458775-8ece8c84-c40e-481a-9454-648025f0fdbc.png">
```[tasklist]
- [x] Update text Cloud Security to `Cloud security Posture`
```

## Empty States 

### Main empty state 

**Before**


![Image](https://user-images.githubusercontent.com/53792284/218278787-32ab4c82-9c49-416b-8c83-36aca6345139.png)

**After**

<img width="865" alt="main-empty-state-after"
src="https://user-images.githubusercontent.com/17135495/218892539-1170c435-ffbf-488f-a924-9afd96c80968.png">


```[tasklist]
- [x] Update placeholder text on the main empty state using the copy provided above
- [x] Update the "Learn more" hyperlink so that it navigates users to https://ela.st/cspm instead of https://ela.st/getting-started-with-kspm
```

### No agent installed empty state 
**Before**


![Image](https://user-images.githubusercontent.com/53792284/218279865-89723988-8d63-4eee-ae73-a07bc2c74aca.png)

**After**

<img width="1729" alt="no-agents-empty-state"
src="https://user-images.githubusercontent.com/17135495/218892571-513c9bef-9e30-4a77-bcbc-29c850f20c08.png">


```[tasklist]
- [x] Update placeholder text on the "No Agents Installed" empty state using the copy provided above 
```

## C/KSPM empty state 
Before


![Image](https://user-images.githubusercontent.com/53792284/218280334-261b1251-ae1e-4ecb-9395-f26f10677d74.png)

After 
kspm
<img width="1479" alt="kspm empty state"
src="https://user-images.githubusercontent.com/17135495/219456479-6a30028b-d128-4781-8e8e-8d2038cbfd96.png">

cspm
<img width="1440" alt="cspm_dashboard_empty_state"
src="https://user-images.githubusercontent.com/17135495/219456576-e79d8f7c-6c3e-4ceb-87b7-4405ff526f6f.png">


```[tasklist]
- [x] Update placeholder text for the empty state on the Cloud and Kubernetes tabs
- [x] The hyperlink on the Cloud tab should direct users to https://ela.st/cspm, while the hyperlink on the Kubernetes tab should direct users to https://ela.st/kspm
```


## Posture Score / Compliance Score  
**Before**


![Image](https://user-images.githubusercontent.com/53792284/218280933-b1ccbfee-7216-45e6-990d-06505c6499a5.png)


![Image](https://user-images.githubusercontent.com/53792284/218281131-c99e19e1-7498-4f66-b8df-f23db369daf2.png)

**After**

<img width="1667" alt="Posture_score_column_dashboard"
src="https://user-images.githubusercontent.com/17135495/218892597-1aa1c60e-e22b-493f-9dba-0b73a70c6193.png">
<img width="1909" alt="Posture_score_column_grouped_by_findings"
src="https://user-images.githubusercontent.com/17135495/218892619-41b9e357-81b9-4c21-9c09-929797e3c7b0.png">


```[tasklist]
- [x] Change the `Compliance Score` column name to `Posture Score` on both the Cloud & Kubernetes tabs in the table where we list individual clusters and cloud accounts. 
- [x] Change the `Compliance Score` column name to `Posture Score` on the grouped-by-resource view of the findings page. 
```


## Posture Dashboard 

**Before**


![Image](https://user-images.githubusercontent.com/53792284/218281551-8da3b02c-d753-4898-8ef3-284e5dfffef4.png)


![Image](https://user-images.githubusercontent.com/53792284/218281612-bad25428-9996-4983-b62f-74768d6560f1.png)

**After**

<img width="953" alt="KSPM_Posture_Dasboard_Title_rename"
src="https://user-images.githubusercontent.com/17135495/218892915-fc38ec31-ad7c-467e-9173-7b27e402771f.png">


```[tasklist]
- [x] Update posture dashboard title from `Cloud Posture` to `Cloud Security Posture`
- [x] Update the `Cloud Posture Score` title in the overall score section to `Overall Cloud Posture Score` on the Cloud tab and `Overall Kubernetes Posture Score` on the Kubernetes tab. 
- [x] Update Dashboard tile card title from `Cloud Posture` to `Cloud Security Posture`
- [x] Update  Breadcrumbs text  from `Cloud Posture` to `Cloud Security Posture`
```

## Integration 

**Before**


![Image](https://user-images.githubusercontent.com/53792284/218282678-c4a8dbe2-8bed-4dc6-8d8e-a4fa9ba20c64.png)


![Image](https://user-images.githubusercontent.com/53792284/218282684-c51ef857-333f-4cd9-805e-c60ed5f5cf6d.png)

**After**

CSPM Integration setup  info text updates
<img width="810" alt="cspm-aws-integraion-setup"
src="https://user-images.githubusercontent.com/17135495/218892958-31e3263a-e6c0-40d4-a82f-92e93b932e22.png">

**KSPM Integeration setup info text updates**
<img width="959" alt="kspm-aws-integration-setup"
src="https://user-images.githubusercontent.com/17135495/218893048-6a850355-05ef-486f-8d96-1455adece779.png">

**CSPM removal link**
<img width="1707" alt="image"
src="https://user-images.githubusercontent.com/17135495/218893469-58c65d28-b2fb-48e3-bd87-07a2b02a5665.png">


**KSPM removal link**
<img width="959" alt="kspm-docs-link-removal"
src="https://user-images.githubusercontent.com/17135495/218893196-d0e9ed6a-4be6-4d33-8a68-271e2a11d2e6.png">


```[tasklist]
- [x] Update Setup Access description for both CSPM & KSPM
- [x] Include KSPM, and CSPM specific getting-started links in the description above (https://ela.st/kspm-get-started and https://ela.st/cspm-get-started)
- [x] Remove our hyperlink to AWS docs from the setup access section 
```
=

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-21 14:40:55 -05:00
Nathan Reese
cd910bee1c
[Dashboard] fix searchSessionId not updated when pinned filter changes (#151390)
Fixes https://github.com/elastic/kibana/issues/151219 and
https://github.com/elastic/kibana/issues/151224

PR separates shouldRefresh logic from unsavedChanges logic to account
for difference in filter check.

shouldRefresh filter check:
* includes pinned filters
* excludes disabled filters
* excludes $state so pinning/unpinning a filter does not cause a
refresh.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-21 09:31:06 -07:00
renovate[bot]
587679ecef
Update dependency core-js to ^3.28.0 (main) (#151658)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [core-js](https://togithub.com/zloirock/core-js) | [`^3.27.2` ->
`^3.28.0`](https://renovatebot.com/diffs/npm/core-js/3.27.2/3.28.0) |
[![age](https://badges.renovateapi.com/packages/npm/core-js/3.28.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/core-js/3.28.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/core-js/3.28.0/compatibility-slim/3.27.2)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/core-js/3.28.0/confidence-slim/3.27.2)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>zloirock/core-js</summary>

###
[`v3.28.0`](https://togithub.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#&#8203;3280---20230214-httpsgithubcomzloirockcore-jsreleasestagv3280)

[Compare
Source](https://togithub.com/zloirock/core-js/compare/v3.27.2...v3.28.0)

##### [3.28.0 -
2023.02.14](https://togithub.com/zloirock/core-js/releases/tag/v3.28.0)

</details>

---

### Configuration

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

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

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

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

---

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

---

This PR has been generated by [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:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDYuMSIsInVwZGF0ZWRJblZlciI6IjM0LjE0Ni4xIn0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Budzenski <jon@elastic.co>
2023-02-21 10:22:11 -06:00
Khristinin Nikita
d93eaa0109
Fix validation for entry fields in exception form (#151654)
## Change validation logic for entry exception field.

Close:
[https://github.com/elastic/kibana/issues/143051](https://github.com/elastic/kibana/issues/143051)

Previously we didn't keep a validation state per field which caused a
reset of validation if we still had invalid fields. Or we can have an
invalid state for the form, but we removed the invalid field. You can
see the videos on the ticket above.

## Solution:
Keep validation state per field, like:
```js 
{
   [entry.id]: true,
}
```
This state can keep old fields, which already were removed, this is why
we use the selector to get the actual amount of errors.



https://user-images.githubusercontent.com/7609147/220337447-95c1558c-aa85-43d1-87e8-76370aeaf141.mov

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-21 16:59:54 +01:00
Luke G
d92d691946
Generate kbn/ecs with ECS 8.6.1 (#151642)
## Summary

This PR updates kbn/ecs to defintions generated with ECS 8.6.1

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-21 15:02:38 +01:00
Alejandro Fernández Gómez
f1fa5d764f
[Synthetics UI] Correct link in the integration deprecation callout (#150879)
Closes #150872
2023-02-21 14:47:46 +01:00
Kevin Delemme
aff771c287
feat(slo): introduce slo feature (#150554) 2023-02-16 10:52:57 -07:00
Thomas Watson
fbdeffb48f
Fix eslint rule for restricting certain lodash imports (#151023)
Fixes #110422

TL;DR: The `lodash.set` function is unsafe and shouldn't be called.

Cause of error: If you specify multiple `no-restricted-imports` paths
for the same module, only the last path is used. Instead you need to
combine them into a single path as I've done in this PR.

This regression was introduced in #100277
2023-02-16 08:35:09 -07:00
Jean-Louis Leysens
f1b0dd4720
[Files] Add meta prop to <FilePicker /> (#151417)
## Summary

Added the `meta` prop to the `FilePicker` component, also pass this down
to the `FileUpload` component so that files created via the picker can
have meta set.

Close https://github.com/elastic/kibana/issues/151375

## How to test

1. Start Kibana with examples `yarn start --run-examples`
2. Go to the "Developer examples" in the side-nav menu under analytics
3. Go to "Files example"
4. Upload a file via the "Select file" button, should present an empty
file picker if you have no files, otherwise use the little upload
component bottom left
5. Either select files or dismiss the modal
6. Inspect the uploaded file and see the `myCool: 'meta'` entry included
with other metadata

## Screenshot

A file uploaded via the `FilePicker` in the "Files example" plugin.

<img width="897" alt="Screenshot 2023-02-16 at 11 41 06"
src="https://user-images.githubusercontent.com/8155004/219342872-c39b5d81-7421-4187-bb1c-d6815d80a3dc.png">


### 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-16 04:58:48 -07:00
Dzmitry Lemechko
b46d25a7ca
[ftr/journeys] allow override ftr base config in journey (#151277)
## Summary

Currently journeys use pre-defined base FTR config and there is no way
to re-configure Kibana to be loaded with extras, e.g. Fleet plugin
configuration.

f443109eea/packages/kbn-journeys/journey/journey_ftr_config.ts (L32-L34)

Probably the easiest way to address it is to path custom FTR config
directly in the journey.

```
export const journey = new Journey({
  ftrConfigPath: 'x-pack/test/cloud_security_posture_api/config.ts',
  ...
})
```


It can be also considered as a step towards using journeys as future
alternative to Webdriver functional tests.
2023-02-16 08:52:05 +01:00
Maja Grubic
a7293f62b5
[Custom Branding] Add custom branding settings to Global settings (#150080)
## Summary

This PR registers custom branding settings from the `custom_branding`
plugin. Once registered, these settings can be viewed under "Global
settings".

UI changes:
<img width="1761" alt="Screenshot 2023-02-06 at 19 59 19"
src="https://user-images.githubusercontent.com/1937956/217060900-7e56c8e9-7d3d-4ac5-96b6-8a8a85d3c1c3.png">

I also removed the client-side version of the `custom_branding` plugin,
as it's not needed.

With this change, it became easier to test custom branding, so I made a
few changes where logo was not showing properly or image size was wrong
or test subjects were missing.

I am working with @gchaps on the exact wording, so that might change. 

### 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]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] 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))
~- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [X] This 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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
2023-02-16 08:13:42 +01:00
Cee Chen
af25a3e073
Upgrade EUI to v75.1.0 (#151200)
## Summary

`eui@75.0.0`  `eui@75.1.0`

---

## [`75.1.0`](https://github.com/elastic/eui/tree/v75.1.0)

- Added padding to `EuiStep` title to better align with icon
([#6555](https://github.com/elastic/eui/pull/6555))
- Added a new `lineNumbers.annotations` API to `EuiCodeBlock`. This new
feature displays an informational icon next to the specified line
number(s), providing more context via popover
([#6580](https://github.com/elastic/eui/pull/6580))

**Bug fixes**

- Fixed bug in `EuiRange` where styles were applied incorrectly when
custom ticks were passed but `showTicks` were false
([#6588](https://github.com/elastic/eui/pull/6588))
- Fixed `fleetApp` and `agentApp` icons that were swapped
([#6590](https://github.com/elastic/eui/pull/6590))

**CSS-in-JS conversions**

- Converted `EuiSteps` to Emotion; Removed `$euiStepStatusColorsToFade`,
`$euiStepNumberSize`, `$euiStepNumberSmallSize`, and
`$euiStepNumberMargin`
([#6555](https://github.com/elastic/eui/pull/6555))
2023-02-15 11:17:29 -08:00