* Initial work
* Expand generic support to alert instances
* Convert index threshold to use generics
* Make fixture alert types use generics
* Make alert instance related types use unknown
* Fix typecheck failures
* Cleanup + add instance generic support to registry.get API
* Shallow clone
* Rename some TS variables
* Fix failing api integration tests
* Change code for easier review and keep more history
* Fix
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Fix issues displaying alerts
* Fix type issues
* More support for multiple alerts
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This PR adds _Role Based Access-Control_ to the Alerting framework & Actions feature using Kibana Feature Controls, addressing most of the Meta issue: https://github.com/elastic/kibana/issues/43994
This also closes https://github.com/elastic/kibana/issues/62438
This PR includes the following:
1. Adds `alerting` specific Security Actions (not to be confused with Alerting Actions) to the `security` plugin which allows us to assign alerting specific privileges to users of other plugins using the `features` plugin.
2. Removes the security wrapper from the savedObjectsClient in AlertsClient and instead plugs in the new AlertsAuthorization which performs the privilege checks on each api call made to the AlertsClient.
3. Adds privileges in each plugin that is already using the Alerting Framework which mirror (as closely as possible) the existing api-level tag-based privileges and plugs them into the AlertsClient.
4. Adds feature granted privileges arounds Actions (by relying on Saved Object privileges under the hood) and plugs them into the ActionsClient
5. Removes the legacy api-level tag-based privilege system from both the Alerts and Action HTTP APIs
* First draft, not quite working but a good start
* More working
* Support configuring throttle
* Get the other alerts working too
* More
* Separate into individual files
* Menu support as well as better integration in existing UIs
* Red borders!
* New overview style, and renamed alert
* more visual updates
* Update cpu usage and improve settings configuration in UI
* Convert cluster health and license expiration alert to use legacy data model
* Remove most of the custom UI and use the flyout
* Add the actual alerts
* Remove more code
* Fix formatting
* Fix up some errors
* Remove unnecessary code
* Updates
* add more links here
* Fix up linkage
* Added nodes changed alert
* Most of the version mismatch working
* Add kibana mismatch
* UI tweaks
* Add timestamp
* Support actions in the enable api
* Move this around
* Better support for changing legacy alerts
* Add missing files
* Update alerts
* Enable alerts whenever any page is visited in SM
* Tweaks
* Use more practical default
* Remove the buggy renderer and ensure setup mode can show all alerts
* Updates
* Remove unnecessary code
* Remove some dead code
* Cleanup
* Fix snapshot
* Fixes
* Fixes
* Fix test
* Add alerts to kibana and logstash listing pages
* Fix test
* Add disable/mute options
* Tweaks
* Fix linting
* Fix i18n
* Adding a couple tests
* Fix localization
* Use http
* Ensure we properly handle when an alert is resolved
* Fix tests
* Hide legacy alerts if not the right license
* Design tweaks
* Fix tests
* PR feedback
* Moar tests
* Fix i18n
* Ensure we have a control over the messaging
* Fix translations
* Tweaks
* More localization
* Copy changes
* Type
* chore(NA): upgrade oss to lodash4
chore(NA): migrate cli, cli_plugin, cli_keystore, dev, test_utils and apm src script to lodash4
chore(NA): missing file for cli plugin
chore(NA): add src core
chore(NA): es archiver and fixtures
chore(NA): try to fix functional test failure
chore(NA): migrate src/legacy entirely to lodash4 except src/legacy/core_plugins
chore(NA): move legacy core plugins to lodash4
chore(NA): upgrade optimize to lodash4
chore(NA): upgrade to lodash4 on advanced_settings, charts, console and dashboard
chore(NA): migrate to lodash4 on dev_tools, discover, embeddable, es_ui)shared, expressions, home plugins
chore(NA): upgrade data plugin to lodash4
chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4
chore(NA): missing data upgrades to lodash4
Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4"
This reverts commit 137055c5fed2fc52bb26547e0bc1ad2e3d4fe309.
Revert "Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4""
This reverts commit f7e73688782998513d9fb6d7e8f0765e9beb28d1.
Revert "chore(NA): missing data upgrades to lodash4"
This reverts commit 92b85bf947a89bfc70cc4052738a6b2128ffb076.
Revert "chore(NA): upgrade data plugin to lodash4"
This reverts commit 88fdb075ee1e26c4ac979b6681d8a2b002df74c6.
chore(NA): upgrade idx_pattern_mgt, input_control_vis, inspector, kbn_legacy, kbn_react, kbn_usage_collections, kbn_utils, management and maps_legacy to lodash4
chore(NA): map src plugin data to lodash3
chore(NA): missing lodash.clonedeep dep
chore(NA): change packages kbn-config-schema deps
chore(NA): update renovate config
chore(NA): upgrade vis_type plugins to lodash4
chore(NA): move vis_type_vislib to lodash3
chore(NA): update visualizations and visualize to lodash4
chore(NA): remove lodash 3 types from src and move test to lodash4
chore(NA): move home, usage_collection and management to lodash 3
Revert "chore(NA): move home, usage_collection and management to lodash 3"
This reverts commit f86e8585f02d21550746569af54215b076a79a3d.
chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3
chore(NA): update x-pack test to mock lodash4
Revert "chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3"
This reverts commit 2d10fe450533e1b36db21d99cfae3ce996a244e0.
* chore(NA): move x-pack and packages to lodash 4
* chore(NA): remove mention to lodash from main package.json
* chore(NA): remove helper alias for lodash4 and make it the default lodash
* chore(NA): fix last failing types in the repo
* chore(NA): fix public api
* chore(NA): fix types for agg_row.tsx
* chore(NA): fix increment of optimizer modules in the rollup plugin
* chore(NA): migrate `src/core/public/http/fetch.ts` (#5)
* omit undefined query props
* just remove merge usage
* fix types
* chore(NA): fixes for feedback from apm team
* chore(NA): recover old behaviour on apm LoadingIndeicatorContext.tsx
* chore(NA): fixes for feedback from watson
* Platform lodash4 tweaks (#6)
* chore(NA): fix types and behaviour on src/core/server/elasticsearch/errors.ts
* Canvas fixes for lodash upgrade
* [APM] Adds unit test for APM service maps transform (#7)
* Adds a snapshot unit test for getConnections and rearranges some code to make testing easier
* reverts `ArrayList` back to `String[]` in the painless script within `fetch_service_paths_from_trace_ids.ts`
* chore(NA): update yarn.lock
* chore(NA): remove any and use a real type for alerts task runner
Co-authored-by: Gidi Meir Morris <github@gidi.io>
* chore(NA): used named import for triggers_actions_ui file
* chore(NA): fix eslint
* chore(NA): fix types
* Delete most uptime lodash references.
* Simplify. Clean up types.
* [Uptime] Delete most uptime lodash references (#8)
* Delete most uptime lodash references.
* Simplify. Clean up types.
* chore(NA): add eslint rule to avoid using lodash3
* chore(NA): apply changes on feedback from es-ui team
* fix some types (#9)
* Clean up some expressions types.
* chore(NA): missing ts-expect-error statements
* Upgrade lodash 4 vislib (#11)
* replace lodash 3 with lodash 4 on vislib plugin
* Further changes
* further replacement of lodash3 to 4
* further work on upgrading to lodash 4
* final changes to update lodash
* chore(NA): upgrade data plugin to lodash4
chore(NA): upgrade data plugin public to lodash4
chore(NA): fix typecheck task
chore(NA): fix agg_config with hasIn
chore(NA): assign to assignIn and has to hasIn
chore(NA): upgrade data plugin server to lodash4
chore(NA): new signature for core api
fix(NA): match behaviour between lodash3 and lodash4 for set in search_source
* chore(NA): remove lodash3 completely from the repo
* chore(NA): fix x-pack/test/api_integration/apis/metrics_ui/snapshot.ts missing content
* chore(NA): fix lodash usage on apm
* chore(NA): fix typecheck for maps
* Patch lodash template (#12)
* Applying changes from https://github.com/elastic/kibana/pull/64985
* Using isIterateeCall, because it seems less brittle
* Also patching `lodash/template` and `lodash/fp/template`
* Reorganizing some files...
* Revising comment
* Ends up `_` is a function also... I hate JavaScript
Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: kobelb <brandon.kobel@elastic.co>
* move last snapshot to inline
* move legacy files to legacy subfolder
* move request types out of legacy
* export Headers from http instead of elasticsearch
* renaming - first pass
* renaming - second pass
* fix core mocks
* adapt new calls
* update generated doc
* fix IT test mocks
* fix new usages
* Ensure we use existing Elasticsearch config
* Use separate type for this to ensure custom properties work
* PR suggestions
* PR feedback
* PR feedback
* Fix type issues
* PR feedback
* Allow registered alert types to be non-editable
* Fixed isUiEditEnabled values
* Fixed due to comments
* fixed failing tests
* Enable alert type selection per alert consumer, only 'alerting' consumer can display other consumers alert types, but in case if it isEditable
* fixed tests
* Removed consumer property from the client side alert type registry and added server side property producer which purpose is to manage a feature logic
* fixed type check
* Fixed tests and type checks
* Removed error message for non registered plugins
* Fixed failing tests
* Fixed due to comments
* fixed test
* -
* revert logic for requiresAppContext
* Added close toast after saving alert
* 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
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.
* [Telemetry] Add posibility of regitering exclusive collectors for collections
* [Telemetry] Filter unwanted fields from the kibana.os telemetry payload
* Filter the collectors properly in bulkFetch
* Move "kibana" usage collector from Monitoring to OSS Telemetry
* Remove exclusivity of the "kibana_settings" collector
* Unify "kibana_stats" collector from Monitoring and Legacy
* Remove unused legacy constants
* Proper type for UsageCollectionSetup in monitoring
* Missed one undo
* Add unit tests to the migrated collectors
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* WIP
* Add new alert with tests
* Fix type issues, and disable new alerting for tests
* Fix up the view all alerts view
* Turn off for merging
* Fix jest test
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* add plugin own contract as third element of getStartServices result
* adapt plugins code
* update tests
* revert unknown to use void again
* update generated doc
* fix UT
* update mock to allow non-object `pluginStartContract`
* add @typeParam documentation
* Align api/stats with the monitoring logic for kibana ops metrics
* Align collectors
* Add in locale to kibana_settings
* More tweaks
* PR feedback
* PR feedback
* [Telemetry] Migration to NP
* Telemetry management advanced settings section + fix import paths + dropped support for injectVars
* Fix i18nrc paths for telemetry
* Move ui_metric mappings to NP registerType
* Fixed minor test tweaks
* Add README docs (#60443)
* Add missing translation
* Update the telemetryService config only when authenticated
* start method is not a promise anymore
* Fix mocha tests
* No need to JSON.stringify the API responses
* Catch handleOldSettings as we used to do
* Deal with the forbidden use case in the optIn API
* No need to provide the plugin name in the logger.get(). It is automatically scoped + one missing CallCluster vs. APICaller type replacement
* Add empty start method in README.md to show differences with the other approach
* Telemetry collection with X-Pack README
* Docs update
* Allow monitoring collector to send its own ES client
* All collections should provide their own ES client
* PR feedback
* i18n NITs from kibana-platform feedback
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* First pass
* First pass
* Add new routes
* Getting closer
* Remove legacy server code, and other fixes
* Register the plugin with xpack
* Pass a legacy client to telemetry
* Suport callWithInternalUser
* Remove this
* More NP work
* Fix some tests
* Fix broken test
* Move over new telemetry changes, and fix other issues
* Fix TODO item
* Reuse the same schema as elasticsearch module
* Use a singular config definition here
* Disable this for now
* Use the right method
* Use custom config again
* Tweak the config to make this optional
* Remove these
* Remove these unnecessary files
* Fix jest test
* Fix some linting issues
* Fix type issue
* Fix localization issues
* Use the elasticsearch config
* Remove todos
* Fix this check
* Move kibana alerting over
* PR feedback
* Use new metrics core service
* Change config for xpack_api_polling_frequency_millis
* Make sure this is disabled for now
* Disable both
* Update this to the new function
* Tighten up legacy api needs
* Check for existence
* Fix jest tests
* Cleaning up the plugin definition
* Create custom type in our plugin
* Revert this change
* Fix CI issues
* Add these tests back
* Just use a different collector type
* Handle errors better
* Use custom type
* PR feedback
* Fix type issues
* PR feedback
* Initial attempt at a reactor of how this works
* Enter and exiting setup mode with migration buttons working
* Adding monitoring url step back in and some small cleanup
* Elasticsearch steps
* Add missing file
* Better organization here
* Remove this debug logic
* Clean up
* PR feedback
* Add in monospacing
* Persist monitoring url in local storage
* Rework the steps
* Change node to server, and add missing files
* Fix linting issues
* Fix api integration tests
* PR feedback
* Pass down if the product is the "primary" or not, then use that to show certain warnings in the UI (just supported for Kibana right now)
* Elasticsearch migration will work slightly differently in that all nodes must be partially migrated before we can disable internal collection
* More PR feedback
* PR feedback
* Better links
* Fix tests
* This should open in a new tab
* PR feedback
* Design and PR feedback
* Fix these tests
* PR feedback
* Remove debug
* PR feedback
* Update the import path
* Update this import path too
* PR feedback
* Fix i18n
* Minor changes to text.
* "Basic" is a proper name, so it should be capatalized.
* Cluster Alerts are plural.
* Fix tests to align with help text changes
* Missed one test file