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

[Cloud Posture] Adding CSP 3P support callout for Wiz integration #196025

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { useKibana } from '@kbn/kibana-react-plugin/public';

import { AVCResultsBanner2024, useIsStillYear2024 } from '@kbn/avc-banner';

import useLocalStorage from 'react-use/lib/useLocalStorage';

import {
isIntegrationPolicyTemplate,
isPackagePrerelease,
Expand Down Expand Up @@ -113,6 +115,31 @@ const UnverifiedCallout: React.FC = () => {
);
};

const LS_CLOUD_POSTURE_3P_SUPPORT_WIZ_INTEGRATIONS_CALLOUT_KEY =
'fleet:cloudSecurityPosture:thirdPartySupport:wizIntegrationsCallout';

const CloudPostureThirdPartySupportCallout = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about having this component in its own file so we can add it to our team ownership? I would also pass the package name to it so that all the logic was inside the component, again to eliminate the risk smth being changed outside our our ownership. Ofc there always be the risk that the call of the component is deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, makes sense

const [userHasDismissedWizCallout, setUserHasDismissedWizCallout] = useLocalStorage(
LS_CLOUD_POSTURE_3P_SUPPORT_WIZ_INTEGRATIONS_CALLOUT_KEY
);

if (userHasDismissedWizCallout) return null;

return (
<>
<EuiCallOut
onDismiss={() => setUserHasDismissedWizCallout(true)}
iconType="cheer"
title={i18n.translate('xpack.fleet.epm.wizIntegration.newFeaturesCallout', {
defaultMessage:
'New! Starting from version 1.9, ingest vulnerability and misconfiguration findings from Wiz into Elastic. Leverage out-of-the-box contextual investigation and threat-hunting workflows.',
})}
/>
<EuiSpacer size="s" />
</>
);
};

export const PrereleaseCallout: React.FC<{
packageName: string;
latestGAVersion?: string;
Expand Down Expand Up @@ -319,6 +346,7 @@ export const OverviewPage: React.FC<Props> = memo(
<EuiSpacer size="s" />
</>
)}
{packageInfo.name === 'wiz' && <CloudPostureThirdPartySupportCallout />}
{isPrerelease && (
<PrereleaseCallout
packageName={packageInfo.name}
Expand Down