Commit graph

34995 commits

Author SHA1 Message Date
Gidi Meir Morris 4abe864f10
Adds Role Based Access-Control to the Alerting & Action plugins based on Kibana Feature Controls (#67157)
This PR adds _Role Based Access-Control_ to the Alerting framework & Actions feature using  Kibana Feature Controls, addressing most of the Meta issue: https://github.com/elastic/kibana/issues/43994

This also closes https://github.com/elastic/kibana/issues/62438

This PR includes the following:

1. Adds `alerting` specific Security Actions (not to be confused with Alerting Actions) to the `security` plugin which allows us to assign alerting specific privileges to users of other plugins using the `features` plugin.
2. Removes the security wrapper from the savedObjectsClient in AlertsClient and instead plugs in the new AlertsAuthorization which performs the privilege checks on each api call made to the AlertsClient.
3. Adds privileges in each plugin that is already using the Alerting Framework which mirror (as closely as possible) the existing api-level tag-based privileges and plugs them into the AlertsClient.
4. Adds feature granted privileges arounds Actions (by relying on Saved Object privileges under the hood) and plugs them into the ActionsClient
5. Removes the legacy api-level tag-based privilege system from both the Alerts and Action HTTP APIs
2020-07-22 14:45:57 +01:00
Chris Roberson 670520a253
[Monitoring] Revert direct shipping code (#72505)
* Backout these changes

* Fix test
2020-07-22 09:24:14 -04:00
Poff Poffenberger 82dd173b2a
Use server basepath when creating reporting jobs (#72722)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-22 08:05:53 -05:00
Cauê Marcondes 4dcf719edb
Adding api test for transaction_groups /breakdown and /avg_duration_by_browser (#72623)
* adding api test for transaction_groups /breakdown and /avg_duration_by_browser

* adding filter by transaction name

* adding filter by transaction name

* addressing pr comments

* fixing TS issue

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-22 15:01:29 +02:00
Gidi Meir Morris a41633d8c5
[Task Manager] Addresses flaky test introduced by buffered store (#72815)
Removed unused functionality which we weren't using anyway and was causing some flaky behaviour.
2020-07-22 13:39:33 +01:00
Cauê Marcondes cb0405eeae
[Observability] filter "hasData" api by processor event (#72810)
* filtering hasdata by processor event

* adding api test
2020-07-22 14:30:52 +02:00
Joe Reuter d992060431
do not pass title as part of tsvb request (#72619) 2020-07-22 12:15:39 +02:00
Joe Reuter 3709de64d6
[Lens] Legend config (#70619) 2020-07-22 12:14:59 +02:00
Joe Reuter 78ea171a80
Stabilize closing toast (#72097)
* stabilize closing toast

* unskip test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-22 11:28:23 +02:00
Joe Reuter b9aede40d6
stabilize failing test (#72086) 2020-07-22 11:26:37 +02:00
Joe Reuter edaea1e341
Stabilize filter bar test (#72032) 2020-07-22 11:26:04 +02:00
Joe Reuter 1810dd1fe7
Unskip vislib tests (#71452) 2020-07-22 11:25:41 +02:00
Pete Harverson a93c327e9d
[ML] Fix layout of anomaly chart tooltip for long field values (#72689) 2020-07-22 09:30:13 +01:00
Pierre Gayvallet 47eaf604bb
fix preAuth/preRouting mocks (#72663) 2020-07-22 09:25:53 +02:00
Andrew Goldstein ad65b2ce34
[Security Solution] Hide KQL bar (all pages) and alerts filters (Detections) when Resolver is full screen (#72788)
## Summary

Fixes an issue where the KQL bar (on all pages) and alerts filters (on the `Detections` page) should be hidden when Resolver is in full screen mode.

**To reproduce:**

1) Navigate to the `Detections` page
2) Enter `agent.type : endpoint` in the KQL bar to only show endpoint alerts
3) Click the `Full screen` button in the detections table

**Expected result**
* The KQL bar, inspect button, alerts filters (`Open | In progress | Closed`), and `Showing n alerts`,  `Select all n alerts`, and `Additional filters` actions are visible in full screen mode

4) Click the `Analyze event` button to show Resolver

**Expected result**
* The KQL bar, inspect button, alerts filters (`Open | In progress | Closed`), `Showing n alerts`,  `Select all n alerts`, and `Additional filters` actions are  **NOT** visible in full screen mode **when Resolver is open**

**Actual result**
* The KQL bar, inspect button, alerts filters (`Open | In progress | Closed`), `Showing n alerts`,  `Select all n alerts`, and `Additional filters` actions are (incorrectly) visible in full screen mode, per the screenshot below:

![filters-in-full-screen-mode](https://user-images.githubusercontent.com/4459398/88079205-9f565b80-cb3a-11ea-996a-fb71bf43c473.png)

5) Click the `< Back to events` button

**Expected result**
* The KQL bar, inspect button, alerts filters (`Open | In progress | Closed`), `Showing n alerts`,  `Select all n alerts`, and `Additional filters` actions become visible again

6) Press the `Esc` (Escape) key to exit Full screen mode

**Expected result**
* The KQL bar, inspect button, alerts filters (`Open | In progress | Closed`), `Showing n alerts`,  `Select all n alerts`, and `Additional filters` actions are (still) visible

## Screenshot (fixed)

The following screenshot of the fix was taken from the `Detections` page after following the reproduction steps above:

![filters-in-full-screen-mode-fixed](https://user-images.githubusercontent.com/4459398/88125154-e882cb80-cb8b-11ea-9b45-718fd9ef0844.png)
2020-07-22 00:12:13 -06:00
Andrew Cholakian 6f405289ec
[Uptime] Rename Whitelist to Allowlist in parse_filter_map (#71584)
Fixes https://github.com/elastic/kibana/issues/71583

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-21 20:36:43 -05:00
Garrett Spong 1a1d7049e8
[Security Solution] Fixes exception modal not loading content (#72770)
## Summary

When using the `useFetchIndexPatterns` hook multiple times within a component (e.g. add_exception_modal & edit_exception_modal), the `apolloClient` will perform `queryDeduplication` and prevent the first query from executing. A deep compare is not performed on `indices`, so another field must be passed to circumvent this.


For all the lovely details, see https://github.com/apollographql/react-apollo/issues/2202

Note: As of yesterday, [support has been added](https://github.com/apollographql/apollo-client/pull/6526) for configuring `queryDeduplicating` via `context`. This is available in `apollo-client` `2.6`, so when upgrading (currently on `2.3.8`) we can swap out this workaround to leverage this functionality.

Note II: This [link](https://www.apollographql.com/docs/link/links/dedup/#context) may also be an option after upgrading to a supported version.
2020-07-21 19:21:40 -06:00
Yara Tercero 9c7d65cfc2
[Security Solution][Exceptions] - Require non empty entries and non empty string values in exception list items (#72748)
## Summary

This PR updates the exception list entries schemas.

- **Prior:** `entries` could be `undefined` or empty array on `ExceptionListItemSchema`
  - **Now:** `entries` is a required field that cannot be empty - there's really no use for an item without `entries`

- **Prior:** `field` and `value` could be empty string in `EntryMatch`
  - **Now:** `field` and `value` can no longer be empty strings

- **Prior:** `field` could be empty string and `value` could be empty array in `EntryMatchAny`
  - **Now:** `field` and `value` can no longer be empty string and array respectively

- **Prior:** `field` and `list.id` could be empty string in `EntryList`
  - **Now:** `field` and `list.id` can no longer be empty strings

- **Prior:** `field` could be empty string in `EntryExists`
  - **Now:** `field` can no longer be empty string

- **Prior:** `field` could be empty string in `EntryNested`
  - **Now:** `field` can no longer be empty string

- **Prior:** `entries` could be empty array in `EntryNested`
  - **Now:** `entries` can no longer be empty array
2020-07-21 21:00:46 -04:00
Patryk Kopyciński 073bd66a86
[Detections] Add validation for Threshold value field (#72611) 2020-07-21 18:18:28 -06:00
Frank Hassanabad eddc62ad4b
[SIEM][Detection Engine][Lists] Adds version and immutability data structures (#72730)
###  Summary

The intent is to get the data structures in similar to rules so that we can have eventually immutable and versioned lists in later releases without too much hassle of upgrading the list and list item data structures.

* Adds version and immutability data structures to the exception lists and the value lists.
* Adds an optional version number to the update route of each so that you can modify the number either direction or you can omit it and it works like the detection rules where it will auto-increment the number.
* Does _not_ add a version and immutability to the exception list items and value list items.
* Does _not_ update the version number when you add a new exception list item or value list item. 

**Examples:**

❯ ./post_list.sh
```json
{
  "_version": "WzAsMV0=",
  "id": "ip_list",
  "created_at": "2020-07-21T20:31:11.679Z",
  "created_by": "yo",
  "description": "This list describes bad internet ip",
  "immutable": false,
  "name": "Simple list with an ip",
  "tie_breaker_id": "d6bd7552-84d1-4f95-88c4-cc504517b4e5",
  "type": "ip",
  "updated_at": "2020-07-21T20:31:11.679Z",
  "updated_by": "yo",
  "version": 1
}
```
❯ ./post_exception_list.sh
```json
{
  "_tags": [
    "endpoint",
    "process",
    "malware",
    "os:linux"
  ],
  "_version": "WzMzOTgsMV0=",
  "created_at": "2020-07-21T20:31:35.933Z",
  "created_by": "yo",
  "description": "This is a sample endpoint type exception",
  "id": "2c24b100-cb91-11ea-a872-adfddf68361e",
  "immutable": false,
  "list_id": "simple_list",
  "name": "Sample Endpoint Exception List",
  "namespace_type": "single",
  "tags": [
    "user added string for a tag",
    "malware"
  ],
  "tie_breaker_id": "c11c4d53-d0be-4904-870e-d33ec7ca387f",
  "type": "detection",
  "updated_at": "2020-07-21T20:31:35.952Z",
  "updated_by": "yo",
  "version": 1
}
```

```json
❯ ./update_list.sh
{
  "_version": "WzEsMV0=",
  "created_at": "2020-07-21T20:31:11.679Z",
  "created_by": "yo",
  "description": "Some other description here for you",
  "id": "ip_list",
  "immutable": false,
  "name": "Changed the name here to something else",
  "tie_breaker_id": "d6bd7552-84d1-4f95-88c4-cc504517b4e5",
  "type": "ip",
  "updated_at": "2020-07-21T20:31:47.089Z",
  "updated_by": "yo",
  "version": 2
}
```

```json
❯ ./update_exception_list.sh
{
  "_tags": [
    "endpoint",
    "process",
    "malware",
    "os:linux"
  ],
  "_version": "WzMzOTksMV0=",
  "created_at": "2020-07-21T20:31:35.933Z",
  "created_by": "yo",
  "description": "Different description",
  "id": "2c24b100-cb91-11ea-a872-adfddf68361e",
  "immutable": false,
  "list_id": "simple_list",
  "name": "Sample Endpoint Exception List",
  "namespace_type": "single",
  "tags": [
    "user added string for a tag",
    "malware"
  ],
  "tie_breaker_id": "c11c4d53-d0be-4904-870e-d33ec7ca387f",
  "type": "endpoint",
  "updated_at": "2020-07-21T20:31:56.628Z",
  "updated_by": "yo",
  "version": 2
}
```

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-07-21 17:50:25 -06:00
Ryland Herrick ba643bd298
[Security Solution][Detections] Validate file type of value lists (#72746)
* UI validates file type of uploaded value list

* file picker itself is restricted to text/csv and text/plain
* if they drag/drop an invalid file, we disable the upload button and
display an error message
* refactors form state to be a File instead of a FileList

* Refactor validation and error message in terms of file type

Instead of maintaining lists of both valid extensions and valid mime
types, we simply use the latter.
2020-07-21 18:31:54 -05:00
Clint Andrew Hall a4957e65c2
[pre-req] New Component Layout proposal (#72385)
* New Component Layout proposal

* Add contribution guidelines; remove dead i18n

* Re-adding i18n... ugh

* Fix i18n files to reflect changes

* Addressing feedback

* Fix merge issue

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-21 19:18:57 -04:00
Dima Arnautov b3f1595331
[ML] do not throw an error when agg is not supported by UI (#72685) 2020-07-22 01:03:27 +02:00
Robert Austin b930cef489
[Resolver] Origin process (#72382)
Co-authored-by: Brent Kimmel <brent.kimmel@elastic.co>

* Center the origin node
* Nodes appear selected when they are selected. also the aria attributes are working.
* Reposition the submenu when the user pans.
2020-07-21 17:47:22 -04:00
Nicolas Chaulet bb7d12864f
[Ingest Manager] Allow to force unenroll from the UI (#72386) 2020-07-21 17:34:19 -04:00
Spencer b32f72d370
skip 6.8 branch when triggering baseline-capture builds (#72706)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-07-21 14:00:19 -07:00
Brian Seeders 2437db63ef
[CI] In-progress PR comments (#72211) 2020-07-21 16:51:58 -04:00
Nick Partridge b0ef3e9580
Fix sorting of scripted string fields (#72681) 2020-07-21 15:31:49 -05:00
Ryland Herrick 8d5a5d0860
[Security Solution][Detections] Adds loading states to export/delete on modal (#72562)
* Add loading spinners to Value Lists modal

While export or a delete is pending, we display a loading spinner
instead of the button that was clicked.

Since state is controlled in the parent, we must pass this additional
state in the same way; the table component simply reacts to this state.

* Fix bug with useAsync and multiple calls

Multiple calls to start() would not previously reset the hook's state,
where useEffect on the hook's state would fire improperly as subsequent
calls would not travel the same undefined -> result path.

* Fix style of loading spinner

This fits the size of the button it's replacing, so no shifting occurs
when replacing elements.

* Better styling of spinner

Keep it roughly the same size as the icons themselves, and fill the
space with margin.

* Fix circular dependency in value lists modal

Moves our shared types into a separate module to prevent a circular
dependency.
2020-07-21 15:26:51 -05:00
Tyler Smalley 33a9604800 [test] Skips flaky bulk operation buffer tests
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-07-21 12:57:29 -07:00
Andrew Goldstein 3f2913b5b8
[Security Solution] Full screen Timeline CSS fixes (#72559)
## [Security Solution] Full screen Timeline CSS fixes

Fixes CSS issues related to the [Full screen timeline, Collapse event](https://github.com/elastic/kibana/pull/71786) feature:

- Sometimes, Timeline's left padding is missing in Full screen mode
- The `Attach to new case` and `Attach to existing case...` actions should be centered in Full screen mode
- The Timeline flyout button is not opaque when the alerts table is in Full screen mode

### Sometimes, Timeline's left padding is missing in Full screen mode

To reproduce:

1) Drag anything to the Timeline
2) Click the `Full screen` button

**Expected result**
- [x] The timeline has left padding in full screen mode

**Actual result**
- [x] Sometimes, the left padding of the Timeline is missing, per the screenshot below:

![timeline-full-screen-before](https://user-images.githubusercontent.com/4459398/87998223-8acf8000-cab4-11ea-91a1-6b5644856b44.png)

### Fix: screenshot

![timeline-full-screen-after](https://user-images.githubusercontent.com/4459398/87998363-e3068200-cab4-11ea-8484-41d87ba4c97e.png)

### The `Attach to new case` and `Attach to existing case...` actions should be centered in full screen mode

1) Create a new timeline with the following KQL query: `agent.type : endpoint`
2) Click the `Analyze event` button on any enabled event to view Resolver

**Expected result**
- [x] The `Attach to new case` and `Attach to existing case...` actions should be centered between the horizontal lines

**Actual result**
- [x] The `Attach to new case` and `Attach to existing case...` actions are **NOT** centered, per the screenshot below:

![attach-to-case-before](https://user-images.githubusercontent.com/4459398/87998636-b9018f80-cab5-11ea-87e8-a54355386519.png)

### Fix: screenshot

![attach-to-case-after](https://user-images.githubusercontent.com/4459398/87998553-82c41000-cab5-11ea-9e33-fcffce11e4b4.png)

### The Timeline flyout button is not opaque when the alerts table is in Full screen mode

To reproduce:

1) Navigate to Security > Detections
2) Click on the `Full screen` button

**Expected result**
- [x] The Timeline flyout button is opaque when the alerts table is in Full screen mode

**Actual result**
- [x] The Timeline flyout button is **NOT** opaque when the alerts table is in Full screen mode, per the screenshot below:

![flyout-button-before](https://user-images.githubusercontent.com/4459398/87998761-0d0c7400-cab6-11ea-9cd3-0c091e0291c9.png)

## Fix: screenshot (light theme)

![flyout-button-after-light](https://user-images.githubusercontent.com/4459398/87998784-231a3480-cab6-11ea-8fc9-17c28cf25202.png)

## Fix: screenshot (dark theme)

![flyout-button-after-dark](https://user-images.githubusercontent.com/4459398/87998824-45ac4d80-cab6-11ea-96ef-6242b8494f84.png)

### Desk testing

Desk tested in :
- Chrome `84.0.4147.89`
- Firefox `78.0.2`
- Safari `13.1.2`
2020-07-21 13:46:05 -06:00
Clint Andrew Hall b05d3d114e
Optimize Functions and Renderers for Webpack builds (#72683) 2020-07-21 15:29:15 -04:00
Alex Kahan 13ec56db8b
Limit concurrent access to download API + Replace with LRU cache (#72503)
* Limit concurrent access to  download API

* Replacing cache with LRU Cache

* Configure the LRU cache

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-21 15:18:01 -04:00
Clint Andrew Hall eb71e599ce
[pre-req] Convert Page Manager, Page Preview, DOM Preview (#70370)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Corey Robertson <corey.robertson@elastic.co>
2020-07-21 14:12:56 -04:00
Patryk Kopyciński 4b06a4eb41
[Security Solution][Timeline] Add Empty view to the Timelines page (#72576) 2020-07-21 19:15:27 +02:00
Kevin Qualters 3f5f9b7669
[Security Solution][Resolver] Show process detail panel when clicking a process node (#72563) 2020-07-21 13:07:40 -04:00
Madison Caldwell c3bd7ae9df
Move manifest packageConfig mocks into security_solution plugin (#72527) 2020-07-21 12:22:53 -04:00
Tre 98fabd4690
[QA][Code Coverage] Fixup Team Assignment (#72467) 2020-07-21 09:58:21 -06:00
Nathan Reese a7a2b7cb4c
[docs] remove references to tile map visualization in supported aggregations (#72493) 2020-07-21 09:26:05 -06:00
Victor Martinez 42d2b7def5
[ci][apm-ui] fix argument name for disabling pr comments (#72633) 2020-07-21 16:16:47 +01:00
Jonathan Buttner 245940ac11
Only check that the event ids are the same in arrays (#72624) 2020-07-21 10:56:06 -04:00
CJ Cenizal a540cafb85
Add doc titles to ES UI apps (#71045)
* Add doc titles to CCR, ILM, Index Management, Ingest Node Pipelines, License Management, Remote Clusters, Rollup Jobs, Watcher, and Upgrade Assistant. Clear doc title when leaving Dev Tools.
* Refactor Watcher boot file to follow index-oriented pattern of other plugins.
2020-07-21 07:04:40 -07:00
CJ Cenizal 1cde692ab7
Add Upgrade Assistant API integration test to ensure the reindex operation saved object can handle immense error messages (#72347) 2020-07-21 07:04:06 -07:00
Søren Louv-Jansen 05ee3da80d
[APM] Disable flaky rum e2e’s (#72614) 2020-07-21 15:56:43 +02:00
Devon Thomson 9facf416f5
Applying tiny fix from 72532 to main branch (#72533) 2020-07-21 09:56:13 -04:00
Søren Louv-Jansen 2fc7112ec2
[APM] Update script with new roles/users (#72599)
* [APM] Update script with new roles/users

* add log

* Add validation for http prefix
2020-07-21 15:55:43 +02:00
Michael Olorunnisola 5d4827f14f
[Security Solution] Add margin (#72542) 2020-07-21 09:54:13 -04:00
Uladzislau Lasitsa 98478b49e0
Migrated fixed_scroll karma tests to jest (#72258)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-21 16:51:29 +03:00
James Gowdy fbf41e5379
[ML] Handling data recognizer saved object errors (#72447)
* [ML] Handling data recognizer saved object errors

* adding text for unknown errors

* fixing typos
2020-07-21 14:28:10 +01:00
Chris Roberson c63ab91c7b
[Monitoring] Fix the messaging around needing TLS enabled (#72310)
* Fix the copy

* Fix type issues

* PR feedback

* Add missing code
2020-07-21 09:12:50 -04:00