## Summary
During testing I encountered this error message:
```
[2021-10-18T13:19:07.053-06:00][ERROR][plugins.securitySolution] The notification throttle "from" and/or "to" range values could not be constructed as valid. Tried to construct the values of "from": now-null "to": 2021-10-18T19:19:00.835Z. This will cause a reset of the notification throttle. Expect either missing alert notifications or alert notifications happening earlier than expected.
```
This error was happening whenever I had a rule that was using an immediately invoked action and was encountering an error such as a non ECS compliant signal. The root cause is that I was not checking everywhere to ensure we had a throttle rule to ensure scheduling.
This fixes that by adding an `if` statement/guard around the areas of code.
I also improve the error message by adding which ruleId the error is coming from.
### 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
* rename legacy actions/responses
fixes elastic/security-team/issues/1702
* use correct name for responses index
refs elastic/kibana/pull/113621
* extract helper method to utils
* append endpoint responses docs to activity log
* Show completed responses on activity log
fixes elastic/security-team/issues/1703
* remove width restriction on date picker
* add a simple test to verify endpoint responses
fixes elastic/security-team/issues/1702
* find unique action_ids from `.fleet-actions` and `.logs-endpoint.actions-default` indices
fixes elastic/security-team/issues/1702
* do not filter out endpoint only actions/responses that did not make it to Fleet
review comments
* use a constant to manage various doc types
review comments
* refactor `getActivityLog`
Simplify `getActivityLog` so it is easier to reason with.
review comments
* skip this for now
will mock this better in a new PR
* improve types
* display endpoint actions similar to fleet actions, but with success icon color
* Correctly do mocks for tests
* Include only errored endpoint actions, remove successful duplicates
fixes elastic/security-team/issues/1703
* Update tests to use non duplicate action_ids
review comments
fixes elastic/security-team/issues/1703
* show correct action title
review fixes
* statusCode constant
review change
* rename
review changes
* Update translations.ts
refs 74a8340b5e
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
**Ticket:** https://github.com/elastic/kibana/issues/107068
**Follow-up after:** https://github.com/elastic/kibana/pull/114585
## Summary
The existing migration function `legacyMigrateRuleAlertIdSOReferences` that migrates `alertId` fields to SO references array did not include all the other attributes of a `siem-detection-engine-rule-status` doc being migrated to the resulting doc.
This PR includes a fix and an integration test for that.
## Run the test
To run the test, in one terminal execute:
```
cd ${KIBANA_HOME} && node scripts/functional_tests_server --config x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts
```
In another terminal execute:
```
cd ${KIBANA_HOME} && node scripts/functional_test_runner --config x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts --include=x-pack/test/detection_engine_api_integration/security_and_spaces/tests/migrations.ts
```
### 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
This creates an APM API endpoint that fetches data for the latency distribution chart in the trace samples tab on the transactions page. Previously, this data was fetched via the custom Kibana search strategies used for APM Correlations which causes issues in load balancing setups.
* Fix package update button + icon
* Adjust order of modal of states based on UX review
* Clarify integration/agent policies in integration UI policy table
* [Snapshot % Restore] Added server side pagination and sorting to get snapshots route, refactored snapshots table to use EuiBasicTable with controlled pagination instead of EuiInMemoryTable
* [Snapshot & Restore] Added server side sorting by shards and failed shards counts
* [Snapshot & Restore] Fixed i18n errors
* [Snapshot & Restore] Added server side sorting by repository
* [Snapshot & Restore] Implemented server side search request for snapshot, repository and policy name
* [Snapshot & Restore] Fixed eslint errors
* [Snapshot & Restore] Removed uncommented code
* [Snapshot & Restore] Fixed pagination/search bug
* [Snapshot & Restore] Fixed pagination/search bug
* [Snapshot & Restore] Fixed text truncate bug
* [Snapshot & Restore] Fixed non existent repository search error
* Update x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_search_bar.tsx
Co-authored-by: CJ Cenizal <cj@cenizal.com>
* Update x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_empty_prompt.tsx
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
* [Snapshot & Restore] Fixed missing i18n and no snapshots callout
* [Snapshot & Restore] Moved "getSnapshotSearchWildcard" to a separate file and added unit tests
* [Snapshot & Restore] Added api integration tests for "get snapshots" endpoint (pagination, sorting, search)
* [Snapshot & Restore] Renamed SnapshotSearchOptions/SnapshotTableOptions to -Params and added the link to the specs issue
* [Snapshot & Restore] Fixed search wildcard to also match string in the middle of the value, not only starting with the string. Also updated the tests following the code review suggestions to make them more readable.
* [Snapshot & Restore] Added incremental search back to snapshots list and a debounce of 500ms
* [Snapshot & Restore] Updated snapshot search debounce value and extracted it into a constant
* [Snapshot & Restore] Renamed debounceValue to cachedListParams and added a comment why debounce is used
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
* Upgraded the version of EUI to 38.2.0 from 38.0.1
* Updated the i18n mappings required for EUI v.38.2.0
* Update i18n snapshots and resolve linting error
* Removed html_id_generator mocks.
Current mock was failing due to missing useGeneratedHtmlId export. This is safe to remove because EUI contains a .testenv that contains an mock for html_id_generator. More info at https://github.com/elastic/eui/blob/master/src/services/accessibility/html_id_generator.testenv.ts
* Resolve linting error in i18n mapping file
* Removed html_id_generator mocks.
Current mock was failing due to missing useGeneratedHtmlId export. This is safe to remove because EUI contains a .testenv that contains a mock for html_id_generator. More info at https://github.com/elastic/eui/blob/master/src/services/accessibility/html_id_generator.testenv.ts
* Update plugin snapshots
* Resolve merge conflict in license_checker config.ts file
* Upgrade EUI to version 39.0.0 from the original target (38.2.0) to handle an issue found with a functional test during the original upgrade
* Updated the i18n mapping for EUI v.39.0.0
* Update various snapshots to account for the an i18n translation token addition in EUI v. 39.0.0
* Updated test cases marked as obsolete by CI
* Update src/dev/license_checker/config.ts
Removing TODO comments from src/dev/license_checker/config.ts as they are no longer needed.
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Add option auto fit row to content
* Fix tests
* Fix tests
* Add temp fix for correct rendering grid with auto-height when changing data or setting
* Fix lint
* Fix lint and tests
* Adds new dependency for temp fix
Co-authored-by: Brianna Hall <briannajdhall@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Bree Hall <40739624+breehall@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* [Reporting] Revisit handling timeouts for different phases of screenshot capture
* remove translations for changed text
* add wip unit test
* simplify class
* todo more testing
* fix ts
* update snapshots
* simplify open_url
* fixup me
* move setupPage to a method of the ObservableHandler class
* do not pass entire config object to helper functions
* distinguish internal timeouts vs external timeout
* add tests for waitUntil
* checkIsPageOpen test
* restore passing of renderErrors
* updates per feedback
* Update x-pack/plugins/reporting/server/lib/screenshots/observable_handler.ts
Co-authored-by: Michael Dokolin <dokmic@gmail.com>
* Update x-pack/plugins/reporting/server/lib/screenshots/observable_handler.ts
Co-authored-by: Michael Dokolin <dokmic@gmail.com>
* Update x-pack/plugins/reporting/server/lib/screenshots/observable_handler.ts
Co-authored-by: Michael Dokolin <dokmic@gmail.com>
* Update x-pack/plugins/reporting/server/lib/screenshots/observable_handler.ts
Co-authored-by: Michael Dokolin <dokmic@gmail.com>
* Update x-pack/plugins/reporting/server/lib/screenshots/observable_handler.ts
Co-authored-by: Michael Dokolin <dokmic@gmail.com>
* fix parsing
* apply simplifications consistently
* dont main waitUntil a higher order component
* resolve the timeouts options outside of the service
* comment correction
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Dokolin <dokmic@gmail.com>
## Summary
It was brought to our attention from security solutions that developers found we are missing the iterators and entries and others from TypeScript that are available when you include within `lib` `DOM.iterable`.
For example without it you cannot use `entries` like this:
<img width="985" alt="Screen Shot 2021-10-15 at 9 10 17 AM" src="https://user-images.githubusercontent.com/1151048/137512234-d14dc43c-129a-49d4-bc6c-410baf2d46f7.png">
Until you add it within he base config. Developers are indicating they noticed that workarounds such as lodash or casting is possible but I think this is the wrong direction to go and it's just an oversight that we missed adding the `DOM.iterable` unless someone tells us otherwise. If it is intentional to omit I would like to add docs to the `tsconfig.base.json` about why we omit it for programmers to understand the intention and why we should discourage use or recommend a library such as lodash instead.
* Replacing EuiPopover with EuiComboBox
* The combobox will help alleviate issues when the list of options is very long
* Refactoring the Combobox to listen for change events
* Added an onChange handler
* Renamed the method to render the combobox
* Commented out additional blocks of code before final refactor
* Finished refactoring the Request Selector to use EUI Combobox
* Removed three helper methods for the EUIPopover.
* `togglePopover()`
* `closePopover()`
* `renderRequestDropdownItem()`
* Removed the local state object and interface (no longer needed)
* Renamed the const `options` to `selectedOptions` in `handleSelectd()`
method to better reflect where the options array was coming from.
* Updating tests and translations
* Fixed the inspector functional test to use comboBox service
* Removed two unused translations
* Updating Combobox options to pass data-test-sub string
* Updated two tests for Combobox single option
* Updated the test expectations to the default string
* Both tests were looking for a named string instead of a default
message
* Adding error handling to Inspector combobox
* Checking for the item status code
* Adding a " (failed)" message if the status code returns `2`
* Updating test to look for "Chart_data" instead of "Chartdata"
* Updating two tests to validate single combobox options
* Added helper method to check default text against combobox options
* Added helper method to get the selected combobox option
* Checking two inspector instances using helpers
* Adding a defensive check to helper method.
* Correct a type error in test return
* Adding back translated failLabel
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
* Fix errors and comment code in middleware (pending to fix this)
* Fix endpoint list middleware test
* Fix policy TA layout test
* Fix test returning missing promise
* [Lens] fix filters not being cleaned
* Update lens_slice.ts
* types
* do not reset persistedDoc on load
* [Lens] functional test for query, filters and time range
* snapshot update
* fix flakiness
* fix getting filters from refs
* simplify tests
* confirm modal
* Update persistent_context.ts
* load the file above
* Update persistent_context.ts
* shorten c4
* flaky test
* fix geo_field changing index pattern, remove non used data view
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fix localizing `os` if the artifact is assigned to multiple OSs
* Test case to validate that multiple OSs are i18n
* updated trusted apps test snapshots