Commit graph

19 commits

Author SHA1 Message Date
Devin W. Hurley
83e6c38159
[Security Solution] [Detections] Write failing status when executionStatus is in error (#79311)
* Write failing status when executionStatus is in error

* adds unit test for error handling if rule status service throws an error

* adds success test for when executionStatus is failed

* moves logic for writing executionStatus failure to rule status saved object inside find rules status route, updates find rules route to display error if executionStatus is in error, but not be in charge of writing the status. That job belongs to the find rules status route.

* test if we are writing an error status when calls are made to find_rules_status_route and adds a test for general error checking

* adds JSDocs description for rules status route, updates findRules filter to append rule ids to the end of query, removes object.keys()

* don't write an error to our rule status in the route, only read from the executionStatus property and merge that result with our stored failures

* fixes tests

* move mock rule status service out of __mocks__ folder and remove unnecessary references to mock in tests

* fix type error

* updates json.gzip for cypress

* PR feedback

* fix timing issue with integration tests

* removes unzipped data.json
2020-10-07 01:03:32 -04:00
Christos Nasikas
752489129b
[Security Solutions][Cases - Timeline] Fix bug when adding a timeline to a case (#76967)
Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-15 23:48:12 +03:00
Ryland Herrick
6dd558e59c
[Security Solution][Detections] Integration test for Editing a Rule (#77090)
* Add cypress test around editing a detection rule

Right now this just navigates around and verifies that the form is
correctly repopulated; next step will be to modify/asset some changes.

* Add assertions for editing a rule

We already were asserting on the population of the Edit form after
creation; this additionally makes modifications, saves them, and asserts
the resulting values on the Rule Details page.

* Remove unused imports

* Inline our cypress expectations

So that expectation failures are less obfuscated, the decision was
previously made to abstract user navigation into functions, but to leave
expectations directly within the test body.

* Dynamically assert Rule Details based on titles

Rule Details are unfortunately unstructured: they're an array of <dt>s
and <dd>s without any hierarchy. To address this, tests
were previously hardcoding the order of these fields, and assertions
were performed by querying for all <dd>s and then indexing with the
hardcoded number (e.g. ABOUT_FALSE_POSITIVES).

However, in addition to being unstructured, these fields are also
_dynamic_, and will be present/absent depending on the data of the given
rule. Thus, we started needing multiple orderings for the different
combinations of rule fields/rule types.

In the absence of refactoring how we build rule details, I'm introducing
a simple helper function to fetch the relevant <dd> by the corresponding
<dt>s text. This should be more robust to change and more declarative.

* Fix bad merge conflict

Lots of these variables no longer exist upstream and this new test
needed to be refactored.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-15 15:30:41 -05:00
MadameSheema
a66788eaf8
[SECURITY SOLUTION] Adds 'cypress:open-as-ci' command (#76125)
* adds 'cypress:open-as-ci' command

* fixes typecheck error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-07 13:26:41 +02:00
Jen Huang
ad5c0f58fe
[Ingest Manager] Rename agent/package config(s) to agent/package policy(ies) (#74914)
* Initial pass at updating client routes, variables names, code comments, and UI copy

* Adjust server routes and param names, more var names and i18n fixes

* Fix test

* More var renaming

* Rest of server-side var renaming

* Rest of client side var renaming

* Rename agent SO attributes and add migrations

* Remove agent prefix from policy fields

* Rename agent policy SO attributes and add migrations

* Rename enrollment api key SO attributes and add migrations

* Rename package policy SO attributes and add migrations

* Rename agent event SO attributes and add migrations

* Rename subtype CONFIG to POLICY (I don't think this string is ever sent by agent, though)

* Update snapshot

* Remove unnecessary cloning in migrations

* Fix migration typos

* Update naming in tests and es archiver data

* Rename file names in /common

* Rename /server files

* Rename /public files

* Rename test file names

* Rename missed files

* Revert "Rename subtype CONFIG to POLICY (I don't think this string is ever sent by agent, though)"

This reverts commit 3c91e01ed9.

* Add migration version to updated es archiver data to fix tests
2020-08-19 13:52:06 -07:00
Jen Huang
042254f026
[Ingest Manager] Update dataset.* to data_stream.* in package config SO attributes (#74414)
* Update `dataset.*` to `data_stream.*` in full agent config yaml

* Replace `dataset.*` with `data_stream.*` in package config saved object attributes
2020-08-06 09:17:20 -07:00
Jen Huang
9ef04e7fb2
Rename package configs SO to package policies (#74422) 2020-08-05 15:28:03 -07:00
Jen Huang
c655f50950
Rename agent configs SO to agent policies (#74397) 2020-08-05 12:51:58 -07:00
Mikhail Shustov
88c0631344
Update @typescript-eslint to ensure compatibility with TypeScript v3.9 (#74091)
* bump @typescript-eslint deps

* update rules

* fix errors in pacakges

* fix src/

* fix x-pack

* fix test

* fix typings

* fix examples

* allow _ as prefix and suffix

* roll back prefix and suffix changes

* add eslint-plugin-eslint-comments

* report unused rules

* remove unused eslint comments from tests

* remove unused eslint comments 2nd pass

* remove unused eslint comments from src/

* remove unused comments in x-pack

* use no-script-url and no-unsanitized/property for ts files

* remove unused eslint comments

* eui/href-or-on-click removed when not complained

* no import/* rules for ts files

* cleanup

* remove the unused eslint-disable

* rollback unnecessary changes

* allow underscore prefix & sufix in type name

* update docs

* fix type error in enterprise search plugin mocks

* rename platform hack __coreProvider --> _coreProvider

* rollback space removal in src/core/public/legacy/legacy_service.test.ts

* fix naming convention in APM
2020-08-05 17:32:19 +02:00
Frank Hassanabad
d57a379aa9
Fixes cypress build by removing alerting version within the saved object that causes migration issue while the cypress tests run (#73550) 2020-07-28 15:03:41 -07:00
MadameSheema
49846834eb
[SIEM] Unskips and fixes Cypress tests (#73322)
* removes not needed configuration

* fixes events columnts tests

* unksips persisten timeline test

* fixes failing test

* skips events test since need more time for investigation

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 15:23:05 +02:00
Devin W. Hurley
f487867fda
[SIEM] Updates consumer in export_rule archive (#72324) 2020-07-17 17:13:34 -04:00
MadameSheema
401ad352e9
[SIEM] Bring Cypress tests back to life (#71871)
* fixes and unskips 'Detection rules, custom'

* fixes 'Export rules' test

* unksips 'Deleting prebuilt rules' test

* unskips Alerts timeline

* unskips 'Events viewer' tests

* unskips 'toggle column in timeline' tests

* unskips 'url timeline' test

* fixes Overview test

* skips flaky test
2020-07-16 21:13:55 +02:00
Jen Huang
3d5afa90d2
[Ingest Manager] Remove epm config options (#71542)
* Remove `epm.enabled`, flatten `epm.registryUrl`

* Update docs
2020-07-13 16:21:33 -07:00
MadameSheema
716d56e4d0
updates consumer to siem (#71117) 2020-07-09 07:45:10 +02:00
MadameSheema
cd50899493
fixes and unskips 'export rule' test (#70699)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-06 21:26:34 +02:00
MadameSheema
7b0e9dfe9a
[SIEM] Unskips and fixes 'Detection rules, custom' test (#70693)
* unskips and fixes 'Detection rules, custom' test

* deletes comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-06 21:25:52 +02:00
Jen Huang
4f7da59a51
[Ingest Manager] Rename data sources to package configs (#70259)
* Rename `datasource` saved object to `package_config` (SO type `ingest-datasource` to `ingest-package-config`) and adjust mappings:

- Remove unused `processors` field on input & stream levels
- Remove unnecessary `enabled` field on package config & input levels
- Rename `agent_stream` field to `compiled_stream`
- Reorder other fields so that important fields are closer to top & similar fields are grouped together

Also,
- Remove 7.9.0 migrations as we are not supporting an upgrade path from experimental to beta release

* Pluralize `ingest-package-configs` for consistency

* Rename `Datasource`-related types to `PackageConfig`, update all references (does not include actual type definition changes yet)

* Rename `Datasource` schemas and rest spec typings to `PackageConfig` (does not include actual schema changes yet)

* Change `datasources` on agent config typings and schemas to `package_configs` and update all references

* Add back `enabled` field on package config and input levels. They are needed for current & future UI features. Also:

- Match types and schemas with saved object mappings (`agent_stream` to `compiled_stream`, removal of `processors`)
- Set `namespace` to be a required property on agent config and package config types, add validation support for it on UI

* Rename server-side datasource references in file names, variable names, and routes

* Update spec file and schema file

* Update doc wording

* Rename all instances of datasource in file paths and variable names on client sides, and for Endpoint too

* Minor copy adjustments, fix i18n check

* Replace datasource references in tests and fixtures; remove unused `ingest/policies` es archiver data

* Fix tests

* Fix test field name

* Fix test fixtures fields again

* Fix i18n
2020-07-01 16:14:21 -07:00
Xavier Mouligneau
1216b0f7cd
[SECURITY] Rename siem plugin to security_solution (#67902)
* rename siem to security_solution

* rename siem to security solution inside of code

* rename translation keys

* fix snapshot

* replace siem for security solution in tutorial

* missing translation to be renamed

* fix types for api test integration

* updates runner file to match the new path

* change category for kibana settings

* miss renaming in advance settings

* fixes cypress tests

* fix api integration test

* fix new translation

* fix unit test

* update translation i18n

* update translation i18n II

Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
2020-06-04 05:35:13 -04:00