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

[Security Solution] [Platform] Utilize SO resolve api for reading rules by id #112478

Merged
merged 31 commits into from
Oct 12, 2021

Conversation

dhurley14
Copy link
Contributor

@dhurley14 dhurley14 commented Sep 16, 2021

Summary

Resolves #109191


Testing aliasMatch

  1. Start up kibana 7.14 and local Elasticsearch @ 7.14 which saves its data to a directory
  2. Create a space in kibana
  3. Create a detection rule (and create some alerts)
  4. Copy the hyperlink for the rule details page somewhere
  5. Shut down kibana 7.14 but DO NOT SHUTDOWN Elasticsearch
  6. Start up this branch with the following key in your kibana.dev.yml -> elasticsearch.ignoreVersionMismatch: true
  7. Log into the space you created the rule in
  8. Visit the hyperlink you copied in step 4
  9. You should see the aliasMatch toast appear.

alias_match_rule_details


Testing conflict

  1. Create a rule using this branch
  2. Go to https://github.com/elastic/kibana/pull/112478/files#diff-73b3c58b193075328ab707123d3e1ef1083df0260fc0881ac96d8c096d10244fR287 and change that line to be const outcome = null; //rule.outcome
  3. Go to https://github.com/elastic/kibana/pull/112478/files#diff-73b3c58b193075328ab707123d3e1ef1083df0260fc0881ac96d8c096d10244fR306 and change that line to be const outcome = 'conflict'; //rule?.outcome This will mock a conflicting saved object _id
  4. Kibana will restart, then visit the rule details page and you should see the below callout

conflict
redirect_callout

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Rules with an aliasMatch will not have rule status saved objects associated with them until their next rule run High Medium Update rule status code + routes to utilize SO resolve, migrate to using event log for statuses, or communicate to users that their statuses will not be reachable in 8.0

For maintainers

@dhurley14 dhurley14 force-pushed the rule-savedobject-resolve branch 2 times, most recently from 0db7505 to b04475c Compare September 23, 2021 19:16
@dhurley14 dhurley14 force-pushed the rule-savedobject-resolve branch 2 times, most recently from b357bb3 to 56749fa Compare September 30, 2021 23:04
@dhurley14 dhurley14 self-assigned this Sep 30, 2021
@dhurley14
Copy link
Contributor Author

@elasticmachine merge upstream

@dhurley14 dhurley14 force-pushed the rule-savedobject-resolve branch 2 times, most recently from 7a6c4ef to 3a1f510 Compare October 1, 2021 18:07
@dhurley14 dhurley14 added Feature:Detection Rules Security Solution rules and Detection Engine Feature:Detection Alerts Security Solution Detection Alerts Feature release_note:fix review Team:Security Solution Platform Security Solution Platform Team v7.16.0 v8.0.0 labels Oct 1, 2021
@dhurley14 dhurley14 marked this pull request as ready for review October 1, 2021 21:27
@dhurley14 dhurley14 requested a review from a team as a code owner October 1, 2021 21:27
@dhurley14 dhurley14 changed the title added outcome to backend routes [Security Solution] [Platform] Utilize SO resolve api for reading rules by id Oct 1, 2021
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.

This looks awesome with great tests. Just did an initial code review. I think we were maybe gonna do a quick zoom walkthrough tomorrow (?) so will 👍🏽 after!

@dhurley14 dhurley14 force-pushed the rule-savedobject-resolve branch 2 times, most recently from b72fd23 to 62fb16f Compare October 6, 2021 03:15
@dhurley14 dhurley14 force-pushed the rule-savedobject-resolve branch from fb6d790 to e29fc03 Compare October 12, 2021 13:04
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / Performance Tests.x-pack/test/performance/tests/reporting_dashboard·ts.performance reporting dashbaord downloaded PDF has OK status

Link to Jenkins

Standard Out

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

