Commit graph

46626 commits

Author SHA1 Message Date
Diana Derevyankina
1459839e37
Failing test: Chrome UI Functional Tests.test/functional/apps/visualize/_tsvb_table·ts - visualize app visualize ciGroup12 visual builder table should display correct values on changing metrics aggregation (#112216)
* Add wait for finish header loading

* Add header waitUntilLoadingHasFinished to visChart waitForVisualizationRenderingStabilized

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-29 09:55:54 +03:00
Tyler Smalley
f9d5b1943c [renovate] Add babel to config
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-28 21:55:40 -07:00
Tyler Smalley
7a0c2f6244
[CI] Require Tech Lead approval for license overrides (#113349)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-28 19:57:51 -07:00
Tyler Smalley
d20a696e95
[ci-stats] Collects additional timings about bootstrap (#112919)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-28 20:56:49 -04:00
Jonathan Budzenski
e54950177d
[build/docker] Fix beats architecture (#113340)
Beats ARM artifacts use arm64 as the identifier.  This fixes the
architecture passed to docker.
2021-09-28 15:46:11 -07:00
Devon Thomson
bd699aceb2
Compare intervals for unsaved changes on dashboard (#112592) 2021-09-28 16:48:11 -04:00
Nathan L Smith
8cf20cd82e
Fix APM E2E (#113297)
Add `?*` to the end of request aliases in instances table tests.

#104301 upgraded Cypress to a newer version that required this, but the APM E2E tests were not run because there were no changes to any files in APM.
2021-09-28 15:17:06 -05:00
Christiane (Tina) Heiligers
8d8b40075e
Removes support for unused optimize.* settings from core deprecations (#113296)
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
2021-09-28 13:08:52 -07:00
Stacey Gammon
4fe8605c7b
Remove RFCs from our repository. (#113289)
* Remove RFCs from our repository.

* Revert "Remove RFCs from our repository."

This reverts commit e97e3fb487.

* rename folder, and update readme.
2021-09-28 15:27:58 -04:00
Kyle Pollich
acd29eddcf
Add test for overridePackageInputs method (#113270) 2021-09-28 15:13:26 -04:00
Lee Drengenberg
200d0353d1
fix skipped test test/accessibility/apps/dashboard·ts - Dashboard create dashboard button #111233 (#112872)
* test if 2s sleep fixes flakey test

* switch from sleep to retry.waitFor

* remove .only, add comments to config file about sample data add/remove

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-28 13:50:22 -05:00
Yuliia Naumenko
3dcfd447d2
[Alerting] Fixed Jest test suites with unhandled promise rejections (#113213)
* [Alerting] Fixed Jest test suites with unhandled promise rejections

* fixed typecheck
2021-09-28 11:05:38 -07:00
Yuliia Naumenko
25c946c6ad
[Alerting] Fixed docs to replace a copy/paste for Elastic Maps Server in our action docs (#113293) 2021-09-28 10:40:13 -07:00
Thomas Watson
4243c10766
Bump ansi-regex from v5.0.0 to v5.0.1 (#113282) 2021-09-28 13:39:43 -04:00
Pablo Machado
2663181b08
Refactor use url state hook (#112675)
* Refactor useUrlStateHooks by batching updates to location

* Delete unused detail name

* Delete URL_STATE_KEYS constants

* Refactor useUrlStateHook

* Fix cypress tests by removing empty AppQuery from URL query string

Fix empty query validation by considering 'query=()' as empty

* Small code readability improvements

It mostly rename variables
2021-09-28 13:26:56 -04:00
Stacey Gammon
20202f7e7d
Add a plugin directory page to the docs build (#112862)
* Write plugin directory doc as part of api docs build.

* Replace service folder with the new name for index patterns

* Updated docs

* small update

* update docs
2021-09-28 13:17:12 -04:00
Maxwell Borden
18930d64a8
[FieldFormatters] Use default values for URL formatter (#113141)
* [FieldFormatters] Use default values for URL formatter
2021-09-28 09:10:10 -07:00
Anton Dosov
3311910736
[embeddable] Don’t include test samples into initial bundle (#113126) 2021-09-28 17:45:34 +02:00
Christiane (Tina) Heiligers
c647929eeb
Removes misc unused so/server/es config deprecations (#113173)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-28 08:01:22 -07:00
Sébastien Loix
e28f4298ce
[Index management] Treat indices beginning with a period as regular indices (#112990) 2021-09-28 15:29:36 +01:00
Davey Holler
d2eb1b083f
[App Search] Add document position indicator to Result component (#112759) 2021-09-28 10:11:03 -04:00
Corey Robertson
245b773235
[Canvas] Move workpad components to typescript (#112556)
* Move workpad components to typescript

* Fix types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-28 09:57:22 -04:00
Jean-Louis Leysens
7a49851bc3
[AppServices] Fix unhandled promise rejections in search tests (#112849)
* updated jest tests to avoid generating unhandled promise rejections

* rather use throwError

* remove unused imports

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-28 15:40:13 +02:00
Patryk Kopyciński
47c9efded8
Bump cypress@8.4.1 (#104301) 2021-09-28 15:07:54 +02:00
Rudolf Meijering
c361a56013
Fix flaky migrations integration test 103231 (#113127) 2021-09-28 14:44:13 +02:00
Mat Schaffer
ba4913829e
Beats instance page (#113086)
* Beats instance page

* Remove unused getPaginationRouteOptions
2021-09-28 21:40:22 +09:00
Mat Schaffer
c95f10d195
Fix breadcrumbs for react ES pages so far (#113087) 2021-09-28 21:38:41 +09:00
Shahzad
62e7deee3c
[User Experience app] Simplify page header responsiveness in ux app (#112930)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-28 13:56:00 +02:00
Jen Huang
c31674ce64
Fix some vars from preconfiguration not being added to package policies (#113204) 2021-09-28 07:53:06 -04:00
Pierre Gayvallet
daaa6f8c19
add SavedObjectType.management.displayName (#113091)
* add `SavedObjectType.management.displayName`

* fix unit tests

* add FTR test

* update generated doc

* also update labels

* fix unit tests
2021-09-28 13:49:00 +02:00
Tiago Costa
7010b67f2b
skip flaky suite (#112920) 2021-09-28 11:57:39 +01:00
Robert Oskamp
b146f82969
[ML] Functional tests - adjust custom URL timeout (#113223)
This PR adjusts the timeout for checking the custom URL label.
2021-09-28 12:38:27 +02:00
Dzmitry Lemechko
fe91978022
[deps] update chromedriver to 94 (#113153) 2021-09-28 12:36:39 +02:00
Marta Bondyra
618d1e5e99
[Lens] replace react specific props events with html events (#113156) 2021-09-28 10:55:41 +02:00
Matthias Wilhelm
c4ddb01d77
[Discover] Add "Chart options" menu (#112453)
Co-authored-by: Tim Roes <mail@timroes.de>
2021-09-28 10:53:29 +02:00
Robert Oskamp
fddb6493ac
[ML] Functional tests - stabilize and re-enable feature importance tests (#113125)
This PR re-enables and stabilizes the feature importance tests by making them independent from the number of features returned by the backend.
2021-09-28 10:50:21 +02:00
Vadim Kibana
c0bf0540dc
Short URLs (#107859) 2021-09-28 10:34:25 +02:00
Miriam
7727bf491c
[APM] Remove start and end from setupRequest (#112828)
* [APM] Remove start and end from setupRequest

* fix some types

* fix some conflicts

* PR review comments

* fix typing
2021-09-28 07:50:57 +01:00
Dario Gieselaar
165cafdd74
[APM] Use oldest exit span instead of newest (#113133) 2021-09-28 08:20:55 +02:00
Clint Andrew Hall
fae5946eee
[fleet] Divide and mock Storybook context, create Home story (#113064)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-27 22:45:56 -04:00
Jonathan Budzenski
73af4f8054 fix skip. #113067 2021-09-27 21:09:42 -05:00
John Dorlus
39e06326dc
Migrate Index Management Functional Tests To Use Test User (#113078)
* Added config and code to make index management use test user.

* Removed unused reference.

* Changed config back to only modifying the permissions on the indices.

* Fixed assertion for new permission.
2021-09-27 20:47:44 -04:00
Clint Andrew Hall
7f3182a1a6
[fleet] Fix over-call to chrome service in useBreadcrumb (#113065)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-27 19:47:12 -05:00
Frank Hassanabad
de43a3b83d
[Security Solutions] Adds back the legacy actions and notification system in a limited fashion (#112869)
## Summary

Fixes https://github.com/elastic/security-team/issues/1759

Related earlier PR, https://github.com/elastic/kibana/pull/109722, where these were removed to where they could no longer function. This PR adds them back to where they will function for existing users. The end goal is to have users naturally migrate as they update, enable/disable, or create new rules. 

What this PR does:
* Adds back the legacy side car actions `siem-detection-engine-rule-actions`
* Adds back the legacy hidden alert of `siem.notifications`
* Adds back unit tests where they existed. Both of these systems did not have existing e2e tests.
* Re-adds the find feature and functionality which should show the rules with legacy and non-legacy notifications/side car actions during a REST find operation.
* Updates the logic for when to show a legacy vs. non-legacy notification/side car action.
* Adds a new route called `/internal/api/detection/legacy/notifications` which is only for developer and tests for us to maintain this system for the foreseeable future.
* Adds script to exercise creating old notifications `detection_engine/scripts/post_legacy_notification.sh`
* Adds a data file for the script to use as an example for ad-hoc testing, `scripts/legacy_notifications/one_action.json`
* Adds within `security_solution/server/types.ts` `ActionsApiRequestHandlerContext` so that if we need to directly access actions within plugins we can. I do not use it here, but it should have been existing there and is good to have it in case we need it at this point within REST routes.
* When adding back the files and changes, I use the kibana-core approach of prefixing files, functions, types, etc... with the words `legacyFoo`. The files are named `legacy_foo.ts`. Everything has `@deprecation` above them as well. The intent here is all of this should hopefully make it unambiguously clear which parts of the notification system are for the new system/existing API and which ones are only for the deprecated legacy system. There exists some parts of the system that are used within _both_ and the hope is that we can keep the legacy pieces separate from the non-legacy pieces for strangling the legacy pieces.   
* This adds a new linter rule to prevent users from easily importing files named `legacy_foo.ts` or `foo_legacy.ts` we are using here and can also use for other similar legacy parts of the system we have.  This seems to be the established pattern that kibana-core does as well looking through the linters and code base.
* Removes some dead import/export code and types instead of maintaining them since they are no longer used.

What this PR does not do (but are planned on follow ups):
* This PR does not add migration logic in most conditions such as a user enabling/disabling a rule, editing a rule unless the user is explicitly changing the actions by turning off the notification and then re-adding the notification.
* This PR does not log any information indicating to the user that they are running legacy rules or indicates they have that.
* This PR does not allow the executors or any UI/UX, backend to re-add a legacy notification. Instead only the hidden REST route of `/internal/api/detection/legacy/notifications` allows us to do this for testing purposes.
* This PR does not migrate the data structure of actions legacy notification system `siem-detection-engine-rule-actions` to use saved object references.
* If you delete an alert this will not delete the side car if it detects one is present on it.
* If you update an alert notification with a new notification this will not remove the side car on the update.

**Ad-hoc testing instructions**
How to do ad-hoc testing for various situations such as having a legacy notification system such as a user's or if you want to mimic a malfunction and result of a "split-brain" to where you have both notification systems running at the same time due to a bug or regression:

Create a rule and activate it normally within security_solution:
<img width="1046" alt="Screen Shot 2021-09-22 at 2 09 14 PM" src="https://user-images.githubusercontent.com/1151048/134416564-e4e001a7-1086-46a1-aa8d-79880f70cc35.png">

Do not add actions to the rule at this point as we will first exercise the older legacy system. However, you want at least one action configured such as a slack notification:
<img width="575" alt="Screen Shot 2021-09-22 at 2 28 16 PM" src="https://user-images.githubusercontent.com/1151048/134417012-58e63709-5447-4832-8866-f82be1b9596b.png">

Within dev tools do a query for all your actions and grab one of the `_id` of them without their prefix:
```json
# See all your actions
GET .kibana/_search
{
  "query": {
    "term": {
      "type": "action"
    }
  }
}
```

Mine was `"_id" : "action:879e8ff0-1be1-11ec-a722-83da1c22a481",` so I will be copying the ID of `879e8ff0-1be1-11ec-a722-83da1c22a481`

Go to the file `detection_engine/scripts/legacy_notifications/one_action.json` and add this id to the file. Something like this:
```json
{
  "name": "Legacy notification with one action",
  "interval": "1m",  <--- You can use whatever you want. Real values are "1h", "1d", "1w". I use "1m" for testing purposes.
  "actions": [
    {
      "id": "879e8ff0-1be1-11ec-a722-83da1c22a481", <--- My action id
      "group": "default",
      "params": {
        "message": "Hourly\nRule {{context.rule.name}} generated {{state.signals_count}} alerts"
      },
      "actionTypeId": ".slack" <--- I am a slack action id type.
    }
  ]
}
```

Query for an alert you want to add manually add back a legacy notification to it. Such as:
```json
# See all your siem.signals alert types and choose one
GET .kibana/_search
{
  "query": {
    "term": {
      "alert.alertTypeId": "siem.signals"
    }
  }
}
```

Grab the `_id` without the `alert` prefix. For mine this was `933ca720-1be1-11ec-a722-83da1c22a481`

Within the directory of `detection_engine/scripts` execute the script
```bash
./post_legacy_notification.sh 933ca720-1be1-11ec-a722-83da1c22a481
{
  "ok": "acknowledged"
}
```

which is going to do a few things. See the file `detection_engine/routes/rules/legacy_create_legacy_notification.ts` for the definition of the route and what it does in full, but we should notice that we have now:

Created a legacy side car action object of type `siem-detection-engine-rule-actions` you can see in dev tools:
```json
# See the actions "side car" which are part of the legacy notification system.
GET .kibana/_search
{
  "query": {
    "term": {
      "type": {
        "value": "siem-detection-engine-rule-actions"
      }
    }
  }
}
```

Note in the response:
```json
          "siem-detection-engine-rule-actions" : {
            "ruleAlertId" : "933ca720-1be1-11ec-a722-83da1c22a481", <--- NOTE, not migrated to references yet
            "actions" : [
              {
                "action_type_id" : ".slack",
                "id" : "879e8ff0-1be1-11ec-a722-83da1c22a481", <--- NOTE, not migrated to references yet
                "params" : {
                  "message" : "Hourly\nRule {{context.rule.name}} generated {{state.signals_count}} alerts"
                },
                "group" : "default"
              }
            ],
            "ruleThrottle" : "1m", <--- Should be the same as the interval in "one_action.json" config
            "alertThrottle" : "1m" <--- Should be the same as the interval in "one_action.json" config
          },
          "type" : "siem-detection-engine-rule-actions",
          "references" : [ ],
```

Created a `siem.notification` rule instance which you can see in dev tools as well:
```json
# Get the alert type of "siem-notifications" which is part of the legacy system.
GET .kibana/_search
{
  "query": {
    "term": {
      "alert.alertTypeId": "siem.notifications"
    }
  }
}
```

Take note from the `siem.notifications` these values which determine how/when it fires and if your actions are set up correctly:
```json
            "name" : "Legacy notification with one action" <--- Our name from one_action.json 
            "schedule" : {
              "interval" : "1m" <--- Interval should match interval in one_action.json
            },
            "enabled" : true, <--- We should be enabled
            "actions" : [
              {
                "group" : "default",
                "params" : {
                  "message" : "Hourly\nRule {{context.rule.name}} generated {{state.signals_count}} alerts"
                },
                "actionTypeId" : ".slack", <--- Our actionID
                "actionRef" : "action_0"
              }
            ],
```


And that now there exists a task within task manager that will be executing this:
```json
# Get the tasks of siem notifications to ensure and see it is running
GET .task-manager/_search
{
  "query": {
    "term": {
      "task.taskType": "alerting:siem.notifications"
    }
  }
}
```

You can double check the interval from the result of the query to ensure it runs as the configuration test file shows it should be:
```json
            "schedule" : {
              "interval" : "1m"
            },
```

Within time you should see your action execute like the legacy notification system:
<img width="876" alt="Screen Shot 2021-09-22 at 2 55 28 PM" src="https://user-images.githubusercontent.com/1151048/134422639-80523abb-f43c-4f7c-abef-a60062bef139.png">

If you go to edit the rule you should notice that the rule now has the side car attached to it within the UI:
<img width="1050" alt="Screen Shot 2021-09-22 at 8 08 54 PM" src="https://user-images.githubusercontent.com/1151048/134445265-fa0a330b-3238-48e2-aef3-6042c7e9aa69.png">

You can also look at your log messages in debug mode to verify the behaviors of the legacy system and the normal rules running.

Compare these data structures to a 7.14.x system in cloud to ensure the data looks the same and the ad-hoc testing functions as expected.

Check the scripts of `./find_rules.sh`, `./read_rules.sh` to ensure that the find REST route returns the legacy actions when they are there.

### 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
2021-09-27 17:18:03 -06:00
Jonathan Budzenski
90792cf738
Bump lmdb-store to 1.6.8 (#112743)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-27 17:42:19 -04:00
Ece Özalp
5955ed550a
[Security Solution] Fix inspect button bug on the overview page (#113161)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-27 17:14:30 -04:00
Jonathan Budzenski
96bfe341c4
[docs] Update keystore location (#111994)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-27 16:12:45 -05:00
Joey F. Poon
94e7844301
[Security Solution] update endpoint list api to support united index (#112758) 2021-09-27 14:51:31 -05:00
Jason Stoltzfus
1767bee636
Added a SuggestionsTable to Curations view (#113123) 2021-09-27 15:50:53 -04:00
Diana Derevyankina
3e5d5f4415
[Viz] legend duplicates percentile options when chart has both left & right Y axes (#113073)
* [Viz] legend duplicates percentile options when chart has both left & right Y axes

* Update comment for isPercentileIdEqualToSeriesId

* Remove Dimension interface

* Replace partial aspect with whole aspect value

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-27 22:15:54 +03:00