Commit graph

3518 commits

Author SHA1 Message Date
igoristic 59315bc84d
[Monitoring] NP Migration complete client cutover (#62908)
* Final phase before the complete cutover

* NP migration

* lint fix

* More NP stuff

* Moved Stack Monitoring client plugin outside legacy and fixed all tests

* ...

* Removed unused files

* Fix for main links

* Fixed more tests

* Fixed redirect when clicking on SM icon again

* Code review feedback

* Addressed code review feedback

* Fixed return value
2020-04-30 15:59:35 -04:00
Nathan Reese d6f0c785d9
[Maps] do not display EMS or kibana layer wizards when not configured (#64554)
* [Maps] do not display EMS or kibana layer wizards when not configured

* default tilemap to empty object instead of array

* fix typo

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-29 13:27:55 -06:00
Gidi Meir Morris 9fe7229357
[Alerting] migrates all remaining plugins to new platform (#64335)
Completes the migration of all Alerting Services plugins onto the Kibana Platform

It includes:

1. Actions plugin
2. Alerting plugin
3. Task Manager plugin
4. Triggers UI plugin

And touches the Uptime and Siem plugins as their use of the Task Manager relied on some of the legacy lifecycle to work (registering AlertTypes and Telemetry tasks after the Start stage has already began). The fix was simply to moves these registrations to the Setup stage.
2020-04-29 15:46:54 +01:00
Corey Robertson ac61783a2d
[CANVAS] Adds Canvas Platform Service (#64453)
* Adds Canvas Platform Service

* Fix type check

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-29 09:49:25 -04:00
Larry Gregory f1d72ad127
Expose security license on setup (#64651) 2020-04-29 08:52:33 -04:00
Justin Kambic 05f0d0ac8a
[Uptime] Migrate client to New Platform (#55086)
* Move uptime legacy server to plugins directory.

* Re-add feature registration code.

* Move uptime legacy server to plugins directory.

* Re-add feature registration code.

* Move all files.

* WIP fixing things.

* WIP fixing things.

* WIP fixing things.

* Finished fixing server.

* Fix alert type registration glitch.

* Remove obsolete file.

* Fix unwanted revisions, uncomment previously un-migrated code, delete accidentally-merged files.

* More cleanup.

* Fix all non-maps unit tests.

* Get functional tests working.

* Delete misplaced file.

* Add uptime CODEOWNERS entry.

* Get map working in Uptime app on NP.

* Update CODEOWNERS to remove legacy entry.

* Update server imports.

* Delete and clean up unused or redundant code/comments.

* Move new files from legacy to NP to fix merge error.

* Fix broken import.

* Delete obsolete test snapshots.

* Clean up imports and types, delete obsolete code.

* Clean up redundant common imports.

* Delete obsolete translation keys.

* Add additional explicit typing to plugin class.

* Combine redundant common imports.

* Delete unneeded optionalPlugin entry.

* Revert "Combine redundant common imports."

This reverts commit 159e66c349.

* Update a translation description.

* Revert "Clean up redundant common imports."

This reverts commit 8794013fbe.

* Remove new common index file and revert imports from only common to more specific paths.

* Fix broken imports in `~/x-pack/test`.

* Move new file from legacy to NP location.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-29 07:28:03 -04:00
Spencer 6986c73cd9
[ngSanitize] add explicit dependencies to all uses of ngSanitize angular module (#64546) 2020-04-28 18:10:19 -07:00
Nathan Reese 7dc3972576
[Maps] fix edit filter (#64586) 2020-04-28 16:02:52 -06:00
Chandler Prall 9610dfb781
Replace a number of any-ed styled(eui*) with accurate types (#64555) 2020-04-28 14:53:01 -06:00
Shahzad d5c1812d00
[Uptime] Update uptime ml job id to limit to 64 char (#64394) 2020-04-28 19:48:34 +02:00
CJ Cenizal 3b753ec514
ES UI new platform cleanup (#64332) 2020-04-28 09:41:02 -07:00
Casper Hübertz 99c382fdac
[APM] Service maps: Improve the selected node style (#64279)
* [APM] Set the text color of the selected state

* [APM] Show label background on selected state
2020-04-28 09:33:55 +02:00
Ryland Herrick 4cc5b3a4d3
[SIEM] Client NP Cutover (#64251)
* Move SIEM public/ folder to NP plugin

This is solely renames; fixes come next.

* Update relative imports in our API tests

* Fix linter errors following move to NP folder

These paths got a little shorter, so some lines could be collapsed.

* Move client dependencies to NP package.json

I'm removing the @types/js-yaml for now because I'm not sure we need it;
I'll add it back later if we do.

* Fix relative imports to other plugins

* Fix errant uses of ui/chrome

* Remove legacy plugin shim

* Move feature registration into plugin

This previously had to be part of legacy bootstrapping due to an order
of operations issue.

* Disconnect legacy plugin

The index file should now be redundant with what's in the plugin:

* app registration
* feature registration

* Move public gitattributes

* Remove references to legacy embeddables

We can now use the NP API. Maps embeddable will not work here until
their work is merged, but this should prevent us from importing legacy
code and thus breaking the build.

* Add our frontend dependencies to kibana.json

These are all required for now, because that's how they're typed. If
they _should_ be optional (and I think several should), we need to
update the type and handle the null case within the app.

* Replace use of ui/new_platform mocks in embeddable utils

* Fix remaining jest tests

* Replace build-breaking ui/new_platform mocks with equivalents in core
proper
* Remove unnecessary mocks of ui/new_platform

* Remove references to legacy SIEM folder

* I left the reference in CODEOWNERS in case someone tries to sneak
something back
* I left the .gitignore reference for the same reason

* Fix mocks of relative paths

These were not caught by typescript and were causing test failures.

* Export our client plugin contracts

They're empty for now.

* Move from deprecated appmount API

The new one dropped a param we weren't using.

* Add missing mock causing test failures

* Don't re-export core types from our plugin

Import them from core where we need them, instead

* Move Actions UI registry outside of mount

This is already imported, there's no benefit (and potential timing
issues) with doing this inside the mount.

* Add security's setup contract to our StartServices

This doesn't change what's used, only how we're typing it. The types are now a
little more truthful as:

* our StartPlugins don't include setup contracts
* our StartServices includes everything we use at Start time, including
the one setup plugin.

* Add order and icon back to the sidebar link

* Replace plugin class properties with constants

These are shared, and should be consistent.

* Enable our UI on NP

* Add missed plugin dependencies

We're not using their contracts, but we are importing code from them.

* Revert use of constant in translation

Can't do that, whoops

* i18n our feature catalogue entry

* Remove unnecessary array from single element

* Remove unused keys

These were the legacy translations used... well, I don't know where they
were used.

* Ignore circular dependencies in external plugins

* Normalize exclusions

* Add undeclared dependencies to kibana.json

We import our maps embeddable from maps, and we pass inspector to the
embeddable. I just missed these in my audit. This was causing errors in
the map embeddable.

* Await our call to setLayerList

This is an async call that we need to complete before we can render.

* Reduce siem plugin size

When we load our initial plugin (before our app is loaded), were were
implicitly importing all of kibana_react with this import. While a
global module prevents this from affecting our bundle size currently,
that could change in the future. Since we only need a reference to our
class, we just import that instead.
2020-04-27 17:59:21 -05:00
Tim Sullivan 54dc148226
[Reporting] Remove boilerplate needed to get thegetScreenshots function (#64269)
* expose reportingCore in ReportingSetup for apps

* improve tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-27 14:25:26 -07:00
Catherine Liu 4e714c2523
[Canvas] Fixes embed flyout (#64468) 2020-04-27 14:15:58 -07:00
Tim Sullivan 6b5a96557f
[Reporting/telemetry] Add 'statuses' object to usage to show status counts by jobType & appType (#63922)
* [Reporting] Additional status by app data for usage

* --wip-- [skip ci]

* clean up types

* add a prettier-ignore

* fix types

* --wip-- [skip ci]

* fix typo

* more tests

* Tweak the data model

* fix the comments and type keys to reflect the data model

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-27 11:49:51 -07:00
Steph Milovic 60cb9367a6
[SIEM] [Cases] Use configure refactor (#64309) 2020-04-27 12:01:22 -06:00
Joe Reuter a32d7b1344
Add editApp and editPath to embeddable (#64297) 2020-04-27 18:07:10 +02:00
Jen Huang 74bf87721f
[Ingest] Make all saved objects namespace agnostic, move to NP plugin (#64360)
* Move saved object type registration & mapping to NP plugin; normalize and prefix saved object type names

* Replace hardcoded saved object type names with constants

* Adjust output type name

* Review and import fixes

* Update tests, fixtures, and instructions
2020-04-24 14:33:38 -07:00
CJ Cenizal 18d1af24d4
Move Rollup out of legacy (#62891) 2020-04-24 14:27:35 -07:00
Justin Kambic e918c43535
[Uptime] Update TLS settings (#64111)
* Refactor settings form event handling and modify certs fields.

* Fix/improve broken types/unit/integration/api tests.

* Modify default expiration threshold.

* Rename test vars.

* Implement PR feedback.

* Refresh snapshots, fix broken tests/types.

* Remove unnecessary state spreading.

* Add type for settings field errors.

* Refresh test snapshots.

* Improve punctuation.
2020-04-24 12:53:28 -04:00
Gidi Meir Morris a012ddf9df
[alerting] removes usage of any throughout Alerting Services code (#64161)
This removes unneeded use of `any` throughout:
1. alerting
2. alerting_builtin
3. actions
4. task manager
5. event log

It also adds a linting rule that will prevent us from adding more `any` in the future unless an explicit exemption is made.
2020-04-24 17:04:36 +01:00
Corey Robertson 4051c94568
[CANVAS] Moves notify to a canvas service (#63268)
* Moves notify to a canvas service

* Typecheck fix
2020-04-24 10:53:27 -04:00
Corey Robertson dfddcdd903
[Canvas] Misc NP Stuff (#63703)
* Timelion function -> np

* embeddable renderer -> np i18n context

* ui_metric -> np

* Fix timelion issue

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-24 10:39:54 -04:00
Matthias Wilhelm 6d099d0a4f
Migrate graph_workspace saved object registration to Kibana platform (#64157)
* Migrate graph_workspace saved object registration to Kibana platform
* Remove legacy plugin 🎉
2020-04-24 14:55:43 +02:00
James Gowdy b3c7002799
[ML] Moving to kibana capabilities (#64057)
* [ML] Moving to kibana capabilities

* fixing types

* renaming privilges

* renaming privileges to capabilities

* renaming resolvers

* correcting admin capabilities

* fixing includes

* removing any types

* renaming type

* readding spaces

* adding capabilities switcher

* updating comment

* removing unnecessary failing tests

* adding error to log
2020-04-24 12:08:19 +01:00
Tiago Costa 34de1aeb8b
chore(NA): use core-js instead of babel-polyfill on canvas sha… (#63486)
* chore(NA): use core-js instead of babel-polyfill on canvas shareable runtime build

* chore(NA): include regenerator-runtime/runtime

* chore(NA): change import order between runtime and core js

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-23 17:42:34 -07:00
Tyler Smalley feed406c77
[eslint] no_restricted_paths config cleanup (#63741)
Major cleanup of the no_restricted_paths rule for imports of core.

For relative imports, we use eslint-module-utils/resolve which resolves
to the full filesystem path. So, to support relative and absolute
imports from the src alias we need to define both the directory and the
index including file extension.

This rule was handling both core imports, as well as imports from other
plugins. Imports from other plugins are being used much more liberally
allowed through the exceptions in tests. I choose to break these up,
removing this exception for tests for core imports.

Fixes:
Absolute imports of src/core/server/mocks were not allowed in src. This
was not an issue in x-pack due to the target excluding
!x-pack/**/*.test.* and !x-pack/test/**/*.

Non-top-level public and server imports were allowed from X-Pack tests
to the previously mentioned exclusion.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-04-23 15:59:01 -07:00
Aaron Caldwell 97c7127589
[Maps] Migrate Maps embeddables to NP (#63976)
* Migrate maps embeddables. Clean up legacy presence

* Fix type error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-23 16:30:32 -06:00
Cauê Marcondes bb89b6a48c
[APM] change span property name from child_ids to child.id (#64209) 2020-04-23 13:16:49 +02:00
Catherine Liu 1a0988f964
[Canvas] Top Menu (#59982)
* Redesigned workpad_header to top menu layout

* Added comments

* Fixed element spec

* Removed element preview images

* Removed tooltip from menus

* Removed extraneous JSX

* Fixed element fixtures

* Moved component strings

* top menu design tweaks

* Added filter debug element

* Fix file picker in asset manager

* Sort components strings object keys

* Removed ElementTypes component in favor of SavedElementsModal

* Updated stories

* Fixed custom elements functional tests

* Removed unused tag strings

* Fixed test fixtures

* Updated element_menu stories

* Updated view_menu stories

* TS for SavedElementsModal

* Updated types

* Fixed TS errors

* Fix i18n errors

* Renamed stories

* Fixed test file name

* Fixed stories

* Updated storyshots

* Reverted storybook webpack config change

* Fixed SavedElementsModal stories

* Updated comments

* Removed unnecessary ts-ignores

* Moved workpad_shortcuts back to /components

* Unskip custom elements functional test

* Reverted workpad_loader changes

* Added element_menu stories and mocks

* Fixed element i18n strings

* Updated storyshots

* Updated storyshot

Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-22 21:06:49 -07:00
Chris Roberson 23fbf7d67d
[Monitoring] Update docs based on config change (#63860)
* Update a bunch of docs

* PR feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-22 15:31:25 -04:00
Corey Robertson cd054285c8
[CANVAS] Pull UI Settings from Kibana Platform (#63397)
* Pull UI Settings from Kibana Platform

* Typecheck

* Fix type check

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-22 14:02:19 -04:00
Chris Roberson e708b415c9
[Monitoring] Use custom route to ensure global state is preserved (#63891)
* WIP

* PR  updates

* Fix testing

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-22 13:03:37 -04:00
Chris Roberson 8b6f6700b7
Ensure time picker is actually disabled (#63709)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-22 13:02:49 -04:00
Chandler Prall 126d187429
Upgrade to EUI v22.3.0 (#62963)
* snapshot updates

* bump to eui 22.3.0

* snapshots

* Fix css selector in test to match EUI internal DOM change

* Updated snapshots

* Insert react-beautiful-dnd@10 into top-level kibana to force siem's node_modules to hold its correct version

* More snapshot updates, resolved a typescript issue

* Move react-beautiful-dnd dependency around to make things happy again

* Use SearchFilterConfig from the top-level eui export

* Swallow 'ResizeObserver error does not have an err object' error in canvas

* Swallow ResizeObserver error cross-browser
2020-04-22 11:01:49 -06:00
Casper Hübertz e22398942a
[APM] Add new Service map external icons (#63844)
* [APM] Add new external icons for Service map

* [APM] Add icons to icons.ts
2020-04-22 17:01:29 +02:00
CJ Cenizal 91f7911d15
Move CCR out of legacy (#62890)
* Convert common/services and server/lib to TypeScript. Update Jest tests.
  - Remove deserializeAutoFollowPattern behavior that returned an empty object if the pattern was undefined.
* Localize mocks with the component integration tests.
* Update API unit tests to use NP mocks.
  - Break up test files.
  - Use inline mocked ES response instead of fixture files.
  - Move remaining fixture files into client integration tests directory.
* Make API route validation more strict.
* Publish isUiDisabled as part of Remote Clusters contract.
* Default trackUiMetric service to be a no-op.
* Remove security dependency.
  - Fix license check so that CCR won't render if the license is invalid.
  - Fix server security check to be more precise by checking if ES has security disabled.
* Render timestamp for autofollow errors.
2020-04-22 07:15:25 -07:00
MadameSheema e17755ecef
[SIEM] Adds 'Create new case' Cypress test (#63971)
* adds timeline data

* adds 'cases' spec

* adds test

* implements test

* refactor

* prepares test to be executed with the new platform

* finishes refactor

* fixes typo

* renames case interface
2020-04-22 15:04:00 +02:00
Cauê Marcondes aecd00f3d8
[APM]fixing custom link unit tests (#64045) 2020-04-22 07:34:40 +02:00
Nathan Reese ea4eb3385b
[Maps] Map settings: min and max zoom (#63714)
* [Maps] Map settings: min and max zoom

* eslint

* header and footer

* zoom range UI

* save session state in mapStateJSON

* disable button when flyout is open

* tslint

* update layer_control jest test

* tslint

* move settings button to top map chrome

* move map_settings_panel to NP

* remove merge conflict artifact

* fix import for NP migration

* remove unused CSS class

* fix path from NP move

* review feedback

* load map settings in embeddable
2020-04-21 16:27:00 -06:00
Ryland Herrick 592a0ff224
[SIEM] New Platform Saved Objects Registration (#64029)
* WIP: Register saved objects types in NP

This works, but responsibilities are spread around. Refactor incoming.

* Moves new SO definitions into corresponding folders

This way our top-level file still acts as the index, but these are
more/less unconnected if/when we split these out into separate
applications.

* Replace raw SO updates with our ruleStatusSavedObjectsClient

This mainly consolidates the SO type name and the attributes type to a single
file so that we don't have to import both any time we want to work with
RuleStatus SavedObjects.
2020-04-21 15:33:27 -05:00
Ryland Herrick 5a55c9a8f6
Register uiSettings on New Platform (#64015)
This now requires us to define a schema for each setting, which is a
little redundant given that we also have to type the useUiSetting calls;
this might be an issue between kibana-react and new UiSettings changes.
2020-04-21 12:47:25 -05:00
Steph Milovic 0c14424321
[SIEM] [Cases] Tags suggestions (#63878) 2020-04-21 10:55:42 -06:00
Yara Tercero dbb7923e9b
[SIEM][Detections Engine] - minor updates to monitoring table with unit tests (#64020)
### Summary

Minor updates to the All Rules monitoring table. Includes front end and backend changes:

- Displays dashes in the monitoring table when no values are present
- Displays `lastLookBackDate` only if the rule indexes events into the signals index, otherwise `lastLookBackDate` is set to null
2020-04-21 10:42:43 -04:00
Josh Dover f43d555f14
Migrate logstash frontend to KP (#63417) 2020-04-21 07:39:59 -06:00
Christos Nasikas 698717173d
[SIEM][CASE] Server common constants (#63952) 2020-04-21 15:09:42 +03:00
Aaron Caldwell 2af0c6d47e
[Maps] Migrate remaining maps client files to NP (except routi… (#63859)
* Move actions over

* Move connected components over

* Move components over

* Move selectors over

* Move embeddables over. Set up legacy presence to keep legacy maps embeddables working

* Move angular and services over. Some additional top-level files

* Some file moves. Move styles over to NP

* Handle feature catalogue entry in NP. Add plugin deps to kibana.json

* Move vis registration to NP

* Clean up linting comments. Add linting comments to route controller. Move common to NP

* Add back in i18n context for embeddable

* Fix jest test paths. Fix TS lint errors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-20 16:58:33 -06:00
Joel Griffith 86922e80a8
[Reporting] Config flag to escape formula CSV values (#63645)
* Adds a new xpack.reporting.csv.escapeFormulaValues boolean to auto-escape potentially bad cells

* Treat csvs with formulas differently than those that aren't escaped

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-20 11:23:16 -07:00
Yara Tercero 7db7597a1d
[SIEM][Detection Engine] - Move All Rules tabs to match other tabs UI (#63920)
### Summary 

Restructure All Rules table tabs to be outside of the table, similar to other tabbed tables in UI.
2020-04-20 12:04:22 -04:00
Shahzad 7c7fbc70cd
[Uptime] Refactor folder structure (#63442)
* update structure

* update connected structure

* update connected structure

* update code structure

* update types

* update imports

* update folder

* update trans

* fixed snapshot

* updated code

* refacto monitor list container

* update types

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-20 11:12:17 +02:00
Shahzad c59320c7dd
[Uptime] Refresh index and also show more info to user regardi… (#62606)
* Refresh index and also show more info to user

* updated type

* updated type

* updated test

* updated formatting

* update text

* updated types

* updated translation

* update

* fixed types

* updated code

* fixed types

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-18 13:41:11 +02:00
Justin Kambic 4242fe5400
[Uptime] Add cert API request and runtime type checking (#63062)
* Add cert API request and runtime type checking.

* Collapse on sha256 field instead of common_name.

* Add basic wildcard search capabilities.

* Support searching.

* Update fields and queries, remove server response validation.

* Update API to utilize x509 fields.

* Add new fields to certs API request, provide defaults.

* Add api test for cert api.

* Add unload command to certs test.

* Extract API params interface to io-ts type.

* Rename a functional test.

* Fix broken type.
2020-04-17 17:58:27 -04:00
Wylie Conlon 561c0f9fed
[Lens] Allow table to scroll horizontally (#63805)
* [Lens] Allow table to scroll horizontally

* Fixing scrolling pt. 2

Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-04-17 17:03:33 -04:00
Aaron Caldwell f179ec4069
Migrate legacy maps licensing (x-pack/tilemap) to NP (#63539)
* Move logic to NP and add basic plugin structure

* Remove unused server-side licensing logic and old index

* Set license in maps_legacy via new plugin

* Change add to set for service settings queryParams function

* Fix accidentally changed emsClient method call

* Require at least a basic license

* Type updates

* Remove unneeded legacy license test

* Remove unused headers in test
2020-04-17 13:56:20 -06:00
Ryland Herrick 40f82229f0
[SIEM] Server cutover to New Platform (#63430)
* Move server code into NP folder

* NP config is not yet used
* Relative imports are somewhat broken

* Move common folder into NP

* Move cypress folder into NP

* Move scripts folder into NP

* Move misc. config into NP folder

A few of these were moved into the cypress folder as they're
cypress-specific.

I tried to update all the relative paths but some are likely broken. I'm
not going to know until other stuff is fixed, though.

* Move value for siem index pattern into common/constants

The other default values live in there, this is no different.

* Update paths following file move

If this was referencing the full project, it now references both paths
(legacy for UI, and NP for server).

* Fix typescript errors related to module resolution

These are mostly updating imports to the common/ folder on the UI side
(since things changed relative to those files).

* Replace Legacy Config with NP Config

* Updates plugin to use NP config
  * defines new config previously coming from savedObjects config
* cleans up legacy types

 Conflicts:
	x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts
	x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts
	x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts
	x-pack/plugins/siem/server/plugin.ts
	x-pack/plugins/siem/server/routes/index.ts
	x-pack/plugins/siem/server/types.ts

* Remove local SIEM tsconfig

This was originally added to address an issue with tsserver, but that
issue is no longer relevant. The presence of this file confuses
typescript into thinking that siem is a separate TS project.

* Update kibana.json to declare our dependencies

These are not necessarily correct in terms of what's required/optional,
but this is what's declared in our types.

* Remove legacy plugin instantiation

* Removes legacy instantiation of server plugin, which is now handled by
NP
* Loosens legacy config spec so we no longer have to duplicate config
types

* Update tests with NP config

These were written against the old Hapi config function; now, we just
have a POJO.

* Update es_archiver helpers' paths

I'm not quite sure if these are working yet, but they're no longer
throwing errors.

* Ignore restricted path on script

This was cribbed from infra, who has made a similar change.

* Ignore restricted path on temporary savedObject mappings import

This will be changed subsequently when we switch to the NP form of
savedObject type registration.

* Add symlink to lockfile

* Fix paths on circular deps script

* Add separate config for Rule and Timeline saved objects

We had previously used the savedObjects' config, but those are not
currently exposed to us on New Platform. For now, we're going to split
this into two sets of values for the SOs we deal with
importing/exporting within the SIEM app, with the same defaults as
savedObjects.

* Fixing relative paths within cypress

These are strings that wouldn't be caught by typescript.
2020-04-17 12:31:54 -05:00
Cauê Marcondes 675c5898ca
[APM] Reparenting spans to support inferred spans (#63695)
* reparening spans

* adding unit test

* adding unit test
2020-04-17 18:19:19 +02:00
Joe Reuter 550d6af2cb
Migrate rollup client side code (#63227) 2020-04-17 18:07:27 +02:00
Justin Kambic 7efe7e88d3
[Uptime] Remove monitor states graphql (#62853)
* WIP replacing GQL with redux/rest.

* Finish implementing migration.

* Introduce new connected component for ping list.

* Replace GraphQL type with io-ts.

* Update some broken tests.

* Add test for new helper function.

* Write test snapshots.

* Migrate api tests from graphql to rest.

* Update fixtures that rely on pings.

* Move ping types to runtime_types folder with rest of io-ts files.

* Update Ping type location and imports, type checking.

* Remove reliance on fixtures for ping functional API tests.

* Fix broken unit tests.

* Fix broken types.

* Remove local state storage from parent components.

* Add functional test to cover Ping List functionality.

* Fix monitor page functional test that was broken by merge conflicts.

* Fix broken tests.

* Fix broken API test.

* Replace a test with a describe block that will pre-navigate all tests.

* Delete unused reducer keys.

* Re-introduce loading to ping list reducer.

* Inroduce code that will cause PingList to re-fetch when refresh button is pressed.

* Update expanded rows to support multiple concurrent expanded rows.

* Modify pingList reducer to have singular optional error field.

* Delete unnecessary helper code.

* Delete unused interface.

* Add runtime_type to parse getPings params, fix pagination index.

* Add dedicated monitor type to runtime_types.

* Fix broken tests.

* Fix broken tests.

* Rename '@timestamp' property to 'timestamp' on Ping type.

* Fix broken type and key pings list table on document ID instead of timestamp.

* Fix broken unit tests.

* Fix broken tests and types.

* Fix broken functional test.

* Add REST endpoint for monitor states.

* Add REST route to constants file.

* Introduce io-ts typing for monitor states.

* Remove remaining GraphQL types.

* Update monitor states types to use io-ts types.

* Add state management for monitor states.

* Introduce connected monitor list component.

* Fixup runtime types for monitor states.

* Remove all remaining references to apollo graphql.

* Update URL generator function tests to use inline snapshots instead of snapshot files.

* Fix missing imports and small type issues.

* Prefer inline snapshot to object literal comparison.

* Add type check and console log to API response.

* Update README to remove graphql references.

* Fix type error.

* Make monitor list refresh when global refresh button is pressed.

* Fix broken types.

* Rename `@timestamp` field to `timestamp`.

* Change spelling of var.

* Add timestamp map for `@timestamp` field in monitor states fetcher.

* Remove need for `monito_states` fixture.

* Write test code that allows for deletion of the `monitor_states_id_filtered` fixture.

* Rewrite pagination tests to no longer rely on monitor states page fixtures.

* Skip test that is causing other functional tests to fail.

* Remove unused translations.

* Fix broken test snapshots.

* Fix stale error reporting errors.

* Remove runtime validation from REST handler.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-17 11:50:20 -04:00
CJ Cenizal 7e7884e01f
Add body validation to update follower index API endpoint. (#63653) 2020-04-17 07:37:50 -07:00
Yara Tercero 954dda1662
[SIEM][Detections] - Update KQL/Lucene search to include lists exceptions (#63264)
[SIEM][Detections] - Update KQL/Lucene search to include lists exceptions (#63264)

### Summary 

This PR adds logic to include the lists values in search so we can now filter off of lists.

- does work with KQL search
- does work with Lucene search
- does NOT yet filter off of large lists (will be separate PR)
- does NOT yet work on ML search (will be separate PR)
2020-04-17 10:04:48 -04:00
Andrew Goldstein c2293cb11d
[SIEM] Threat hunting enhancements: Filter for/out value, Show top field, Copy to Clipboard, Draggable chart legends (#61207)
## [SIEM] Threat hunting enhancements: Filter for/out value, Show top field, Copy to Clipboard, Draggable chart legends

Enhancements to the threat hunting experience

![show-top-field](https://user-images.githubusercontent.com/4459398/79180753-f9bb7f80-7dc7-11ea-9ae2-d4e4fc79208c.gif)

### New draggable context menu

A new context menu with the following items has been added to all draggables:

- Filter for value
- Filter out value
- Show top _field name_
- Copy to Clipboard

as shown in the following animated gif:

![new-context-menu](https://user-images.githubusercontent.com/4459398/79173935-4dbd6880-7db6-11ea-9253-7746481e1b17.gif)

### Filter for value

The _Filter for value_ context menu action adds the draggable to the global filter bar, which is applicable to all pages in the SIEM app, per the following animated gif:

![filter-in-value](https://user-images.githubusercontent.com/4459398/79176624-f91deb80-7dbd-11ea-9b01-799145d776c8.gif)

### Filter out value

The _Filter out value_ context menu action adds the draggable to the global filter bar as a _negated_ (`NOT`) filter, per the following animated gif:

![filter-out-value](https://user-images.githubusercontent.com/4459398/79178474-9f6bf000-7dc2-11ea-9423-512ad7f89a18.gif)

### Show top _field_

The _Show top field_ context menu action displays an interactive Top 10 histogram, per the following animated gif: 

![show-top-field](https://user-images.githubusercontent.com/4459398/79180753-f9bb7f80-7dc7-11ea-9ae2-d4e4fc79208c.gif)

- The contents of the histogram are filtered by the global KQL bar / filters and current date range
- Brushing over the bars in the histogram updates the global date range / picker
- Select _Events_ or _Signals_
- The _Show top field_ action is also available in the Fields Browser, per the following animated gif:

![in-fields-browser](https://user-images.githubusercontent.com/4459398/79179548-1a360a80-7dc5-11ea-9ad7-cdd7fef0cc64.gif)

### Copy to Clipboard

The _Copy to clipboard_ context menu action copies the draggable field and value to the clipboard in KQL format (e.g. `process.name: "nice"`).

Per the following animated gifs, it's now possible to copy _any_ draggable to the clipboard, and paste it in KQL format, which addresses [this feature request from a user](https://github.com/elastic/kibana/issues/59472):

![copy-to-clipboard](https://user-images.githubusercontent.com/4459398/79178893-a7785f80-7dc3-11ea-868a-5d7bc2824912.gif)

![pasted-value](https://user-images.githubusercontent.com/4459398/79179126-2c637900-7dc4-11ea-92a7-86c7d6377688.gif)

### Draggable chart legends

You may now pivot from chart legends by dragging and dropping them to a timeline, or by selecting the Filter for / out context menu action, per the following animated gif:

![draggable-legend](https://user-images.githubusercontent.com/4459398/79179769-9deff700-7dc5-11ea-9153-b472914f2dfe.gif)

#### Desk testing

Desk tested in:

- Chrome `81.0.4044.92`
- Firefox `75.0`
- Safari `13.1`
2020-04-16 22:17:28 -06:00
Nathan Reese 420ccffcd6
[Maps] fix term join agg key collision (#63324)
* [Maps] fix term join agg key collision

* fix tslint and jest errors

* fix join functional test

* revert LayerDescriptor union and cast to VectorLayerDescriptor instead

* move getJoinKey out of constants and into its own file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-16 19:22:02 -06:00
Nick Partridge 4e8ff57355
update elastic charts to 18.3.0 (#63732) 2020-04-16 17:00:36 -05:00
Dario Gieselaar 5413cee294
[APM] Encode spaces when creating ML job (#63683)
Closes #62370. Per 95a7eed9aa/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlStrings.java (L20-L26), spaces are not supported in job and group ids.
2020-04-16 22:50:16 +02:00
Thomas Neirynck ad41eea211
[Maps] Add 3rd party vector tile support (#62084)
Adds support for adding an external vector tile service to Maps. This is experimental functionality. To enable, add `xpack.maps.enableVectorTiles: true` to the `kibana.yml`configuration file.
2020-04-16 16:26:13 -04:00
Shahzad a9399c3d91
[Uptime] Certificate expiration threshold settings (#63682)
* update settings

* added cert form

* update settings

* update types

* update test

* updated tests

* updated snapshots
2020-04-16 21:13:35 +02:00
Alexey Antonov 871f7209f9
[Timeseries] remove unused configuration properties (#62543)
* [Timeseries] remove unused configuration properties

* Fix PR comments

* update id of vis_type_timeseries plugin

* metrics -> vis_type_timeseries

* fix wrong plugin id

* update requiredPliugins for infra/kibana.json

* change id

* update plugin id in infra folder

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-16 19:28:04 +03:00
Devin W. Hurley ebcb50227a
[SIEM] [Detection Engine] Changes find_statuses route HTTP met… (#63508)
* changes http method for find_statuses route from GET to POST

* fix test string formatting

* update sample shell script for find statuses route

* adds e2e test for find statuses
2020-04-16 10:52:43 -04:00
Frank Hassanabad 721e4fae1b
[SIEM][Detection Engine] Adds an error aggregator by error reason and a way to filter them
## Summary

Changes the error handling for when responses are returning with errors from the backend. We were aggregating on error status codes, but this will aggregate on the error reason per rule run and report those instead.

* Adds a utility function
* Adds unit tests for the utility function
* Adds TypeScript Types for the utility function
* Adds sample helpers for the mocks for testing 

### 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-04-16 08:04:23 -06:00
Aaron Caldwell 11b6f7fc7d
[Maps] Update remaining client dependencies to NP (#63297)
* Routes dependencies updated (except for routes itself)

* Replace all chrome deps except map controller

* Replace npSetup and npStart with normal plugin init logic. Some clean up

* Bind kibana services in map controller

* Use kibana services in map controller

* Convert remaining deps that aren't critical to legacy operation

* Remove last angular bindings to gis map saved object loader

* Consolidate kibana services in NP

* Some fixes. Remove console logs

* Fix type errors

* Fix jest test path refs

* Accomodate legacy 'hacks' and init services for vis type alias

* Review feedback. Remove/update unused declarations

* getFileUpload actually just needed Component tacked on the end

* Handle visibility of toolbars for full screen mode using new core chrome. Should fix test

* Import source types in getInitialLayers to ensure registry
2020-04-16 05:49:53 -06:00
Shahzad a3f4acfc27
[Uptime] Update duration chart query filters (#63620)
* updated duration query

* updated snapshot

* update fixtures

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-16 13:48:34 +02:00
Angela Chuang 7b74aa9d69
[SIEM] move away from Joi for importing/exporting timeline (#62125)
* move away from joi

* update schema for filterQuery

* fix types

* update schemas

* remove boom

* remove redundant params

* reuse utils from case

* update schemas for query params and body

* fix types

* update validation schema

* fix unit test

* update description for test cases

* remove import from case

* lifting common libs

* fix dependency

* lifting validation builder function

* add unit test

* fix for code review

* reve comments

* rename common utils

* fix types
2020-04-16 10:17:15 +01:00
Gidi Meir Morris bb9f8845ae
[alerting] Adds an alertServices mock and uses it in siem, monitoring and uptime (#63489)
Work on #61313 has revealed that we don't have amock for AlertServices, which creates coupling between us and any solution depending on us, which makes it harder to make changes in our own code.

This PR adds mocks and uses them in SIEM, Monitoring and Uptime, so that we can make future changes without having to change outside solutions.
2020-04-16 08:45:38 +01:00
Oliver Gupte 3ade2d358d
Closes #63109 for Service Map by resetting edges styles for the selected node (#63655) 2020-04-16 00:42:25 -07:00
Steph Milovic 31ed266d73
[SIEM] [Cases] Insert timeline and reporters/tags in table bug fixes (#63642) 2020-04-16 00:53:22 -06:00
Tim Sullivan 3d41ca6d27
[Reporting] Make usable default element positions (#63191)
* [Reporting] Make usable default element posistions

* revert unrelated changes

* fix ts

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-15 17:00:56 -07:00
Tim Sullivan f4c81b440d
[Reporting] Switch Serverside Config Wrapper to NP (#62500)
* New config

* fix translations json

* add csv.useByteOrderMarkEncoding to schema

* imports cleanup

* restore "get default chromium sandbox disabled" functionality

* integrate getDefaultChromiumSandboxDisabled

* fix tests

* --wip-- [skip ci]

* add more schema tests

* diff prettiness

* trash legacy files that moved to NP

* create_config tests

* Hoist create_config

* better disableSandbox tests

* fix ts

* fix export

* fix bad code

* make comments better

* fix i18n

* comment

* automatically setting... logs

* replace log_configuration

* fix lint

* This is f2

* improve startup log about sandbox info

* update docs with log reference

* revert log removal

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-15 14:52:32 -07:00
Tim Sullivan 23e3f1aab5
[Reporting] Add "warning" status as an alternate type of completed job (#63498)
* [Reporting] Add "warning" as a status

* test

* fix warning status handling

* Simplify logic

* fix syntax

* more different statuses

* fix warning

* feedbacks
2020-04-15 14:05:19 -07:00
Tim Roes 99332b8a6e
Fix CODEOWNERS and sass lint paths (#63552) 2020-04-15 17:52:21 +02:00
Corey Robertson 3a91e713aa
Fixes Keyboard Shortcuts help extension (#63583) 2020-04-15 11:13:28 -04:00
Oliver Gupte d1d0a44d5d
Closes #63113 by limiting service maps to only draw certain shapes in IE 11 without icons (#63558) 2020-04-15 06:59:47 -07:00
patrykkopycinski 5deb74e6c4
[SIEM][Detection Engine] Increase UI unit tests coverage (#62230) 2020-04-15 14:34:29 +02:00
Tim Roes ebbc062689
Move Lens frontend to Kibana Platform (#62965)
* Move Lens frontend to Kibana platform

* Fix line breaks

* Fix jest tests

* Fix remaining test

* Remove old Lens plugin entry

* Fix i18n prefix

* Add config schema

* Address review
2020-04-15 12:22:37 +02:00
Wylie Conlon 7cd746bc2f
[Lens] Fix missing formatting bug in "break down by" (#63288)
* [Lens] Fix missing formatting bug in "break down by"

* Stop showing UUIDs, make logic more explicit

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-14 17:20:18 -04:00
Steph Milovic f9e8c1bfff
[SIEM] [Cases] Removed double pasted line (#63507) 2020-04-14 14:11:50 -06:00
Steph Milovic d275d7f4df
[SIEM] [Cases] Case container unit tests (#63376) 2020-04-14 12:25:54 -06:00
Mikhail Shustov d015c24509
[NP] Migrate logstash server side code to NP (#63135)
* convert api_integration test into TS

* create logstash NP plugin and move models

* move common/constants to NP

* type fetch all from scroll

* move route declaration to NP

* add licence checker wrapper

* register logstash route handlers in NP

* track logstash NP i18n

* address shaunak comment

* fix validation

* udpdate security tests since for new mock defaults

* address Pierres comments

* rename upgrade file route
2020-04-14 17:45:40 +02:00
Wylie Conlon 48d528ff2e
[Lens] Fix bug where suggestions didn't use filters (#63293)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-14 10:59:01 -04:00
Justin Kambic e6095fcd03
[Uptime] Remove pings graphql (#59392)
* WIP replacing GQL with redux/rest.

* Finish implementing migration.

* Introduce new connected component for ping list.

* Replace GraphQL type with io-ts.

* Update some broken tests.

* Add test for new helper function.

* Write test snapshots.

* Migrate api tests from graphql to rest.

* Update fixtures that rely on pings.

* Move ping types to runtime_types folder with rest of io-ts files.

* Update Ping type location and imports, type checking.

* Remove reliance on fixtures for ping functional API tests.

* Fix broken unit tests.

* Fix broken types.

* Remove local state storage from parent components.

* Add functional test to cover Ping List functionality.

* Fix monitor page functional test that was broken by merge conflicts.

* Fix broken tests.

* Fix broken API test.

* Replace a test with a describe block that will pre-navigate all tests.

* Delete unused reducer keys.

* Re-introduce loading to ping list reducer.

* Inroduce code that will cause PingList to re-fetch when refresh button is pressed.

* Update expanded rows to support multiple concurrent expanded rows.

* Modify pingList reducer to have singular optional error field.

* Delete unnecessary helper code.

* Delete unused interface.

* Add runtime_type to parse getPings params, fix pagination index.

* Add dedicated monitor type to runtime_types.

* Fix broken tests.

* Fix broken tests.

* Rename '@timestamp' property to 'timestamp' on Ping type.

* Fix broken type and key pings list table on document ID instead of timestamp.

* Fix broken unit tests.

* Fix broken tests and types.

* Fix broken functional test.
2020-04-14 08:35:31 -04:00
Gil Raphaelli 5bc539c6db
update in-app links to metricbeat configuration docs (#63295) 2020-04-13 22:06:09 -04:00
The SpaceCake Project b54388746d
investigation notes field (documentation / metadata) (#63386)
* notes field

added text to the "investigation notes" field in md which the field supports.

* Revert "notes field"

This reverts commit dae6ffc683.

* Revert "Revert "notes field""

This reverts commit f9de4bfc92.

* Update linux_anomalous_network_activity.json

* text change

change to "Signals from this rule indicate"
2020-04-13 18:42:10 -04:00
Nathan Reese 3623875175
[Maps] fix bug where toggling Scaling type does not re-fetch data (#63326)
* [Maps] fix bug where toggling Scaling type does not re-fetch data

* reset to empty array instead of deleting

* move setting of layer type to action creator instead of side effect of UPDATE_SOURCE_PROP

* review feedback
2020-04-13 15:53:07 -06:00
Aaron Caldwell 6f46e6b827
Migrate legacy maps service to NP & update refs (#60942)
* Get legacy maps into basic NP plugin form. Swap out legacy services for NP

* Pull service settings from injected vars. Return new instance of service settings from setup

* Use NP service settings in vega maps. Clean up legacy shim

* Use NP maps service in region maps. Clean up shim. Add exports to NP service

* Pull zoom precision out to separate module since it's dependent on config

* Update paths to point to NP resources

* More path updates, clean up, use IServiceSettings

* Remove dependency on legacy service settings. Add tile_map dependency ng-sanitize

* More path cleanup. Use zoomPrecision provided through plugin inteface

* Move getPrecision into contract-provided function since it depends on config

* Move tests to new service location, remove vis dir

* Update test paths. Move origin const declaration into public

* Clean up, fixes

* Fix type errors. General cleaning

* Inject toast service into map when needed

* Fix typo in regionmap config

* i18n fixes

* Update jest test path

* Fix karma tests

* i18n fixes

* Type updates. Add mapsLegacy to np karma mock

* Remove html sanitizer

* Fix vega test that depends on serviceSettings

* Revise xpack license handling to use NP serviceSettings. Remove angular bindings

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 14:32:32 -06:00
Corey Robertson 25cedbe60c
[Canvas] Migrate saved object mappings and migrations to Kibana Platform (#58891)
* Move saved object mappings and migratins to kibana platform

* Remove ts-ignore

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 16:26:00 -04:00
Thomas Neirynck a6ecd4c278
[Maps] Add SOURCE_TYPES enumeration (#62975) 2020-04-13 15:33:43 -04:00
Nathan Reese 301b795db6
[Maps] update geospatial filters to use geo_shape query for geo_point fields (#62966)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 13:30:18 -06:00
Corey Robertson e27526fd92
Move away from npStart for embeddables in canvas (#62680)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 15:29:24 -04:00
Corey Robertson 19fcc6111a
Use MapInput type from Maps plugin (#61539) 2020-04-13 14:21:02 -04:00
Maggie Ghamry 1084b1c7b9
Update to pagination for workpad and templates (#62050)
Added logic to hide pagination if no Canvas workpads exists, and disable the previous/next arrows if there is only one page, for both workapds and templates
2020-04-13 13:41:12 -04:00