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

[7.x] Add Host Risk metadata data to alerts flyout (#113274) #114238

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

kibanamachine
Copy link
Contributor

Backports the following commits to 7.x:

* Filter out empty values from alert flyout overview

* Add Host Risk metadata data to alerts flyout

* Add feature flag to host risk data query

* Swap investigation guide and enrichment data places in the UI

* Migrate alert_summary_view.test to react testing library

* Refactor threat summary by extracting components and renaming
@kibanamachine
Copy link
Contributor Author

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/uptime/certificates·ts.Uptime app with generated data certificates with certs page "before each" hook for "displays certificates"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://github.com/elastic/kibana/issues/112900

[00:00:00]     │
[00:00:00]       └-: Uptime app
[00:00:00]         └-> "before all" hook in "Uptime app"
[00:00:00]         └-: with generated data
[00:00:00]           └-> "before all" hook in "with generated data"
[00:01:11]           └-: certificates
[00:01:11]             └-> "before all" hook in "certificates"
[00:01:26]             └-: with certs
[00:01:26]               └-> "before all" hook for "can navigate to cert page"
[00:01:26]               └-> "before all" hook for "can navigate to cert page"
[00:01:26]                 │ info [x-pack/test/functional/es_archives/uptime/blank] Loading "mappings.json"
[00:01:26]                 │ info [x-pack/test/functional/es_archives/uptime/blank] Loading "data.json"
[00:01:26]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [heartbeat-7-generated-test] creating index, cause [api], templates [], shards [1]/[1]
[00:01:27]                 │ info [x-pack/test/functional/es_archives/uptime/blank] Created index "heartbeat-7-generated-test"
[00:01:27]                 │ debg [x-pack/test/functional/es_archives/uptime/blank] "heartbeat-7-generated-test" settings undefined
[00:01:27]                 │ debg TestSubjects.exists(uptimeSettingsToOverviewLink)
[00:01:27]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeSettingsToOverviewLink"]') with timeout=0
[00:01:27]                 │ debg --- retry.tryForTime error: [data-test-subj="uptimeSettingsToOverviewLink"] is not displayed
[00:01:27]                 │ debg navigating to uptime url: http://localhost:61231/app/uptime
[00:01:27]                 │ debg navigate to: http://localhost:61231/app/uptime
[00:01:27]                 │ debg browser[INFO] http://localhost:61231/app/uptime?_t=1633599691042 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:01:27]                 │
[00:01:27]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:27]                 │ debg ... sleep(700) start
[00:01:28]                 │ debg ... sleep(700) end
[00:01:28]                 │ debg returned from get, calling refresh
[00:01:29]                 │ debg browser[INFO] http://localhost:61231/app/uptime?_t=1633599691042 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:01:29]                 │
[00:01:29]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:29]                 │ debg currentUrl = http://localhost:61231/app/uptime
[00:01:29]                 │          appUrl = http://localhost:61231/app/uptime
[00:01:29]                 │ debg TestSubjects.find(kibanaChrome)
[00:01:29]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:01:30]                 │ debg ... sleep(501) start
[00:01:31]                 │ERROR browser[SEVERE] http://localhost:61231/44975/bundles/plugin/uptime/8.0.0/uptime.chunk.1.js 2:3687 "API /api/uptime/monitor/list is not returning expected response, Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.monitor.timespan.lt\" for response" Object
[00:01:31]                 │ debg ... sleep(501) end
[00:01:31]                 │ debg in navigateTo url = http://localhost:61231/app/uptime
[00:01:31]                 │ debg isGlobalLoadingIndicatorVisible
[00:01:31]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:01:31]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:01:32]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:01:33]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:01:33]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:01:33]                 │ debg TestSubjects.exists(uptimeOverviewPage)
[00:01:33]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeOverviewPage"]') with timeout=2000
[00:01:33]                 │ debg TestSubjects.click(superDatePickerApplyTimeButton)
[00:01:33]                 │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:01:33]                 │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:01:33]               └-> can navigate to cert page
[00:01:33]                 └-> "before each" hook: global before each for "can navigate to cert page"
[00:01:33]                 └-> "before each" hook: delete settings for "can navigate to cert page"
[00:01:33]                   │ debg Deleting saved object {
[00:01:33]                   │        type: 'uptime-dynamic-settings',
[00:01:33]                   │        id: 'uptime-dynamic-settings-singleton'
[00:01:33]                   │      }/%s
[00:01:33]                   │ERROR browser[SEVERE] http://localhost:61231/44975/bundles/plugin/uptime/8.0.0/uptime.chunk.1.js 2:3687 "API /api/uptime/monitor/list is not returning expected response, Invalid value \"undefined\" supplied to \"summaries.state.summaryPings.monitor.timespan.lt\" for response" Object
[00:01:34]                 └-> "before each" hook: load heartbeat data for "can navigate to cert page"
[00:01:34]                   │ info [x-pack/test/functional/es_archives/uptime/blank] Loading "mappings.json"
[00:01:34]                   │ info [x-pack/test/functional/es_archives/uptime/blank] Loading "data.json"
[00:01:34]                   │ info [o.e.c.m.MetadataDeleteIndexService] [node-01] [heartbeat-7-generated-test/E-iOddy7RJ-BYZBIOVvwfA] deleting index
[00:01:34]                   │ info [x-pack/test/functional/es_archives/uptime/blank] Deleted existing index "heartbeat-7-generated-test"
[00:01:34]                   │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [heartbeat-7-generated-test] creating index, cause [api], templates [], shards [1]/[1]
[00:01:34]                   │ info [x-pack/test/functional/es_archives/uptime/blank] Created index "heartbeat-7-generated-test"
[00:01:34]                   │ debg [x-pack/test/functional/es_archives/uptime/blank] "heartbeat-7-generated-test" settings undefined
[00:01:34]                 └-> "before each" hook for "can navigate to cert page"
[00:01:34]                 │ debg isGlobalLoadingIndicatorVisible
[00:01:34]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:01:34]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:01:36]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:01:36]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:01:36]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:01:36]                 │ debg TestSubjects.exists(data-missing)
[00:01:36]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="data-missing"]') with timeout=2500
[00:01:39]                 │ debg --- retry.tryForTime error: [data-test-subj="data-missing"] is not displayed
[00:01:39]                 │ debg TestSubjects.missingOrFail(data-missing)
[00:01:39]                 │ debg Find.waitForDeletedByCssSelector('[data-test-subj="data-missing"]') with timeout=2500
[00:01:40]                 │ debg Find.existsByCssSelector('[href="/app/uptime/certificates"]') with timeout=2500
[00:01:40]                 │ debg TestSubjects.exists(uptimeCertificatesPage)
[00:01:40]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeCertificatesPage"]') with timeout=0
[00:01:40]                 │ debg --- retry.tryForTime error: [data-test-subj="uptimeCertificatesPage"] is not displayed
[00:01:40]                 │ debg Find.existsByCssSelector('[href="/app/uptime/certificates"]') with timeout=0
[00:01:40]                 │ debg Find.clickByCssSelector('[href="/app/uptime/certificates"]') with timeout=10000
[00:01:40]                 │ debg Find.findByCssSelector('[href="/app/uptime/certificates"]') with timeout=10000
[00:01:41]                 │ debg TestSubjects.exists(uptimeCertificatesPage)
[00:01:41]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeCertificatesPage"]') with timeout=120000
[00:01:41]                 └- ✓ pass  (6.3s) "Uptime app with generated data certificates with certs can navigate to cert page"
[00:01:41]               └-> "after each" hook: unload for "can navigate to cert page"
[00:01:41]                 │ info [x-pack/test/functional/es_archives/uptime/blank] Unloading indices from "mappings.json"
[00:01:41]                 │ info [o.e.c.m.MetadataDeleteIndexService] [node-01] [heartbeat-7-generated-test/VJlo3jK8TtqSN4s2qLkmMA] deleting index
[00:01:41]                 │ info [x-pack/test/functional/es_archives/uptime/blank] Deleted existing index "heartbeat-7-generated-test"
[00:01:41]                 │ info [x-pack/test/functional/es_archives/uptime/blank] Unloading indices from "data.json"
[00:01:41]               └-: page
[00:01:41]                 └-> "before all" hook for "displays certificates"
[00:01:41]                 └-> displays certificates
[00:01:41]                   └-> "before each" hook: global before each for "displays certificates"
[00:01:41]                   └-> "before each" hook: delete settings for "displays certificates"
[00:01:41]                     │ debg Deleting saved object {
[00:01:41]                     │        type: 'uptime-dynamic-settings',
[00:01:41]                     │        id: 'uptime-dynamic-settings-singleton'
[00:01:41]                     │      }/%s
[00:01:41]                   └-> "before each" hook: load heartbeat data for "displays certificates"
[00:01:41]                     │ info [x-pack/test/functional/es_archives/uptime/blank] Loading "mappings.json"
[00:01:41]                     │ info [x-pack/test/functional/es_archives/uptime/blank] Loading "data.json"
[00:01:41]                     │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [heartbeat-7-generated-test] creating index, cause [api], templates [], shards [1]/[1]
[00:01:41]                     │ info [x-pack/test/functional/es_archives/uptime/blank] Created index "heartbeat-7-generated-test"
[00:01:41]                     │ debg [x-pack/test/functional/es_archives/uptime/blank] "heartbeat-7-generated-test" settings undefined
[00:01:41]                   └-> "before each" hook for "displays certificates"
[00:01:41]                   └-> "before each" hook for "displays certificates"
[00:01:41]                     │ debg TestSubjects.exists(uptimeCertificatesPage)
[00:01:41]                     │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="uptimeCertificatesPage"]') with timeout=0
[00:01:41]                     │ debg TestSubjects.click(superDatePickerApplyTimeButton)
[00:01:41]                     │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:01:41]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:01:51]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:01:51]                     │      Wait timed out after 10033ms
[00:01:52]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:02:02]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:02:02]                     │      Wait timed out after 10021ms
[00:02:02]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:02:12]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:02:12]                     │      Wait timed out after 10040ms
[00:02:13]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:02:23]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:02:23]                     │      Wait timed out after 10031ms
[00:02:23]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:02:33]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:02:33]                     │      Wait timed out after 10047ms
[00:02:34]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:02:44]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:02:44]                     │      Wait timed out after 10042ms
[00:02:45]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:02:55]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:02:55]                     │      Wait timed out after 10041ms
[00:02:55]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:03:05]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:03:05]                     │      Wait timed out after 10028ms
[00:03:06]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:03:16]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:03:16]                     │      Wait timed out after 10006ms
[00:03:16]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:03:26]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:03:26]                     │      Wait timed out after 10046ms
[00:03:27]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:03:37]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:03:37]                     │      Wait timed out after 10050ms
[00:03:37]                     │ debg Find.findByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=10000
[00:03:47]                     │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:03:47]                     │      Wait timed out after 10049ms
[00:03:48]                     │ info Taking screenshot "/dev/shm/workspace/parallel/23/kibana/x-pack/test/functional/screenshots/failure/Uptime app with generated data certificates with certs page _before each_ hook for _displays certificates_.png"
[00:03:48]                     │ info Current URL is: http://localhost:61231/app/uptime/certificates
[00:03:48]                     │ info Saving page source to: /dev/shm/workspace/parallel/23/kibana/x-pack/test/functional/failure_debug/html/Uptime app with generated data certificates with certs page _before each_ hook for _displays certificates_.html
[00:03:48]                     └- ✖ fail: Uptime app with generated data certificates with certs page "before each" hook for "displays certificates"
[00:03:48]                     │      Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
[00:03:48]                     │ Wait timed out after 10049ms
[00:03:48]                     │     at /dev/shm/workspace/parallel/23/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:03:48]                     │     at runMicrotasks (<anonymous>)
[00:03:48]                     │     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:03:48]                     │       at onFailure (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:03:48]                     │       at retryForSuccess (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry_for_success.ts:57:13)
[00:03:48]                     │       at RetryService.try (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry.ts:31:12)
[00:03:48]                     │       at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/23/kibana/test/functional/services/common/find.ts:360:5)
[00:03:48]                     │       at TestSubjects.click (/dev/shm/workspace/parallel/23/kibana/test/functional/services/common/test_subjects.ts:105:5)
[00:03:48]                     │       at refreshApp (test/functional/services/uptime/navigation.ts:32:5)
[00:03:48]                     │       at Object.refreshApp (test/functional/services/uptime/navigation.ts:37:7)
[00:03:48]                     │       at Context.<anonymous> (test/functional/apps/uptime/certificates.ts:67:11)
[00:03:48]                     │       at Object.apply (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:03:48]                     │ 
[00:03:48]                     │ 

Stack Trace

Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="superDatePickerApplyTimeButton"])
Wait timed out after 10049ms
    at /dev/shm/workspace/parallel/23/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at onFailure (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry_for_success.ts:17:9)
    at retryForSuccess (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry_for_success.ts:57:13)
    at RetryService.try (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry.ts:31:12)
    at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/23/kibana/test/functional/services/common/find.ts:360:5)
    at TestSubjects.click (/dev/shm/workspace/parallel/23/kibana/test/functional/services/common/test_subjects.ts:105:5)
    at refreshApp (test/functional/services/uptime/navigation.ts:32:5)
    at Object.refreshApp (test/functional/services/uptime/navigation.ts:37:7)
    at Context.<anonymous> (test/functional/apps/uptime/certificates.ts:67:11)
    at Object.apply (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 2292 2296 +4

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
securitySolution 1299 1307 +8

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 4.3MB 4.3MB +6.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 103.8KB 103.8KB +8.0B
Unknown metric groups

API count

id before after diff
securitySolution 1353 1361 +8

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

cc @machadoum

@kibanamachine kibanamachine merged commit bbaec75 into elastic:7.x Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants