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][Endpoint][Guided onboarding] New extension point with the endpoint UI #142395

Conversation

gergoabraham
Copy link
Contributor

@gergoabraham gergoabraham commented Sep 30, 2022

Summary

Added new UI for onboarding users through setting up Elastic Defend.

Screenshots:
Desktop layout

Mobile layout

Checklist

Delete any items that are not applicable to this PR.

@gergoabraham gergoabraham changed the title [Security Solution][Endpoint] Guided onboarding: new extension point with the endpoint UI [Security Solution][Endpoint][Guided onboarding] New extension point with the endpoint UI Sep 30, 2022
@gergoabraham gergoabraham added Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.6.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Sep 30, 2022
@gergoabraham gergoabraham marked this pull request as ready for review September 30, 2022 17:32
@gergoabraham gergoabraham requested review from a team as code owners September 30, 2022 17:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

@gergoabraham
Copy link
Contributor Author

@elasticmachine merge upstream

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 3, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@dasansol92 dasansol92 left a comment

Choose a reason for hiding this comment

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

This is looking great! 🔥 Left some questions/suggestions, let me know if anything is not clear or needs more explanation. Happy to discuss about those 🙂

Read more about Endpoint security configuration in our {docsPage}."
values={{
docsPage: (
<EuiLink href="https://www.elastic.co/guide/en/security/master/configure-endpoint-integration-policy.html">
Copy link
Contributor

Choose a reason for hiding this comment

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

You have to use kibana docs service here. This will show the link with the stack version. You can check how it works here . You will also have to update kibana docs types to add the new one if it doesn't exists yet.

Copy link
Contributor Author

@gergoabraham gergoabraham Oct 4, 2022

Choose a reason for hiding this comment

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

/** The integration policy being created */
newPolicy: NewPackagePolicy;
}
export type PackagePolicyCreateMultiStepExtensionComponent = ComponentType<{}>;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would not remove these props as could be used in the future (or might be used for other integrations) when we add any kind of integration modification action.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we discussed, I'd leave them removed to avoid unneeded complexity, and put them back when they are really needed.

);

const LargeSecurityLogo = () => (
<EuiIcon type="logoSecurity" style={{ width: '128px', height: '128px' }} />
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: create a styled component instead so we don't have inline css styles defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

memo<PackagePolicyCreateMultiStepExtensionComponentProps>(({ newPolicy }) => {
return <></>;
});
export const EndpointPolicyCreateMultiStepExtension = memo(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move the final component at the end so we see first all the defined consts and finally the component that uses those?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, for functions that returns a component or JSX code I think it would be better to define those inside the component so all are rendered on component render and not on module import level. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you move the final component at the end so we see first all the defined consts and finally the component that uses those?

Personally I like it better when the higher level components/functions are on the top of the file, so when one opens it, they can see the high level logic first, and if they want to see the details, they can go down in the file. But I see that your suggestion is the general style in our codebase, so of course! It's better to have an aligned code style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, for functions that returns a component or JSX code I think it would be better to define those inside the component so all are rendered on component render and not on module import level. What do you think?

Great idea! Usually I'd keep small components out of the main component, so the functional components are not re-created on every re-render, but in this case with a static component, I agree that favouring a faster module load is probably better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EndpointPolicyCreateMultiStepExtension.displayName = 'EndpointPolicyCreateMultiStepExtension';

const Container = styled('div')`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid this using an EUI component with some spacing? It seems too much specific

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

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

This is looking good, but I belive we can simplifiy the code further if we use CSS padding and margins instead of using EuiSpacer.

Comment on lines 58 to 70
const LargeCustomSpacer = () => (
<>
<EuiSpacer size="m" />
<EuiSpacer size="xxl" />
</>
);

const MediumCustomSpacer = () => (
<>
<EuiSpacer size="m" />
<EuiSpacer size="xl" />
</>
);
Copy link
Member

Choose a reason for hiding this comment

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

Please merge these two separate components into a single one called CustomSpacer that takes sizes as an array and then spits out EuiSpacers based on that. Then you can just use something like <CustomSpacer spacers={['m', 'xxl']} /> or <CustomSpacer spacers={['m', 'xl']} /> where needed.

EndpointPolicyCreateMultiStepExtension.displayName = 'EndpointPolicyCreateMultiStepExtension';

const Container = styled('div')`
padding: 0 23px;
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, why is this exact padding needed instead of using the Eui token values for padding? Also looks like either the Container should have padding that is equal to the LargeCustomSpacer instead of the custom spacer. Also, the EuiFlexGroup on line 23 should have a margin that is equal to MediumCustomSpacer instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gergoabraham gergoabraham requested a review from a team as a code owner October 4, 2022 09:58
Copy link
Contributor

@dasansol92 dasansol92 left a comment

Choose a reason for hiding this comment

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

Looks great! Left two more suggestions but this is ready 🔥 Thanks for applying all the changes!

`;

const LargeLogo = styled(EuiIcon)`
width: 128px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use any UI token here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Read more about Endpoint security configuration in our {docsPage}."
values={{
docsPage: (
<EuiLink href={docLinks.links.securitySolution.configureEndpointIntegrationPolicy}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we should open the link in a new tab:

<EuiLink href={docLinks.links.securitySolution.configureEndpointIntegrationPolicy} target="_blank" external> [...] </EuiLink>

cc: @caitlinbetz @kevinlog

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, let's open on a new tab so that it doesn't take the user from the onboarding flow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gergoabraham
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@dasansol92 dasansol92 left a comment

Choose a reason for hiding this comment

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

🔥 🔥 🔥

Copy link
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

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

Looking good to 🚢

Comment on lines 112 to 113
margin-bottom: ${marginSize};
margin-top: ${marginSize};
Copy link
Member

Choose a reason for hiding this comment

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

Should be padding and not margin. Conceptually, you're padding out the content so that there's spacing around it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool, thanks! It also makes things easier, that's for sure.
50d0017

margin-top: ${marginSize};
`}
>
<CenteredEuiFlexItem grow={false}>{securityLogo}</CenteredEuiFlexItem>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need this additional center alignment. You can just use the EuiFlexItem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the given design, you are right! The center alignment helps with the mobile view.

<p>
<FormattedMessage
id="xpack.securitySolution.endpoint.policy.multiStepOnboarding.details"
defaultMessage="You can change this later by editing the Endpoint Security integration agent policy.
Copy link
Contributor

@kellyemurphy kellyemurphy Oct 4, 2022

Choose a reason for hiding this comment

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

This is Janeen. Edit to @kellyemurphy 's suggestion because we updated the name to Elastic Defend in 8.5.

Suggested change
defaultMessage="You can change this later by editing the Endpoint Security integration agent policy.
defaultMessage="You can edit these settings later in the Elastic Defend integration policy.

<FormattedMessage
id="xpack.securitySolution.endpoint.policy.multiStepOnboarding.details"
defaultMessage="You can change this later by editing the Endpoint Security integration agent policy.
Read more about Endpoint security configuration in our {docsPage}."
Copy link
Contributor

Choose a reason for hiding this comment

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

We can shorten this entire sentence to just "Learn more" that links to that doc page and a jumpout icon.

Copy link
Contributor

@jmikell821 jmikell821 left a comment

Choose a reason for hiding this comment

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

Added a comment for language. @joepeeples can you make sure we don't need to edit language anywhere else in this PR? Thanks!

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

doclink is good.

Copy link
Contributor

@joepeeples joepeeples left a comment

Choose a reason for hiding this comment

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

One small nit about "macOS" vs. "Mac", otherwise LGTM!

<p>
<FormattedMessage
id="xpack.securitySolution.endpoint.policy.multiStepOnboarding.feature"
defaultMessage="Windows, Mac, and Linux event collection"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "macOS" (capitalized as such) is the proper name of the operating system, and Apple usually uses "Mac" to refer to a piece of hardware

Suggested change
defaultMessage="Windows, Mac, and Linux event collection"
defaultMessage="Windows, macOS, and Linux event collection"

Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch!

Copy link
Contributor

@benironside benironside left a comment

Choose a reason for hiding this comment

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

The UI copy looks good to me, once the other reviewers' comments have been included. Only other thing I would suggest considering is to make the header "Set up an Elastic Defend integration" (the current version doesn't have an "an"). Not crucial but I think it would be slightly more accurate.

@gergoabraham
Copy link
Contributor Author

@kellyemurphy @jmikell821 @joepeeples
Thanks a lot for the feedback! What do you think of @benironside's suggestion? #142395 (review)

Now the UI looks like this:
image

ead759e

@gergoabraham
Copy link
Contributor Author

@elasticmachine merge upstream

@joepeeples
Copy link
Contributor

What do you think of @benironside's suggestion? #142395 (review)

I agree, the heading needs an article. I might lean toward "Set up the Elastic Defend integration", but "an" probably works too.

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #3 / All hosts table it renders risk column

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3148 3161 +13

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 894 893 -1

Async chunks

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

id before after diff
fleet 911.6KB 911.6KB -11.0B
securitySolution 6.6MB 6.6MB +8.5KB
total +8.5KB

Page load bundle

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

id before after diff
core 367.2KB 367.2KB +93.0B
securitySolution 264.5KB 264.5KB +56.0B
total +149.0B
Unknown metric groups

API count

id before after diff
fleet 998 996 -2

History

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

cc @gergoabraham

@kellyemurphy
Copy link
Contributor

kellyemurphy commented Oct 5, 2022

What do you think of @benironside's suggestion? #142395 (review)

I agree, the heading needs an article. I might lean toward "Set up the Elastic Defend integration", but "an" probably works too.

@joepeeples @benironside Would there ever be more than one? If it's singular, then "the" makes sense. If there could be multiple, then "an" is ok.

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Fleet changes looks good to me

@gergoabraham
Copy link
Contributor Author

@joepeeples @benironside Would there ever be more than one? If it's singular, then "the" makes sense. If there could be multiple, then "an" is ok.

@kellyemurphy I merge the current modification, because modifying the title is rather related to the overall onboarding flow, than the UI in this issue. Do you have an Epic/workflow to discuss the title change? In case not, please let me know if you would like me to create an issue for that change.

@gergoabraham gergoabraham merged commit 46d87da into elastic:main Oct 6, 2022
@gergoabraham gergoabraham deleted the feat/olm-5030-guided-onboarding-new-extension-point-with-the-endpoint-ui branch October 6, 2022 09:12
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 11, 2022
…with the endpoint UI (elastic#142395)

* Add new UI for extension for onboarding

* Remove unnecessary props

* Improve layout for mobile browsers

* use Kibana Docs service for documentation url

* use styled components instead of inline style

* move small components above/in the main component

* use Eui components and tokens instead of custom ones

* use Eui sizing tokens for logo size

* open documentation link on new tab

* use padding instead of margin

* update texts

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

Co-authored-by: Kibana Machine <[email protected]>
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 14, 2022
…with the endpoint UI (elastic#142395)

* Add new UI for extension for onboarding

* Remove unnecessary props

* Improve layout for mobile browsers

* use Kibana Docs service for documentation url

* use styled components instead of inline style

* move small components above/in the main component

* use Eui components and tokens instead of custom ones

* use Eui sizing tokens for logo size

* open documentation link on new tab

* use padding instead of margin

* update texts

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

Co-authored-by: Kibana Machine <[email protected]>
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 OLM Sprint release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team:Fleet Team label for Observability Data Collection Fleet team v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.