Commit graph

42162 commits

Author SHA1 Message Date
Joe Portner 978f5eca5a
Add config properties for HTTP security headers (#97158) 2021-04-19 13:12:45 -04:00
Spencer b7a9b84af8
Revert "Revert "[ci] skip building ts refs when not necessary (#95739)" (#95746)" (#95750)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 09:45:09 -07:00
Corey Robertson 6712bc0727
Fix and unskip test suite (#97144)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 12:35:20 -04:00
Yuliia Naumenko 5141f598dc
[Alerting] Added proper check to see if TLS is required using security API for apiKeys: areAPIKeysEnabled (#97317)
* replaced xpack usage calls with the security API areAPIKeysEnabled

* fixed typechecks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 09:04:34 -07:00
Nathan Reese 4ab22f9336
[Maps] add visibility toggle and fit to bounds buttons to layer quick actions menu. (#97013)
* hover actions

* clean up

* tslint, i18n, and snapshot fixes

* update jest snapshot

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 09:57:50 -06:00
Pierre Gayvallet f1bc11e2fa
add FTR test for aborted requests error name (#97086)
* add FTR test for aborted requests error name

* delete unused file

* wait for the request to fire before cancellation
2021-04-19 17:50:17 +02:00
Joe Reuter a2620f1c47
[Lens] improve handling of mixed axes (#97236) 2021-04-19 16:35:15 +02:00
Shahzad 92eb85f121
Added rison-node to kibana shared deps. (#97417) 2021-04-19 16:29:47 +02:00
Matthias Wilhelm 7c5f41e171
[Discover] Unskip functional saved queries test 2021-04-19 16:13:03 +02:00
Sonja Krause-Harder efcf7d1a25
[Fleet] Don't fail on errors in 'update' or 'reupdate' operation in /setup (#97404)
* Don't fail on, just report, update and reupdate errors.

* Show error toast on update and reupdate errors.

* Don't return empty error array.

* Adjust mock.

* Adjust test.
2021-04-19 16:01:10 +02:00
John Schulz 17ecb04dce
[Fleet] Filter hosted policies from menu (#97380)
## Summary

 * 4C & 7C from https://github.com/elastic/kibana/issues/91906 about hiding hosted agent policy from select menus
 * Also changed reassign agent to new policy UI from flyout to modal as requested
<details><summary>Screenshots</summary>

<h3>Current</h3>
<img width="1090" alt="Screen Shot 2021-04-16 at 1 37 02 PM" src="https://user-images.githubusercontent.com/57655/115075124-9d9ea600-9ec8-11eb-8e88-d8f14f62613f.png">


<h3>PR</h3>
<img width="1092" alt="Screen Shot 2021-04-16 at 1 43 51 PM" src="https://user-images.githubusercontent.com/57655/115075127-9d9ea600-9ec8-11eb-8c47-c3b1fbeb96eb.png">

<h3>current</h3>
<img width="1112" alt="Screen Shot 2021-04-16 at 1 44 41 PM" src="https://user-images.githubusercontent.com/57655/115075129-9e373c80-9ec8-11eb-9f93-cac511c9d53d.png">

<h3>PR</h3>
<img width="1106" alt="Screen Shot 2021-04-16 at 1 50 28 PM" src="https://user-images.githubusercontent.com/57655/115075130-9e373c80-9ec8-11eb-93fb-0adfa5ae81ba.png">


<h3>current</h3>
<img width="1106" alt="Screen Shot 2021-04-16 at 1 35 48 PM" src="https://user-images.githubusercontent.com/57655/115075121-9d9ea600-9ec8-11eb-8605-89336371938b.png">

<h3>PR</h3>
<img width="1106" alt="Screen Shot 2021-04-16 at 2 35 15 PM" src="https://user-images.githubusercontent.com/57655/115075133-9ecfd300-9ec8-11eb-9458-0b7f9cf76c10.png">

<img width="2136" alt="Screen Shot 2021-04-16 at 3 24 16 PM" src="https://user-images.githubusercontent.com/57655/115075141-a0010000-9ec8-11eb-896c-efc4be4be5ac.png">

</details>

### 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/master/packages/kbn-i18n/README.md)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 09:43:43 -04:00
Marco Liberati 1b02152e18
[Graph] Fix style for disabled fields when focused (#96780)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 15:30:28 +02:00
Joe Reuter 4540a943d7
directly submit query (#97254) 2021-04-19 14:14:10 +02:00
Maja Grubic 5035230190
[Discover] Sort option: Introduce format parameter (#96774)
* [Discover] Updating a functional test

* [Discover] Context view: add support for date nanos custom

* Remove unnecessary change to a functional test

* Fix failing unit tests

* Remove unnecessary intialization

* Add new type definition to data plugin

* Update docs

* Simplify return statement

* Removing unnecessary type export

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 13:10:24 +01:00
Joe Reuter ce6d2f5a50
improve custom label handling (#97219) 2021-04-19 14:06:13 +02:00
Joe Reuter a021946e85
[Lens] Reload on runtime edit (#97161) 2021-04-19 13:52:49 +02:00
Joe Reuter 0ea0e40331
[Lens] Better defaults for top values odering (#97099) 2021-04-19 13:49:26 +02:00
John Schulz 2f4e9db7fc
Use <AgentPolicySummaryLine /> for consistent name+icon lockup (#97377)
## Summary

From design ticket https://github.com/elastic/observability-design/issues/32
> any ... place we display a link to the hosted agent policy, show an icon with hover tooltip:

This PR closes 1B + 1C from https://github.com/elastic/kibana/issues/91906 & two other places which followed the same pattern.

Factored out some repeated code at each call site into a `<AgentPolicySummaryLine />` component


<details><summary>Screenshots</summary>
<h3>Agent Policy List View</h3>
<img width="1103" alt="Screen Shot 2021-04-16 at 1 01 55 PM" src="https://user-images.githubusercontent.com/57655/115059112-18a99180-9eb4-11eb-9035-36a8e9db1f9d.png">

<h3>Agent List View</h3>
<img width="1185" alt="Screen Shot 2021-04-16 at 12 38 40 PM" src="https://user-images.githubusercontent.com/57655/115058885-bea8cc00-9eb3-11eb-8529-6f185fcac7d2.png">


<h3>Packaged Policy List View</h3>
<img width="1251" alt="Screen Shot 2021-04-16 at 10 23 49 AM" src="https://user-images.githubusercontent.com/57655/115058880-be103580-9eb3-11eb-8060-c501663af556.png">

<h3>Agent Policy Detail View</h3>
<img width="1145" alt="Screen Shot 2021-04-16 at 12 21 42 PM" src="https://user-images.githubusercontent.com/57655/115058883-bea8cc00-9eb3-11eb-9970-462ff4600fa4.png">



</details>

### 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/master/packages/kbn-i18n/README.md)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 07:33:27 -04:00
Tiago Costa b6fd28884b
chore(NA): moving @kbn/babel-preset into bazel (#97271)
* chore(NA): moving @kbn/babel-preset into bazel

* chore(NA): remove unused deps from xpack package.json
2021-04-19 12:37:56 +02:00
Uladzislau Lasitsa f5a8405eb9
[Vega] Fixes problem with controls not being displayed on a map (#97373)
* add element for vegaControls

* Fix check types

* Fixed type check

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 12:58:33 +03:00
Vadim Dalecky 249f9aca15
RFC: URL Service (TTL: expired) (#95416)
* docs: ✏️ start URL Service RFC

* docs: ✏️ improe short URL example

* docs: ✏️ add summary, basic examples and motivation sections

* docs: ✏️ fill end sections of rfc

* feat: 🎸 start "Detailed design" section

* docs: ✏️ add HTTP endpoints section

* docs: ✏️ use table layout

* docs: ✏️ cleanup various text parts

* feat: 🎸 add redirect route GET endpoints

* docs: ✏️ add alternatives

* docs: ✏️ update examples

* docs: ✏️ update client interfaces

* docs: ✏️ update HTTP endpoints

* docs: ✏️ update url generator references

* docs: ✏️ add note about short URL migration

* docs: ✏️ add Peter's clarifications

* docs: ✏️ fix typos

* docs: ✏️ remove short url create() method

* docs: ✏️ update redirect endpoints

* docs: ✏️ add note about locator usage

* docs: ✏️ make paramsVersion required

* docs: ✏️ add goals section

* docs: ✏️ add suggested bullet points
2021-04-19 11:57:01 +02:00
Liza Katz 4c45ae0645
[Search] enable fun-ctional tests (#97398)
* only fun-ctional

* fix functional tests

* tests

* Type
2021-04-19 12:21:50 +03:00
Shahzad 1bc7e5462f
[Exploratory view] integerate page views to exploratory view (#97258) 2021-04-19 09:28:44 +02:00
CJ Cenizal 681bd642fb
Fix typo in license_api_guard README name and import http server mocks from public interface (#97334)
* Reject basic minimum licenses.
2021-04-18 20:28:13 -07:00
Pierre Gayvallet 787b493403
Avoid mutating KQL query when validating it (#97081) 2021-04-18 23:07:36 +02:00
Pierre Gayvallet cb2cf67609
Add description as title on tag badge (#97109) 2021-04-18 20:49:35 +02:00
Pierre Gayvallet f8838e3b89
Remove legacy ES client usages in home and xpack_legacy (#97359)
* Home plugin: remove usages of the legacy ES client

* remove legacy es client usage in xpack_legacy
2021-04-18 20:42:07 +02:00
Sonja Krause-Harder 05bd1c0cdb
[Fleet] Finer-grained error information from install/upgrade API (#95649)
* Intercept installation errors and add meta info.

* Adjust mock.

* Catch errors in all steps of install/upgrade.

* Adjust handler for direct package upload.

* Don't throw not-found errors on assets during rollback.

* Correctly catch errors from _installPackage()

* Propagate error from installResult in bulk install case.

* Add tests for rollback.

* Remove unused code.

* Skipping test that doesn't test what it says.

* Fix and reenable test.
2021-04-18 16:47:24 +02:00
Dario Gieselaar fed17c2b6e
Rule registry bundle size (#97251) 2021-04-18 16:40:54 +02:00
Liza Katz 1a3e033c90
[Partial Results] Move other bucket into Search Source (#96384)
* Move inspector adapter integration into search source

* docs and ts

* Move other bucket to search source

* test ts + delete unused tabilfy function

* hierarchical param in aggconfig.
ts improvements
more inspector tests

* fix jest

* separate inspect
more tests

* jest

* inspector

* Error handling and more tests

* put the fun in functional tests

* code review

* Add functional test for other bucket in search example app

* test

* test

* ts

* test

* test

* ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-18 12:50:02 +03:00
Catherine Liu 3b31d81196
[Dashboard] Makes lens default editor for creating new panels (#96181)
* Makes lens default editor in dashboard

Added all editors menu to dashboard panel toolbar

Fixed toggle on editor menu

Removed unnecessary comments

Added data test subjects to editor menu buttons

Populated editor menu with vis types

Removed unused imports

Fixed imports

Adds showCreateNewMenu prop to AddPanelFlyout

Rearranged order of editor menu options

Fixed ts errors

Added groupnig to embeddable factory

Use embeddable state transfer service to redirect to editors

Added showGroups to TypeSelectionState

Fixed add panel flyout test

Fixed data test subjects

Fixed factory groupings

Removed unused import

Fixed page object

Added telemtry to dashboard toolbar

Added telemtry to editor menu

Fix ml embeddable functional tests

Fix lens dashboard test

Fix empty dashboard test

Fixed ts errors

Fixed time to visualize security test

Fixed empty dashboard test

Fixed clickAddNewEmbeddableLink in dashboardAddPanel service

Fixed agg based vis functional tests

Revert test changes

Fixed typo

Fix tests

Fix more tests

Fix ts errors

Fixed more tests

Fixed toolbar sizes and margins to align with lens

Fix tests

Fixed callbacks

Fixed button prop type

New vis modal copy updates

Added savedObjectMetaData to log stream embeddable factory

Addressed feedback

Fixed ts error

Fix more tests

Fixed ts errors

Updated dashboard empty prompt copy

Adds tooltip to log stream embeddable factory saved object meta data

Made icons monochrome in toolbar

Fixed icon colors in dark mode

Cleaned up css

Fixed ts errors

Updated snapshot

Fixed map icon color

* Added tooltips for ML embeddables

* Restored test

* Added empty dashboard panel test

* Fixed i18n id

* Fix dashboard_embedding test

* Removed unused service

* Fixed i18n error

* Added icon and description properties to embeddable factory definition

* Fixed ts errors

* Fixed expected value

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-17 22:29:27 -07:00
Tiago Costa a89b756710
skip flaky suite (#97387) 2021-04-17 15:52:32 +01:00
Bryan Clement e0da8b2e96
[Asset Management] Agent picker follow up (#97357) 2021-04-17 06:42:49 -04:00
spalger e321f57f64 skip flaky suite (#97382) 2021-04-16 22:28:19 -07:00
Frank Hassanabad 721f4b55f5
[Security Solutions] Fixes flake with cypress tests (#97329)
## Summary

Fixes some recent flakeyness with Cypress tests
* Adds cypress.pipe() on button clicks around the area of flakes
* Adds an alerting threshold to the utilities so we can wait for when an exact number of alerts are available on a page
* Changes the alerts to not run again with 10 seconds, because if a test takes longer than 10 seconds, the rule can run a second time which can invalidate some of the text when running checks when timeline or other components update on their button clicks.

### 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-04-16 13:52:35 -06:00
spalger 1cbdb26cea skip flaky suite (#97355) 2021-04-16 12:11:12 -07:00
Tyler Smalley 194355fdd3 Skip test to try and stabilize master
https://github.com/elastic/kibana/issues/97378

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-04-16 10:57:29 -07:00
Mikhail Shustov 6c7d776fc1
minimize number of so fild asserted in tests. it creates flakines when implementation details change (#97374) 2021-04-16 13:55:16 -04:00
Liza Katz c187270b5e
[Search Sessions] Client side search cache (#92439)
* dev docs

* sessions tutorial

* title

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update dev_docs/tutorials/data/search.mdx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Code review

* client cache

* mock utils

* improve code

* Use cacheOnClient in Lens

* mock

* docs and types

* unit tests!

* Search response cache + tests

* remove cacheOnClient
evict cache on error

* test ts

* shouldCacheOnClient + improve tests

* remove unused

* clear subs

* dont unsubscribe on setItem

* caching mess

* t

* fix jest

* add size to bfetch response @ppisljar
use it to reduce the # of stringify in response cache

* ts

* ts

* docs

* simplify abort controller logic and extract it into a class

* docs

* delete unused tests

* use addAbortSignal

* code review

* Use shareReplay, fix tests

* code review

* bfetch test

* code review

* Leave the bfetch changes out

* docs + isRestore

* make sure to clean up properly

* Make sure that aborting in cache works correctly
Clearer restructuring of code

* fix test

* import

* code review round 1

* ts

* Added functional test for search request caching

* test

* skip before codefreeze

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-16 19:59:23 +03:00
Pierre Gayvallet 106afd41b6
[SavedObjects] Add aggregations support (#96292)
* step 1 to add aggs in the find function of saved object

* setp 2 - add specific unit test to aggs + fix bug found during integrations

* step 3 - add security api_integration arounds aggs

* fix types

* unit test added for aggs_utils

* add documentation

* fix docs

* review I

* doc

* try to fix test

* add the new property to the saved object globaltype

* fix types

* delete old files

* fix types + test api integration

* type fix + test

* Update src/core/server/saved_objects/types.ts

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>

* review I

* change our validation to match discussion with Pierre and Rudolph

* Validate multiple items nested filter query through KueryNode

* remove unused import

* review + put back test

* migrate added tests to new TS file

* fix documentation

* fix license header

* move stuff

* duplicating test mappings

* rename some stuff

* move ALL the things

* cast to aggregation container

* update generated doc

* add deep nested validation

* rewrite the whole validation mechanism

* some cleanup

* minor cleanup

* update generated doc

* adapt telemetry client

* fix API integ tests

* fix doc

* TOTO-less

* remove xpack tests

* list supported / unsupported aggregations

* typo fix

* extract some validation function

* fix indent

* add some unit tests

* adapt FTR assertions

* update doc

* fix doc

* doc again

* cleanup test names

* improve tsdoc on validation functions

* perf nit

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-16 10:40:30 +02:00
Michael Dokolin 15e8ca1161
[Reporting] Remove legacy elasticsearch client usage from the reporting plugin (#97184) 2021-04-16 10:09:34 +02:00
Spencer 9987e3d73b
[kbnClient] fix basePath handling and export reponse type (#97277)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-15 22:12:23 -07:00
Tyler Smalley 347882f01a skip flaky suite (#91360) 2021-04-15 22:05:14 -07:00
Ryland Herrick b5ae056ac4
[Security Solution][Detections] ML Rules accept multiple ML Job IDs (#97073)
* Adds helper to normalize legacy ML rule field to an array

This will be used on read of rules, to normalize legacy rules while
avoiding an explicit migration.

* Fix our detection-specific ML search function

Luckily this was just a translation layer to our anomaly call, and the
underlying functions already accepted an array of strings.

* WIP: Run rules against multiple ML Job IDs

We don't yet support creation of rules with multiple job ids, either on
the API or the UI, but when we do they will work.

Note: the logic was previously to generate an error if the underlying
job was not running, but to still query and generate alerts. Extending
that logic to multiple jobs: if any are not running, we generate an
error but continue querying and generating alerts.

* WIP: updating ml rule schemas to support multiple job IDs

* Simplify normalization method

We don't care about null or empty string values here; those were
holdovers from copying the logic of normalizeThreshold and don't apply
to this situation.

* Move normalized types to separate file to fix circular dependency

Our use of NonEmptyArray within common/schemas seemed to be causing the
above; this fixes it for now.

* Normalize ML job_ids param at the API layer

Previous changes to the base types already covered the majority of
routes; this updates the miscellaneous helpers that don't leverage those
shared utilities.

At the DB level, the forthcoming migration will ensure that we always
have "normalized" job IDs as an array.

* Count stopped ML Jobs as partial failure during ML Rule execution

Since we continue to query anomalies and potentially generate alerts, a
"failure" status is no longer the most accurate for this situation.

* Update 7.13 alerts migration to allow multi-job ML Rules

This ensures that we can assume string[] for this field during rule
execution.

* Display N job statuses on rule details

* WIP: converts MLJobSelect to a multiselect

Unfortunately, the SuperSelect does not allow multiselect so we need to
convert this to a combobox. Luckily we can reuse most of the code here
and remain relatively clean.

Since all combobox options must be the same (fixed) height, we're
somewhat more limited than before for displaying the rows. The
truncation appears fine, but I need to figure out a way to display the
full description as well.

* Update client-side logic to handle an array of ML job_ids

* Marginally more legible error message

* Conditionally call our normalize helper only if we have a value

This fixes a type error where TS could not infer that the return value
would not be undefined despite knowing that the argument was never
undefined. I tried some fancy conditional generic types, but that didn't
work.

This is more analogous to normalizeThresholdObject now, anyway.

* Fix remaining type error

* Clean up our ML executor tests with existing contract mocks

* Update ML Executor tests with new logic

We now record a partial failure instead of an error.

* Add and update tests for new ML normalization logic

* Add and update integration tests for ML Rules

Ensures that dealing with legacy job formats continues to work in the
API.

* Fix a type error

These params can no longer be strings.

* Update ML cypress test to create a rule with 2 ML jobs

If we can create a rule with 2 jobs, we should also be able to create a
rule with 1 job.

* Remove unused constant

* Persist a partial failure message written by a rule executor

We added the result.warning field as a way to indicate that a partial
failure was written to the rule, but neglected to account for that in the
main rule execution code, which caused a success status to immediately
overwrite the partial failure if the rule execution did not otherwise
fail/short-circuit.
2021-04-15 21:27:43 -05:00
Ryland Herrick 540924b5be
[Security Solution][Detections] Adds Nested CTI row renderer (#96275)
* Move alert-specific mocks to more declarative mock file

* Add placeholder interface for ECS threat fields

* Test and implement CTI row renderer

The display details are not yet implemented, but those will be fleshed
out in the ThreatMatchRow component.

* Pass full fields data to our row renderers

This data is not used by any existing row renderers and so this commit
is mostly just plumbing that data through.

This is necessary, however, for our new threat match row renderer as it
requires nested fields, which cannot be retrieved through the mechanism
that retrieves the existing row renderer data. However, these nested
fields are available, if requested, through this other data structure,
hence this plumbing.

For now to minimize changes I'm marking this as an optional field;
however in reality a value will always be present.

* Rewrite existing row renderer in terms of flattened data

Updates logic, tests and mocks accordingly.

* Moving logic into discrete files

* helpers
* explicit fields file, which will hopefully be part of the renderer API
  at some point
* parent component to split data into "rows" as defined by our renderer
* row component for stateless presentation of a single match

* Register threat match row rendere

Adds tentative copy, example row, and accompanying mock data.

* WIP: Rendering draggable fields but hit the data loss issue with nested fields being flattened

* WIP: implementing row renderer against new data format

I haven't yet deleted the old (new?) unused path yet. Cleanup to come.

* Updating based on new data

* Rewrites isInstance logic for new data as helper, hasThreatMatchValue
* Updating types and tests
  * Adds to the previously empty ThreatEcs

* Revert "Pass full fields data to our row renderers"

This reverts commit 19c93ee0732166747b5472433cd5fc813638e21b.

We ended up extending the existing data (albeit from the fields
response!).

* Fix draggables

* adds contextId and eventId to pass to draggable
* We don't have a order-independent key for each individual
  ThreatMatchRow, due to matched.id not being mapped/returned in the
  fields response
* Fixes up a few things related to using the new data format

* Move indicator field strings to constants

* Fix example data for CTI row renderer

* Adds missing Threat ECS types

* Move CTI field constants to common folder

In order to use these in both the row renderer and the server request,
we need to move them to common/

* Remove redundant CTI fields from client request

These are currently hardcoded on the backend of the events/all query
(via TIMELINE_EVENTS_FIELDS); declaring them on both ends is arguably
confusing, and we're going with YAGNI for now.

* Add missing graphQL type

This was causing type errors as this enum exists both here and in
common/, and I had only updated one of them.

* Updates tests

One is still failing due to an outdated test subject, but I expect this
to change after an upcoming meeting so leaving it for now.

* Split ThreatMatchRow into subcomponents

One for displaying match details, and another for indicator details

The indicator details will be sparse, so there's going to be some
conditional rendering in there.

* Make CTI row renderer look nice

* Adds translations for copy
* Fixes most of our layout woes with more flexbox!
* Conditional rendering of indicator details based on data
* tests

* Make indicator reference field an external link

Leverages the existing FormattedFieldValue component, with one minor
tweak to add this field to the URL allowlist.

* Back to consistent horizontal spacing, here

The draggable badges are a little odd in that their full box isn't
indicated until hover, making the visual weight a little off.

* Add hr as a visual separator between each match "row" of the row renderer

* Fix tests broken due to addition of a new row renderer

These tests are all implicitly testing the list of row renderers.

* Full-width hr

At certain container widths, a half-width hr is not sufficient.

* More descriptive constant

Obviates the need for the accompanying comments.

* More realistic data

Also ensures less traffic to urlhaus ;)

* Remove useless comment

* Add threat_match row renderer type to GQL client

Gennin' beanz

* Ensure contextId is unique for each CTI subrow

We need to add the row index to our contextId to ensure that our
draggables work correctly for multiple rows, since each row will
necessarily have the same eventId and timelineId.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-15 21:28:18 -04:00
John Schulz 6e5c9278ba
[Fleet] Use 'hosted agent policy' naming in UI & API messages (#97287)
## Summary

### What this PR _does_ change
 - [x] Replace all UI & API instances of "managed policy" with "hosted agent policy" #93504
 - [x] Replace all UI & API instances of "unmanaged policy" with "regular agent policy" #93504
 - [x] Update most variable names containing `managed` to `hosted`

<details><summary>screenshots</summary>

<img width="489" alt="Screen Shot 2021-04-15 at 10 54 01 AM" src="https://user-images.githubusercontent.com/57655/114898051-cac35980-9ddf-11eb-9c55-3fb5c0211c63.png">
<img width="339" alt="Screen Shot 2021-04-15 at 11 40 47 AM" src="https://user-images.githubusercontent.com/57655/114898053-cac35980-9ddf-11eb-8c60-3459aed3db6c.png">
<img width="714" alt="Screen Shot 2021-04-15 at 11 40 59 AM" src="https://user-images.githubusercontent.com/57655/114898054-cac35980-9ddf-11eb-912a-623eba9c3860.png">
</details>

### What this PR _does not_ change
  - [ ] The `is_managed` property of the agent policy saved object*
  - [ ] The updated error messages in https://github.com/elastic/kibana/issues/92591

<details><summary>*why not change the <code>is_managed</code> property?</summary>

<p>Changing the property will require a migration from 7.12. That's not a problem, but we haven't decided on <a href="https://github.com/elastic/kibana/issues/93504#issuecomment-790060997">a new name/approach</a> yet. Rather than update to <code>is_hosted: boolean</code> now and potentially something like <code>managed_by: enum</code> later, we'll update it when we have a decision.

<p><strong>TL;DR:</strong> It's a trivial update to make later and a minuscule amount of debt to pay until then. Less than cost of doing it twice.
 
</details>

### 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/master/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
2021-04-15 21:01:28 -04:00
Spencer 9d0b495a30
[ci] ship Jest unit test junit with runbld in jest worker (#97197)
Co-authored-by: Brian Seeders <seeders@gmail.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-04-15 17:13:38 -07:00
Spencer 689c4d40cd
[ci/baseline] check public API doc count to populate baseline metrics (#97320)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-04-15 17:12:52 -07:00
Xavier Mouligneau 875c475936
happy it is fix (#97313) 2021-04-15 17:58:51 -04:00
CJ Cenizal 35214416f8
Extract License service from CCR and Watcher into license_api_guard plugin in x-pack (#95973)
* Localize error messages.
2021-04-15 14:54:49 -07:00