Skip to content

Commit

Permalink
[Cloud Security] [CIS GCP] Google Cloud Shell Onboarding steps (#163030)
Browse files Browse the repository at this point in the history
Added Google Cloud Shell onboarding option
- User now are able to choose Google Cloud Shell Option
- Upon Saving integration with Google Cloud Shell Setup access option,
Google Cloud Shell deployment post installation modal will pop up.
Clicking on the Launch Cloud Shell button will redirect user to Google
Cloud Shell page
- User could also click on the Launch Cloud Shell button from Agent
installation flyout modal and get redirected to Google Cloud Shell page

NOTE:
- The cloud shell Url are not fully functioning right now as we don't
have 8.10 branch yet, as such when we want to test this for now, user
could just change the cloudshell_git_branch value on the url to main
from 8.10 manually

<img width="840" alt="Screenshot 2023-08-05 at 10 48 02 AM"
src="https://github.com/elastic/kibana/assets/8703149/bf7d5acc-1006-4807-b7a9-1ebb3e2aa847">
<img width="914" alt="Screenshot 2023-08-05 at 10 46 45 AM"
src="https://github.com/elastic/kibana/assets/8703149/41a5a2e2-1e32-471d-a150-bbd319eee592">
<img width="1679" alt="Screenshot 2023-08-05 at 10 44 28 AM"
src="https://github.com/elastic/kibana/assets/8703149/2e04a05a-c0bd-4f6a-ab49-a6efe3600c66">



https://github.com/elastic/kibana/assets/8703149/fc0f5825-882b-4091-8a62-2917d108abb6


https://github.com/elastic/kibana/assets/8703149/e8ea0ca8-997e-452d-8280-5180db34aaa9
  • Loading branch information
animehart authored Aug 10, 2023
1 parent e5a591c commit a8f3a5a
Show file tree
Hide file tree
Showing 31 changed files with 1,009 additions and 129 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/cloud_security_posture/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,7 @@ export const VULNERABILITIES_SEVERITY: Record<VulnSeverity, VulnSeverity> = {
CRITICAL: 'CRITICAL',
UNKNOWN: 'UNKNOWN',
};

export const VULNERABILITIES_ENUMERATION = 'CVE';
export const SETUP_ACCESS_CLOUD_SHELL = 'google_cloud_shell';
export const SETUP_ACCESS_MANUAL = 'manual';
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const cloudPostureIntegrations: CloudPostureIntegrations = {
{
type: CLOUDBEAT_AWS,
name: i18n.translate('xpack.csp.cspmIntegration.awsOption.nameTitle', {
defaultMessage: 'Amazon Web Services',
defaultMessage: 'AWS',
}),
benchmark: i18n.translate('xpack.csp.cspmIntegration.awsOption.benchmarkTitle', {
defaultMessage: 'CIS AWS',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CIS_AWS, CIS_GCP } from '../../common/constants';
import { Cluster } from '../../common/types';
import { CISBenchmarkIcon } from './cis_benchmark_icon';
import { CompactFormattedNumber } from './compact_formatted_number';
import { useNavigateFindings } from '../common/hooks/use_navigate_findings';

export const AccountsEvaluatedWidget = ({
clusters,
Expand All @@ -23,6 +24,12 @@ export const AccountsEvaluatedWidget = ({
return clusters?.filter((obj) => obj?.meta.benchmark.id === benchmarkId) || [];
};

const navToFindings = useNavigateFindings();

const navToFindingsByCloudProvider = (provider: string) => {
navToFindings({ 'cloud.provider': provider });
};

const cisAwsClusterAmount = filterClustersById(CIS_AWS).length;
const cisGcpClusterAmount = filterClustersById(CIS_GCP).length;

Expand All @@ -32,32 +39,46 @@ export const AccountsEvaluatedWidget = ({
return (
<>
<EuiFlexGroup gutterSize="s">
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem>
<CISBenchmarkIcon type={CIS_AWS} name={cisAwsBenchmarkName} />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<CompactFormattedNumber
number={cisAwsClusterAmount}
abbreviateAbove={benchmarkAbbreviateAbove}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
<CISBenchmarkIcon type={CIS_GCP} name={cisGcpBenchmarkName} />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<CompactFormattedNumber
number={cisGcpClusterAmount}
abbreviateAbove={benchmarkAbbreviateAbove}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
{cisAwsClusterAmount > 0 && (
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem>
<CISBenchmarkIcon type={CIS_AWS} name={cisAwsBenchmarkName} />
</EuiFlexItem>
<EuiFlexItem
grow={false}
onClick={() => {
navToFindingsByCloudProvider('aws');
}}
>
<CompactFormattedNumber
number={cisAwsClusterAmount}
abbreviateAbove={benchmarkAbbreviateAbove}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
)}
{cisGcpClusterAmount > 0 && (
<EuiFlexItem>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem>
<CISBenchmarkIcon type={CIS_GCP} name={cisGcpBenchmarkName} />
</EuiFlexItem>
<EuiFlexItem
grow={false}
onClick={() => {
navToFindingsByCloudProvider('gcp');
}}
>
<CompactFormattedNumber
number={cisGcpClusterAmount}
abbreviateAbove={benchmarkAbbreviateAbove}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
)}
</EuiFlexGroup>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const Link = ({ children, url }: { children: React.ReactNode; url: string }) =>
</EuiLink>
);

const ReadDocumentation = ({ url }: { url: string }) => {
export const ReadDocumentation = ({ url }: { url: string }) => {
return (
<EuiText color="subdued" size="s">
<FormattedMessage
Expand Down
Loading

0 comments on commit a8f3a5a

Please sign in to comment.