Commit graph

228 commits

Author SHA1 Message Date
Mikhail Shustov
8d654bfbb0
Make SameSite cookie's attribute configurable (#68108) (#68989)
* support 'SameSite: None' in http service

* add tests

* allow to configure SameSite attribute for security cookie

* update docs

* fix test suite name

* remove false from samesite options

* document xpack.security.sameSiteCookies

* address comments

* address comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/security/server/config.ts
2020-06-12 12:18:22 +02:00
Josh Dover
4a2a616dd7
Fix running Kibana Platform migrations in development (#61325) (#61360) 2020-03-25 17:37:33 -06:00
Pierre Gayvallet
6bc866a9b1
introduce StartServicesAccessor type for CoreSetup.getStartServices (#60748) (#61070)
* create StartServicesAccessor type

* update generated doc

* update usages to use new type

* add missing public annotation
2020-03-24 16:30:16 +01:00
Liza Katz
ffba422fe1
Add addInfo toast to core notifications service (#60574) (#60724)
* addInfo toast

* md files

* fis types

* Added options to toast methods

* Export ToastOptions

* Export ToastOptions

* added test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 14:50:00 +02:00
CJ Cenizal
68eafd6715
Publish getIsNavDrawerLocked$ method on core chrome service. (#60191) (#60593)
* Remove isCollapsed, getIsCollapsed, and global_nav_state.
2020-03-18 21:59:01 -07:00
Rudolf Meijering
aca82ec668
Re-backport and re-generate typescript docs (#60507) 2020-03-18 23:14:23 +01:00
Mikhail Shustov
80b58a589d
Add UiSettings validation & Kibana default route redirection (#59694) (#60257)
* add schema to ui settings params

* add validation for defaults and overrides

* validate in ui settings client

* ui settings routes validation

* clean up tests

* use schema for defaultRoutes

* move URL redirection to NP

* fix spaces test

* update docs

* update kbn pm

* fix karma test

* fix tests

* address comments

* get rid of getDEfaultRoute

* regen docs

* fix tests

* fix enter-spaces test

* validate on relative url format

* update i18n

* fix enter-spoace test

* move relative url validation to utils

* add CoreApp containing application logic

* extract public uiSettings params in a separate type

* make schema required

* update docs
2020-03-16 18:09:51 +01:00
Rudolf Meijering
66d5b223b5
Expose Elasticsearch from start and deprecate from setup (#59886) (#60163)
* Expose Elasticsearch from start and deprecate from setup

* Expose client under legacy namespace, add deprecated note

* Update migration guide

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 12:33:37 +01:00
Rudolf Meijering
d0ab21145c
Make context.core required argument to context providers (#59996) (#60061)
* Make context.core required argument to context providers

* Refactor plugins: context.core isn't optional anymore

* Update docs
2020-03-12 22:44:00 +01:00
Pierre Gayvallet
4a08acbb4a
Add SavedObject management section registration in core (#59291) (#59731)
* add management section to SavedObjectsType

* adapt import/export routes to get types accessor

* add documentation

* update generated doc

* update migration guide

* use request context to access exportable types

* update generated doc

* adapt SavedObjectsManagement to use the registry

* stop magical tricks about the config type, register it as any other so type.

* fix FTR assertions

* fix so_mixin tests

* register the `config` type from the uiSettings service

* nits and comments

* update generated doc

* remove true from dynamic property definition, use force-cast back for config type

* remove obsolete test comment
2020-03-10 12:57:34 +01:00
Mikhail Shustov
1582299967
Add an optional authentication mode for HTTP resources (#58589) (#59614)
* add authRequred: 'optional'

* expose auth status via request context

* update security plugin to use notHandled auth outcome

* capabilities service uses optional auth

* update tests

* attach security headers only to unauthorised response

* add isAuthenticated tests for 'optional' auth mode

* security plugin relies on http.auth.isAuthenticated to calc capabilities

* generate docs

* reword test suit names

* update tests

* update test checking isAuth on optional auth path

* address Oleg comments

* add test for auth: try

* fix

* pass isAuthenticted as boolean via context

* remove response header from notHandled

* update docs

* add redirected for auth interceptor

* security plugin uses t.redirected to be compat with auth: optional

* update docs

* require location header in the interface

* address comments #1

* declare isAuthenticated on KibanaRequest

* remove auth.isAuthenticated from scope

* update docs

* remove unnecessary comment

* do not fail on FakrRequest

* small improvements
2020-03-07 20:15:48 +01:00
Pierre Gayvallet
f6beb1e838
Expose metrics service to public API (#59294) (#59355)
* expose metrics service to public API

* update generated doc
2020-03-04 23:17:45 +01:00
Pierre Gayvallet
e1b8938f1f
Expose savedObject import / export utility methods (#58882) (#59295)
* add getImportExportObjectLimit to so setup

* expose static method for so import / export

* improve functions naming

* fix mocked reference
2020-03-04 14:50:25 +01:00
Mikhail Shustov
0fdb6e520a
Allow disabling xsrf protection per an endpoint (#58717) (#59151)
* add xsrfRequired flag to a route definition interface

* update tests

* deprecate server.xsrf.whitelist

It meant to be used for IdP endpoints only, which we are going to refactor to disable xsrf requirement per a specific endpoint.

* update docs

* do not fail on manual KibanaRequest creation

* address comments

* update tests

* address comments

* make xsrfRequired available only for destructive methods

* update docs

* another isSafeMethod usage
2020-03-03 17:47:12 +01:00
Josh Dover
b5eb0912a7
[7.x] Remove appBasePath from docs + add mock for AppMountPara… (#59097) 2020-03-03 07:57:17 -07:00
Pierre Gayvallet
321952f998
Add core metrics service (#58623) (#59122)
* create base service and collectors

* wire the service into server, add mock

* add collector tests

* add main collector test

* export metric types from server

* add service and server tests

* updates generated doc

* improve doc

* nits and comments

* add disconnected requests test
2020-03-03 14:52:16 +01:00
Pierre Gayvallet
30fca567f6
add dynamic property to type definition (#58852) (#58886) 2020-02-28 18:36:25 +01:00
Pierre Gayvallet
85fd92aa5c
block SO setup API calls after startup (#58718) (#58844) 2020-02-28 16:22:09 +01:00
Josh Dover
cbb96a7213
[7.x] Add ScopedHistory to AppMountParams (#56705) (#58639) 2020-02-26 14:57:03 -07:00
Pierre Gayvallet
b4009fcfd2
Allow savedObjects types registration from NP (#57430) (#58602)
* expose `registerType` API

* expose `getTypeRegistry` API

* change SavedObjectMigrationFn signature to add context

* fix exported types

* update generated doc

* update migration documentation

* fix legacy service test

* fix typings

* update service setup description

* add saved_objects server folder convention

* fix unit test

* documentation NITs

* add typeRegistry to SavedObjectClientWrapperOptions
2020-02-26 18:17:51 +01:00
Mikhail Shustov
fc6674ad1e
force savedObject API consumers to define SO type explicitly (#58022) (#58281)
* force savedObject consumers to define type explicitly

* address comments

* regen docs
2020-02-22 07:36:20 +01:00
Josh Dover
6a86b57242
Expose serverBasePath on client-side (#58070) (#58185)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-21 15:03:35 -07:00
Mikhail Shustov
325a4e3d77
Saved Objects testing (#56965) (#58202)
* Expose core/public savedObjectsServiceMock

* Test docs for Saved Objects unit and integration tests

* Review comments

* Update api types / docs

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
2020-02-21 12:01:42 +01:00
Mikhail Shustov
9b6b1402c2
Expose elasticsearch config schema (#57655) (#58199)
* expose elasticsearch config schema

* update docs

* mark export as alpha since it can be deleted

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-21 11:30:20 +01:00
Pierre Gayvallet
a43ce0aa65
[7.x] Use app id instead of pluginId to generate navlink from legacy apps (#57542) (#57670)
* Use app id instead of pluginId to generate navlink from legacy apps (#57542)

* properly use app id instead of pluginId to generate navlink

* extract convertToNavLink, add more tests

* use distinct mapping methods

* fix linkToLastSubUrl default value

* nits & doc

* update generated doc
2020-02-14 14:57:01 +01:00
Pierre Gayvallet
6f6cc356f9
Preserve the original error name instead of returning raw AbortError (#57550) (#57653)
* Preserve the original error name instead of returning raw AbortError

* use Error as the default error name
2020-02-14 11:50:16 +01:00
Pierre Gayvallet
07ceb70278
add absolute option to getUrlForApp (#57193) (#57543) 2020-02-13 12:28:03 +01:00
Ahmad Bamieh
d02fb7a928
[7.x] [Telemetry] Migrate public to NP (#56285) (#57534) 2020-02-13 11:41:31 +02:00
Pierre Gayvallet
181862c191
Restructure SavedObject types internal representation (#56378) (#56953)
* adapt types and tests to prepare for new NP api

* rename and export public types

* update generated doc

* first implementation of registerMappings

* adapt es archiver to convert legacy mappings

* update generated doc

* fix more tests

* add unit tests

* add legacy-compat unit test

* add documentation and examples

* Introduce SavedObjectTypeRegistry and SavedObjectType types

* add and fix tests

* expose createSerializer API and fix usages

* remove registerMappings API, add internal registerType

* revert changes to migration guide

* adapt ES-archiver migrator creation

* export serializer-related types

* update generated doc

* add and use convertTypesToLegacySchema

* remove / move to internal some mapping types

* fix forEach closure context

* add missing docs

* fix core path

* some nits

* fix so_mixin tests

* fix integration tests

* fix integration tests for real

* add documentation on serializer + restructure files and types

* nit

* add and use the ISavedObjectTypeRegistry interface

* Add documentation, deprecates migrationLogger#warning

* better typing for SavedObjectsRawDoc._source

* nits

* update generated doc

* remove exposition of SavedObjectsTypeMappingDefinitions, update doc

* creates so internal contracts mocks

* improve documentation
2020-02-06 12:10:31 +01:00
Greg Thompson
13476af53f
Upgrade EUI to v18.3.0 (#56228) (#56702)
* eui to 18.3.0

* ts interface update

* src snapshot updates

* x-pack snapshot updates

* icons in nav

* Homepage updates, nav drawer and tests

* feedback

* more feedback

* euiIconType for observability and security

* remove unused translations

Co-authored-by: dave.snider@gmail.com <dave.snider@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: dave.snider@gmail.com <dave.snider@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-04 09:15:53 -06:00
Nick Partridge
af577cc79c
Kibana property config migrations (#55937) (#56720)
* Move defaultAppId config param into kibanaLegacy
* Move disableWelcomeScreen config param into Home plugin
* Update api and docs with silent option for renameFromRoot
2020-02-04 08:04:04 -06:00
Pierre Gayvallet
e5a0477542
Add getServerInfo API to http setup contract (#56636) (#56721)
* add getServerInfo http setup api

* update generated doc
2020-02-04 09:27:14 +01:00
Joe Reuter
23757f3f6f
Add flag to opt out from sub url tracking (#55672) (#56169) 2020-01-28 18:24:08 +01:00
Josh Dover
5bbf2cfc59
Add isSystemRequest support to Kibana Platform (#53734) (#55927) 2020-01-28 07:33:11 -07:00
Mikhail Shustov
7a53f8bd29
Normalize EOL symbol in platform docs (#56021) (#56041)
* use api-extractor generate command with api-documenter config

* update docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 21:04:26 +01:00
Mikhail Shustov
e1bf90916a
[NP] Platform exposes API to get authenticated user data (#55327) (#55998)
* expose auth.get/isAuthenticated. move getAuthHeaders to internal type

* update mocks

* update docs

* update docs

* add integration test for auth
2020-01-27 15:19:31 +01:00
spalger
2ffbbcb1e8 Revert "[7.x] [csp] allow blob styles when running from source (#54991) (#55597)"
This reverts commit d198bb521b.
2020-01-23 23:33:02 -07:00
Matthew Kime
ced9f76723
Advanced Settings management => typescript (#54477) (#55716)
* advanced settings => typescript
2020-01-23 12:05:17 -06:00
Pierre Gayvallet
76ae43f407
Run SO migration after plugins setup phase. (#55012) (#55664)
* change setClientFactory api to setClientFactoryProvider

* cleanup and add test for service

* change the signatures of SO start/setup

* fix registerCoreContext by accessing stored start contract reference

* move migration inside `start`

* adapt and add service tests

* add doc and export new types

* adapt plugins code

* update generated doc

* better core access

* address some review comments

* remove parametrized type from SavedObjectsClientFactory, use KibanaRequest instead

* add logs when starting and ending so migration

* fix KibanaRequest imports

* NITs and review comments

* fix alerting FTR test

* review comments
2020-01-23 12:36:51 +01:00
Spencer
d198bb521b
[7.x] [csp] allow blob styles when running from source (#54991) (#55597)
* [csp] allow blob styles when running from source

* update kbn/pm dist

* add kibanaServer service to saml_api_integration suite

* use common naming

* attempt to use env.packageInfo instead of IS_KIBANA_DISTRIBUTABLE const

* remove mock, clone rules before modifying

* pass env where necessary

* update core api docs

* make env optional in HttpConfig

* add tests for CspConfig changes, base header on this.rules

* fix test snapshot

* make env optional in HttpConfig too

* remove CspConfig.DEFAULT and make env a required constructor arg

* update csp_usage_collector tests

* update core api docs

* fix test name

* rename headerChangedFromDefault back to rulesChangedFromDefault

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-22 17:20:52 -07:00
Mikhail Shustov
bd8e4a5c70
[NP] KibanaRequest provides request abortion event (#55061) (#55538)
* add aborted$ observable to KibanaRequest

* complete observable on request end

* update docs

* update test suit names

* always finish subscription

* address comments
2020-01-22 14:55:50 +01:00
Michail Yasonik
12f0c95cac
[7.x] Grouped Kibana nav (#53545) (#55496)
Adds concept of `category` to nav links, grouping them by this in the side nav
2020-01-21 22:45:10 -05:00
Mikhail Shustov
9272e43701
Expose fatalErrors API from the Start contract (#55300) (#55374)
* Expose FatalErrors from the Start contract.

This API is intended to be used for runtime as well.

* update docs

* update data plugin snapshot to fix tests

* address comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-21 14:23:05 +01:00
Pierre Gayvallet
8fba124795
Implements getStartServices on server-side (#55156) (#55290)
* implements server-side getStartServices

* add unit test

* add integration test

* update generated doc

* improve test
2020-01-20 13:13:56 +01:00
Mikhail Shustov
666eda060b
Enforce camelCase format for a plugin id (#53759) (#55270)
* add isCamelCase  function

* add a warning if id is not in camelCase

* document pluginId expected in camelCase

* regen docs

* add a test for logging

* update tests. warn can be called several times for different reasons

* pluginPath falls back to plugin id in snake_case

* update tests

* update docs

* add example with id & configPath different formats

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-18 15:44:32 +01:00
Pierre Gayvallet
6a30fca986
Deprecate chrome.navlinks.update and add documentation (#54893) (#55168)
* add migration example on application status updater

* update example with proper licensing plugin usage

* fix line width
2020-01-17 14:55:11 +01:00
Liza Katz
87822871c6
export new ui settings types and regen docs (#55020) (#55072)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-16 23:22:17 +02:00
Eli Perelman
dc1b1f504e
Generate legacy vars when rendering all applications (#54768) (#55079)
* Generate legacy vars when rendering all applications

* Move rendering functional tests and add user settings tests

* Make rendering integration tests more robust, get data from page

* Address review nits, fix CI failures

* Remove extraneous file

* Fix type error
2020-01-16 13:00:20 -06:00
Andrew Goldstein
fd2e7b1fb8
[SIEM] New Overview Page (#54783) (#54873)
## [SIEM] Overview Page "1.5"

A redesigned SIEM Overview page that includes `Recent timelines`, a `Security news` feed, visualizations, and rolled-up event counts

![overview-day](https://user-images.githubusercontent.com/4459398/72396016-90f53600-36f8-11ea-9b41-6d54d09de589.png)

![overview-night](https://user-images.githubusercontent.com/4459398/72394575-fb57a780-36f3-11ea-868e-8fcd2c5c4543.png)

### Overview enhancements
- Added the global Search bar and Date picker to the Overview page
- New `Recent timelines` widget affords quick access to favorite and recently modified timelines
- New `Security news` widget
- New Kibana advanced settings (toggle switch) for enabling or disabling the news widget and configuring the news URL
![news-settings](https://user-images.githubusercontent.com/4459398/72362776-fd4c4700-36b0-11ea-805b-3c7353f2c1cd.png)
- New `Events count by dataset` widget
- Updated the `Host Events` and `Network Events` widgets to integrate with the Search bar and date picker input
- Enhanced the `Host Events` and `Network Events` widgets to use an accordion paradigm that summarizes stats by source (e.g. `Auditbeat`, `Endgame`)
- Enhanced the `Host Events` and `Network Events` widgets to visualize relative percentages of events collected as progress bars
- New `Alerts count by category` widget
- New `Signals count by MITRE ATT&CK™ category` widget
- New `View events`, `View alerts`, and `View signals` navigation buttons for their respective visualizations


### FTUE enhancements
- FTUE "no data" view design refresh
![ftue](https://user-images.githubusercontent.com/4459398/72361771-43a0a680-36af-11ea-969f-5872ac4a01a1.png)
- When the FTUE "no data" page is displayed, hide all global navigation links (i.e. `Hosts`, `Network`, `Detection engine`), such that only `Overview` appears in the global nav
- App Help popover design refresh
![help](https://user-images.githubusercontent.com/4459398/72362132-d80b0900-36af-11ea-9b58-1fd3b923b7c8.png)
- Removed the `Beta` badge and `Security Information & Event Management with the Elastic Stack` from the Overview header

- Tested in Chrome `79.0.3945.117`, Firefox `72.0.1`, and Safari `13.0.4`

## Known issues

- The `siem:newsFeedUrl` advanced setting is defaulted to `https://feeds.elastic.co/kibana`
- The `Signals count by MITRE ATT&CK™ category` visualization does not display all categories
- The `Signals count by MITRE ATT&CK™ category` visualization may require a different index pattern
- `EuiButtonGroup` throwing a `Can't perform a React state update on an unmounted component` warning when switching from the Overview tab

https://github.com/elastic/siem-team/issues/484

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-14 22:49:27 -07:00
Liza Katz
1ccd5705b1
Support "Deprecated" label in advanced settings (#54539) (#54660)
* Support deprecating label in advanced settings
mark courier:batchSearches as deprecated

* jest update

* Add deprecation to UiSettingsParams type
Translate click aria label
Use docLinks service

* Rename doc link

* Remove url option from DeprecationSettings

* Simplify code

* Updated docs

* Revert "Updated docs"

This reverts commit c9512ced1f.

* snapshots

* docs
2020-01-14 01:14:03 +02:00