Skip to content

Commit

Permalink
[Security Solution][Endpoint] Revert Badges for SentinelOne functiona…
Browse files Browse the repository at this point in the history
…lity back to Tech Preview (from Beta) (elastic#177488)

## Summary

This PR reverts most of the changes done in elastic#176228 : 

- Reverts changes to Connectors so that the Badge displayed for
SentinelOne is again showing "Technical Preview"
- Changes the badge displayed on the Host Isolation flyout and Responder
for SentinelOne host to "Technical Preview"
- Fixes elastic#177337 

IN addition, the following issue was also addressed:

- Corrected `i18n` definition for response action log history ( Fixes
elastic#177185 )


_____________

### Host isolation flyout

<img width="1283" alt="image"
src="https://github.com/elastic/kibana/assets/56442535/dc1f104a-9792-4aee-ae12-140489562d96">



### Responder

<img width="1272" alt="image"
src="https://github.com/elastic/kibana/assets/56442535/6361008a-182f-4163-b754-92619b6c9ee1">


### Connector

<img width="638" alt="image"
src="https://github.com/elastic/kibana/assets/56442535/338d03d9-b74d-479d-bfe2-d1796d1f2103">


<img width="1283" alt="image"
src="https://github.com/elastic/kibana/assets/56442535/4eeeeccb-e966-4897-b97f-17696e0bd5ef">
  • Loading branch information
paul-tavares authored and fkanout committed Mar 4, 2024
1 parent 9206afc commit 636c3a7
Show file tree
Hide file tree
Showing 20 changed files with 119 additions and 166 deletions.
15 changes: 15 additions & 0 deletions x-pack/plugins/security_solution/public/common/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ export const BETA_TOOLTIP = i18n.translate('xpack.securitySolution.pages.common.
'This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.',
});

export const TECHNICAL_PREVIEW = i18n.translate(
'xpack.securitySolution.pages.common.technicalPreviewLabel',
{
defaultMessage: 'Technical Preview',
}
);

export const TECHNICAL_PREVIEW_TOOLTIP = i18n.translate(
'xpack.securitySolution.pages.common.technicalPreviewTooltip',
{
defaultMessage:
'This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.',
}
);

export const UPDATE_ALERT_STATUS_FAILED = (conflicts: number) =>
i18n.translate('xpack.securitySolution.pages.common.updateAlertStatusFailed', {
values: { conflicts },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_exper
import { PanelHeader } from './header';
import { FLYOUT_HEADER_TITLE_TEST_ID } from './test_ids';
import { isAlertFromSentinelOneEvent } from '../../../common/utils/sentinelone_alert_check';
import { TECHNICAL_PREVIEW } from '../../../common/translations';

jest.mock('../../../common/hooks/use_experimental_features');
jest.mock('../../../common/utils/sentinelone_alert_check');
Expand Down Expand Up @@ -63,7 +64,7 @@ describe('<PanelHeader />', () => {
const { getByTestId } = renderPanelHeader();

expect(getByTestId(FLYOUT_HEADER_TITLE_TEST_ID)).toBeInTheDocument();
expect(getByTestId(FLYOUT_HEADER_TITLE_TEST_ID)).toHaveTextContent('Beta');
expect(getByTestId(FLYOUT_HEADER_TITLE_TEST_ID)).toHaveTextContent(TECHNICAL_PREVIEW);
}
);

Expand All @@ -79,7 +80,7 @@ describe('<PanelHeader />', () => {
const { getByTestId } = renderPanelHeader();

expect(getByTestId(FLYOUT_HEADER_TITLE_TEST_ID)).toBeInTheDocument();
expect(getByTestId(FLYOUT_HEADER_TITLE_TEST_ID)).not.toHaveTextContent('Beta');
expect(getByTestId(FLYOUT_HEADER_TITLE_TEST_ID)).not.toHaveTextContent(TECHNICAL_PREVIEW);
}
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'
import type { FC } from 'react';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { TECHNICAL_PREVIEW, TECHNICAL_PREVIEW_TOOLTIP } from '../../../common/translations';
import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features';
import { BETA, BETA_TOOLTIP } from '../../../common/translations';
import { isAlertFromSentinelOneEvent } from '../../../common/utils/sentinelone_alert_check';
import { useIsolateHostPanelContext } from './context';
import { FLYOUT_HEADER_TITLE_TEST_ID } from './test_ids';
Expand Down Expand Up @@ -43,7 +43,7 @@ export const PanelHeader: FC = () => {
</EuiFlexItem>
{isSentinelOneV1Enabled && isSentinelOneAlert && (
<EuiFlexItem grow={false}>
<EuiBetaBadge label={BETA} tooltipContent={BETA_TOOLTIP} />
<EuiBetaBadge label={TECHNICAL_PREVIEW} tooltipContent={TECHNICAL_PREVIEW_TOOLTIP} />
</EuiFlexItem>
)}
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export const ActionsLogFilterPopover = memo(
>
{filterName === 'types'
? isSentinelOneV1Enabled
? FILTER_NAMES.types('s')
: FILTER_NAMES.types('')
? FILTER_NAMES.types(2)
: FILTER_NAMES.types(1)
: FILTER_NAMES[filterName]}
</EuiFilterButton>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ export const FILTER_NAMES = Object.freeze({
}),
// TODO: change it to just a value instead of a function
// when responseActionsSentinelOneV1Enabled is enabled/removed
types: (suffix: string) =>
types: (countOfTypes: number) =>
i18n.translate('xpack.securitySolution.responseActionsList.list.filter.types', {
defaultMessage: `Type{suffix}`,
values: { suffix },
defaultMessage: `{countOfTypes, plural, one {Type} other {Types}}`,
values: { countOfTypes },
}),
// replace above with:
// types: i18n.translate('xpack.securitySolution.responseActionsList.list.filter.types', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { useCallback } from 'react';
import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { BETA, BETA_TOOLTIP } from '../../common/translations';
import { TECHNICAL_PREVIEW, TECHNICAL_PREVIEW_TOOLTIP } from '../../common/translations';
import { useLicense } from '../../common/hooks/use_license';
import type { ImmutableArray } from '../../../common/endpoint/types';
import {
Expand Down Expand Up @@ -136,7 +136,10 @@ export const useWithShowResponder = (): ShowResponseActionsConsole => {
<EuiFlexGroup>
<EuiFlexItem>{RESPONDER_PAGE_TITLE}</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBetaBadge label={BETA} tooltipContent={BETA_TOOLTIP} />
<EuiBetaBadge
label={TECHNICAL_PREVIEW}
tooltipContent={TECHNICAL_PREVIEW_TOOLTIP}
/>
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ export const installSentinelOneAgent = async ({

try {
// Generate an alert in SentinelOne
await hostVm.exec('nslookup amazon.com');
const command = 'nslookup elastic.co';

log?.info(`Triggering alert using command: ${command}`);
await hostVm.exec(command);
} catch (e) {
log?.warning(`Attempted to generate an alert on SentinelOne host failed: ${e.message}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ const runCli: RunFn = async ({ log, flags }) => {
s1Client,
});

log.info(`SentinelOne Agent Status:
${s1Info.status}`);

const {
id: agentPolicyId,
agents = 0,
Expand Down Expand Up @@ -177,7 +180,5 @@ const runCli: RunFn = async ({ log, flags }) => {
${hostVm.info()}
${agentPolicyVm ? `${agentPolicyVm.info()}\n` : ''}
${await getMultipassVmCountNotice(2)}
SentinelOne Agent Status:
${s1Info.status}
`);
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ export type ExperimentalFeatures = typeof allowedExperimentalValues;
*/
export const allowedExperimentalValues = Object.freeze({
isMustacheAutocompleteOn: false,
// set to true to show tech preview badge on sentinel one connector
sentinelOneConnectorOn: true,
// set to true to show beta badge on sentinel one connector
// TODO: set to true when 8.13 is ready
sentinelOneConnectorOnBeta: false,
});

export type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@ export function registerConnectorTypes({
connectorTypeRegistry.register(getTinesConnectorType());
connectorTypeRegistry.register(getD3SecurityConnectorType());

// get sentinelOne connector type
// when either feature flag is enabled
if (
// 8.12
ExperimentalFeaturesService.get().sentinelOneConnectorOn ||
// 8.13
ExperimentalFeaturesService.get().sentinelOneConnectorOnBeta
) {
if (ExperimentalFeaturesService.get().sentinelOneConnectorOn) {
connectorTypeRegistry.register(getSentinelOneConnectorType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ import type {
ActionTypeModel as ConnectorTypeModel,
GenericValidationResult,
} from '@kbn/triggers-actions-ui-plugin/public';
import { getIsExperimentalFeatureEnabled } from '../../common/get_experimental_features';
import {
SENTINELONE_CONNECTOR_ID,
SENTINELONE_TITLE,
SUB_ACTION,
} from '../../../common/sentinelone/constants';
import type {
SentinelOneActionParams,
SentinelOneConfig,
SentinelOneSecrets,
SentinelOneActionParams,
} from '../../../common/sentinelone/types';

interface ValidationErrors {
Expand All @@ -32,16 +31,11 @@ export function getConnectorType(): ConnectorTypeModel<
SentinelOneSecrets,
SentinelOneActionParams
> {
const isSentinelOneBetaBadgeEnabled = getIsExperimentalFeatureEnabled(
'sentinelOneConnectorOnBeta'
);

return {
id: SENTINELONE_CONNECTOR_ID,
actionTypeTitle: SENTINELONE_TITLE,
iconClass: lazy(() => import('./logo')),
isBeta: isSentinelOneBetaBadgeEnabled ? true : undefined,
isExperimental: isSentinelOneBetaBadgeEnabled ? undefined : true,
isExperimental: true,
selectMessage: i18n.translate(
'xpack.stackConnectors.security.sentinelone.config.selectMessageText',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
*/

import React, { useEffect, useState } from 'react';
import { EuiCard, EuiFlexGrid, EuiFlexItem, EuiIcon, EuiSpacer, EuiToolTip } from '@elastic/eui';
import { EuiFlexItem, EuiCard, EuiIcon, EuiFlexGrid, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { EuiToolTip } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { ActionType, ActionTypeIndex, ActionTypeRegistryContract } from '../../../types';
import { loadActionTypes } from '../../lib/action_connector_api';
import { actionTypeCompare } from '../../lib/action_type_compare';
import { checkActionTypeEnabled } from '../../lib/check_action_type_enabled';
import { useKibana } from '../../../common/lib/kibana';
import { SectionLoading } from '../../components/section_loading';
import { betaBadgeProps, technicalPreviewBadgeProps } from './beta_badge_props';
import { betaBadgeProps } from './beta_badge_props';

interface Props {
onActionTypeChange: (actionType: ActionType) => void;
Expand Down Expand Up @@ -76,13 +77,12 @@ export const ActionTypeMenu = ({
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const registeredActionTypes = Object.entries(actionTypesIndex ?? [])
.filter(
([id, details]) =>
actionTypeRegistry.has(id) &&
!actionTypeRegistry.get(id).hideInUi &&
details.enabledInConfig
details.enabledInConfig === true &&
!actionTypeRegistry.get(id).hideInUi
)
.map(([id, actionType]) => {
const actionTypeModel = actionTypeRegistry.get(id);
Expand All @@ -91,7 +91,6 @@ export const ActionTypeMenu = ({
selectMessage: actionTypeModel ? actionTypeModel.selectMessage : '',
actionType,
name: actionType.name,
isBeta: actionTypeModel.isBeta,
isExperimental: actionTypeModel.isExperimental,
};
});
Expand All @@ -102,13 +101,7 @@ export const ActionTypeMenu = ({
const checkEnabledResult = checkActionTypeEnabled(item.actionType);
const card = (
<EuiCard
betaBadgeProps={
item.isBeta
? betaBadgeProps
: item.isExperimental
? technicalPreviewBadgeProps
: undefined
}
betaBadgeProps={item.isExperimental ? betaBadgeProps : undefined}
titleSize="xs"
data-test-subj={`${item.actionType.id}-card`}
icon={<EuiIcon size="xl" type={item.iconClass} />}
Expand All @@ -124,7 +117,7 @@ export const ActionTypeMenu = ({
return (
<EuiFlexItem key={index}>
{checkEnabledResult.isEnabled && card}
{!checkEnabledResult.isEnabled && (
{checkEnabledResult.isEnabled === false && (
<EuiToolTip position="top" content={checkEnabledResult.message}>
{card}
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
import { i18n } from '@kbn/i18n';

export const betaBadgeProps = {
label: i18n.translate('xpack.triggersActionsUI.betaBadgeLabel', {
defaultMessage: 'Beta',
}),
tooltipContent: i18n.translate('xpack.triggersActionsUI.betaBadgeDescription', {
defaultMessage:
'This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.',
}),
};

export const technicalPreviewBadgeProps = {
label: i18n.translate('xpack.triggersActionsUI.technicalPreviewBadgeLabel', {
defaultMessage: 'Technical preview',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,25 @@
import React, { memo } from 'react';
import {
EuiBadge,
EuiBetaBadge,
EuiTitle,
EuiFlexGroup,
EuiFlexItem,
EuiFlyoutHeader,
EuiIcon,
EuiSpacer,
EuiText,
EuiTitle,
EuiFlyoutHeader,
IconType,
EuiSpacer,
EuiBetaBadge,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { betaBadgeProps, technicalPreviewBadgeProps } from '../beta_badge_props';
import { betaBadgeProps } from '../beta_badge_props';

interface Props {
icon?: IconType | null;
actionTypeName?: string | null;
actionTypeMessage?: string | null;
compatibility?: string[] | null;
isExperimental?: boolean;
isBeta?: boolean;
}

const FlyoutHeaderComponent: React.FC<Props> = ({
Expand All @@ -36,7 +35,6 @@ const FlyoutHeaderComponent: React.FC<Props> = ({
actionTypeMessage,
compatibility,
isExperimental,
isBeta,
}) => {
return (
<EuiFlyoutHeader hasBorder data-test-subj="create-connector-flyout-header">
Expand All @@ -63,23 +61,14 @@ const FlyoutHeaderComponent: React.FC<Props> = ({
</h3>
</EuiTitle>
</EuiFlexItem>
{actionTypeName
? isBeta && (
<EuiFlexItem grow={false}>
<EuiBetaBadge
label={betaBadgeProps.label}
tooltipContent={betaBadgeProps.tooltipContent}
/>
</EuiFlexItem>
)
: isExperimental && (
<EuiFlexItem grow={false}>
<EuiBetaBadge
label={technicalPreviewBadgeProps.label}
tooltipContent={technicalPreviewBadgeProps.tooltipContent}
/>
</EuiFlexItem>
)}
{actionTypeName && isExperimental && (
<EuiFlexItem grow={false}>
<EuiBetaBadge
label={betaBadgeProps.label}
tooltipContent={betaBadgeProps.tooltipContent}
/>
</EuiFlexItem>
)}
</EuiFlexGroup>
<EuiText size="s" color="subdued">
{actionTypeMessage}
Expand Down
Loading

0 comments on commit 636c3a7

Please sign in to comment.