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] expandable flyout - replace feature flag with advanced settings toggle #161614

Merged
merged 2 commits into from
Aug 11, 2023

Conversation

PhilippeOberti
Copy link
Contributor

@PhilippeOberti PhilippeOberti commented Jul 11, 2023

Summary

We are going GA with the new Expandable Flyout in Security Solution in 8.10. We still want to allow users to use the old flyout.
Until now we were allowing users to switch to the new flyout by modifying the kibana.yml like so
xpack.securitySolution.enableExperimental: ['securityFlyoutEnabled']
Using a toggle within the Stack Management => Advanced Settings page under the Security Solution section is a lot more user friendly.

This PR replaces the feature flag experimental feature by an advanced settings toggle.
The new advanced settings toggle is set to true by default.

Screenshot 2023-07-11 at 8 35 17 AM

Screen.Recording.2023-07-11.at.8.33.31.AM.mov

Primary changes:

  • add new securitySolution:enableExpandableFlyout advanced settings and remove securityFlyoutEnabled feature flag
  • remove all enableExperimental tags in investigations/alerts flyout Cypress tests
  • programmatically turn the new advanced settings off for all the other teams's Cypress tests (these will be updated to the new final once we remove the advanced settings entirely - most likely for 8.11 or 8.12)

https://github.com/elastic/security-team/issues/6641

@PhilippeOberti PhilippeOberti force-pushed the expanded-flyout-6640 branch 2 times, most recently from 6b19840 to cda4659 Compare July 11, 2023 15:25
@PhilippeOberti PhilippeOberti force-pushed the expanded-flyout-6640 branch 8 times, most recently from 3cd9180 to e4e46bc Compare August 2, 2023 11:04
@PhilippeOberti PhilippeOberti force-pushed the expanded-flyout-6640 branch 8 times, most recently from 48608c5 to cd5fde6 Compare August 9, 2023 07:20
@@ -29,7 +29,7 @@ import { login, visit } from '../../tasks/login';

import { ALERTS_URL } from '../../urls/navigation';

