From 6d91a7c0659c2a9e65bc963d193e81eb357b669c Mon Sep 17 00:00:00 2001 From: Rickyanto Ang Date: Mon, 25 Nov 2024 15:24:17 -0800 Subject: [PATCH] [Cloud Security][D4C] Hide K8S (#201062) ## Summary This PR is to hide K8S so User won't be able to access K8S Dashboard via navigating to it from the page or by direct URL, also deleting Cypress tests related to this --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../common/experimental_features.ts | 2 +- .../security_solution/public/kubernetes/routes.tsx | 3 ++- .../cypress/e2e/explore/navigation/navigation.cy.ts | 12 ------------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index 7fcdabad3b36c..3697359365619 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -15,7 +15,7 @@ export const allowedExperimentalValues = Object.freeze({ // FIXME:PT delete? excludePoliciesInFilterEnabled: false, - kubernetesEnabled: true, + kubernetesEnabled: false, donutChartEmbeddablesEnabled: false, // Depends on https://github.com/elastic/kibana/issues/136409 item 2 - 6 /** diff --git a/x-pack/plugins/security_solution/public/kubernetes/routes.tsx b/x-pack/plugins/security_solution/public/kubernetes/routes.tsx index 67bd4a9fcad85..7520de8cffa5a 100644 --- a/x-pack/plugins/security_solution/public/kubernetes/routes.tsx +++ b/x-pack/plugins/security_solution/public/kubernetes/routes.tsx @@ -7,6 +7,7 @@ import React from 'react'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; +import { allowedExperimentalValues } from '../../common'; import { KubernetesContainer } from './pages'; import type { SecuritySubPluginRoutes } from '../app/types'; @@ -24,7 +25,7 @@ export const KubernetesRoutes = () => ( export const routes: SecuritySubPluginRoutes = [ { - path: KUBERNETES_PATH, + path: allowedExperimentalValues.kubernetesEnabled ? KUBERNETES_PATH : [], component: KubernetesRoutes, }, ]; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts index 1920bd01668f6..eba2dbe770e48 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts @@ -21,7 +21,6 @@ import { DETECTION_RESPONSE, DASHBOARDS, CSP_DASHBOARD, - KUBERNETES, INDICATORS, BLOCKLIST, CSP_BENCHMARKS, @@ -54,7 +53,6 @@ import { EXPLORE_URL, MANAGE_URL, CSP_DASHBOARD_URL, - KUBERNETES_URL, BLOCKLIST_URL, CSP_BENCHMARKS_URL, CSP_FINDINGS_URL, @@ -114,11 +112,6 @@ describe('top-level navigation common to all pages in the Security app', { tags: cy.url().should('include', ENTITY_ANALYTICS_URL); }); - it('navigates to the Kubernetes page', () => { - navigateFromHeaderTo(KUBERNETES); - cy.url().should('include', KUBERNETES_URL); - }); - it('navigates to the CSP dashboard page', () => { navigateFromHeaderTo(CSP_DASHBOARD); cy.url().should('include', CSP_DASHBOARD_URL); @@ -289,11 +282,6 @@ describe('Serverless side navigation links', { tags: '@serverless' }, () => { cy.url().should('include', ENTITY_ANALYTICS_URL); }); - it('navigates to the Kubernetes page', () => { - navigateFromHeaderTo(ServerlessHeaders.KUBERNETES, true); - cy.url().should('include', KUBERNETES_URL); - }); - it('navigates to the CSP dashboard page', () => { navigateFromHeaderTo(ServerlessHeaders.CSP_DASHBOARD, true); cy.url().should('include', CSP_DASHBOARD_URL);