[00:00:00]     │
[00:00:00]       └-: performance
[00:00:00]         └-> "before all" hook in "performance"
[00:00:00]         └-: reporting dashbaord
[00:00:00]           └-> "before all" hook for "downloaded PDF has OK status"
[00:00:00]           └-> "before all" hook for "downloaded PDF has OK status"
[00:00:00]             │ debg resolved import for x-pack/test/performance/kbn_archives/reporting_dashboard to /dev/shm/workspace/parallel/23/kibana/x-pack/test/performance/kbn_archives/reporting_dashboard.json
[00:00:00]             │ info importing 4 saved objects { space: undefined }
[00:00:00]             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/78JP_7nzSDmBg7sY-GQzOA] update_mapping [_doc]
[00:00:00]             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/78JP_7nzSDmBg7sY-GQzOA] update_mapping [_doc]
[00:00:00]             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/78JP_7nzSDmBg7sY-GQzOA] update_mapping [_doc]
[00:00:00]             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/78JP_7nzSDmBg7sY-GQzOA] update_mapping [_doc]
[00:00:00]             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/78JP_7nzSDmBg7sY-GQzOA] update_mapping [_doc]
[00:00:00]             │ succ import success
[00:00:00]             │ info [x-pack/test/performance/es_archives/reporting_dashboard] Loading "mappings.json"
[00:00:00]             │ info [x-pack/test/performance/es_archives/reporting_dashboard] Loading "data.json.gz"
[00:00:00]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [foo] creating index, cause [api], templates [], shards [1]/[1]
[00:00:00]             │ info [x-pack/test/performance/es_archives/reporting_dashboard] Created index "foo"
[00:00:00]             │ debg [x-pack/test/performance/es_archives/reporting_dashboard] "foo" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:00:02]             │ info [x-pack/test/performance/es_archives/reporting_dashboard] Indexed 10000 docs into "foo"
[00:00:03]           └-> downloaded PDF has OK status
[00:00:03]             └-> "before each" hook: global before each for "downloaded PDF has OK status"
[00:00:03]             │ debg navigating to dashboards url: http://localhost:61231/app/dashboards
[00:00:03]             │ debg navigate to: http://localhost:61231/app/dashboards
[00:00:03]             │ debg browser[INFO] http://localhost:61231/login?next=%2Fapp%2Fdashboards%3F_t%3D1634049452935 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:00:03]             │
[00:00:03]             │ 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:00:03]             │ debg ... sleep(700) start
[00:00:04]             │ debg ... sleep(700) end
[00:00:04]             │ debg returned from get, calling refresh
[00:00:05]             │ debg browser[INFO] http://localhost:61231/login?next=%2Fapp%2Fdashboards%3F_t%3D1634049452935 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:00:05]             │
[00:00:05]             │ 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:00:05]             │ debg currentUrl = http://localhost:61231/login?next=%2Fapp%2Fdashboards%3F_t%3D1634049452935
[00:00:05]             │          appUrl = http://localhost:61231/app/dashboards
[00:00:05]             │ debg TestSubjects.find(kibanaChrome)
[00:00:05]             │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:00:06]             │ debg Found login page
[00:00:06]             │ debg TestSubjects.setValue(loginUsername, test_user)
[00:00:06]             │ debg TestSubjects.click(loginUsername)
[00:00:06]             │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:00:06]             │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:00:06]             │ERROR browser[SEVERE] http://localhost:61231/api/licensing/info - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:00:06]             │ debg TestSubjects.setValue(loginPassword, changeme)
[00:00:06]             │ debg TestSubjects.click(loginPassword)
[00:00:06]             │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:00:06]             │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:00:06]             │ debg TestSubjects.click(loginSubmit)
[00:00:06]             │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:00:06]             │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:00:06]             │ debg Find.waitForDeletedByCssSelector('.kibanaWelcomeLogo') with timeout=10000
[00:00:06]             │ proc [kibana] [2021-10-12T14:37:36.841+00:00][INFO ][plugins.security.routes] Logging in with provider "basic" (basic)
[00:00:07]             │ debg browser[INFO] http://localhost:61231/app/dashboards?_t=1634049452935 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:00:07]             │
[00:00:07]             │ 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:00:07]             │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:00:09]             │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"] nav:not(.ng-hide)') with timeout=60000
[00:00:10]             │ debg browser[INFO] http://localhost:61231/app/dashboards?_t=1634049459464 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:00:10]             │
[00:00:10]             │ 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:00:11]             │ debg Finished login process currentUrl = http://localhost:61231/app/dashboards
[00:00:11]             │ debg ... sleep(501) start
[00:00:11]             │ debg ... sleep(501) end
[00:00:11]             │ debg in navigateTo url = http://localhost:61231/app/dashboards
[00:00:11]             │ debg Waiting up to 20000ms for dashboard landing page...
[00:00:11]             │ debg onDashboardLandingPage
[00:00:11]             │ debg TestSubjects.exists(dashboardLandingPage)
[00:00:11]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="dashboardLandingPage"]') with timeout=5000
[00:00:12]             │ debg Load Saved Dashboard dashboard
[00:00:12]             │ debg gotoDashboardLandingPage
[00:00:12]             │ debg onDashboardLandingPage
[00:00:12]             │ debg TestSubjects.exists(dashboardLandingPage)
[00:00:12]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="dashboardLandingPage"]') with timeout=5000
[00:00:12]             │ debg searchForItemWithName: dashboard
[00:00:12]             │ debg TestSubjects.find(tableListSearchBox)
[00:00:12]             │ debg Find.findByCssSelector('[data-test-subj="tableListSearchBox"]') with timeout=10000
[00:00:12]             │ debg isGlobalLoadingIndicatorVisible
[00:00:12]             │ debg TestSubjects.exists(globalLoadingIndicator)
[00:00:12]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:00:12]             │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:00:12]             │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:00:14]             │ debg TestSubjects.click(dashboardListingTitleLink-dashboard)
[00:00:14]             │ debg Find.clickByCssSelector('[data-test-subj="dashboardListingTitleLink-dashboard"]') with timeout=10000
[00:00:14]             │ debg Find.findByCssSelector('[data-test-subj="dashboardListingTitleLink-dashboard"]') with timeout=10000
[00:00:15]             │ debg isGlobalLoadingIndicatorVisible
[00:00:15]             │ debg TestSubjects.exists(globalLoadingIndicator)
[00:00:15]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:00:15]             │ debg browser[INFO] http://localhost:61231/app/dashboards#/view/37b49c50-2dc6-11eb-8af3-cb3aa84dbabd?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now)) 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:00:15]             │
[00:00:15]             │ 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:00:16]             │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:00:17]             │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:00:17]             │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:00:17]             │ debg TestSubjects.missingOrFail(dashboardLandingPage)
[00:00:17]             │ debg Find.waitForDeletedByCssSelector('[data-test-subj="dashboardLandingPage"]') with timeout=10000
[00:00:17]             │ debg openPdfReportingPanel
[00:00:17]             │ debg openShareMenuItem title:PDF Reports
[00:00:17]             │ debg TestSubjects.exists(shareContextMenu)
[00:00:17]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="shareContextMenu"]') with timeout=2500
[00:00:18]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [.async-search] creating index, cause [auto(bulk api)], templates [], shards [1]/[0]
[00:00:20]             │ debg --- retry.tryForTime error: [data-test-subj="shareContextMenu"] is not displayed
[00:00:20]             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/78JP_7nzSDmBg7sY-GQzOA] update_mapping [_doc]
[00:00:21]             │ debg TestSubjects.click(shareTopNavButton)
[00:00:21]             │ debg Find.clickByCssSelector('[data-test-subj="shareTopNavButton"]') with timeout=10000
[00:00:21]             │ debg Find.findByCssSelector('[data-test-subj="shareTopNavButton"]') with timeout=10000
[00:00:21]             │ debg Find.findByCssSelector('div.euiContextMenuPanel') with timeout=10000
[00:00:22]             │ debg TestSubjects.click(sharePanel-PDFReports)
[00:00:22]             │ debg Find.clickByCssSelector('[data-test-subj="sharePanel-PDFReports"]') with timeout=10000
[00:00:22]             │ debg Find.findByCssSelector('[data-test-subj="sharePanel-PDFReports"]') with timeout=10000
[00:00:23]             │ debg Find.waitForElementStale with timeout=10000
[00:00:24]             │ debg TestSubjects.click(generateReportButton)
[00:00:24]             │ debg Find.clickByCssSelector('[data-test-subj="generateReportButton"]') with timeout=10000
[00:00:24]             │ debg Find.findByCssSelector('[data-test-subj="generateReportButton"]') with timeout=10000
[00:00:24]             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/78JP_7nzSDmBg7sY-GQzOA] update_mapping [_doc]
[00:00:24]             │ debg getReportURL
[00:00:24]             │ debg TestSubjects.getAttribute(downloadCompletedReportButton, href, tryTimeout=120000, findTimeout=60000)
[00:00:24]             │ debg TestSubjects.find(downloadCompletedReportButton)
[00:00:24]             │ debg Find.findByCssSelector('[data-test-subj="downloadCompletedReportButton"]') with timeout=60000
[00:01:25]             │ debg --- retry.tryForTime error: Waiting for element to be located By(css selector, [data-test-subj="downloadCompletedReportButton"])
[00:01:25]             │      Wait timed out after 61251ms
[00:01:26]             │ debg TestSubjects.find(downloadCompletedReportButton)
[00:01:26]             │ debg Find.findByCssSelector('[data-test-subj="downloadCompletedReportButton"]') with timeout=60000
[00:02:27]             │ debg --- retry.tryForTime error: Waiting for element to be located By(css selector, [data-test-subj="downloadCompletedReportButton"])
[00:02:27]             │      Wait timed out after 61145ms
[00:02:27]             │ info Taking screenshot "/dev/shm/workspace/parallel/23/kibana/x-pack/test/functional/screenshots/failure/performance reporting dashbaord downloaded PDF has OK status.png"
[00:02:27]             │ info Current URL is: http://localhost:61231/app/dashboards#/view/37b49c50-2dc6-11eb-8af3-cb3aa84dbabd?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:02:27]             │ info Saving page source to: /dev/shm/workspace/parallel/23/kibana/x-pack/test/performance/failure_debug/html/performance reporting dashbaord downloaded PDF has OK status.html
[00:02:27]             └- ✖ fail: performance reporting dashbaord downloaded PDF has OK status
[00:02:27]             │      Error: retry.tryForTime timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="downloadCompletedReportButton"])
[00:02:27]             │ Wait timed out after 61145ms
[00:02:27]             │     at /dev/shm/workspace/parallel/23/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:02:27]             │     at runMicrotasks (<anonymous>)
[00:02:27]             │     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:02:27]             │       at onFailure (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:02:27]             │       at retryForSuccess (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry_for_success.ts:59:13)
[00:02:27]             │       at RetryService.tryForTime (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry.ts:22:12)
[00:02:27]             │       at TestSubjects.getAttribute (/dev/shm/workspace/parallel/23/kibana/test/functional/services/common/test_subjects.ts:190:12)
[00:02:27]             │       at ReportingPageObject.getReportURL (test/functional/page_objects/reporting_page.ts:36:17)
[00:02:27]             │       at Context.<anonymous> (test/performance/tests/reporting_dashboard.ts:50:7)
[00:02:27]             │       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:02:27]             │ 
[00:02:27]             │ 

Stack Trace

Error: retry.tryForTime timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="downloadCompletedReportButton"])
Wait timed out after 61145ms
    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:59:13)
    at RetryService.tryForTime (/dev/shm/workspace/parallel/23/kibana/test/common/services/retry/retry.ts:22:12)
    at TestSubjects.getAttribute (/dev/shm/workspace/parallel/23/kibana/test/functional/services/common/test_subjects.ts:190:12)
    at ReportingPageObject.getReportURL (test/functional/page_objects/reporting_page.ts:36:17)
    at Context.<anonymous> (test/performance/tests/reporting_dashboard.ts:50:7)
    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]

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 +990.0B

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.9KB +90.0B

History

  • 💔 Build #159773 failed fb6d790482c2e5d2b671d04a5abdf4b1294f32d2
  • 💔 Build #159714 failed 3f7cd0c8a82d5b1aaa1dcd566527ae8a8392027d
  • 💚 Build #158288 succeeded 62fb16f82aa724d6e6417336b899b8dcef494feb
  • 💔 Build #158263 failed 2b9d3be20f50e328a7a38dce81c35d6bc1459f2b
  • 💔 Build #158259 failed e0b23b30d9400e14e044f265ff8ba453953b8136

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

cc @dhurley14

@dhurley14 dhurley14 added the auto-backport Deprecated - use backport:version if exact versions are needed label Oct 12, 2021
@dhurley14 dhurley14 merged commit 1038695 into elastic:master Oct 12, 2021
@dhurley14 dhurley14 deleted the rule-savedobject-resolve branch October 12, 2021 16:12
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 112478

dhurley14 added a commit that referenced this pull request Oct 13, 2021
…ng rules by `id` (#112478) (#114683)

* [Security Solution] [Platform] Utilize SO resolve api for reading rules by `id` (#112478)

* added outcome to backend routes

* adds so resolved property alias_target_id to response

* adds UI portion

* working URL redirect on aliasMatch - todo -> update rule details page refresh button to use SO resolve.

* cleanup

* fix integration tests

* fix jest tests

* cleanup types

* fix eslint.. I think vs code formatted this

* WIP - undo me, working index.test.ts function

* WIP - also undo me, probably

* working test for aliasMatch, need to add test for outcome = conflict

* add conflict callout when SO resolve yields conflict outcome

* code cleanup

* fix type issues

* small cleanup, fix jest test after undoing changes for getFailingRuleStatus

* cleanup tests

* add alias_target_id to response validation too

* unit test changes

* update tests again

* add all dependencies to useEffect and prefer useMemo

* add type cast

* adds integration tests for different outcomes after mocking a migrated rule leading to an aliasMatch and a migrated rule + accidental inserted rule to lead to a conflict. Also removes the outcome property if it is an exactMatch

* remove unused import

* fix test

* functional WIP

* cleanup

* cleanup

* finishing touches to address PR review comments

* remove console.error

* fix bug where spaces was not typed correctly in the plugin start method here #113983
# Conflicts:
#	x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_hosts_risk_score.ts
#	x-pack/plugins/security_solution/public/types.ts

* fix eslint

* skip 8.0 integration tests for 7.16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Detection Alerts Security Solution Detection Alerts Feature Feature:Detection Rules Security Solution rules and Detection Engine release_note:fix review Team:Security Solution Platform Security Solution Platform Team v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solutions] Change backend routes to use savedObject.resolve with signal id's
5 participants