describe('Enrichment', () => {
describe.skip('Enrichment', () => {
Copy link
Contributor Author

@PhilippeOberti PhilippeOberti Aug 9, 2023

Choose a reason for hiding this comment

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

this test has been failing for the last few builds and also fails locally

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please create a ticket similar to this one #162818 and put there details about skipped test and link to the failing builkite job? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ticket created!

Copy link
Contributor

Choose a reason for hiding this comment

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

@PhilippeOberti I was thinking more about this and was wondering if this test is failing only on your PR? If that is the case and the test is not failing on main then I would say we should figure out why these changes cause this test to fail and fix it instead of skipping.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for coming back to this. I spent a bit more time and was able to actually fix the test. It was NOT flaky. I guess I was confused the first time.
The test is now unskipped and fixed. I also closed the ticket I opened. Sorry!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you so much!

@PhilippeOberti PhilippeOberti marked this pull request as ready for review August 9, 2023 09:31
@PhilippeOberti PhilippeOberti requested review from a team as code owners August 9, 2023 09:31
@PhilippeOberti PhilippeOberti requested a review from a team as a code owner August 9, 2023 09:31
@PhilippeOberti
Copy link
Contributor Author

Files by Code Owner

elastic/kibana-core

  • src/plugins/kibana_usage_collection/server/collectors/management/schema.ts
  • src/plugins/kibana_usage_collection/server/collectors/management/types.ts
  • src/plugins/telemetry/schema/oss_plugins.json

elastic/kibana-telemetry

  • src/plugins/telemetry/schema/oss_plugins.json

elastic/security-defend-workflows

  • x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/automated_response_actions.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/no_license.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/results.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/isolate.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/tasks/common.ts
  • x-pack/test/security_solution_endpoint/apps/endpoint/responder.ts

elastic/security-detection-engine

  • x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.test.tsx
  • x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx

elastic/security-solution

  • x-pack/plugins/security_solution/common/constants.ts
  • x-pack/plugins/security_solution/common/experimental_features.ts
  • x-pack/plugins/security_solution/cypress/e2e/detection_alerts/cti_enrichments.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/detection_alerts/enrichments.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/explore/guided_onboarding/tour.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/alerts_details.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_analyzer_graph_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_correlations_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_entities_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_investigation_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_response_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_session_view_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_threat_intelligence_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_json_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_overview_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_table_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_url_sync.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/investigate_in_timeline.cy.ts
  • x-pack/plugins/security_solution/cypress/tasks/api_calls/kibana_advanced_settings.ts
  • x-pack/plugins/security_solution/public/common/components/control_columns/row_action/index.tsx
  • x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.test.tsx
  • x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx
  • x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/automated_response_actions.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/no_license.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/results.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/isolate.cy.ts
  • x-pack/plugins/security_solution/public/management/cypress/tasks/common.ts
  • x-pack/plugins/security_solution/server/ui_settings.ts

elastic/security-threat-hunting-explore

  • x-pack/plugins/security_solution/cypress/e2e/explore/guided_onboarding/tour.cy.ts

elastic/security-threat-hunting-investigations

  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/alerts_details.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_analyzer_graph_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_correlations_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_entities_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_investigation_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_response_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_session_view_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_threat_intelligence_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_json_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_overview_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_table_tab.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_url_sync.cy.ts
  • x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/investigate_in_timeline.cy.ts

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Telemetry changes LGTM

Copy link
Contributor

@tomsonpl tomsonpl left a comment

Choose a reason for hiding this comment

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

Defend Workflows LGTM 🚀
Great to see the flyout getting GA :)

But regarding specyfing response_actions to run only on old flyout - I think it would be great to also mirror the tests in the new flyout since it's gonna be enabled by default. Would you have some time to do that? If it's problematic I can help, just tell me if I should commit directly here, or wait until you merge?
Once again, great work, thanks for doing this 👍

@PhilippeOberti
Copy link
Contributor Author

Defend Workflows LGTM 🚀 Great to see the flyout getting GA :)

But regarding specyfing response_actions to run only on old flyout - I think it would be great to also mirror the tests in the new flyout since it's gonna be enabled by default. Would you have some time to do that? If it's problematic I can help, just tell me if I should commit directly here, or wait until you merge? Once again, great work, thanks for doing this 👍

thanks @tomsonpl! I didn't mirror the tests is because I'm not super familiar with how the response details tab was implemented. Looking at my growing list of things to do before feature freeze I'm really not sure I would have time to write the new tests. Also, I have 2 more PRs waiting for this one to be merged, so it would be a lot less stressful to get this in first, if that is ok with everyone of course!

Copy link
Contributor

@e40pud e40pud left a comment

Choose a reason for hiding this comment

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

DE changes LGTM!

Two comments:

  1. Could you add ticket for the skipped test?
  2. Would be great if you can run affected tests against "flaky test runner". Here is the doc about the runner.

@@ -29,7 +29,7 @@ import { login, visit } from '../../tasks/login';

import { ALERTS_URL } from '../../urls/navigation';

describe('Enrichment', () => {
describe.skip('Enrichment', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please create a ticket similar to this one #162818 and put there details about skipped test and link to the failing builkite job? Thanks!

@PhilippeOberti PhilippeOberti force-pushed the expanded-flyout-6640 branch 2 times, most recently from 60e21fe to bded134 Compare August 10, 2023 22:35
@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 11, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Defend Workflows Cypress Tests #1 / Endpoint Policy Response from Endpoint List page should display policy response with errors should display policy response with errors
  • [job] [logs] Defend Workflows Cypress Tests #1 / Endpoint Policy Response from Fleet Agent Details page should display policy response with errors should display policy response with errors

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 15.6MB 15.6MB -10.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 58.8KB 58.8KB +56.0B

History

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

@angorayc
Copy link
Contributor

angorayc commented Aug 11, 2023

Hi Philippe, I ran the branch and was able to enable/disable the new flyout via advance settings 👍 . But I found some unexpected error when clicking the sub-tabs (correlations especially) under insight tab. Could you please try if you can reproduce this?

I created a rule with host.name: *, generated alerts and clicked on one of it. Expanded the details and clicked on each tab.

Screen.Recording.2023-08-11.at.12.57.38.mov

Another test video:
https://drive.google.com/file/d/1nJemH90SUTN946thnBFl8GR4Y20kXhfc/view?usp=drive_link

@PhilippeOberti
Copy link
Contributor Author

Hi Philippe, I ran the branch and was able to enable/disable the new flyout via advance settings 👍 . But I found some unexpected error when clicking the sub-tabs (correlations especially) under insight tab. Could you please try if you can reproduce this?

Hey @angorayc, thanks for reviewing! This is a known issue and I have a draft PR fixing it, as well as a few more PRs making small changes to the new flyout. This current PR is only to change the feature flag to an advanced settings :)

@PhilippeOberti PhilippeOberti merged commit a86c016 into main Aug 11, 2023
@PhilippeOberti PhilippeOberti deleted the expanded-flyout-6640 branch August 11, 2023 13:18
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Aug 11, 2023
jloleysens added a commit to jloleysens/kibana that referenced this pull request Aug 11, 2023
* main: (64 commits)
  [ML] Transforms: Fix privileges check. (elastic#163687)
  [Log Explorer] Add test suite for Dataset Selector (elastic#163079)
  [Security Solution][Endpoint] Add API checks to Endpoint Policy create/update for checking `endpointPolicyProtections` is enabled (elastic#163429)
  [Security Solution] Fix flaky test: x-pack/test/detection_engine_api_integration/security_and_spaces/update_prebuilt_rules_package/update_prebuilt_rules_package·ts - update_prebuilt_rules_package should allow user to install prebuilt rules from scratch, then install new rules and upgrade existing rules from the new package (elastic#163241)
  [Security Solution] expandable flyout - replace feature flag with advanced settings toggle (elastic#161614)
  [DOCS] Adds the release notes for the 8.9.1 release. (elastic#163578)
  [FTR] Implement browser network condition utils (elastic#163633)
  [Security Solution] Unskip rules table auto-refresh Cypress tests (elastic#163451)
  [Security Solution] Re-enable fixed rule snoozing Cypress test (elastic#160037)
  [Flaky Test elastic#111821] Mock `moment` to avoid midnight TZ issues (elastic#163157)
  Document interactive setup (elastic#163619)
  [Lens] Align decoration color with text color for layer actions (elastic#163630)
  [Lens] Relax counter field checks for saved visualizations with unsupported operations (elastic#163515)
  [Security Solution][Endpoint] Removes pMap and uses a for loop instead (elastic#163509)
  [Enterprise Search] Update Workplace Search connectors doclink (elastic#163676)
  Update APM (main) (elastic#163623)
  [Serverless] Partially fix lens/maps/visualize breadcrumbs missing title  (elastic#163476)
  [Flaky elastic#118272] Unskip tests (elastic#163319)
  [APM] Make service group saved objects exportable (elastic#163569)
  [Observability AI Assistant] Action menu item (elastic#163463)
  ...
patrykkopycinski added a commit that referenced this pull request Aug 16, 2023
## Summary

Adjust tests to #161614
Split tests into smaller files to better utilize parallelization and
increase the stability of tests
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 18, 2023
## Summary

Adjust tests to elastic#161614
Split tests into smaller files to better utilize parallelization and
increase the stability of tests

(cherry picked from commit fd33ed5)
kibanamachine referenced this pull request Aug 18, 2023
# Backport

This will backport the following commits from `main` to `8.10`:
- [Fix osquery cypress tests
(#163988)](#163988)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Patryk
Kopyciński","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-16T22:11:05Z","message":"Fix
osquery cypress tests (#163988)\n\n## Summary\r\n\r\nAdjust tests to
https://github.com/elastic/kibana/pull/161614\r\nSplit tests into
smaller files to better utilize parallelization and\r\nincrease the
stability of
tests","sha":"fd33ed55fd9bc81d006ca41c85b7bd4117741e80","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v8.10.0","v8.11.0"],"number":163988,"url":"https://github.com/elastic/kibana/pull/163988","mergeCommit":{"message":"Fix
osquery cypress tests (#163988)\n\n## Summary\r\n\r\nAdjust tests to
https://github.com/elastic/kibana/pull/161614\r\nSplit tests into
smaller files to better utilize parallelization and\r\nincrease the
stability of
tests","sha":"fd33ed55fd9bc81d006ca41c85b7bd4117741e80"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163988","number":163988,"mergeCommit":{"message":"Fix
osquery cypress tests (#163988)\n\n## Summary\r\n\r\nAdjust tests to
https://github.com/elastic/kibana/pull/161614\r\nSplit tests into
smaller files to better utilize parallelization and\r\nincrease the
stability of
tests","sha":"fd33ed55fd9bc81d006ca41c85b7bd4117741e80"}},{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Patryk Kopyciński <[email protected]>
@PhilippeOberti PhilippeOberti added this to the 8.10 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:Threat Hunting:Investigations Security Solution Investigations Team v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants