Commit graph

2304 commits

Author SHA1 Message Date
Michael Olorunnisola
1fb971b355
[Security Solution][Investigations] - Change context menu text and add test (#117673) 2021-11-05 13:28:28 -04:00
Pablo Machado
6c2f9a4dfc
Add CreateFieldButton component to browser fields (#117627)
Add user permission check to CreateFieldButton

Refetch data after creating field

Add global styles to make Overlay z-index higher than timeline z-index

Fix create runtime field loading state

Update alert table columns after adding a new runtime field

Updated documentation of 'overlays.openFlyout' public API

Add cypress test

Add CreateField button unit test
2021-11-05 18:25:17 +01:00
Gloria Hornero
4844ea8305
improves URL fix (#117641)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-05 17:55:29 +01:00
Ashokaditya
f40df9d201
[Security Solution][Endpoint] Use fleet const instead of hardcoded paths (#117146)
fixes elastic/security-team/issues/1958

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-05 16:31:44 +01:00
Christos Nasikas
28142609cc
[Cases] Fix cases navigation after attaching an alert to a case. (#117633) 2021-11-05 15:03:55 +00:00
Christos Nasikas
5ce12b2a84
[Connectors][ServiceNow] Remove SN flags (#117511) 2021-11-05 12:44:45 +02:00
David Sánchez
a2296c5e2a
Fix warning when setting description to undefined (#117338)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-05 09:33:56 +01:00
Jonathan Budzenski
2603f9d0b3 fix types 2021-11-04 16:53:59 -05:00
Steph Milovic
fb6fe9bd72
[Security Solution] [Sourcerer] [Feature Branch] Update to use Kibana Data Views (#114806) 2021-11-04 14:51:32 -06:00
Steph Milovic
5eeb5b8dbe
[Security Solution] Fix ip.replace error on Network/HTTP Tab (#116288) 2021-11-04 07:30:50 -06:00
Ashokaditya
d422da5919
[Security Solution][Endpoint] Use a feature flag to use the new pending actions logic (#117219)
* use a feature flag to use the new pending actions logic

refs elastic/kibana/issues/116715

* switch off pending actions for endpoints when feature flag is disabled

review suggestions

* update/add tests to use FF

* correctly override the FF

`parseExperimentalConfigValue` method sets feature flag key values to `true` if passed as arg

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-04 12:08:46 +00:00
Michael Olorunnisola
dc5ac17d8c
[Security Solution][Investigations] - Update timeline host and ip fields to be clickable (#117403) 2021-11-04 06:45:17 -04:00
Yara Tercero
2f88776eac
[Security Solution][Platform] - Update rule exported counts to include total object count (#116338)
### Summary

Addresses #116330.
2021-11-04 03:00:13 +00:00
Spencer
4385ac4d83
[eslint] enable type-specific lint rules (#114184)
* [eslint] enable type-specific lint rules

* autofix violations

* duplicate eslint-disable to new export statement

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-03 16:56:17 -06:00
Esteban Beltran
c6db4986ed
[Security Solution] Improves host isolation exceptions test reliability (#117327) 2021-11-03 21:44:11 +00:00
Ashokaditya
038e77680d
Show correct completed response message on activity log (#117407) 2021-11-03 21:01:10 +00:00
Madison Caldwell
bd97d1f001
[Security Solution][RAC][Cases] Fix RAC "add to case" functionality from alerts table (#116768)
* Fix add to case functionality

* Use appropriate owner when attaching an alert to a case

* Use field name constants

* Gotta reskip the test

* Better error handling

* Fix type errors

* Fix tests
2021-11-03 20:33:41 +00:00
Gloria Hornero
0681348c3a
[Security Solution] Fixes skipped test (#115757)
* waits for the page to be loaded before continuing with the actions

* changes the order of the wait

* unskip data provider test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-03 07:44:21 -04:00
Yara Tercero
b52a9aba1f
Exceptions export duplicates (#116698)
## Summary

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

Removes duplicate exception lists on rule export when multiple rules reference the same list.
2021-11-02 11:55:32 -06:00
David Sánchez
03cebac547
[Security solution] [Endpoint] Fixes for operator "match_any" in event filters card (#117136)
* Fix translations and allow negative operators
* UI fixes
* Remove useCallbacks and update test
2021-11-02 17:53:31 +00:00
Madison Caldwell
089505956d
Implement suggestions from PR #116491 (#117014) 2021-11-02 10:54:07 -04:00
Or Ouziel
f2b9acf67b
replace any with unknown in http client and types (#114265) 2021-11-02 13:53:56 +02:00
Pete Hampton
56d3efdcab
[Telemetry] Migrate off unix epoch to UTC ISO Timestamp. (#116744)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-02 09:24:46 +00:00
Pablo Machado
74bee4bc17
Add column-gap to HeaderSectionComponent (#115952)
* Add column-gap to HeaderSectionComponent

* Please code review by using gutterSize instead of flex column-gap

* Add eui-textBreakNormal to header_section title

It makes sure that words in the title don't break into a new line

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-02 09:59:37 +01:00
David Sánchez
cc366dd888
[Security Solution][Endpoint] Fix error when searching with special characters in policies filter (#116444)
* Fix error when searchin with special characters in policies filter

* remove unused brackets

* Refactor test uses userEvent instead of fireEvent to supress act() usage

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-02 09:48:29 +01:00
Paul Tavares
08d0131c64
[Security Solution][Endpoint] Add tooltip to Name and Description on the ArtifactEntryCollapsableCard when collapsed (#116839)
* Add `withTooltip` prop to `TextValueDisplay` and use it in CardCompressedHeader
* Add UT
2021-11-01 13:11:57 -04:00
Candace Park
d905cacc1d
[Security Solution][Endpoint][Cases] Add cases path to sourcerer init so browser fields load (#116464)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-01 11:32:39 -04:00
Paul Tavares
fa79ebeabd
[Security Solution][Endpoint] Fix display of long description text values (with no spaces) on Artifact Entry Cards (#116780)
* New DescriptionField component for artifact cards
* Use new DescriptionField in ArtifactCardEntry
* Added `eui-textBreakWord` class name to TextValueDisplay component in artifact cards
* Use `DescriptionField` in `CardCompressedHeader`
* Fix i18n of Description label on minified card
* Use DescriptionField in ArtifactEntryMinified
2021-11-01 11:01:54 -04:00
Or Ouziel
9e4bab31b5
replace ts_ignore with ts_expect_error (#113768) 2021-11-01 16:41:10 +02:00
Georgii Gorbachev
2431a08d2b
[Security Solution][Detections] Reading last 5 failures from Event Log v1 - raw implementation (#115574)
**Ticket:** https://github.com/elastic/kibana/issues/106469, https://github.com/elastic/kibana/issues/101013

## Summary

TL;DR: New internal endpoint for reading data from Event Log (raw version), legacy status SO under the hood.

With this PR we now read the Failure History (last 5 failures) on the Rule Details page from Event Log. We continue getting the Current Status from the legacy `siem-detection-engine-rule-status` saved objects. Rule Management page also gets data from the legacy saved objects.

- [x] Deprecate existing methods for reading data in `IRuleExecutionLogClient`: `.find()` and `.findBulk()`
- [x] Introduce new methods for reading data in IRuleExecutionLogClient:
  - for reading last N execution events for 1 rule from event log
  - for reading current status and metrics for 1 rule from legacy status SOs
  - for reading current statuses and metrics for N rules from legacy status SOs
- [x] New methods should return data in the legacy status SO format.
- [x] Update all the existing endpoints that depend on `IRuleExecutionLogClient` to use the new methods.
- [x] Implement a new internal endpoint for fetching current status of the rule execution and execution events from Event Log for a given rule.
- [x] The API of the new endpoint should be the same as `rules/_find_statuses` to minimise changes in the app.
- [x] Use the new endpoint on the Rule Details page.

## Near-term plan for technical implementation of the Rule Execution Log (https://github.com/elastic/kibana/issues/101013)

**Stage 1. Reading last 5 failures from Event Log v1 - raw implementation** - ✔️ done in this PR

TL;DR: New internal endpoint for reading data from Event Log (raw version), legacy status SO under the hood.

- Deprecate existing methods for reading data in `IRuleExecutionLogClient`: `.find()` and `.findBulk()`
- Introduce new methods for reading data in IRuleExecutionLogClient:
  - for reading last N execution events for 1 rule from event log
  - for reading current status and metrics for 1 rule from legacy status SOs
  - for reading current statuses and metrics for N rules from legacy status SOs
- New methods should return data in the legacy status SO format.
- Update all the existing endpoints that depend on `IRuleExecutionLogClient` to use the new methods.
- Implement a new internal endpoint for fetching current status of the rule execution and execution events from Event Log for a given rule.
- The API of the new endpoint should be the same as `rules/_find_statuses` to minimise changes in the app.
- Use the new endpoint on the Rule Details page.

**Stage 2: Reading last 5 failures from Event Log v2 - clean implementation**

TL;DR: Clean HTTP API, legacy Rule Status SO under the hood.

🚨🚨🚨 Possible breaking changes in Detections API 🚨🚨🚨

- Design a new data model for the Current Rule Execution Info (the TO-BE new SO type and later the TO-BE data in the rule object itself).
- Design a new data model for the Rule Execution Event (read model to be used on the Rule Details page)
- Think over changes in `IRuleExecutionLogClient` to support the new data model.
- Think over changes in all the endpoints that return any data related to rule monitoring (statuses, metrics, etc). Make sure to check our docs to identify what's documented there regarding rule monitoring.
- Update `IRuleExecutionLogClient` to return data in the new format. 
- Update all the endpoints (including the raw new one) to return data in the new format.
- Update Rule Details page to consume data in the new format.
- Update Rule Management page to consume data in the new format.

**Stage 3: Reading last 5 failures from Event Log v3 - new SO**

TL;DR: Clean HTTP API, new Rule Execution Info SO under the hood.

- Implement a new SO type for storing the current rule execution info. Relation type: 1 rule - 1 current execution info.
- Swap the legacy SO with the new SO in the implementation of `IRuleExecutionLogClient`.

**Stage 4: Cleanup and misc**

- Revisit the problem of deterministic ordering ([comment](https://github.com/elastic/kibana/pull/115574#discussion_r735803087))
- Remove rule execution log's glue code: adapters, feature switch.
- Remove the legacy rule status SO.
- Mark the legacy rule status SO as deleted in Kibana Core.
- Encapsulate the current space id in the instance of IRuleExecutionLogClient. Remove it from parameters of its methods.
- Introduce a Rule Execution Logger scoped to a rule instance. For use in rule executors.
- Add test coverage.

### 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
2021-11-01 14:40:14 +01:00
Esteban Beltran
602e15d8dd
[Security Solution] Show searchbar when a search doesn't return results in Host isolation exceptions. (#116767) 2021-11-01 12:49:52 +00:00
Ashokaditya
8fd02151e9
[Security Solution][Endpoint] Add tests for pending status API changes (#115998)
* add tests for pending status api changes

related to elastic/kibana/pull/115441

refs elastic/security-team/issues/1705

* update mock

refs elastic/kibana/pull/116214

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-01 11:56:07 +01:00
Frank Hassanabad
eaedb7863d
Follow up (#116860)
## Summary

One line follow up from #116490 from @dhurley14 here: https://github.com/elastic/kibana/pull/116490#discussion_r739314768


### 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-10-29 23:39:36 -06:00
Devin W. Hurley
6817a02e0d
[Security Solution] [Platform] Fix critical bug when migrating action within update route (#116512)
* WIP - need to figure out how to delete old siem-detection action SO's after each test

* WIP - adds some fixes for the update rules utility that differ from patch rules utility

* fix type checks

* cleanup

* remove commented out code

* rename const to use capital snake case

* naming integration tests, adds expect for disabled rules that get migrated, adds expect for pre-migrated rules
2021-10-29 22:05:55 -04:00
Frank Hassanabad
57899a2f68
Removes isUuid and tests as they're not used anymore (#116848)
## Summary

Removes isUuid and tests as they're not used anymore

### 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
2021-10-29 19:33:59 -06:00
Esteban Beltran
107661129d
[Security Solution] Use useEndpointPrivileges instead of checking the license directly (#116142)
* Use useEndpointPrivileges instead of checking the license directly

* Use the correct privilege key

* rename variable

* Skips flaky test

* Remove skip

* Remove extra dependency

* Add back entries check

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-30 00:01:48 +01:00
Esteban Beltran
5afa164ab9
[Security Solution] Fix edit not working due to state management overwrite in Host isolation exceptions (#116676)
* Fix edit not working due to state management overwrite

* clear the form after a succesfull update

* Preserve order after editing and adding
2021-10-29 23:01:14 +02:00
Ece Özalp
f65485f997
[SecuritySolution][CTI] Fix preview matrix histogram query (#116328)
* [SecuritySolution][CTI] Fix preview matrix histogram query

* fixes mock

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-29 16:21:14 -04:00
Chris Donaher
478d138c32
Send Endpoint Alert _id field up as insights docs track that on status changes (#116687)
* Send Endpoint Alert _id field up as insights docs track that on status changes

* Added test to make sure top-level underscore-prefixed fields are allowed

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-29 13:47:31 -06:00
Marshall Main
b59b132ff4
Remove validation requiring action id to be UUID (#116524)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-29 15:26:06 -04:00
Paul Tavares
d284d65ad4
[Security Solution][Endpoint] Fix and un-skip Jest UT for Policy Details remove trusted app modal (#116492)
* increase update API response delay
2021-10-29 14:46:30 -04:00
Paul Tavares
ea1c3f2a09
Fix skipped test to be more robust in matching relative dates (#116474)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-29 14:40:35 -04:00
Frank Hassanabad
29ac5583b7
[Security Solutions] Critical bug fix to make error messages about missing connections clearer for the end user. (#116490)
## Summary

Fixes issue see on this comment:
https://github.com/elastic/kibana/issues/116336#issuecomment-952159636

* Removes legacy toaster component
* Adds newer toaster component
* Removes issue with the deps array within ReactJS
* Adds utility to give a better network error message to the end user.
* This does effect the timeline component since it shares the same import common component.
* Adds a count of how many rules/timeline items have failed imports
* These error toasters mimic Kibana core's error toaster error message and UI/UX
* Adds e2e tests for imports with actions and error messages for them.

## Rules import error messages now

Before for small toaster:
<img width="417" alt="Screen Shot 2021-10-26 at 6 03 25 PM" src="https://user-images.githubusercontent.com/1151048/139132586-3cf77c73-53ac-4066-b01f-2e91ef2da111.png">

After for small toaster for different error conditions:
<img width="358" alt="Screen Shot 2021-10-26 at 6 00 24 PM" src="https://user-images.githubusercontent.com/1151048/139132679-2eeb1ed3-9f6e-4766-a8ed-8804ce3e6963.png">

<img width="396" alt="Screen Shot 2021-10-26 at 6 01 00 PM" src="https://user-images.githubusercontent.com/1151048/139132742-750cd937-f401-44e8-9a10-c21410073b5d.png">

<img width="379" alt="Screen Shot 2021-10-26 at 6 02 29 PM" src="https://user-images.githubusercontent.com/1151048/139132766-21b58bea-7f46-43a6-a0e9-f01632958eab.png">

Before for when you click "See the full error":
<img width="817" alt="Screen Shot 2021-10-26 at 5 58 47 PM" src="https://user-images.githubusercontent.com/1151048/139132980-de1942d6-7b03-4c08-b34a-1fc4a22d5207.png">

After for when you click "See the full error":
<img width="838" alt="Screen Shot 2021-10-27 at 1 48 16 PM" src="https://user-images.githubusercontent.com/1151048/139136581-af1e331e-ed77-4338-8fb0-c2457acd135f.png">

<img width="802" alt="Screen Shot 2021-10-27 at 1 26 31 PM" src="https://user-images.githubusercontent.com/1151048/139135083-9ca56940-30a8-4f83-9355-312307172834.png">

## timeline

Before:
<img width="441" alt="Screen Shot 2021-10-27 at 1 19 00 PM" src="https://user-images.githubusercontent.com/1151048/139136614-8360d6a6-d182-413e-b5d9-b18e3d70dc24.png">

<img width="827" alt="Screen Shot 2021-10-27 at 1 19 08 PM" src="https://user-images.githubusercontent.com/1151048/139136637-f9203ac2-0eea-4a77-9c53-ac2c20ab32e0.png">

After:
<img width="408" alt="Screen Shot 2021-10-27 at 1 49 45 PM" src="https://user-images.githubusercontent.com/1151048/139136758-7532a8ba-6d73-45e2-adbb-6756ee997289.png">

<img width="820" alt="Screen Shot 2021-10-27 at 1 49 50 PM" src="https://user-images.githubusercontent.com/1151048/139136774-26d4a8a2-caf0-4c6f-94d3-a6cd92b79f5f.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
2021-10-29 11:44:38 -06:00
Frank Hassanabad
83fe1dd90a
Changes log level from info to debug from user complaints about logs filling up (#116518)
## Summary

Changes detections log level from info to debug within the detection engine. Users have been complaining about their log files filling up in excessive size from when they have noisy rules or if they have a large amount of rules enabled.
2021-10-29 11:40:08 -06:00
Madison Caldwell
6ba984eb03
Add support for actions on kibana.* fields and legacy signal.* fields (#116491)
* Add support for actions on kibana.* fields and legacy signal.* fields

* Improve types and add scheduleNotificationActions test

* Unnecessary cast

* Was accidentally returning all alerts in map, instead of single alert

* Cleanup

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-29 11:29:38 -06:00
Vitalii Dmyterko
b481bff349
[Security Solution][Detections] Fix truncated values in columns for rules table (#115825)
* Fix truncated rule name on rules table

* remove empty line

* remove truncateText for all rules table columns

* rename unit tests

* refactor unit tests

* fix ts error

* fix ts error

* remove config line

* fix types after kbn bootstrap

* CR: remove unnecesary tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-29 18:28:11 +01:00
Marshall Main
a68f3ffd06
[Security Solution] Only apply field aliases to legacy .siem-signals indices (#115290)
* Only apply field aliases to legacy .siem-signals indices

* Fix unit test mocks

* Add new function for special index existence check

* Actually add new function for special index existence check

* Undo getIndexVersion change

* Add basic integration tests for field alias logic

* Add back create_index to test list

* Add missing markdown to readme

* Revert change to delete_index_route

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-29 13:19:54 -04:00
Tyler Smalley
c4815d319e
Updates Github link references from master to main (#116789)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-29 09:53:08 -07:00
Esteban Beltran
ddf092f38c
[Security Solution] Host isolation exceptions - fixes for QA issues (#116089)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-28 15:54:17 +00:00
Gloria Hornero
b102846c82
adds import Timeline test (#114703) 2021-10-28 15:34:19 +01:00