Skip to content

Commit

Permalink
[Cloud Posture] Add Coming soon options for KSPM (#154513)
Browse files Browse the repository at this point in the history
  • Loading branch information
opauloh authored Apr 10, 2023
1 parent f63fffc commit 17ed210
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 8 deletions.
2 changes: 2 additions & 0 deletions x-pack/plugins/cloud_security_posture/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export const CSP_RULE_TEMPLATE_SAVED_OBJECT_TYPE = 'csp-rule-template';

export const CLOUDBEAT_VANILLA = 'cloudbeat/cis_k8s';
export const CLOUDBEAT_EKS = 'cloudbeat/cis_eks';
export const CLOUDBEAT_AKS = 'cloudbeat/cis_aks';
export const CLOUDBEAT_GKE = 'cloudbeat/cis_gke';
export const CLOUDBEAT_AWS = 'cloudbeat/cis_aws';
export const CLOUDBEAT_GCP = 'cloudbeat/cis_gcp';
export const CLOUDBEAT_AZURE = 'cloudbeat/cis_azure';
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 38 additions & 3 deletions x-pack/plugins/cloud_security_posture/public/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ import {
VULN_MGMT_POLICY_TEMPLATE,
CLOUDBEAT_VULN_MGMT_GCP,
CLOUDBEAT_VULN_MGMT_AZURE,
CLOUDBEAT_AKS,
CLOUDBEAT_GKE,
} from '../../common/constants';

import eksLogo from '../assets/icons/cis_eks_logo.svg';
import aksLogo from '../assets/icons/cis_aks_logo.svg';
import gkeLogo from '../assets/icons/cis_gke_logo.svg';

export const statusColors = {
passed: euiThemeVars.euiColorVis0,
Expand All @@ -48,7 +52,7 @@ export interface CloudPostureIntegrationProps {
name: string;
shortName: string;
options: Array<{
type: PostureInput;
type: PostureInput | typeof CLOUDBEAT_AKS | typeof CLOUDBEAT_GKE;
name: string;
benchmark: string;
disabled?: boolean;
Expand Down Expand Up @@ -119,7 +123,7 @@ export const cloudPostureIntegrations: CloudPostureIntegrations = {
{
type: CLOUDBEAT_VANILLA,
name: i18n.translate('xpack.csp.kspmIntegration.vanillaOption.nameTitle', {
defaultMessage: 'Self-Managed/Vanilla Kubernetes',
defaultMessage: 'Self-Managed',
}),
benchmark: i18n.translate('xpack.csp.kspmIntegration.vanillaOption.benchmarkTitle', {
defaultMessage: 'CIS Kubernetes',
Expand All @@ -129,12 +133,43 @@ export const cloudPostureIntegrations: CloudPostureIntegrations = {
{
type: CLOUDBEAT_EKS,
name: i18n.translate('xpack.csp.kspmIntegration.eksOption.nameTitle', {
defaultMessage: 'EKS (Elastic Kubernetes Service)',
defaultMessage: 'EKS',
}),
benchmark: i18n.translate('xpack.csp.kspmIntegration.eksOption.benchmarkTitle', {
defaultMessage: 'CIS EKS',
}),
icon: eksLogo,
tooltip: i18n.translate('xpack.csp.kspmIntegration.eksOption.tooltipContent', {
defaultMessage: 'Elastic Kubernetes Service',
}),
},
{
type: CLOUDBEAT_AKS,
name: i18n.translate('xpack.csp.kspmIntegration.aksOption.nameTitle', {
defaultMessage: 'AKS',
}),
benchmark: i18n.translate('xpack.csp.kspmIntegration.aksOption.benchmarkTitle', {
defaultMessage: 'CIS AKS',
}),
disabled: true,
icon: aksLogo,
tooltip: i18n.translate('xpack.csp.kspmIntegration.aksOption.tooltipContent', {
defaultMessage: 'Azure Kubernetes Service - Coming soon',
}),
},
{
type: CLOUDBEAT_GKE,
name: i18n.translate('xpack.csp.kspmIntegration.gkeOption.nameTitle', {
defaultMessage: 'GKE',
}),
benchmark: i18n.translate('xpack.csp.kspmIntegration.gkeOption.benchmarkTitle', {
defaultMessage: 'CIS GKE',
}),
disabled: true,
icon: gkeLogo,
tooltip: i18n.translate('xpack.csp.kspmIntegration.gkeOption.tooltipContent', {
defaultMessage: 'Google Kubernetes Engine - Coming soon',
}),
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ describe('<CspPolicyTemplateForm />', () => {
it('renders KSPM input selector', () => {
const { getByLabelText } = render(<WrappedComponent newPolicy={getMockPolicyK8s()} />);

const option1 = getByLabelText('Self-Managed/Vanilla Kubernetes');
const option2 = getByLabelText('EKS (Elastic Kubernetes Service)');
const option1 = getByLabelText('Self-Managed');
const option2 = getByLabelText('EKS');

expect(option1).toBeInTheDocument();
expect(option2).toBeInTheDocument();
Expand All @@ -116,7 +116,7 @@ describe('<CspPolicyTemplateForm />', () => {
const eksPolicy = getMockPolicyEKS();

const { getByLabelText } = render(<WrappedComponent newPolicy={k8sPolicy} />);
const option = getByLabelText('EKS (Elastic Kubernetes Service)');
const option = getByLabelText('EKS');
userEvent.click(option);

// Listen to the 2nd triggered by the test.
Expand Down Expand Up @@ -148,8 +148,8 @@ describe('<CspPolicyTemplateForm />', () => {
<WrappedComponent newPolicy={getMockPolicyK8s()} edit={true} />
);

const option1 = getByLabelText('Self-Managed/Vanilla Kubernetes');
const option2 = getByLabelText('EKS (Elastic Kubernetes Service)');
const option1 = getByLabelText('Self-Managed');
const option2 = getByLabelText('EKS');

expect(option1).toBeInTheDocument();
expect(option2).toBeInTheDocument();
Expand Down

0 comments on commit 17ed210

Please sign in to comment.