* Fix role mappings table search not working on some columns
Not searchable columns had non-string data: arrays, objects.
The default implementation of search doesn't perform a search on non-string data.
The solution used here is to have a custom search callback that converts the entire
role mapping object to string and then checks if user query exists in this string.
It was copied and adjusted from example in EUI docs:
https://elastic.github.io/eui/#/tabular-content/in-memory-tables#in-memory-table-with-search-callback
* Fix copy
* Fix the same issue for Users table
The search was not performed on Engines/Groups column.
Also adjust the variable names in role_mappings_table to closely match
variable names in users_table
* [ML] Job import/export calendar and filter warnings
* fixing translation id
* adding export callout
* fixing translation id
* translation ids
* bug in global calendar check
* code clean up based on review
* updating text
* updatiung text
* updating apidoc
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [APM] Displays callout when transaction events are used instead of aggregrated metrics (#107477)
* Apply suggestions from code review
Co-authored-by: Søren Louv-Jansen <sorenlouv@gmail.com>
* PR feedback, and isolates the logic for getting the fallback strategy
* PR feedback
Co-authored-by: Søren Louv-Jansen <sorenlouv@gmail.com>
* Replace more legacy elasticsearch types
* Handle possibly undefined response fields
These are both number | undefined, so we default to 0 if we need a
value. Fixes the type errors resulting from the previous type changes.
## Summary
This is part 1 to addressing the issue seen here: https://github.com/elastic/kibana/issues/101975
This part 1 wires up our rules to be able to `inject` and `extract` parameters from the saved object references. Follow up part 2 (not included here) will do the saved object migrations of existing rules to have the saved object references.
The way the code is written it shouldn't interfere or blow up anything even though the existing rules have not been migrated since we do fallbacks and only log errors when we detect that the saved object references have not been migrated or have been deleted.
Therefore this PR should be migration friendly in that you will only see an occasional error as it serializes and deserializes a non migrated rule without object references but still work both ways. Non-migrated rules or rules with deleted saved object references will self correct during the serialization phase when you edit a rule and save out the modification. This should be migration bug friendly as well in case something does not work out with migrations, we can still have users edit an existing rule to correct the bug.
For manual testing, see the `README.md` in the folder. You should be able to create and modify existing rules and then see in their saved objects that they have `references` pointing to the top level exception list containers with this PR.
* Adds the new folder in `detection_engine/signals/saved_object_references` with all the code needed
* Adds a top level `README.md` about the functionality and tips for new programmers to add their own references
* Adds a generic pattern for adding more saved object references within our rule set
* Adds ~40 unit tests
* Adds additional migration safe logic to de-couple this from required saved object migrations and hopefully helps mitigates any existing bugs within the stack or previous migration bugs a bit for us.
### Checklist
- [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
* Refactor - moved extension types to its own type file
* initial add of new extension point type
* Removes unused imports
* fix import order
* try to fix ts errors
* Add ts types for delete callback and register it. Also add packagePolicy to the delete response
* Use logger instead of console log
* Removes array check
* Try fix some types and added TODO's
* Fix ts errors and remove @ts-ignore 's
* Remove useless ts-ignore
* Remove useless todo
* Remove enforced assertion by checking externalCallbackType
Co-authored-by: Paul Tavares <paul.tavares@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* ensure all hyperparameters are retained on clone
* ensure resultsField is set to default when switch enabled
* Add FeatureProcessor type
* ensure state persists for advanced fields when switching to form
* Remove description column, replace w/ tooltip
* Add upgrade tooltip to version column in package policy table
* Add update policy action
* Add inline upgrade package policy button
* Clean up types + add upgrade CTA's to integrations policy table
* Fix i18n
* Fix button widths
* Upgrade package policy when saving integration w/ upgrade param
* Update edit policy page description for upgrades
* Support setting vars on new package version before saving to upgrade
* Add flyout for JSON of previous policy version
* Compile package policy before displaying in flyout
* Support different success redirects following package policy upgrades
* Fix i18n
* Fix more type errors
* Fix even more type errors 🙃
* Fix type errors
* Don't throw errors for missing vars, include them in missingVars response object
* Update tests for new missingVars field
* Fix failing tests
* Address PR feedback
* Fix missing i18n value
* Fix types
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* first iteration of ilm policy copy - in a callout
* apply James' suggested change
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
### Summary
### Fields used moving forward
`kibana.alert.rule.consumer` will refer to the context in which a rule instance is created. Rules created in:
- stack --> `alerts`
- security solution --> `siem`
- apm --> `apm`
`kibana.alert.rule.producer` will refer to the plugin that registered a rule type. Rules registered in:
- stack --> `alerts`
- security solution --> `siem`
- apm --> `apm`
So an `apm.error_rate` rule created in stack will have:
- consumer: `alerts` and producer: `apm`
An `apm.error_rate` rule created in apm will have:
- consumer: `apm` and producer: `apm`
`kibana.alert.rule.rule_type_id` will refer to a rule's rule type id. Examples:
- `apm.error_rate`
- `siem.signals`
- `siem.threshold`
Also renamed the following because `rule.*` fields are meant to be ecs fields pulled from the source/event document, not refer to our rule fields.
`rule.name` --> `kibana.alert.rule.name` will refer to the rule's name.
`rule.category` --> `kibana.alert.rule.category` will refer to the rule's category.
`rule.id` --> `kibana.alert.rule.uuid` will refer to the rule's uuid.
- Makes sure fields defined in `FIELDS_TO_ADD_AS_CANDIDATE` and prefixed with one of `FIELD_PREFIX_TO_ADD_AS_CANDIDATE` get queried first when retrieving the `correlation` and `ks-test` value.
- Correctly consider the `includeFrozen` parameter.
- The bulk of the PR is a refactor:
- Moves `query_*` files to `queries` directory
- Introduces `asyncSearchServiceStateProvider` to manage the state of the async search service in isolation so that we no longer mutate individual vars or plain objects.
- Introduces `asyncSearchServiceLogProvider` and extends the log to not only store messages but original error messages retrieved from ES too.
- Refactors some more functions in separate files and adds unit tests.
- Removes some deprecated code no longer needed.
* clean up the enqueue job function
* clean up the screenshots observable
* clean up authorized user pre routing
* clean up get_user
* fix download job response handlers
* clean up jobs query factory repetition
* clean up setup deps made available from plugin.ts
* update test for screenshots observable
* Revert "clean up setup deps made available from plugin.ts"
This reverts commit 91de680ebf.
* revert renames
* minor rename
* fix test after rename
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [build_ts_refs] improve caches, allow building a subset of projects
* cleanup project def script and update refs in type check script
* rename browser_bazel config to avoid kebab-case
* remove execInProjects() helper
* list references for tsconfig.types.json for api-extractor workload
* disable composite features of tsconfig.types.json for api-extractor
* set declaration: true to avoid weird debug error
* fix jest tests
Co-authored-by: spalger <spalger@users.noreply.github.com>
* Add brush listener
* Fix back button not working
* [ML] Remove api names in apidoc.json
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fixes https://github.com/elastic/kibana/issues/106233
During an earlier upgrade/fix to our system to add defaults to our types, we overlooked the "author" field which wasn't part of the original rules. Users upgrading might get errors such as:
```
params invalid: Invalid value "undefined" supplied to "author"
```
This fixes that issue by adding a migration for the `author` field for `7.14.1`.
See https://github.com/elastic/kibana/issues/106233 for test instructions or manually remove your author field before upgrading your release and then upgrade and this should be fixed on upgrade.
### Checklist
- [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
* Should not show edit button on rule management page if rule not editable in stack
* Disabling edit button in collapsed actions
* Adding tests for collapsed item actions component
* Cleanup
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* rename constants and alert types to rules
* update test language
* update BaseRule properties to rule
* change rawAlert to sanitizedRule
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>