* 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
* [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>
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.
* 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>
* 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.
* [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>
* 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
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.
* 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>
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>
* 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
* 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.
* 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
* [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
* 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.
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.
### 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
* 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>
* 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>
* 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>
* 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.
* 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
* 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.
* 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>
[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)
* [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>
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.
* 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
## 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
* 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
* 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
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.
* [Reporting] Add "warning" as a status
* test
* fix warning status handling
* Simplify logic
* fix syntax
* more different statuses
* fix warning
* feedbacks
* 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.
* 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"
* [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
* 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>
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