* [Metrics UI] Fix hasData call to ensure it has data not just indices
* Fixing formatting
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* improve test stability
* query string input manager (needed for search demo)
* docs
* dashboard
* Fix jest
* mock fix
* Allow restoring a saved query
* sync url
* Luke's fix to test
* cleanup
* lens jest tests
* docs
* use queryStringManager.getDefaultQuery
Don't sync query to global state
* Update app.test.tsx
lens mock
* jest fix
* jest
* use new api in the example
* Rename state param to query to match url state
* Apply changes to discover
* Update src/plugins/data/public/query/query_string/index.ts
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
* Improve query string state manager
* Cleanup dashboard code
* Handle refresh button
* Set initial dashboard state
* visualize state
* remove unused
* docs
* fix example
* fix jest
* fix filter app state in discover
* fix maps test
* jest
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Remove need for ValueListsTable
Modifying columns has revealed that they should be exposed as props, at
which point we have no real need for the table component.
* Unroll the ActionButton component
I thought this was useful when I wrote it!
* Handle multiple simultaneous exports on value lists modal
Instead of passing our export function to GenericDownloader, we now
manage the multiple exports ourselves, and when successful we pass the blob to
GenericDownloader.
* tracks a list of exporting IDs instead of single ID
* chains onto the export promise to set local state
* Port useful table tests over to modal tests
These verify that we've wired up our table actions to our API calls. A
little brittle/tied to implementation, but I'd rather have them than
not.
* WIP: Simpler version of GenericDownloader
* Replace use of GenericDownloader with simpler AutoDownload
This component takes a blob and downloads it in a
cross-browser-compatible manner.
* Handle error when uploading value lists
Converts to the try/catch/finally form as well.
* Fix failing cypress test
We lost this test subj during our refactor, oops
* More explicit setting of global DOM function
Our component fails due to this method being undefined, so we mock it
out for these tests. We do not need to reset the mock as it is assigned
fresh on every test.
* Fixes jest failures on CI
Defines a global static method in a more portable way, as the regular
assignment was failing on CI as the property was readonly.
* Simplify our export/delete clicks in jest tests
The less we assume about the UI, the more robust these'll be.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Handling entity ids of empty string
* Tests for entity id being empty
* More comments
* entity test
* Renaming interface
* Removing unneeded test
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
This PR addresses the following:
- Adds `list_id` to `rule.exceptions_list` - this is needed in a number of features
- Updated `getExceptions` in `x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts` to use the latest exception item find endpoint that accepts an array of lists (previously was looping through lists and conducting a `find` for each)
- Updated prepackaged rule that makes reference to global endpoint list to include `list_id`
- Updates `formatAboutStepData` in `x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts` to include exception list `list_id`
* Manifest version is semantic version
* Configurable task interval
* Use task interval over scheduled when provided
* Fix crash on download of large artifact
* Don't need to generate linux artifacts
* Configurable artifact validation
* Test fixes
* Test fixes
* Type/test fixes
* Final tweaks
* Remove linux endpoint exception generation from UI
* Fix paging so that we stop before 10k
* Fix pagination
* Fix pagination test
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Adds conditional context to the "needs index permissions" prompt
In an effort to assist the user in their configuration, this adds
additional context to this configuration prompt. We now distinguish
which indexes need configuration: signals, lists, or both.
* Use latin pluralization consistently
* Rename component file to be more accurate
* Refactor message construction to separate function
* Remove unused translations
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Validate exception list size when adding new items
* Update comment
* Extract list size validation and apply to endpoint route also
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Add test to confirm missing config responds w/ 404
Currently failing with a 500 as in https://github.com/elastic/kibana/issues/66388
* Use after() to remove items added by test.
The test initally failed with a 500 when the `after` was added. Debugging narrowed it down to a missing default config.
getDefaultAgentConfigId errors if there isn't a default config. The config is added by `setupIngestManager` which _was_ always called during plugin#start but is no longer.
We could add the setup call to the test/suite, but instead I changed AgentConfigService.delete to use ensureDefaultAgentConfig instead of getDefaultAgentConfigId.
ensureDefaultAgentConfig adds one if it's missing. The check in delete is to make sure we don't delete the default config. We can still do that and now we add a config if it wasn't already there (which seems like A Good Thing)
* Fix package config path in OpenApi spec
* Return 404 if package config id is invalid/missing
* Change test for error displayed text
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
By default the upload time limit for payloads is 10 seconds. This is really too short and we were getting internal QA bug reports that uploads are timing out on large value list importing. This PR adds the plumbing and unit tests to make the timeout configurable for routes.
* Adds a single timeout option for routes and then normalizes that through Hapi for the socket, payload, and server timeouts.
* Adds unit tests which test the various options
* Adds integration tests which test the various options
* Adds some NOTES about where there are odd behaviors/bugs within Hapi around validations and the timeouts
* Adds a configurable 5 minute timeout to the large value lists route
**Manual testing of the feature**
You can manually test this by adding a configurable option to your chrome network throttle like so below where you throttle upload by some configurable amount. I chose to use 300 kbs/s upload
<img width="556" alt="Screen Shot 2020-07-23 at 11 26 01 AM" src="https://user-images.githubusercontent.com/1151048/88318015-5ab3f700-ccd7-11ea-9d9b-7e3649ec65de.png">
And then run an import of large value lists using a large enough file that it will exceed 5 minutes:
![screen-shot-upload](https://user-images.githubusercontent.com/1151048/88318584-28ef6000-ccd8-11ea-90a1-8ca4aafabcb4.png)
After 5 minutes you should see this message within your server side messages if you have configured your kibana.dev.yml to allow for these messages:
```ts
server respons [10:52:31.377] [access:lists-all] POST /api/lists/items/_import?type=keyword 408 318292ms - 9.0B
```
Note that it should show you that it is trying to return a `408` after `318292ms` the timeout period. Sometimes you will get the 408 in the browser and sometimes the browser actually will not respect the 408 and continue staying in a pending state forever. This seems to be browser side issue and not a client/user land issue. If you get the browser message it will be this error toaster
![timeout-message](https://user-images.githubusercontent.com/1151048/88318760-74a20980-ccd8-11ea-9b7b-0d27f8eb6bce.png)
### Checklist
- [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
- [x] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials
- [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
### For maintainers
- [x] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
* Do not display threshold field for an ML Rule
* Give 'read' privileges to 'all' users
We have several lists routes that require lists-read access. If the user
was given the 'all' privilege for securitySolution, they would
previously be locked out of those routes.
Add validation to reject when value list and other exception type are entries in the same exception item. Also adds tests for this situation on the schema validation