-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] adjust policy onboarding view, check for Ingest permissions #70536
Merged
Merged
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
47eac9d
adjust policy onboarding view
kevinlog 4bc6023
correct test subj
kevinlog d233ff7
fix tests
kevinlog 3db51c2
Merge branch 'master' of github.com:kevinlog/kibana into task/onboard…
kevinlog e0f5209
re-enable tests
kevinlog fcc8cf2
add no permissions view
kevinlog 4ea98d2
Merge branch 'master' into task/onboarding-ux-updates
elasticmachine 33dd8fc
adjust onbording look
kevinlog f1df980
adjust text
kevinlog e49ecf9
Merge branch 'master' of github.com:kevinlog/kibana into task/onboard…
kevinlog 44b402f
use ingest hook, add tests
kevinlog f9489e3
Merge branch 'master' into task/onboarding-ux-updates
elasticmachine b47a1b9
adjust text
kevinlog fa5f413
Merge branch 'task/onboarding-ux-updates' of github.com:kevinlog/kiba…
kevinlog d0e9e42
address comments
kevinlog c327fa3
Merge branch 'master' of github.com:kevinlog/kibana into task/onboard…
kevinlog 4d7d081
beta badges
kevinlog bf532c1
fix test
kevinlog 65a2248
Merge branch 'master' into task/onboarding-ux-updates
elasticmachine aa75c5e
Merge branch 'master' of github.com:kevinlog/kibana into task/onboard…
kevinlog 133b471
Merge branch 'master' of github.com:kevinlog/kibana into task/onboard…
kevinlog 7f8fb8d
correct timeline flyout
kevinlog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { | |
EuiSelectable, | ||
EuiSelectableMessage, | ||
EuiSelectableProps, | ||
EuiIcon, | ||
EuiLoadingSpinner, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
@@ -35,71 +36,121 @@ const PolicyEmptyState = React.memo<{ | |
onActionClick: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void; | ||
actionDisabled?: boolean; | ||
}>(({ loading, onActionClick, actionDisabled }) => { | ||
const policySteps = useMemo( | ||
() => [ | ||
{ | ||
title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepOneTitle', { | ||
defaultMessage: 'Head over to Ingest Manager.', | ||
}), | ||
children: ( | ||
<EuiText color="subdued" size="xs"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.stepOne" | ||
defaultMessage="Here, you’ll add the Elastic Endpoint Security Integration to your Agent Configuration." | ||
/> | ||
</EuiText> | ||
), | ||
}, | ||
{ | ||
title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepTwoTitle', { | ||
defaultMessage: 'We’ll create a recommended security policy for you.', | ||
}), | ||
children: ( | ||
<EuiText color="subdued" size="xs"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.stepTwo" | ||
defaultMessage="You can edit this policy in the “Policies” tab after you’ve added the Elastic Endpoint integration." | ||
/> | ||
</EuiText> | ||
), | ||
}, | ||
{ | ||
title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepThreeTitle', { | ||
defaultMessage: 'Enroll your agents through Fleet.', | ||
}), | ||
children: ( | ||
<EuiText color="subdued" size="xs"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.stepThree" | ||
defaultMessage="If you haven’t already, enroll your agents through Fleet using the same agent configuration." | ||
/> | ||
</EuiText> | ||
), | ||
}, | ||
], | ||
[] | ||
); | ||
|
||
return ( | ||
<ManagementEmptyState | ||
loading={loading} | ||
onActionClick={onActionClick} | ||
actionDisabled={actionDisabled} | ||
dataTestSubj="emptyPolicyTable" | ||
steps={policySteps} | ||
headerComponent={ | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.noPolicyPrompt" | ||
defaultMessage="Looks like you're not using the Elastic Endpoint" | ||
/> | ||
} | ||
bodyComponent={ | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.noPolicyInstructions" | ||
defaultMessage="Elastic Endpoint Security gives you the power to keep your endpoints safe from attack, as well as unparalleled visibility into any threat in your environment." | ||
/> | ||
} | ||
/> | ||
<div data-test-subj="emptyPolicyTable"> | ||
{loading ? ( | ||
<EuiFlexGroup alignItems="center" justifyContent="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner size="xl" className="essentialAnimation" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
) : ( | ||
<EuiFlexGroup data-test-subj="policyOnboardingInstructions"> | ||
<EuiFlexItem> | ||
<EuiText> | ||
<h3> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingTitle" | ||
defaultMessage="Get started with Elastic Endpoint Security" | ||
/> | ||
</h3> | ||
</EuiText> | ||
<EuiSpacer size="xl" /> | ||
<EuiText size="s" color="subdued"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingSectionOne" | ||
defaultMessage="Elastic Endpoint Security gives you the power to keep your endpoints safe from attack, as well as unparalleled visibility into any threat in your environment." | ||
/> | ||
</EuiText> | ||
<EuiSpacer size="xl" /> | ||
<EuiText size="s" color="subdued"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingSectionTwo" | ||
defaultMessage="You’ll be able to view and manage hosts in your environment running the Elastic Endpoint from this page." | ||
/> | ||
</EuiText> | ||
<EuiSpacer size="xl" /> | ||
<EuiFlexGroup> | ||
<EuiFlexItem> | ||
<EuiFlexGroup> | ||
<EuiFlexItem grow={false} style={{ marginRight: '10px' }}> | ||
<EuiIcon type="search" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false} style={{ marginLeft: '0' }}> | ||
<EuiText> | ||
<h4> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingHostTitle" | ||
defaultMessage="Hosts" | ||
/> | ||
</h4> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiSpacer size="s" /> | ||
<EuiText size="xs" color="subdued"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingHostInfo" | ||
defaultMessage="Hosts running the Elastic Endpoint" | ||
/> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiFlexGroup> | ||
<EuiFlexItem grow={false} style={{ marginRight: '10px' }}> | ||
<EuiIcon type="tableDensityExpanded" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false} style={{ marginLeft: '0' }}> | ||
<EuiText> | ||
<h4> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingPolicyTitle" | ||
defaultMessage="Policies" | ||
/> | ||
</h4> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiSpacer size="s" /> | ||
<EuiText size="xs" color="subdued"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingPolicyInfo" | ||
defaultMessage="View and configure protections" | ||
/> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiSpacer size="xl" /> | ||
<EuiText size="s" color="subdued"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.onboardingSectionThree" | ||
defaultMessage="To get started, you’ll have to add the Elastic Endpoint integration to your Agents. Let’s do that now!" | ||
/> | ||
</EuiText> | ||
<EuiSpacer size="xl" /> | ||
<EuiFlexGroup> | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
fill | ||
iconType="plusInCircle" | ||
onClick={onActionClick} | ||
isDisabled={actionDisabled} | ||
data-test-subj="onboardingStartButton" | ||
> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.actionButtonText" | ||
defaultMessage="Add Endpoint Security" | ||
/> | ||
</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiIcon type="logoSecurity" size="xl" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
)} | ||
</div> | ||
); | ||
}); | ||
|
||
|
@@ -114,17 +165,17 @@ const EndpointsEmptyState = React.memo<{ | |
() => [ | ||
{ | ||
title: i18n.translate('xpack.securitySolution.endpoint.endpointList.stepOneTitle', { | ||
defaultMessage: 'Select a policy you created from the list below.', | ||
defaultMessage: 'Select the policy you want to use to protect your hosts', | ||
}), | ||
children: ( | ||
<> | ||
<EuiText color="subdued" size="xs"> | ||
<EuiText color="subdued" size="m" grow={false}> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.endpointList.stepOne" | ||
defaultMessage="These are existing policies." | ||
defaultMessage="Existing policies are listed below. This can be changed later." | ||
/> | ||
</EuiText> | ||
<EuiSpacer size="m" /> | ||
<EuiSpacer size="xxl" /> | ||
<EuiSelectable | ||
options={selectionOptions} | ||
singleSelection="always" | ||
|
@@ -158,38 +209,54 @@ const EndpointsEmptyState = React.memo<{ | |
{ | ||
title: i18n.translate('xpack.securitySolution.endpoint.endpointList.stepTwoTitle', { | ||
defaultMessage: | ||
'Head over to Ingest to deploy your Agent with Endpoint Security enabled.', | ||
'Enroll your agents enabled with Endpoint Security through Ingest Manager', | ||
}), | ||
status: actionDisabled ? 'disabled' : '', | ||
children: ( | ||
<EuiText color="subdued" size="xs"> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.endpointList.stepTwo" | ||
defaultMessage="You'll be given a command in Ingest to get you started." | ||
/> | ||
</EuiText> | ||
<EuiFlexGroup alignItems="center"> | ||
<EuiFlexItem> | ||
<EuiText color="subdued" size="m" grow={false}> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.endpointList.stepTwo" | ||
defaultMessage="You’ll be provided with the necessary commands to get started." | ||
/> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
fill | ||
onClick={onActionClick} | ||
isDisabled={actionDisabled} | ||
data-test-subj="onboardingStartButton" | ||
> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.emptyCreateNewButton" | ||
defaultMessage="Enroll Agent" | ||
/> | ||
</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
), | ||
}, | ||
], | ||
[selectionOptions, handleSelectableOnChange, loading] | ||
[selectionOptions, handleSelectableOnChange, loading, actionDisabled, onActionClick] | ||
); | ||
|
||
return ( | ||
<ManagementEmptyState | ||
loading={loading} | ||
onActionClick={onActionClick} | ||
actionDisabled={actionDisabled} | ||
dataTestSubj="emptyEndpointsTable" | ||
steps={policySteps} | ||
headerComponent={ | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.endpointList.noEndpointsPrompt" | ||
defaultMessage="You have a policy, but no Endpoints are deployed!" | ||
defaultMessage="Enable Elastic Endpoint Security on your agents" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agents? Is something people are expected to know? |
||
/> | ||
} | ||
bodyComponent={ | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.endpointList.noEndpointsInstructions" | ||
defaultMessage="Elastic Endpoint Security gives you the power to keep your endpoints safe from attack, as well as unparalleled visibility into any threat in your environment." | ||
defaultMessage="You’ve created your security policy. Now you need to enable the Elastic Endpoint Security capabilities on your agents following the steps below." | ||
/> | ||
} | ||
/> | ||
|
@@ -198,80 +265,45 @@ const EndpointsEmptyState = React.memo<{ | |
|
||
const ManagementEmptyState = React.memo<{ | ||
loading: boolean; | ||
onActionClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void; | ||
actionDisabled?: boolean; | ||
actionButton?: JSX.Element; | ||
dataTestSubj: string; | ||
steps?: ManagementStep[]; | ||
headerComponent: JSX.Element; | ||
bodyComponent: JSX.Element; | ||
}>( | ||
({ | ||
loading, | ||
onActionClick, | ||
actionDisabled, | ||
dataTestSubj, | ||
steps, | ||
actionButton, | ||
headerComponent, | ||
bodyComponent, | ||
}) => { | ||
return ( | ||
<div data-test-subj={dataTestSubj}> | ||
{loading ? ( | ||
<EuiFlexGroup alignItems="center" justifyContent="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner size="xl" className="essentialAnimation" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
) : ( | ||
<> | ||
<EuiSpacer size="xxl" /> | ||
<EuiTitle size="m"> | ||
<h2 style={TEXT_ALIGN_CENTER}>{headerComponent}</h2> | ||
</EuiTitle> | ||
<EuiSpacer size="xxl" /> | ||
<EuiText textAlign="center" color="subdued" size="s"> | ||
{bodyComponent} | ||
</EuiText> | ||
<EuiSpacer size="xxl" /> | ||
{steps && ( | ||
<EuiFlexGroup alignItems="center" justifyContent="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiSteps steps={steps} data-test-subj={'onboardingSteps'} /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
)} | ||
}>(({ loading, dataTestSubj, steps, headerComponent, bodyComponent }) => { | ||
return ( | ||
<div data-test-subj={dataTestSubj}> | ||
{loading ? ( | ||
<EuiFlexGroup alignItems="center" justifyContent="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner size="xl" className="essentialAnimation" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
) : ( | ||
<> | ||
<EuiSpacer size="xxl" /> | ||
<EuiTitle size="m"> | ||
<h2 style={TEXT_ALIGN_CENTER}>{headerComponent}</h2> | ||
</EuiTitle> | ||
<EuiSpacer size="xxl" /> | ||
<EuiText textAlign="center" color="subdued" size="m"> | ||
{bodyComponent} | ||
</EuiText> | ||
<EuiSpacer size="xxl" /> | ||
{steps && ( | ||
<EuiFlexGroup alignItems="center" justifyContent="center"> | ||
<EuiFlexItem grow={false}> | ||
<> | ||
{actionButton ? ( | ||
actionButton | ||
) : ( | ||
<EuiButton | ||
fill | ||
onClick={onActionClick} | ||
isDisabled={actionDisabled} | ||
data-test-subj="onboardingStartButton" | ||
> | ||
<FormattedMessage | ||
id="xpack.securitySolution.endpoint.policyList.emptyCreateNewButton" | ||
defaultMessage="Click here to get started" | ||
/> | ||
</EuiButton> | ||
)} | ||
</> | ||
<EuiSteps steps={steps} data-test-subj={'onboardingSteps'} /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</> | ||
)} | ||
</div> | ||
); | ||
} | ||
); | ||
)} | ||
</> | ||
)} | ||
</div> | ||
); | ||
}); | ||
|
||
PolicyEmptyState.displayName = 'PolicyEmptyState'; | ||
EndpointsEmptyState.displayName = 'EndpointsEmptyState'; | ||
ManagementEmptyState.displayName = 'ManagementEmptyState'; | ||
|
||
export { PolicyEmptyState, EndpointsEmptyState, ManagementEmptyState }; | ||
export { PolicyEmptyState, EndpointsEmptyState }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll
may beYou will
?