Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIEM][Detections] Adds large list support using REST endpoints #62552

Merged
merged 82 commits into from
Apr 28, 2020

Conversation

FrankHassanabad
Copy link
Contributor

@FrankHassanabad FrankHassanabad commented Apr 4, 2020

Summary

  • Adds large list support using REST endpoints.

Status:

  • Currently ready to be merged behind the feature flag of it being disabled with ongoing work happening after it is merged.
  • REST Endpoints shouldn't have large refactoring at this point
  • Team meeting occurred where the pieces were discussed in person.

What is left?

Testing

Ensure you set this in your ENV before starting Kibana:

export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true

Download or create a large list file such as this one filled with IP's:
https://cinsscore.com/list/ci-badguys.txt

Go to your REST endpoint folder of scripts:

cd kibana/x-pack/plugins/lists/server/scripts

Do a hard reset:

./hard_reset

Then import it as either a data type of ip:

./import_list_items_by_filename.sh ip ~/Downloads/ci-badguys-smaller.txt

Or as a keyword

./import_list_items_by_filename.sh keyword ~/Downloads/ci-badguys-smaller.txt

Then you can export it through:

./export_list_items.sh ci-badgusy-smaller.txt

For all the other endpoints and testing of the CRUD operations you have access to:

delete_all_lists.sh
delete_list.sh
delete_list_index.sh
delete_list_item.sh
delete_list_item_by_id.sh
delete_list_item_by_value.sh
export_list_items.sh
export_list_items_to_file.sh
get_list.sh
get_list_item_by_id.sh
get_list_item_by_value.sh
import_list_items.sh
import_list_items_by_filename.sh
lists_index_exists.sh
patch_list.sh
patch_list_item.sh
post_list.sh
post_list_index.sh
post_list_item.sh

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@FrankHassanabad FrankHassanabad changed the title Add list endpoints [SIEM][Detections] Adds large list support for REST endpoints Apr 4, 2020
@FrankHassanabad FrankHassanabad changed the title [SIEM][Detections] Adds large list support for REST endpoints [SIEM][Detections] Adds large list support using REST endpoints Apr 4, 2020
@elastic elastic deleted a comment from kibanamachine Apr 5, 2020
@angorayc
Copy link
Contributor

@spong
Copy link
Member

spong commented Apr 23, 2020

@elasticmachine merge upstream

@spalger

This comment has been minimized.

Copy link
Contributor

@yctercero yctercero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I pulled down and ran through the scripts. Added super minor comments. This is really clean and nice/easy to read through :)

'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look forward to having some of these over in the detections engine too :)

import * as t from 'io-ts';

export const listItemIndexExistSchema = t.type({
lists_index: t.boolean,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - Would you want these changed to be singular list... to match the changes you made in the ConfigSchema to make them singular?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I will change it to singular form. I left the REST endpoint plural and folder naming but made everything else singular form.

});
} else if (type != null) {
const { filename } = request.body.file.hapi;
// TODO: Should we prevent the same file from being uploaded multiple times?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we surface up more info on imports? Even on a successful import I wasn't seeing any sort of response message showing up. And maybe on duplicates (looks like right now we're not allowing and just returning the existing list?) also add a message letting user know of current behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicates are tricky as its an async operation when it does imports at a particular lower level. The counting of the duplicates and what not become wrong values or false values as the streams can be independent parallel things.

I noticed a lot of odd streaming things and I don't want to add penalties of waiting in any other areas as I think we want to introduce streaming of large list items as a feature from the REST endpoint all the way to the backend and hopefully 🤞back-pressure works auto-magically with the streams from the browser to the backend.

If the imports become pure streaming in, we might be able to re-introduce duplicate counting but the way this works right now it "sinks" all the lists into memory on the import and then begins streaming that list into the backend and returns the 200 so it does not time out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will bubble up more information here on an import where it auto-creates the list. I think that is a good idea.

@FrankHassanabad

This comment has been minimized.

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / Firefox XPack UI Functional Tests.x-pack/test/functional/apps/spaces/enter_space·ts.Spaces app Enter Space "after each" hook for "falls back to the default home page when the configured default route is malformed"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:07:18]         └-: Spaces app
[00:07:18]           └-> "before all" hook
[00:18:06]           └-: Enter Space
[00:18:06]             └-> "before all" hook
[00:18:06]             └-> "before all" hook
[00:18:06]               │ info [spaces/enter_space] Loading "mappings.json"
[00:18:06]               │ info [spaces/enter_space] Loading "data.json"
[00:18:06]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_2/A4oWJVl4S7SJIRU0tmy_WA] deleting index
[00:18:06]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_1/EPKS7cHuSmyiQkmE1PRjYg] deleting index
[00:18:06]               │ info [spaces/enter_space] Deleted existing index [".kibana_2",".kibana_1"]
[00:18:06]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] applying create index request using v1 templates []
[00:18:06]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:18:07]               │ info [spaces/enter_space] Created index ".kibana"
[00:18:07]               │ debg [spaces/enter_space] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:18:07]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana/hwhlxNXqS-CGaRnmd0R9qw] update_mapping [_doc]
[00:18:07]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana/hwhlxNXqS-CGaRnmd0R9qw] update_mapping [_doc]
[00:18:07]               │ info [spaces/enter_space] Indexed 5 docs into ".kibana"
[00:18:07]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana/hwhlxNXqS-CGaRnmd0R9qw] update_mapping [_doc]
[00:18:07]               │ debg Migrating saved objects
[00:18:07]               │ proc [kibana]   log   [20:58:23.502] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:18:08]               │ proc [kibana]   log   [20:58:23.537] [info][savedobjects-service] Creating index .kibana_2.
[00:18:08]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] applying create index request using v1 templates []
[00:18:08]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:18:08]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] updating number_of_replicas to [0] for indices [.kibana_2]
[00:18:08]               │ proc [kibana]   log   [20:58:23.661] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:18:08]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] applying create index request using v1 templates []
[00:18:08]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:18:08]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] updating number_of_replicas to [0] for indices [.kibana_1]
[00:18:08]               │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] 13285 finished with response BulkByScrollResponse[took=29.8ms,timed_out=false,sliceId=null,updated=0,created=6,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:18:08]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana/hwhlxNXqS-CGaRnmd0R9qw] deleting index
[00:18:08]               │ proc [kibana]   log   [20:58:24.074] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:18:08]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_2/UaKAr1-PRcu9xr_tJ_XsAg] update_mapping [_doc]
[00:18:08]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_2/UaKAr1-PRcu9xr_tJ_XsAg] update_mapping [_doc]
[00:18:08]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_2/UaKAr1-PRcu9xr_tJ_XsAg] update_mapping [_doc]
[00:18:08]               │ proc [kibana]   log   [20:58:24.290] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:18:08]               │ proc [kibana]   log   [20:58:24.384] [info][savedobjects-service] Finished in 848ms.
[00:18:08]               │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:18:08]               │ proc [kibana]   log   [20:58:24.443] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:18:08]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] [.kibana_2/UaKAr1-PRcu9xr_tJ_XsAg] update_mapping [_doc]
[00:18:09]               │ proc [kibana]   log   [20:58:24.644] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:18:09]               │ debg SecurityPage.forceLogout
[00:18:09]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=100
[00:18:09]               │ debg Already on the login page, not forcing anything
[00:18:09]             └-> falls back to the default home page when the configured default route is malformed
[00:18:09]               └-> "before each" hook: global before each
[00:18:09]               │ debg navigating to login url: http://localhost:6111/login
[00:18:09]               │ debg navigate to: http://localhost:6111/login
[00:18:09]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:18:09]               │ debg ... sleep(700) start
[00:18:10]               │ debg ... sleep(700) end
[00:18:10]               │ debg returned from get, calling refresh
[00:18:11]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:18:11]               │ debg currentUrl = http://localhost:6111/login
[00:18:11]               │          appUrl = http://localhost:6111/login
[00:18:11]               │ debg TestSubjects.find(kibanaChrome)
[00:18:11]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:18:50]               │ debg browser[info] "INFO: 2020-04-28T20:59:05Z
[00:18:50]               │        Adding connection to http://localhost:6111/elasticsearch
[00:18:50]               │
[00:18:50]               │      "
[00:19:01]               │ debg ... sleep(501) start
[00:19:02]               │ debg ... sleep(501) end
[00:19:02]               │ debg in navigateTo url = http://localhost:6111/login
[00:19:02]               │ debg TestSubjects.exists(statusPageContainer)
[00:19:02]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:19:04]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:19:05]               │ debg TestSubjects.setValue(loginUsername, elastic)
[00:19:05]               │ debg TestSubjects.click(loginUsername)
[00:19:05]               │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:19:05]               │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:19:06]               │ debg TestSubjects.setValue(loginPassword, changeme)
[00:19:06]               │ debg TestSubjects.click(loginPassword)
[00:19:06]               │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:19:06]               │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:19:06]               │ debg TestSubjects.click(loginSubmit)
[00:19:06]               │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:19:06]               │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:19:06]               │ proc [kibana]   log   [20:59:22.189] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:06]               │ proc [kibana]   log   [20:59:22.206] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:06]               │ proc [kibana]   log   [20:59:22.317] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:06]               │ proc [kibana]   log   [20:59:22.324] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:06]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:19:06]               │ debg TestSubjects.find(kibanaSpaceSelector)
[00:19:06]               │ debg Find.findByCssSelector('[data-test-subj="kibanaSpaceSelector"]') with timeout=10000
[00:19:09]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] applying create index request using v1 templates [.kibana-event-log-8.0.0-template]
[00:19:09]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xl-1588104258133744889] applying create index request using v1 templates [ilm-history]
[00:19:32]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="kibanaSpaceSelector"])
[00:19:32]               │      Wait timed out after 25290ms
[00:19:32]               │ debg TestSubjects.find(kibanaSpaceSelector)
[00:19:32]               │ debg Find.findByCssSelector('[data-test-subj="kibanaSpaceSelector"]') with timeout=10000
[00:19:33]               │ debg browser[info] "INFO: 2020-04-28T20:59:48Z
[00:19:33]               │        Adding connection to http://localhost:6111/elasticsearch
[00:19:33]               │
[00:19:33]               │      "
[00:19:33]               │ proc [kibana]   log   [20:59:49.066] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:33]               │ proc [kibana]   log   [20:59:49.152] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:33]               │ proc [kibana]   log   [20:59:49.232] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:33]               │ proc [kibana]   log   [20:59:49.335] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:33]               │ proc [kibana]   log   [20:59:49.388] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ debg Finished login process, landed on space selector. currentUrl = http://localhost:6111/spaces/space_selector
[00:19:34]               │ info SpaceSelectorPage:clickSpaceCard(default)
[00:19:34]               │ debg TestSubjects.click(space-card-default)
[00:19:34]               │ debg Find.clickByCssSelector('[data-test-subj="space-card-default"]') with timeout=10000
[00:19:34]               │ debg Find.findByCssSelector('[data-test-subj="space-card-default"]') with timeout=10000
[00:19:34]               │ proc [kibana]   log   [20:59:49.577] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:49.591] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:49.691] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ debg browser[log] "Detected an unhandled Promise rejection.
[00:19:34]               │      TypeError: NetworkError when attempting to fetch resource."
[00:19:34]               │ proc [kibana]   log   [20:59:49.749] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:49.760] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:49.817] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:49.861] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:49.939] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:50.150] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ proc [kibana]   log   [20:59:50.160] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:19:34]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:19:34]               │ debg ... sleep(1000) start
[00:19:35]               │ debg ... sleep(1000) end
[00:19:35]               │ debg expectRoute(default, /app/kibana#/home)
[00:19:35]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"] nav:not(.ng-hide) ') with timeout=20000
[00:20:28]               │ debg browser[info] "INFO: 2020-04-28T21:00:43Z
[00:20:28]               │        Adding connection to http://localhost:6111/elasticsearch
[00:20:28]               │
[00:20:28]               │      "
[00:20:28]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="kibanaChrome"] nav:not(.ng-hide) )
[00:20:28]               │      Wait timed out after 52779ms
[00:20:28]               │ proc [kibana]   log   [21:00:44.015] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:28]               │ proc [kibana]   log   [21:00:44.050] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:28]               │ proc [kibana]   log   [21:00:44.302] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:28]               │ proc [kibana]   log   [21:00:44.313] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:28]               │ debg expectRoute(default, /app/kibana#/home)
[00:20:28]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"] nav:not(.ng-hide) ') with timeout=20000
[00:20:30]               │ proc [kibana]   log   [21:00:46.046] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:30]               │ proc [kibana]   log   [21:00:46.058] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:40]               └- ✓ pass  (2.0m) "Spaces app Enter Space falls back to the default home page when the configured default route is malformed"
[00:20:40]             └-> "after each" hook
[00:20:40]               │ debg SecurityPage.forceLogout
[00:20:40]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=100
[00:20:40]               │ proc [kibana]   log   [21:00:55.716] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:40]               │ proc [kibana]   log   [21:00:55.925] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:40]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:20:40]               │ debg Redirecting to /logout to force the logout
[00:20:41]               │ proc [kibana]   log   [21:00:56.600] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:41]               │ proc [kibana]   log   [21:00:56.611] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:41]               │ proc [kibana]   log   [21:00:56.621] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:20:41]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:20:41]               │ debg Waiting on the login form to appear
[00:20:41]               │ debg Waiting up to 100000ms for login form...
[00:20:41]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:20:44]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:20:45]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:21:22]               │ debg browser[info] "INFO: 2020-04-28T21:01:38Z
[00:21:22]               │        Adding connection to http://localhost:6111/elasticsearch
[00:21:22]               │
[00:21:22]               │      "
[00:21:23]               │ proc [kibana]   log   [21:01:38.730] [warning][ui-settings-service] Ignore invalid UiSettings value. Error: [validation [defaultRoute]]: Must be a relative URL..
[00:21:23]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:22:17]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:18]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:22:34]               │ debg browser[log] "Detected an unhandled Promise rejection.
[00:22:34]               │      out of memory"
[00:22:37]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:38]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:22:40]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:41]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:22:44]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:45]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:22:48]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:49]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:22:51]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:52]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:22:55]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:56]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:22:58]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:22:59]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:02]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:03]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:06]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:07]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:09]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:10]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:13]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:14]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:16]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:17]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:20]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:21]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:23]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:24]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:27]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:28]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:30]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:31]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:34]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:35]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:37]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:38]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:41]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:42]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:44]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:45]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:48]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:49]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:51]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:52]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:55]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:56]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:23:58]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:23:59]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:02]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:03]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:05]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:06]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:09]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:10]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:13]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:14]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:16]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:17]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:20]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:21]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:23]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:24]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:27]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:28]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:30]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:31]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:34]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:35]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:37]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:38]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:41]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:42]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:44]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:45]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:48]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:49]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:51]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:52]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:55]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:56]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:24:58]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:24:59]               │ proc [kibana]   log   [21:05:14.515] [warning][plugins][taskManager][taskManager] Cancelling task lens_telemetry "Lens-lens_telemetry" as it expired at 2020-04-28T20:58:14.327Z after running for 08m 00s (with timeout set at 1m).
[00:24:59]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:02]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:03]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:05]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:06]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:09]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:10]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:12]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:13]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:16]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:17]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:20]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:21]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:23]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:24]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:27]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:28]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:30]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:31]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:34]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:35]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:37]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:38]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:41]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:42]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:44]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:45]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:48]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:49]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:51]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:52]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:55]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:56]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:58]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:59]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:02]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:03]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:05]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:06]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:09]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:10]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:13]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:14]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:16]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:17]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:20]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:21]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:23]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:24]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:27]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:28]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:30]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:31]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:34]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:35]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:37]               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:26:38]               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:26:40]               └- ✖ fail: "Spaces app Enter Space "after each" hook for "falls back to the default home page when the configured default route is malformed""
[00:26:40]               │

Stack Trace

[Error: Timeout of 360000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/dev/shm/workspace/kibana/x-pack/test/functional/apps/spaces/enter_space.ts)]

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@FrankHassanabad FrankHassanabad merged commit 1282341 into elastic:master Apr 28, 2020
@FrankHassanabad FrankHassanabad deleted the add-list-endpoints branch April 28, 2020 22:00
FrankHassanabad added a commit that referenced this pull request Apr 29, 2020
…#62552) (#64710)

* [SIEM][Detections] Adds large list support using REST endpoints

* Adds large list support using REST endpoints.

Status:
---

* Currently ready to be merged behind the feature flag of it being disabled with ongoing work happening after it is merged.
* REST Endpoints shouldn't have large refactoring at this point
* Team meeting occurred where the pieces were discussed in person.

What is left?
---

- [ ] Add other data types. At the moment `ip` and `keyword` are the two types of lists. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html
- [x] Unit tests
- [x] Lots of misc TODO's in the code base still
- [ ] Import loads everything into memory first when it should attempt streaming
- [ ] Add end to end backend tests
- [x] Add transform and io-ts validation for returns

Testing
---

Ensure you set this in your ENV before starting Kibana:
```ts
export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true
```

Download or create a large list file such as this one filled with IP's:
https://cinsscore.com/list/ci-badguys.txt

Go to your REST endpoint folder of scripts:
```ts
cd kibana/x-pack/plugins/lists/server/scripts
```

Do a hard reset:
```ts
./hard_reset
```

Then import it as either a data type of `ip`:
```ts
./import_list_items_by_filename.sh ip ~/Downloads/ci-badguys-smaller.txt
```

Or as a `keyword`
```ts
./import_list_items_by_filename.sh keyword ~/Downloads/ci-badguys-smaller.txt
```

Then you can export it through:
```ts
./export_list_items.sh ci-badgusy-smaller.txt
```

For all the other endpoints and testing of the CRUD operations you have access to:

```ts
delete_all_lists.sh
delete_list.sh
delete_list_index.sh
delete_list_item.sh
delete_list_item_by_id.sh
delete_list_item_by_value.sh
export_list_items.sh
export_list_items_to_file.sh
get_list.sh
get_list_item_by_id.sh
get_list_item_by_value.sh
import_list_items.sh
import_list_items_by_filename.sh
lists_index_exists.sh
patch_list.sh
patch_list_item.sh
post_list.sh
post_list_index.sh
post_list_item.sh
```

Delete any items that are not applicable to this PR.

- [ ] [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

- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)

* Delete CODEOWNERS

Code owners should not be backported

Co-authored-by: Elastic Machine <[email protected]>
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Sep 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:enhancement Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants