Skip to content

[SecuritySolution] Onboarding hub with Fleet integration#194028

Merged
angorayc merged 19 commits intoelastic:mainfrom
angorayc:fleet-integration
Oct 3, 2024
Merged

[SecuritySolution] Onboarding hub with Fleet integration#194028
angorayc merged 19 commits intoelastic:mainfrom
angorayc:fleet-integration

Conversation

@angorayc
Copy link
Copy Markdown
Contributor

@angorayc angorayc commented Sep 25, 2024

Summary

This is the Fleet relevant changes from #193131

  1. Add an option to display installation status on package cards.
  2. Add options to display spacer in grid, card height, line clamps for card title and description.
  3. On the integration details page, if onboardingLink and onboardingAppId are appended as url params, they will be used as the redirect link after clicking cancel or save and continue on the installation form page.

Please run from this branch and visit Security Solution to test: #193131

Screen.Recording.2024-09-24.at.18.36.20.mov
Screen.Recording.2024-09-24.at.17.48.50.mov
Screen.Recording.2024-09-30.at.15.49.12.mov

Checklist

Delete any items that are not applicable to this PR.

@angorayc angorayc changed the title Fleet integration [SecuritySolution] Onboarding hub with Fleet integration Sep 25, 2024
@angorayc
Copy link
Copy Markdown
Contributor Author

/ci

@angorayc angorayc marked this pull request as ready for review October 1, 2024 10:18
@angorayc angorayc requested a review from a team as a code owner October 1, 2024 10:18
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-threat-hunting-explore (Team:Threat Hunting:Explore)

@angorayc angorayc added the backport This PR is a backport of another PR label Oct 1, 2024
@botelastic botelastic Bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 1, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@angorayc angorayc requested a review from kpollich October 1, 2024 12:27
Copy link
Copy Markdown
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Thanks so much for taking the time to put this together @angorayc - it looks great!

As we discussed in our call, one suggestions I have is to put the search bar query for the onboarding UI into the URL via URLSearchParams like we do elsewhere in Fleet/Kibana. This could probably be behind a ?q= query parameter, so when a user types a search query like "elastic" the URL would update to include ?q=elastic. This should hopefully be a relatively straightforward refactor, but if this presents problems I'm happy to take another look.

Comment thread x-pack/plugins/fleet/common/constants/routes.ts Outdated
@angorayc
Copy link
Copy Markdown
Contributor Author

angorayc commented Oct 3, 2024

/ci

@angorayc angorayc requested a review from criamico October 3, 2024 15:05
Copy link
Copy Markdown
Member

@criamico criamico left a comment

Choose a reason for hiding this comment

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

Thanks for making those changes! LGTM

@angorayc angorayc enabled auto-merge (squash) October 3, 2024 15:08
@angorayc angorayc merged commit 3d932e1 into elastic:main Oct 3, 2024
@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 1208 1209 +1

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
fleet 1246 1287 +41

Async chunks

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

id before after diff
fleet 1.7MB 1.7MB +2.4KB

Page load bundle

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

id before after diff
fleet 171.4KB 171.5KB +141.0B
Unknown metric groups

API count

id before after diff
fleet 1369 1410 +41

History

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

@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11166268091

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 3, 2024
)

## Summary
This is the Fleet relevant changes from
elastic#193131
1. Add an option to display installation status on package cards.
2. Add options to display spacer in grid, card height, line clamps for
card title and description.
3. On the integration details page, if `onboardingLink` and
`onboardingAppId` are appended as url params, they will be used as the
redirect link after clicking `cancel` or `save and continue` on the
installation form page.

Please run from this branch and visit Security Solution to test:
elastic#193131

https://github.com/user-attachments/assets/40fc155f-d07c-460f-ab70-372e3b43bfc0

https://github.com/user-attachments/assets/06bd0c5e-14b2-4074-b5a1-932a88a1cc6a

https://github.com/user-attachments/assets/1ed4ace9-20a7-42ab-9082-4536d6cd643a

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 3d932e1)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 3, 2024
…) (#194863)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[SecuritySolution] Onboarding hub with Fleet integration
(#194028)](#194028)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Angela
Chuang","email":"6295984+angorayc@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-03T16:56:11Z","message":"[SecuritySolution]
Onboarding hub with Fleet integration (#194028)\n\n## Summary\r\nThis is
the Fleet relevant changes
from\r\nhttps://github.com//pull/193131\r\n1. Add an
option to display installation status on package cards.\r\n2. Add
options to display spacer in grid, card height, line clamps for\r\ncard
title and description.\r\n3. On the integration details page, if
`onboardingLink` and\r\n`onboardingAppId` are appended as url params,
they will be used as the\r\nredirect link after clicking `cancel` or
`save and continue` on the\r\ninstallation form page.\r\n\r\nPlease run
from this branch and visit Security Solution to
test:\r\nhttps://github.com//pull/193131\r\n\r\n\r\nhttps://github.com/user-attachments/assets/40fc155f-d07c-460f-ab70-372e3b43bfc0\r\n\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/06bd0c5e-14b2-4074-b5a1-932a88a1cc6a\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/1ed4ace9-20a7-42ab-9082-4536d6cd643a\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"3d932e18e88a5b093c5be38da27139785d572061","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","Team:Fleet","v9.0.0","Team:Threat
Hunting:Explore","v8.16.0"],"title":"[SecuritySolution] Onboarding hub
with Fleet
integration","number":194028,"url":"https://github.com/elastic/kibana/pull/194028","mergeCommit":{"message":"[SecuritySolution]
Onboarding hub with Fleet integration (#194028)\n\n## Summary\r\nThis is
the Fleet relevant changes
from\r\nhttps://github.com//pull/193131\r\n1. Add an
option to display installation status on package cards.\r\n2. Add
options to display spacer in grid, card height, line clamps for\r\ncard
title and description.\r\n3. On the integration details page, if
`onboardingLink` and\r\n`onboardingAppId` are appended as url params,
they will be used as the\r\nredirect link after clicking `cancel` or
`save and continue` on the\r\ninstallation form page.\r\n\r\nPlease run
from this branch and visit Security Solution to
test:\r\nhttps://github.com//pull/193131\r\n\r\n\r\nhttps://github.com/user-attachments/assets/40fc155f-d07c-460f-ab70-372e3b43bfc0\r\n\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/06bd0c5e-14b2-4074-b5a1-932a88a1cc6a\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/1ed4ace9-20a7-42ab-9082-4536d6cd643a\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"3d932e18e88a5b093c5be38da27139785d572061"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194028","number":194028,"mergeCommit":{"message":"[SecuritySolution]
Onboarding hub with Fleet integration (#194028)\n\n## Summary\r\nThis is
the Fleet relevant changes
from\r\nhttps://github.com//pull/193131\r\n1. Add an
option to display installation status on package cards.\r\n2. Add
options to display spacer in grid, card height, line clamps for\r\ncard
title and description.\r\n3. On the integration details page, if
`onboardingLink` and\r\n`onboardingAppId` are appended as url params,
they will be used as the\r\nredirect link after clicking `cancel` or
`save and continue` on the\r\ninstallation form page.\r\n\r\nPlease run
from this branch and visit Security Solution to
test:\r\nhttps://github.com//pull/193131\r\n\r\n\r\nhttps://github.com/user-attachments/assets/40fc155f-d07c-460f-ab70-372e3b43bfc0\r\n\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/06bd0c5e-14b2-4074-b5a1-932a88a1cc6a\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/1ed4ace9-20a7-42ab-9082-4536d6cd643a\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"3d932e18e88a5b093c5be38da27139785d572061"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
tiansivive pushed a commit to tiansivive/kibana that referenced this pull request Oct 7, 2024
)

## Summary
This is the Fleet relevant changes from
elastic#193131
1. Add an option to display installation status on package cards.
2. Add options to display spacer in grid, card height, line clamps for
card title and description.
3. On the integration details page, if `onboardingLink` and
`onboardingAppId` are appended as url params, they will be used as the
redirect link after clicking `cancel` or `save and continue` on the
installation form page.

Please run from this branch and visit Security Solution to test:
elastic#193131


https://github.com/user-attachments/assets/40fc155f-d07c-460f-ab70-372e3b43bfc0





https://github.com/user-attachments/assets/06bd0c5e-14b2-4074-b5a1-932a88a1cc6a




https://github.com/user-attachments/assets/1ed4ace9-20a7-42ab-9082-4536d6cd643a


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Comment on lines +20 to +22
onboardingLink:
// Users from Security Solution onboarding page will have onboardingLink to redirect back to the onboarding page
queryParams.get('observabilityOnboardingLink') || queryParams.get('onboardingLink'),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Back button

Comment on lines +419 to +421
onCancelNavigateTo: [onboardingAppId, { path: onboardingLink }],
onCancelUrl: onboardingLink,
onSaveNavigateTo: [onboardingAppId, { path: onboardingLink }],
Copy link
Copy Markdown
Contributor Author

@angorayc angorayc Mar 18, 2025

Choose a reason for hiding this comment

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

Fleet stores their save and cancel links in their route states, so I override it to
back to given page if onboardingAppId && onboardingLink are provided on integration saved or cancelled.

Comment on lines +142 to 144
const onboardingLink = useMemo(() => queryParams.get('onboardingLink'), [queryParams]);
const onboardingAppId = useMemo(() => queryParams.get('onboardingAppId'), [queryParams]);

Copy link
Copy Markdown
Contributor Author

@angorayc angorayc Mar 18, 2025

Choose a reason for hiding this comment

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

kgeller added a commit that referenced this pull request Mar 26, 2025
…te custom fleet onboarding logic (#215561)

## Summary

Updated fleet custom navigation logic to be more generic and consistent
between security and observability onboarding flows.

## Details

When attempting to start using the custom logic for routing back to
onboarding pages for another project, I noticed inconsistencies in how
we were linking back to the onboarding pages for the `Back to selection`
button on the Integrations overview page and the `Cancel` and `Save and
continue` on the Add integration page. Due to these inconsistencies,
both custom routing mechanisms couldn't both work at the same time. I
re-worked the implementation of the back button to match the cancel/save
buttons and utilize `navigateToApp` to fix.

Now instead of observability utilizing the `observabilityOnboardingLink`
query param, and security utilizing both `observabilityOnboardingLink`
and `onboardingAppId`, both solutions will use `returnAppId` and
`returnPath` (or different names if we don't love these) to route back
to their sourcing locations.

Note: Observability onboarding will also now inherit logic the security
onboarding team added where the same query parameters route back to the
source when a user cancels or saves from the Add integration page (item
3 from [this PR](#194028))

## Screen recordings

Regular integrations page


https://github.com/user-attachments/assets/0f306bec-657f-4a7a-b2da-25557899b629

Security onboarding


https://github.com/user-attachments/assets/d2a161a0-62ee-40b1-9dd9-5165aea6a65a

Observability onboarding


https://github.com/user-attachments/assets/89f6b9a3-a348-4488-8688-1d5c96716185

Relates: 
- #181520
- elastic/security-team#11789

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Mar 31, 2025
…te custom fleet onboarding logic (elastic#215561)

## Summary

Updated fleet custom navigation logic to be more generic and consistent
between security and observability onboarding flows.

## Details

When attempting to start using the custom logic for routing back to
onboarding pages for another project, I noticed inconsistencies in how
we were linking back to the onboarding pages for the `Back to selection`
button on the Integrations overview page and the `Cancel` and `Save and
continue` on the Add integration page. Due to these inconsistencies,
both custom routing mechanisms couldn't both work at the same time. I
re-worked the implementation of the back button to match the cancel/save
buttons and utilize `navigateToApp` to fix.

Now instead of observability utilizing the `observabilityOnboardingLink`
query param, and security utilizing both `observabilityOnboardingLink`
and `onboardingAppId`, both solutions will use `returnAppId` and
`returnPath` (or different names if we don't love these) to route back
to their sourcing locations.

Note: Observability onboarding will also now inherit logic the security
onboarding team added where the same query parameters route back to the
source when a user cancels or saves from the Add integration page (item
3 from [this PR](elastic#194028))

## Screen recordings

Regular integrations page


https://github.com/user-attachments/assets/0f306bec-657f-4a7a-b2da-25557899b629

Security onboarding


https://github.com/user-attachments/assets/d2a161a0-62ee-40b1-9dd9-5165aea6a65a

Observability onboarding


https://github.com/user-attachments/assets/89f6b9a3-a348-4488-8688-1d5c96716185

Relates: 
- elastic#181520
- elastic/security-team#11789

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
angorayc pushed a commit to angorayc/kibana that referenced this pull request May 28, 2025
…te custom fleet onboarding logic (elastic#215561)

## Summary

Updated fleet custom navigation logic to be more generic and consistent
between security and observability onboarding flows.

## Details

When attempting to start using the custom logic for routing back to
onboarding pages for another project, I noticed inconsistencies in how
we were linking back to the onboarding pages for the `Back to selection`
button on the Integrations overview page and the `Cancel` and `Save and
continue` on the Add integration page. Due to these inconsistencies,
both custom routing mechanisms couldn't both work at the same time. I
re-worked the implementation of the back button to match the cancel/save
buttons and utilize `navigateToApp` to fix.

Now instead of observability utilizing the `observabilityOnboardingLink`
query param, and security utilizing both `observabilityOnboardingLink`
and `onboardingAppId`, both solutions will use `returnAppId` and
`returnPath` (or different names if we don't love these) to route back
to their sourcing locations.

Note: Observability onboarding will also now inherit logic the security
onboarding team added where the same query parameters route back to the
source when a user cancels or saves from the Add integration page (item
3 from [this PR](elastic#194028))

## Screen recordings

Regular integrations page

https://github.com/user-attachments/assets/0f306bec-657f-4a7a-b2da-25557899b629

Security onboarding

https://github.com/user-attachments/assets/d2a161a0-62ee-40b1-9dd9-5165aea6a65a

Observability onboarding

https://github.com/user-attachments/assets/89f6b9a3-a348-4488-8688-1d5c96716185

Relates:
- elastic#181520
- elastic/security-team#11789

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 6967952)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants