* [Global Nav] Moved Overview page/link to the accordion/Solution title
* Using Cloud logo for deployment link and fixing isActive state
* Change Deployment section to dark background
* Completely remove locking ability
* Change buttonElement if overview page exists
* Snaps from button/div
* PR Feedback:
- Puts `Overview` links back for Observability and Security
- Increases hit area and scopes underline of anchor tag within the accordion header
- Uses `id`’s to find Overview pages instead of `title` text
* xpack.actions.proxyVerificationMode is actual xpack.actions.ssl.proxyVerificationMode
* xpack.actions.verificationMode is actual xpack.actions.ssl.verificationMode
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Lens] Allows users to not render suggestions
* Improve the transitions
* change implementation and use EuiAccordion instead
* Fixes the scrolling problem on the suggestions panel
* Apply PR comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
A change in the ES range agg no longer accepts numbers with decimals if the underlying field is typed as long. This PR fixes the issue by rounding the percentiles values we pass on to the range agg.
* Add column-gap to HeaderSectionComponent
* Please code review by using gutterSize instead of flex column-gap
* Add eui-textBreakNormal to header_section title
It makes sure that words in the title don't break into a new line
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fix error when searchin with special characters in policies filter
* remove unused brackets
* Refactor test uses userEvent instead of fireEvent to supress act() usage
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Set `keep_policies_up_to_date` during preconfiguration
Don't rely on only our 7.16 migration set this flag, ensure it gets set
to `true` for any package that appears in `DEFAULT_PACKAGES` during
preconfiguration
Closes#116982
* Move default logic to installation
* Revert conflict change in preconfiguration.ts
* Disable agent monitoring settings in UI for managed policies
* Allow namespace to be changed for preconfigured managed policies
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Previously, we were only honoring the "keep policies up to date"
setting for policies generated during preconfiguration. This fix ensure
we honor it for all policies.
Closes#116435
* use event.ingested for datastream last activity
* remove ms precision from datastream dates
* add timestamp check to test
* fix type error
* split test out to be less complex and more reliable 🤞
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* New DescriptionField component for artifact cards
* Use new DescriptionField in ArtifactCardEntry
* Added `eui-textBreakWord` class name to TextValueDisplay component in artifact cards
* Use `DescriptionField` in `CardCompressedHeader`
* Fix i18n of Description label on minified card
* Use DescriptionField in ArtifactEntryMinified
**Ticket:** https://github.com/elastic/kibana/issues/106469, https://github.com/elastic/kibana/issues/101013
## Summary
TL;DR: New internal endpoint for reading data from Event Log (raw version), legacy status SO under the hood.
With this PR we now read the Failure History (last 5 failures) on the Rule Details page from Event Log. We continue getting the Current Status from the legacy `siem-detection-engine-rule-status` saved objects. Rule Management page also gets data from the legacy saved objects.
- [x] Deprecate existing methods for reading data in `IRuleExecutionLogClient`: `.find()` and `.findBulk()`
- [x] Introduce new methods for reading data in IRuleExecutionLogClient:
- for reading last N execution events for 1 rule from event log
- for reading current status and metrics for 1 rule from legacy status SOs
- for reading current statuses and metrics for N rules from legacy status SOs
- [x] New methods should return data in the legacy status SO format.
- [x] Update all the existing endpoints that depend on `IRuleExecutionLogClient` to use the new methods.
- [x] Implement a new internal endpoint for fetching current status of the rule execution and execution events from Event Log for a given rule.
- [x] The API of the new endpoint should be the same as `rules/_find_statuses` to minimise changes in the app.
- [x] Use the new endpoint on the Rule Details page.
## Near-term plan for technical implementation of the Rule Execution Log (https://github.com/elastic/kibana/issues/101013)
**Stage 1. Reading last 5 failures from Event Log v1 - raw implementation** - ✔️ done in this PR
TL;DR: New internal endpoint for reading data from Event Log (raw version), legacy status SO under the hood.
- Deprecate existing methods for reading data in `IRuleExecutionLogClient`: `.find()` and `.findBulk()`
- Introduce new methods for reading data in IRuleExecutionLogClient:
- for reading last N execution events for 1 rule from event log
- for reading current status and metrics for 1 rule from legacy status SOs
- for reading current statuses and metrics for N rules from legacy status SOs
- New methods should return data in the legacy status SO format.
- Update all the existing endpoints that depend on `IRuleExecutionLogClient` to use the new methods.
- Implement a new internal endpoint for fetching current status of the rule execution and execution events from Event Log for a given rule.
- The API of the new endpoint should be the same as `rules/_find_statuses` to minimise changes in the app.
- Use the new endpoint on the Rule Details page.
**Stage 2: Reading last 5 failures from Event Log v2 - clean implementation**
TL;DR: Clean HTTP API, legacy Rule Status SO under the hood.
🚨🚨🚨 Possible breaking changes in Detections API 🚨🚨🚨
- Design a new data model for the Current Rule Execution Info (the TO-BE new SO type and later the TO-BE data in the rule object itself).
- Design a new data model for the Rule Execution Event (read model to be used on the Rule Details page)
- Think over changes in `IRuleExecutionLogClient` to support the new data model.
- Think over changes in all the endpoints that return any data related to rule monitoring (statuses, metrics, etc). Make sure to check our docs to identify what's documented there regarding rule monitoring.
- Update `IRuleExecutionLogClient` to return data in the new format.
- Update all the endpoints (including the raw new one) to return data in the new format.
- Update Rule Details page to consume data in the new format.
- Update Rule Management page to consume data in the new format.
**Stage 3: Reading last 5 failures from Event Log v3 - new SO**
TL;DR: Clean HTTP API, new Rule Execution Info SO under the hood.
- Implement a new SO type for storing the current rule execution info. Relation type: 1 rule - 1 current execution info.
- Swap the legacy SO with the new SO in the implementation of `IRuleExecutionLogClient`.
**Stage 4: Cleanup and misc**
- Revisit the problem of deterministic ordering ([comment](https://github.com/elastic/kibana/pull/115574#discussion_r735803087))
- Remove rule execution log's glue code: adapters, feature switch.
- Remove the legacy rule status SO.
- Mark the legacy rule status SO as deleted in Kibana Core.
- Encapsulate the current space id in the instance of IRuleExecutionLogClient. Remove it from parameters of its methods.
- Introduce a Rule Execution Logger scoped to a rule instance. For use in rule executors.
- Add test coverage.
### Checklist
Delete any items that are not applicable to this PR.
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* add tests for pending status api changes
related to elastic/kibana/pull/115441
refs elastic/security-team/issues/1705
* update mock
refs elastic/kibana/pull/116214
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fix error appearing if user leaves Sources page very quickly
The issue was that the response from /sources endpoint could came after the user has left the page.
Since the user has already left the page, the Sources logic is unmounted,
and any code that was using the response couldn't update the value in that logic file and caused an error.
Fortunately Kea provides a `breakpoint` API exactly for such cases:
https://kea.js.org/docs/guide/additional#breakpoints
This commit uses that API to fix the issue.
* Fix error appearing after leaving Sources page less quickly
This commit solves the same problem, but for the /status endpoint:
1) for the first status call that saves server values to the sources_logic
2) for the subsequent status calls that poll the server for the status updates
* Increase test coverage
The new test duplicates the test below it, but it doesn't set up
initial source statuses. For some reason this case was considered to be covered before,
but after seemingly unrelated changes in this PR, the coverage started to show that this
code branch was missed.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* WIP - need to figure out how to delete old siem-detection action SO's after each test
* WIP - adds some fixes for the update rules utility that differ from patch rules utility
* fix type checks
* cleanup
* remove commented out code
* rename const to use capital snake case
* naming integration tests, adds expect for disabled rules that get migrated, adds expect for pre-migrated rules
## Summary
Removes isUuid and tests as they're not used anymore
### Checklist
Delete any items that are not applicable to this PR.
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* Use useEndpointPrivileges instead of checking the license directly
* Use the correct privilege key
* rename variable
* Skips flaky test
* Remove skip
* Remove extra dependency
* Add back entries check
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Send Endpoint Alert _id field up as insights docs track that on status changes
* Added test to make sure top-level underscore-prefixed fields are allowed
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* clean up IField API
* disable switch when using MVTs for es docs
* clean up interface comment style
* implement supportsFieldMetaFromEs and supportsFieldMetaFromLocalData in all Field classes
* fix dynamic_color_property test
* fix jest tests
* mock getRangeFieldMeta instead of passing in VectorLayerMock with MockStyle
* review feedback
* clean up supportsFieldMetaFromLocalData test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* ensure included fields not overwritten + reduce unnecessary renders.
* ensure editor validation works
* ensure depVar always in includes
* ensure selected runtimeField depVar option is shown
## Summary
Changes detections log level from info to debug within the detection engine. Users have been complaining about their log files filling up in excessive size from when they have noisy rules or if they have a large amount of rules enabled.
* [Maps] do not allow label overlap
* split symbol labels into seperate layer
* clean up comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add support for actions on kibana.* fields and legacy signal.* fields
* Improve types and add scheduleNotificationActions test
* Unnecessary cast
* Was accidentally returning all alerts in map, instead of single alert
* Cleanup
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Only apply field aliases to legacy .siem-signals indices
* Fix unit test mocks
* Add new function for special index existence check
* Actually add new function for special index existence check
* Undo getIndexVersion change
* Add basic integration tests for field alias logic
* Add back create_index to test list
* Add missing markdown to readme
* Revert change to delete_index_route
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Logs UI][Metrics UI] Remove deprecated config fields from APIs
* Fix typecheck
* Fix typecheck
* Fix typecheck
* Fix jest
* Fix functional test
* Remove extraneous timeField args
* Typecheck fix
* Consolidate log file changes to ResolvedLogSourceConfiguration
* Fix merge
* Revert additional logs files
* Revert inventory models
* Revert log_analysis api
* Fix timefield reference in process list
* Restore logs page files, fix typecheck on mock
* Fix functional test
* Restore inventory models index
* Fix typecheck on getFilteredMetrics
* Look CI if you don't tell me all the type errors at once I can't fix them all
* Maybe this is the last typecheck fix who knows
* Add compatibility aliases to alerts as data indices
* Fix dupe mitigation, allow more fields in mapping
* Remove legacy signals fields from new RAC alerts
* Fix cypress test
* Remove outdated comment
* Reduce flakiness in time based test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add `.catch()` statement to ES calls in order to get better stacktraces
* Improve efficiency of getHostEndpoint() search strategy method
* Refactor `getHostEndpoint()` to use new Metadata service as well as the internal kibana ES client
* unskip test suite
* Fix functional tests and some refactoring
* Refactor Policy Details test and centralize getting of Agent Policy combined input for endpoint
* Change approach for checking policy data in fleet pages
* Change Policy Settings displayed in Fleet to a) show a loader while retrieving settings and b) show loading errors if any
* Close any visible toasts before clicking on the save button
* remove use of boom from info response handler; also changed unauthd response to forbidden to avoid client logging user out
* rather return 500 with err.message
* added jest tests for common cases on the info route
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [ILM] Fixed ILM a11y test by creating a snapshot repo that is now required in the ILM API
* [ILM] Fixed functional test by creating a snapshot repository
* [ILM] Updated the params after es client update
* [ILM] Added filtering by policy name to the a11y test to find the correct ILM policy in the list
* [ILM] Added filtering by policy name to the a11y test to find the correct ILM policy in the list
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [ML] Retain _meta on clone
* [ML] Fix validation on schema to only check it it's defined/not null
* [ML] Remove validation because es should handle the validation already
* Change type to unknown
This commit introduces the multi-layer time axis in Discover, Lens, Visualize, TSVB.
It adds visualization:useLegacyTimeAxis advanced settings under charts plugin to toggle legacy time axis.
The new multi-layer time axis is introduced in @elastic/charts https://elastic.github.io/elastic-charts/?path=/story/area-chart--timeslip and was demoed as part of the Kibana Demo Days.
It is the outcome of the research done in elastic/elastic-charts#1310 related to improving the time axis solving the following problems:
- sparse time labels that can be far apart
- unclear where time point is on the label (the middle)
- difficult / tedious to read due to redundant information and small fonts
- resolution is not explicit (is it hours of days or days themselves)
* [Canvas] Generic embeddable function (#104499)
* Created generic embeddable function
Fixed telemetry
Updates expression on input change
Fixed ts errors
Store embeddable input to expression
Added lib functions
Added comments
Fixed type errors
Fixed ts errors
Clean up
Removed extraneous import
Added context type to embeddable function def
Fix import
Update encode/decode fns
Moved embeddable data url lib file
Added embeddable test
Updated comment
* Fix reference extract/inject in embeddable fn
* Simplify embeddable toExpression
* Moved labsService to flyout.tsx
* Added comment
* [Canvas] Adds Save and Return Workflow (#111411)
* [Canvas] Adds editor menu to Canvas (#113194)
* Merge existing embeddable input with incoming embeddable input (#116026)
* [Canvas] Extract and inject references for by-value embeddables (#115124)
* Extract/inject references for by-value embeddables in embeddable function
Fixed server interpreter setup
Register external functions in canvas_plugin_src plugin def
* Fixed ref name in embeddable.inject
* Fixed ts errors
* Fix missing type error
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial commit
* Properly handle signal history
* Fix#95258 - cardinality sort bug
* Init threshold rule
* Create working threshold rule
* Fix threshold signal generation
* Fix tests
* Update mappings
* ALERT_TYPE_ID => RULE_TYPE_ID
* Add tests
* Fix types
* Adds RAC rule type migration
* Fix threshold tests (remove outputIndex)
* Add threshold rule type to ruleTypeMappings
* Add kbn-securitysolution-rules package for sharing with alerting framework
* Fix type errors
* Fix find_rules tests
* First round of test fixes
* Fix issues from merge conflicts
* Use ruleDataClient getReader() for reading
* Fixes to 'generating_signals' tests
* Remove more refs to legacy schema
* Linting
* Quick type fix
* Bug fixes
* Add saved query rule type
* Linting
* Fix types
* Signal generation tests
* Test updates
* Update some more refs
* build_alert tests
* Cleanup
* Ref updates
* Revert "Ref updates"
This reverts commit 4d1473d6b0.
* Update status field
* Test fixes
* Another test
* Got a little too aggressive with search/replace
* let's see where we're at
* Fix
* Test fixes
* cleanup
* Fix cases API integration test config, flaky DE tests
* Move flattenWithPrefix to package / skip signal migration tests
* Fix unit tests
* Use new schema for bulk rule creation
* event: { kind } => event.kind
* Fix signal migration API tests
* Fix ml integration test
* Fix threat match integration tests
* Fix ML rule type tests and add correct producer to all rule types
* Update threat match API integration test
* Remove dupe properties
* Type fix
* Fix ML producer in functional test
* Fix generating_signals tests
* Remove usage of RuleDataClient-based execution log client
* Don't check output index version if rule registry enabled
* Fix bulk duplicate rule
* Fix duplicate rule test
* Fix readPrivileges and timestamp check logic
* Fixes for eql and exceptions tests... disable open_close_signals
* Type fixes / keyword test fixes
* Additional test fixes
* Unit test fixes + signal -> kibana.alert
* Test fixes for exceptions
* Fix read_resolve_rules test
* Various test fixes with marshallmain
* Sort search results
* Fix create_rules tests
* Disable writer cache for integration tests
* Disable writer cache for cases integration tests
* Fix types in rule_data_plugin_service
* Fix ordering in exceptions tests
* Remove rule_registry.enabled flag
* Fix signals migration tests
* Don't check signals index before creation
* Fix cypress config
* Fix type error
* create_migrations tests
* Skip flaky test
* Helpful comment
* Fixes from merge conflicts
* Pretend that signals index exists
* Fix type errors
* Skip flaky tests
* Fix threat matching test
* Clean up
* Reverting default ruleRegistry experimental flag (breaks unit tests)
* Reenable rule registry experimental feature by default
* Execute DE rule migration in 8.0
Co-authored-by: Marshall Main <marshall.main@elastic.co>
* [maps] add support for mvt _key property
* return property value, not key name
* eslint
* eslint
* fix jest test and update expect for second geo grid tile API test
* tslint
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Update dependencies overview route to use backendName as a query param
* Remove backendName from context
* Move backendMetadataFetch call to the place that is used and remove ApmBackendContext
* Update API routes and tests
* Add redirect from the old route