Commit graph

292 commits

Author SHA1 Message Date
Xavier Mouligneau
8f277d4677
[RAM] Fix bulk action for o11y for 7.17 (#126686)
* fix bulk action for o11y

* review I

* discuss it more with Devin

* clean up
2022-03-03 15:31:53 -05:00
Bree Hall
6bf8a9c709
Upgrade EUI to v48.1.1 (#125023)
* Upgraded the version of EUI to 47.0.0 and react-beautiful-dnd (an EUI dependancy) to 13.1.0

* Update i18n mappings with required changes

* Fix all data grid types/tests missing the new `colIndex` prop passed by renderCellValue and cellActions

* Fix cellActions closePopover type to indicate conditionality (only passed when popover is open)

* Fix more datagrid colIndex errors

- pass more missing `colIndex`s

- pass RowAction colIndex, because it's inheriting types from EUI

- omit colIndex from the leading controls column renderer, because it doesn't need them

* Improve StatefulCell typing

- pass colIndex (which fixes EUI type match issue)
- DRY out ariaColIndex logic
- rename ariaRowindex passed to StatefulCell to rowIndex

* Updated i18n_eui_mapping tests to add euiSelectable.searchResults to the tokensToSkip array

* Fix failing ML datagrid FTR test

- `visibleRowIndex` is not a prop passed back by `popoverContents` (see `EuiDataGridCellValueElementProps`), but `rowIndex` is

* Revert attempted ML type change

- in actuality this is an EUI typing issue, children is a ReactElement, not a ReactNode. However we'll shortly be deprecationg popoverContents, so this isn't worth fixing right now

* Update test files to include up to date snapshots of code samples

* Updated a test snapshots to match the latest version of code samples

* Upgraded the version of EUI from 47.0.0 to 48.0.0 in package.json and license_checker config files

* Update the required i18n translation mapping file with additions and changes from EUI version 48.0.0

* Updated three security screen accessibility tests to check for the aria-checked attribute instead of the aria-selected attribute as part of an accessibility update to aria made in EUI PR 5581

* Updated two unit cases to that are responsible for checking strict equality of strings. These unit tests were for the EuiSelectable and EuiFilterGroup components. Both of these components contain and utilize EuiScreenReaderOnly which provides text that is used for screen readers, but can still be viewed and queried in the DOM. These tests have been updated with the EuiScreenReaderOnly text in mind.

* Code clean up and added a missing internationalization token

* Ran yarn kbn bootstrap to update the yarn lock file

* Fix failing ML FTR test
- EuiSelectable now relies on aria-checked to indicate selected state, per W3 spec

* Fix failing functional tests that click the datagrid cell expand button

.euiDataGridRowCell__expandButtonIcon was deprecated in favor of a shared .euiDataGridRowCell__actionButtonIcon class, but the expand action is always the last one

* Upgrade to 48.1.1

* Switch to data-test-subj for datagrid cell expansion selectors

* Switch to new `data-test-selected` attribute over `aria-checked`

* Update snapshots/Jest tests to account for EuiSelectable use in EuiFilter

Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-23 17:01:40 -05:00
Esteban Beltran
bedad2a0c9
[Cases] Refactor show/hide cases "add to existing case" modal out of timelines (#126071)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: Cristina Amico <criamico@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@elastic.co>
Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
Co-authored-by: Matthew Kime <matt@mattki.me>
Co-authored-by: Ying Mao <ying.mao@elastic.co>
Co-authored-by: Maja Grubic <maja.grubic@elastic.co>
Co-authored-by: Lee Drengenberg <lee.drengenberg@elastic.co>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
2022-02-23 06:41:09 -07:00
mgiota
3195a54406
Alerts in overview page (#125337)
* render alerts in overview page

* pass routeParams

* create useAlertIndexNames hook

* remove unused file

* use alertIndexNames hook in new overview page

* remove unused stuff

* fix failing tests

* remove min-height from FullWidthFlexGroup in standalone t-grid

* Remove old alerts section from overview and use same style as other sections

* remove alertsStateContainer from overview page

* revert changes in new overview page

* Add refetch function to alerts table

* Fix type

* rename file

* remove not needed check

* fix types

Co-authored-by: Ester Marti <ester.martivilaseca@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-23 11:14:02 +01:00
Kevin Qualters
9920e7b880
[Security Solution] Make analyzer full screen work with new eui using existing hooks. (#126117)
* Fix analyzer full screen with new eui data grid

* Add basic tests for full screen hook
2022-02-22 20:09:46 -05:00
Esteban Beltran
1b2f9a43be
[Cases] Refactor attach alert to new case flyout (#125505)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-22 10:58:40 +01:00
Pierre Gayvallet
6627bd8b3a
Elasticsearch client: no longer default to using meta: true (#124488)
* Use `Client` interface instead of `KibanaClient`

* get rid of getKibanaEsClient and convertToKibanaClient

* get rid of last KibanaClient usages

* update usages and types in @kbn/securitysolution-es-utils

* fix some violations

* add sugar method around client mock

* update SO repository calls

* adapt more core usages

* export mock types

* batch 1

* batch 2

* batch 3

* batch 4

* batch 5

* batch 6

* batch 7

* batch 8

* batch 9

* security - batch 1

* security - batch 2

* security - batch 3

* last batch of initial violations

* fix resolve_time_pattern

* update generated doc

* fix /internal/index-pattern-management/preview_scripted_field endpoint

* fix monitoring's getLegacyClusterShim

* fix /api/snapshot_restore/privileges route

* fix UptimeESClient

* fix transforms/_nodes endpoint

* lint

* unit test fix - batch 1

* unit test fix - batch 2

* unit test fix - batch 3

* integration test fix - batch 1

* lint

* adapt ML client

* unit test fix - batch 4

* fix uptime test helper

* fix /api/transform/transforms/{transformId}/_update route

* fix ES client FTR test

* fix uptime unit test

* fix type errors on last unit tests

* fix RollupSearchStrategy call

* fix /internal/security/fields/{query} route

* fix GET /api/index_lifecycle_management/policies route

* fix mlClient.getDataFrameAnalytics

* fix APMEventClient

* fix security solution getBootstrapIndexExists

* fix data_enhanced's getSearchStatus

* remove unused @ts-expect-error

* fix unit tests due to latest code changes

* fix more calls in security_solution routes

* fix more calls in ml routes

* fix POST /api/index_management/component_templates route

* fix unit tests due to latest changes

* fix rule_registry's ResourceInstaller.createOrUpdateIndexTemplate

* fix more fleet client calls

* fix UA's GET cloud_backup_status route

* fix createLifecycleExecutorApiTest

* fix hasFleetServers

* fix unit tests due to latest changes

* changes due to last merge

* fix ml modelProvider.getModelsPipelines

* fix security_solution LifecycleQuery.search

* fix new CoreUsageDataService usage

* fix security solution's StatsQuery.search

* improve ml FTR assertions

* fix security_solution's EventsQuery.search

* fix EsClient type as we're keeping transport

* NITs

* clean RepositoryEsClient type

* update generated doc

* review comments

* adapt mlClient.anomalySearch signature

* remove unnecessary .then((body) => body)

* nit

* add unit tests for the client mocking functions

* fix new upgrade assistant /remote_clusters endpoint
2022-02-12 09:19:44 +01:00
Steph Milovic
4fe96b799e
[Security Solution] Use search strategy error in timeline (#125178) 2022-02-11 11:06:05 -07:00
Pablo Machado
9d810e06c8
Bootstrap user page (#124701)
* Bootstrap user page

* Bootstrap user details page

* Delete ueba

* Create User detail flyout

* Add cypress test to User page

* Add Sourcerer to the users page

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-11 09:06:47 -07:00
Esteban Beltran
05f187aae2
[Cases] Refactor timeline and cases add alert to new case. Move postComment inside cases (#124831) 2022-02-10 10:26:22 +01:00
Chris Cowan
535acb782c
[Observability][RAC] Set display names for columns and fix reason message (#124570)
* [Observability][RAC] Set display names for columns and fix reason message bug

* Adding missing file

* Adding a way to add additional fields to fetch to the timeline query
2022-02-08 10:22:46 -05:00
Kevin Qualters
e312c36e4c
[Security Solution] Remove a data fetching hook from the add to timeline action component (#124331)
* Fetch alert ecs data in actions.tsx and not a hook in every table row

* Add error handling and tests for theshold timelines

* Fix bad merge

* Remove unused imports

* Actually remove unused file

* Remove usage of alertIds and dead code from cases

* Add basic sanity tests that ensure no extra network calls are being made

* Remove unused operator

* Remove unused imports

* Remove unused mock
2022-02-08 06:13:06 -05:00
Tiago Costa
a5b4b822ce
chore(NA): splits types from code on @kbn/test (#124469)
* chore(NA): splits types from code on @kbn/test

* chore(NA): create new @kbn/test-jest-helpers

* chore(NA): move wrong files into @kbn/test

* chore(NA): remove @kbn/test/jest references

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-04 03:27:39 +00:00
Jonathan Buttner
39de549049
[Cases] Removing sub cases (#123006)
* Removing subcases from the backend

* making more progress

* Removing sub cases references

* Fixing tests

* Removing sub case class

* Fixing type errors

* First wave of fixes for integration tests

* Fixing integration tests and some types

* Fixing translations

* Fixing comments and todos

* Removing the collection keyword

* Updating readme and fixing type error

* Removing remainder of readme for case connector

* Fixing integration test type error

* Removing references to "sub case"

* Addressing additional feedback

* Removing styled table and fixing type errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-31 08:45:45 -07:00
Greg Thompson
e84f370ef0
Upgrade EUI to v46.1.0 (#123652)
* eui to 46.1.0

* use optimize build

* dataGridWrapper -> euiDataGridBody

* remove unused dep from bazel

* use column-index and row-index attrs

* datagrid test fixes

* prevent duplicate global styles

* snapshot updates

* rendering_service test

* update comment

* clean up

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-28 08:53:36 -06:00
Sergi Massaneda
7f7dbbb3cc
[SecuritySolution][Timeline] Clean removed runtime fields (#122976)
* remove unexisting fields from timeline

* replicate clean logic in security timeline

* tests updated due to mocks changes

* solve action dipatches race condition

* tests fixed

* fix async dispatches

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-25 15:01:09 -07:00
Tiago Costa
356861d23b
chore(NA): splits types from code on @kbn/ui-shared-deps-src (#123313)
* chore(NA): splits types from code on @kbn/ui-shared-deps-src

* chore(NA): break flot-charts into another package

* chore(NA): skip failing tests

* chore(NA): remove skip and add correct value

* chore(NA): fix new ui-theme import

* chore(NA): adding fleet cloned test

* chore(NA): remove cloned test

* chore(NA): remove added typo
2022-01-20 22:04:19 +00:00
Kristof C
91a35c20ce
Fix success message to show correct language based on timelin… (#123258)
* Fix success message to show correct language based on timeline type

* Fix translation problems

Co-authored-by: Kristof-Pierre Cummings <kristofpierre.cummings@elastic.co>
2022-01-18 15:49:59 -07:00
Marshall Main
886ad6fdaf
[Security Solution] Add aliases, fix types, remove extra fields (#122880)
* Add aliases, fix types, remove extra fields

* Update aliases version and update tests

* Update aliases version test

* Remove dangling references to fields

* Update test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-18 17:31:14 -05:00
Ryland Herrick
8c11be1154
[Timelines] Update fields metadata from beats 8.0 (#123014)
* Move beats metadata script to timelines plugin

This is the plugin that consumes the artifacts of the script, not
security_solution.

* Remove unused beats metadata file

This file also exists in the timelines plugin, but only that one is
used.

* Update fields metadata from beats 8.0.0-rc1

This will serve as the data source for our metadata in kibana 8.0.

* Update indexFields unit tests following ECS update

8.0 introduced some textual changes to field descriptions.

* Revert "Move beats metadata script to timelines plugin"

This reverts commit cbc8e9db1a.

* Update script to modify the appropriate timelines file

This is the one used by IndexFields.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-18 13:46:45 -07:00
Andrew Goldstein
0da9156298
[Security Solution] Fixes alerts table Full screen button overlap (#122901)
## [Security Solution] Fixes alerts table `Full screen` button overlap

This PR fixes an issue reported in <https://github.com/elastic/kibana/issues/122231> where the alerts table's `Full screen` button, recently [moved to the right side of `EuiDataGrid`](https://github.com/elastic/eui/pull/5334) in [EUI 43.0.0](https://elastic.github.io/eui/#/package/changelog), overlapped the existing view selector.

### Details

In the `8.0` release of the Security Solution, the alerts table `Full screen` button appears above the table on the **left**, per the screenshot below:

![8_0_alerts_table](https://user-images.githubusercontent.com/4459398/149236219-9aac04de-4bbb-4cef-8705-f6bb712fb19e.png)

_Above: The alerts table `Full screen` button in `8.0`_

Starting with `8.1` (via [EUI 43.0.0](https://elastic.github.io/eui/#/package/changelog)), `EuiDataGrid`'s `Full screen` button has been [moved to the right side of `EuiDataGrid`](https://github.com/elastic/eui/pull/5334), per the screenshot below:

![data_grid_before_after](https://user-images.githubusercontent.com/4459398/149237831-61aa7a30-695e-48d8-b016-89a0738d4bd9.png)

_Above: `EuiDataGrid`'s full screen icon has moved from left to right_

The new location of the `Full screen` button overlapped the existing alerts table view selector, per the `Before` screenshot below:

#### Before

![overlapped image](https://user-images.githubusercontent.com/60252716/148024399-24106303-baef-46bf-ad03-c4b53d78bbe8.png)

_Above: Overlapping icons reported in <https://github.com/elastic/kibana/issues/122231>_

This PR fixes the overlap, per the `After` screenshots below:

#### After

Chrome `97.0.4692.71`:

![after_chrome](https://user-images.githubusercontent.com/4459398/149239990-1039d659-67a9-4d09-a910-3f8bdfd179e4.png)

Firefox `96.0`:

![after_firefox](https://user-images.githubusercontent.com/4459398/149239483-590108d8-b6db-4c87-a3e7-579fc33e98a5.png)

Safari `15.2`:

![after_safari](https://user-images.githubusercontent.com/4459398/149239764-1751b89c-125b-44b8-b9b2-984b630e3925.png)
2022-01-13 07:55:55 -07:00
Kevin Qualters
6c72063531
[Security Solution] Make rule detail link work for both signal.rule.name and kibana.alert.rule.name (#122437)
* Make rule detail link work for both signal.rule.name and kibana.alert.rule.name

* Remove failing test

* Remove incorrect comment about possible bug

* PR feedback

* More cleanup/feedback

* Memoize hook usage
2022-01-12 21:52:15 -05:00
Jan Monschke
d6526b0165
fix: remove height hack (#122755)
With the upgrade to EUI 44.0.0 we no longer need the height hack for the data grid since the issues that were causing wrong heights have been fixed.
2022-01-12 18:56:18 +01:00
Madison Caldwell
27a9df79e7
[Security Solution] Fixes threshold alert "Investigate in Timeline" functionality (#121256)
* Add flattend parameters object and populate it in Security Solution

* Fix severity, risk_score, bugs, tests

* Add ALERT_RULE_PARAMETERS to package

* Skip tightly coupled test

* fix more tests

* Remove unused import

* Fix threat matching API test

* Continue overriding kibana.alert.rule.risk_score and severity for now

* Add ignore_above to ALERT_RULE_PARAMETERS

* Exploratory

* Not pretty

* more garbage

* debugging

* use expandDottedObject for alerts data in UI

* Remove kibana.alert.rule.risk_score and severity

* Fix tests related to risk_score and severity

* Make translation a template

* Can't use expression in template literal

* Remove commented line added by bad merge

* Fix linting

* Fix unflattening of UI data

* Fix mapping

* Remove console logs

* Fix imports

* Clean up, fix dupes

* Remaining test and type errors

* Remove comment

* Fix skip param

* Add backcompat for threshold timeline

* Fix linting

* Use indexNames for threshold timeline instead of data view

* Add tests for threshold timeline action

* Implement suggestion for simplified alertIds initialization

Co-authored-by: Marshall Main <marshall.main@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-11 10:05:55 -05:00
Mikhail Shustov
38feafad72
Update ES client to canary.37 (#119791)
* upgrade es client to canary 37

* fix error in core

* mute error in test/

* mute incompatible errors

* unskip request_entity_too_large_exception test

* commit autofix

* unskip batch_size_bytes_exceeds_es_content_length test

* fix errors in Core code

* fix or mute errors in data plugin

* fix data_view_management

* fix error index_management

* fix x-pack/test errors

* fix watcher

* fix event_log

* fix data_enhanced

* fix uptime

* fix triggers_actions_ui

* fix transform

* fix reporting

* fix rule_registry

* fix timeline

* fix task_manager

* fix security_solution

* fix rule_registry

* fix fleet

* fix index_management

* fix lens

* fix maps

* fix ml

* fix observability

* bump to canary 8.1-2

* fix error in packages

* fix errors in core

* fix errors in data

* fix errors in discover

* fix some discover tests

* fix errors in telemetry

* fix alerting

* fix errors in apm

* fix errors in event_log

* fix errors in fleet

* fix errors in infra

* fix errors in lists

* mute errors in maps

* fix errors in ml

* fix errors in osquery

* fix errors in security_solution

* fix errors in stack_alerts

* fix errors in task_manager

* fix errors in timelines

* fix errors in transform

* fix errors in watcher

* fix errors in tests

* update docs

* adjust fleet code

* fix problem in fleet

* remove outdated _type from data plugin tests

* fix packages tests

* update type

* fix tests part 2

* Adds product header back to elasticsearch

* Updates API docs

* Fix Discover tests

* update alerting typings

* Fix type errors

* Import Sort type

* Update x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_server.ts

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>

* Remove double negation

* Fix snapshot conflict issues after merge from "main"

Co-authored-by: Christiane Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2021-12-24 14:43:53 +01:00
Xavier Mouligneau
c07a9dc939
[SECURITY SOLUTION] Allow the application to create its own data view without using user privilege (#121109)
* backend update to use unsecure so

* wip on UI

* fix UI to work with one dataview at the time

* by pass capabilities in data view factory

* fix sourcerer in timeline

* fix types

* fix unit test

* fix index field to work with security data view

* cypress + detection roles tests

* add unit test

* review I

* review II

* review III

* clean up after talking to Larry

* fix latets code

* working to be green

* by pass capabilities from data view API only use saved object kibana privilege

* fix lint

* add commnet per review

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
2021-12-21 11:09:30 -07:00
Tiago Costa
aa6fe695af
chore(NA): splits types from code on @kbn/rule-data-utils (#121535)
* chore(NA): splits types from code on @kbn/rule-data-utils

* chore(NA): remove old style imports for this pkg

* chore(NA): eslint fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-20 20:41:46 +00:00
Greg Thompson
604409b3de
Upgrade EUI to v43.1.1 (#120935)
* eui to v43.0.0

* update themeprovider types

* update sass import location

* storyshots

* snapshots

* jest

* jest

* timepicker functional test helpers

* snapshots

* timepicker functional test helpers

* invert checked logic

* fix i18n token

* snapshots

* handle new refresh interval operations order

* refactor refresh interval logic, test

* jest

* timepicker popover order

* eui to v43.1.0

* jest

* jest

* jest

* euicode selector

* jest

* functional tests

* functional tests

* timepicker

* bump timeout

* conditional click to close

* clean up

* eui to v43.1.1

* clean up

* loading background

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-20 10:48:36 -06:00
Marshall Main
e59a8feaa4
[Security Solution] Remove extra rule fields from kibana.alert.rule (#121135)
* Remove kibana.alert.rule.risk_score and severity

* Fix tests related to risk_score and severity

* Make translation a template

* Can't use expression in template literal

* Remove commented line added by bad merge

* Fix linting

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-17 13:23:27 -08:00
mgiota
cdd66ea0eb
[RAC][Observability] Use flattened type for rule params in Observability (#120758)
* add kibana.alert.rule.parameters as a flattened type

* temp

* rule_data_formatter

* fix bug in search strategy with flattend field type where prefix was wrong (kibana.alert.rule.parameters was ignored)

* fix inventory rule data formatters

* remove console log

* hack that prepends kibana.alerts.rule.parameters in the nested subfields

* import ALERT_RULE_PARAMETERS from kbn rule data utils

* remove console log

* format custom metric link

* remove ALERT_PARAMS from technical field names

* fix bug in timelines plugin to use dotField instead of prependField & fix failing tests

* remove console log and unused variable

* delete kibana.alert.rule.params from the mapping

* flatten kibana.alert.rule.parameters and add some unit tests

* fix rule_data_formatter

* handle scenario of having multiple items in an array (multiple conditions setup in the rule)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-16 21:29:06 +01:00
Sergi Massaneda
52a9d60e3b
[Cases] Case details UI KPI metrics (#119463)
* Working lifespan metrics api

* new case metrics container and api call

* Adding remaining metrics handlers and some tests

* Fixing jest snapshot

* Switch to kbn archiver

* tests added, case view page refactor

* test for metrics component added

* fix type

* fix responsivenes on small screens

* type fixes

* use new features prop for case metrics

* test fixed

* fix CasesFeatures type

* integration test fix

* changes and suggestions

* metrics features implementation and connectors type

Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-15 16:49:47 +01:00
Kevin Qualters
5d5cda3ff9
[Security Solution] Add app id prop for navigateToApp (#121139)
* Add app id prop for navigateToApp

* Add missing hook dependency

* Fix types
2021-12-13 18:36:20 -05:00
Michael Olorunnisola
cc9be33dad
[Security Solutio][Investigations] Update Timeline Details API with ECS field (#120683)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-13 11:56:40 -05:00
Pablo Machado
c743c97c2d
Fix wrong runtime field format on alert table (#120744)
* Fix wrong runtime field format on alert table

* Fix CI

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-13 14:31:25 +01:00
Faisal Kanout
7c2e0524a6
[RAC] Show all alerts, not only "open" workflow status, and remove Workflow filter related logic and clean up the code (#120231)
* Remove comments

* Remove workflow code from Alert page and make currentFilter in t grid optional

* Remove workflow props for AlertsTableTGridProps

* Remove unused import

* Remove workflow state from Alert page state container

* Update page state container

* Update tests

* Remove builk actions tests

* Remove bulk actions provider

* Remove does not render case options in the overflow menu test

* Resume permissions for cases test

* Fix does not render case options in the overflow menu test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-09 06:11:47 -07:00
Steph Milovic
268b29009e
[Security Solution] [Sourcerer] Update available on legacy timelines (#120022) 2021-12-07 07:30:29 -07:00
Frank Hassanabad
3c8ba82134
[Security Solutions] Removes tech debt of exporting all from linter rule for timeline plugin (#120437)
## Summary

See: https://github.com/elastic/kibana/issues/110903

This removes all the top level API `export *` spots from:
* `timeline` plugin within both the common and public section

This reduces the number of metrics and warning about undocumented functions.

I also add this text to timeline:

```
// Careful of exporting anything from this file as any file(s) you export here will cause your page bundle size to increase.
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here.

// When you do have to add things here you might want to consider creating a package to share with
// other plugins instead as packages are easier to break down and you do not have to carry the cost of extra plugin weight on
// first download since the other plugins/areas of your code can directly pull from the package in their async imports.
// See: https://docs.elastic.dev/kibana-dev-docs/key-concepts/platform-intro#public-plugin-api
```
2021-12-06 21:19:29 -07:00
Khristinin Nikita
a8405feb52
Add support for threat.feed.name (#120250)
* Add support for threat.feed.name

* fix cy tests

* Remove provider field

* fix tests

* Provider to feed.name

* Fix tests

* Fix tests

* fix comments

* Fix i18n

* fix type

* Fix types

* fix tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-06 20:47:52 -05:00
Tyler Smalley
92a8636f0f
Upgrade Typescript to 4.3.5 (#104470)
Co-authored-by: Mikhail Shustov <restrry@gmail.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
Co-authored-by: Kyle Pollich <kpollich1@gmail.com>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Kevin Qualters <kevin.qualters@elastic.co>
Co-authored-by: Candace Park <candace.park@elastic.co>
Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: spalger <spencer@elastic.co>
2021-12-02 16:27:41 -08:00
Christos Nasikas
319fc9fb7f
[Cases] Move disabling features to the cases context (#119864)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-02 10:11:10 -07:00
Faisal Kanout
d69aa8b200
[8.0][RAC] 19482 t grid fix always show checkboxes (#119608)
* Add showCheckboxes prop

* Hide leading checkboxes from Alerts page and updates the tests.

* Skip tests

* Skip test

* Testing FLAKY tls alert

* Remove exclusive test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-30 14:21:20 +01:00
Tiago Costa
9d662b77be
chore(NA): splits types from code on @kbn/i18n (#119256)
* chore(NA): auto creation of the package.json for the new types pkg rule

* chore(NA): first alpha api extractor working version

* chore(NA): support kbn-analytics

* chore(NA): correctly read tsconfig files and deps from ts_config rule

* chore(NA): layed out pkg_npm_types tree artifact custom rule

* chore(NA): missing todos

* chore(NA): node modules link mapping

* chore(NA): fully working pkg_npm_types rule

* chore(NA): fix changes on new packages using elastic datemath pkgs

* docs(NA): remove todo

* docs(NA): last todo text correction

* chore(NA): removed commented lines

* fix(NA): include missing package version

* chore(NA): include license keys

* chore(NA): change mock types package into private

* chore(NA): disable validator on ts_project rule

* chore(NA): use the wrapper for ts_project

* commit using @elastic.co

* chore(NA): commit using @elastic.co

* chore(NA): split types from code on @kbn/i18n

* chore(NA): update yarn.lock file

* chore(NA): split @kbn/i18n and @kbn/i18n-react

* chore(NA): missing import fix

* chore(NA): fix jest project configs

* chore(NA): change imports on kbn i18n

* chore(NA): change imports on kbn i18n

* chore(NA): correct loader imports

* chore(NA): missnig i18nLoader export key

* chore(NA): fix type exports

* chore(NA): export type only

* chore(NA): export type only

* fix(NA): type exports

* chore(NA): missing @Kbn/i18n/react imports

* chore(NA): missing skip path for kbn-i18n-react

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-24 17:18:03 +00:00
Madison Caldwell
c3484ae132
[Security Solution][RAC][Cypress] Unskip some tests (#117596)
* Reenable cypress tests for rules

* Indicator match is not yet passing

* Update refs

* Fix eql alert generation original_time and building_block_type

* Unskip a few more tests

* Update field names in jest tests

* Fix unit tests / cypress tests

* Have to keep this one skipped for now

* Fix some more tests?

* cleanup

* Fix translation
2021-11-23 13:28:23 -07:00
Zacqary Adam Xeper
c012dd887d
[RAC] Store Alerts View table state in localStorage (#118207)
* [RAC] Store Alerts View table state in localStorage

* Use Redux store subscriber instead of callback

* Fix typecheck

* Fix bad merge

* Add tests

* Remove persisting selected rows

* Fix bad merge

* onTGridStateChange => onStateChange

* Remove non-null assertion

* Put non-null assertion back because typescript hates me, personally

* Fix checks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-22 14:32:48 -05:00
Sergi Massaneda
4eb797a8b2
[Cases] Integrate routes and navigation (#117582)
* getCases function and router

* all pages router

* navigation hooks created

* external navigations removed

* basePath in cases context

* context optimization

* no privileges screen

* new files

* CasesDeepLinkIds constant renamed

* remove props spreading

* AllCasesList tests

* Fix types and tests: Part 1

* Fix types and tests: Part 2

* Move glasses badge logic inside cases

* Fix export types

* Improve helpers

* observability changes integrated

* Small fixes

* Fix timelines unit tests

* Add readonly badge test

* test fixed

* form context test fixed

* fix breadcrumbs test

* fix types in o11y routes

* Fix more tests

* Fix bug

* urlType fixes

* Fix cypress tests

* configure header conflict solved

* Fix i18n

* fix breadcrumbs test

* tests and suggestions

* Add navigation tests

* README updated

* update plugin list docs

* Add more tests

* Fix i18n

* More tests

* Fix README

* Fix types

* fix resolve redirect paths

* fix flyout z-index on timeline

* add flyout z-index class comment

* use kibana currentAppId and application observables instead of passing props

* Get application info from the hook

* Fix tests

* Fix more tests

* tests fixed

* Fix container tests

* Fix container tests

* test updated

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
2021-11-19 11:42:35 -07:00
Andrew Goldstein
5641932726
[Security Solution] Restores the @timestamp column actions and fixes an @timestamp alignment issue (#118990)
## [Security Solution] Restores the `@timestamp` column actions and fixes an `@timestamp` alignment issue

This PR fixes the `@timestamp` column issues described in https://github.com/elastic/kibana/issues/118989

The PR:

- Fixes an issue where the `Filter in`, `Filter out`, and `Investigate in timeline` actions were disabled in the `Security > Alerts` table, per the before / after screenshots below:

**Before**

![alerts-actions-before](https://user-images.githubusercontent.com/4459398/142335094-141fe435-eb9a-4920-a6d3-2c7673f31664.png)

_Above: The `Filter in`, `Filter out`, and `Investigate in timeline` actions were disabled for `@timestamp` in Security > Alerts_

**After**

![alerts-actions-after](https://user-images.githubusercontent.com/4459398/142302794-c2c3684b-92cc-483c-a02b-33f2624ddc79.png)

_Above: The `Filter in`, `Filter out`, and `Investigate in timeline` actions are enabled for `@timestamp` in Security > Alerts_

- Fixes a CSS issue where text truncation styles were causing the `@timestamp` column to be mis-aligned in Timeline, per the before / after screenshots below:

**Before**

![timestamp-alignment-before](https://user-images.githubusercontent.com/4459398/142334676-3a95bb9b-3be9-47c6-8828-efe5f8cbfe2c.png)

_Above: The `@timestamp` column in Timeline was vertically mis-aligned_

**After**

![timestamp-alignment-after](https://user-images.githubusercontent.com/4459398/142334495-c4997aa0-225e-4373-bee2-44b8ec05312b.png)

_Above: The `@timestamp` column in Timeline is correctly (vertically) aligned_

### No changes to the o11y alert actions

There are no changes to the actions shown in the `o11y` alerts table, per the before / after screenshots below:

![o11y-alerts-before](https://user-images.githubusercontent.com/4459398/142335532-5678c55c-b8a1-4122-accb-47e4f71e761f.png)

_Above: Before - the `@timestamp` field in the `o11y` alerts table does NOT have actions_

![o11y-alerts-after-no-change](https://user-images.githubusercontent.com/4459398/142321916-fd7ffbd6-c2db-4820-b055-b9f3fe546cc9.png)

_Above: After - the `@timestamp` field in the `o11y` alerts table (still) does NOT have actions_

### Field browser search input auto-focus

- Fixed an issue where the `Fields` browser search input was not auto-focused, per the screenshot above:

![fields-browser-auto-focused](https://user-images.githubusercontent.com/4459398/142300763-21d0fc50-e1c1-477b-be15-4f367e800af8.png)

_Above: The search input is auto-focused when the `Fields` browser is opened_

### Details

The fix that re-enables the `Filter in`, `Filter out`, and `Investigate in timeline` actions in the `Security > Alerts` required removing a recently-introduced `TODO` in `x-pack/plugins/timelines/public/components/t_grid/body/index.tsx`, which defined a common set of disabled actions for both the `o11y` and `Security` solutions.

The `TODO` was replaced by a `disabledCellActions` prop, which enables each solution to configure the disabled cell actions independently.

### Desk testing

While desk testing the `@timestamp` alignment issue:

> - Fixes a CSS issue where text truncation styles were causing the `@timestamp` column to be mis-aligned in Timeline

You may find it informative to locally edit `x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx` to add the following styles:

```css
background-color: red;
```

and

```css
background-color: green;
```

to `ProviderContentWrapper`, as shown in the code below:

```typescript
export const ProviderContentWrapper = styled.span`
  > span.euiToolTipAnchor {
    background-color: red;
    display: block; /* allow EuiTooltip content to be truncatable */
  }

  > span.euiToolTipAnchor.eui-textTruncate {
    background-color: green;
    display: inline-block; /* do not override display when a tooltip is truncated via eui-textTruncate */
  }
`;
```

as illustrated by the `diff` below:

![background-colors](https://user-images.githubusercontent.com/4459398/142300526-c61f1de7-f695-4b96-99d9-428763405d99.png)

_Above: `background-color: green` and `background-color: red` styles added locally for desk testing_

With the (temporary) style changes above, the effect (and scope) of the new style is easily seen, as shown in the screenshot below:

![compare-styles](https://user-images.githubusercontent.com/4459398/142300502-dbc44572-6066-4cb1-a045-26a15086d02d.png)

_Above: The effect of the (green) style changes compared with the (red) unchanged styles_

When the new style introduced in this PR is commented-out for desk testing, as shown in the code below:

```typescript
export const ProviderContentWrapper = styled.span`
  > span.euiToolTipAnchor {
    background-color: red;
    display: block; /* allow EuiTooltip content to be truncatable */
  }

  /*
  > span.euiToolTipAnchor.eui-textTruncate {
    background-color: green;
    display: inline-block; /* do not override display when a tooltip is truncated via eui-textTruncate */
  }
  */
`;
```

the behavior of `@timestamp` reverts to the behavior prior to this PR, as shown in the screenshot below:

![reverted-fix](https://user-images.githubusercontent.com/4459398/142300380-095c4b58-0417-46c4-98b4-10387c4220b8.png)

_Above: The `@timestamp` column defaults to the old (red) unchanged behavior when the new style is commented-out for desk testing_
2021-11-19 08:32:28 -07:00
Steph Milovic
55de7bb3b2
fix (#119065) 2021-11-18 20:50:10 -07:00
Greg Thompson
cd8c648012
Upgrade EUI to v41.0.0 (#117242)
* eui to v41.0.0

* update eui i18n tokens

* sass tokens

* EuiLoadingKibana

* EuiCodeEditor

* subdued

* betaBadgeProps

* EuiCodeEditor null-loader

* src secondary -> success

* [enterprise_search] Deprecate 'secondary' color prop

* [apm] Deprecate 'secondary' color prop

* [canvas] Deprecate 'secondary' color prop

* [cases] Deprecate 'secondary' color prop

* [cross_cluster_replication] Deprecate 'secondary' color prop

* [data_enhanced] Deprecate 'secondary' color prop

* [data_visualizer] Deprecate 'secondary' color prop

* [fleet] Deprecate 'secondary' color prop

* [index_management] Deprecate 'secondary' color prop

* [infra] Deprecate 'secondary' color prop

* [ingest_pipelines] Deprecate 'secondary' color prop

* [maps] Deprecate 'secondary' color prop

* [ml] Deprecate 'secondary' color prop

* [monitoring] Deprecate 'secondary' color prop

* [observability] Deprecate 'secondary' color prop

NB: conditional became `type === 'success' ? 'success' : type` after find&replace, which felt fairly redundant, so I simplified it

* [osquery] Deprecate 'secondary' color prop

* [painless_lab] Deprecate 'secondary' color prop

* [remote_clusters] Deprecate 'secondary' color prop

* [rollup] Deprecate 'secondary' color prop

* [security] Deprecate 'secondary' color prop

* [security_solution] Deprecate 'secondary' color prop

NB: several conditional became `type === 'success' ? 'success' : type` after find&replace, which felt fairly redundant, so I simplified them

* [snapshot_restore] Deprecate 'secondary' color prop

* [spaces] Deprecate 'secondary' color prop

* [transform] Deprecate 'secondary' color prop

* [triggers_actions_ui] Deprecate 'secondary' color prop

* [uptime] Deprecate 'secondary' color prop

* [watcher] Deprecate 'secondary' color prop

* [infra] replace ambiguous 'secondary' color

- GaugesSectionVis doesn't appear to use the color property but it's required by the SeriesOverrides types, so changing it just in case

* [examples] Deprecate 'secondary' color prop

* [uptime] deprecate 'subdued' prop on EuiButtonIcon

* revert EuiKeyPadMenuItem betaBadge props

* mobileOptions

* examples/ updates

* fix brace import

* fix type exports

* update expressions_explorer requiredBundles

* remove make_id mocks

* snapshot updates

* fix import 🤦

* Fix `ReferenceError: ace is not defined` Jest failures

* Remove unused brace import (?)

- Assuming here, as no code editor is actually being used in this file

* Fix failing Jest test due to EuiCodeEditor moving to es_ui_shared plugin

+ minor cleanup of `jest.mock()`s

* Fix failing Jest test due to snapshot update

* Fix failing `TypeError: Cannot read properties of undefined (reading 'euiBorderRadius')` Jest test

- since this is being mount()'d, EuiThemeProvider as a wrapper is needed to prevent the failure

* access uiSettings

* Move react-ace dependency into kbn-ui-shared-deps-npm

* Revert App Search shenanigans

- caused local unsaved changes shenanigans, somehow

* secondary -> success

Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
2021-11-18 12:29:51 -06:00
Frank Hassanabad
f202c5ae03
Removes plugins/data/public deprecations from timelines plugin (#118975)
## Summary

This removes all the areas marked as deprecated from `.../src/plugins/data/public` with their `@kbn/es-query` equivalent or it uses the directly exported version from `.../src/plugins/data/public`. Anywhere else this adds the `import type {` where it can to encourage the build system to do more type erasures.

### 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
2021-11-17 19:08:31 -07:00
Spencer
0f68fcf5af
[kbn/rule-data-utils] add submodules and require public use them (#117963)
* [kbn/rule-data-utils] add submodules and require public use them

* fix lint errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-15 15:23:52 -07:00