From 1c3596465b88f73635f9a7b19954de000c425f0e Mon Sep 17 00:00:00 2001
From: smtan <smtan@gitlab.com>
Date: Wed, 18 Jan 2023 13:52:41 +0800
Subject: [PATCH] Remove cluster image scanning from Security Configuration
 page

Changelog: removed
---
 .../components/constants.js                   | 21 ---------------
 .../user_views_security_configuration_spec.rb | 26 +++----------------
 locale/gitlab.pot                             |  3 ---
 3 files changed, 4 insertions(+), 46 deletions(-)

diff --git a/app/assets/javascripts/security_configuration/components/constants.js b/app/assets/javascripts/security_configuration/components/constants.js
index 77216408c39c4..c87dcef6a93ed 100644
--- a/app/assets/javascripts/security_configuration/components/constants.js
+++ b/app/assets/javascripts/security_configuration/components/constants.js
@@ -9,7 +9,6 @@ import {
   REPORT_TYPE_SECRET_DETECTION,
   REPORT_TYPE_DEPENDENCY_SCANNING,
   REPORT_TYPE_CONTAINER_SCANNING,
-  REPORT_TYPE_CLUSTER_IMAGE_SCANNING,
   REPORT_TYPE_COVERAGE_FUZZING,
   REPORT_TYPE_CORPUS_MANAGEMENT,
   REPORT_TYPE_API_FUZZING,
@@ -105,18 +104,6 @@ export const CONTAINER_SCANNING_CONFIG_HELP_PATH = helpPagePath(
   { anchor: 'configuration' },
 );
 
-export const CLUSTER_IMAGE_SCANNING_NAME = s__('ciReport|Cluster Image Scanning');
-export const CLUSTER_IMAGE_SCANNING_DESCRIPTION = __(
-  'Check your Kubernetes cluster images for known vulnerabilities.',
-);
-export const CLUSTER_IMAGE_SCANNING_HELP_PATH = helpPagePath(
-  'user/application_security/cluster_image_scanning/index',
-);
-export const CLUSTER_IMAGE_SCANNING_CONFIG_HELP_PATH = helpPagePath(
-  'user/application_security/cluster_image_scanning/index',
-  { anchor: 'configuration' },
-);
-
 export const COVERAGE_FUZZING_NAME = __('Coverage Fuzzing');
 export const COVERAGE_FUZZING_DESCRIPTION = __(
   'Find bugs in your code with coverage-guided fuzzing.',
@@ -153,7 +140,6 @@ export const SCANNER_NAMES_MAP = {
   DAST: DAST_SHORT_NAME,
   API_FUZZING: API_FUZZING_NAME,
   CONTAINER_SCANNING: CONTAINER_SCANNING_NAME,
-  CLUSTER_IMAGE_SCANNING: CLUSTER_IMAGE_SCANNING_NAME,
   COVERAGE_FUZZING: COVERAGE_FUZZING_NAME,
   SECRET_DETECTION: SECRET_DETECTION_NAME,
   DEPENDENCY_SCANNING: DEPENDENCY_SCANNING_NAME,
@@ -212,13 +198,6 @@ export const securityFeatures = [
     configurationHelpPath: CONTAINER_SCANNING_CONFIG_HELP_PATH,
     type: REPORT_TYPE_CONTAINER_SCANNING,
   },
-  {
-    name: CLUSTER_IMAGE_SCANNING_NAME,
-    description: CLUSTER_IMAGE_SCANNING_DESCRIPTION,
-    helpPath: CLUSTER_IMAGE_SCANNING_HELP_PATH,
-    configurationHelpPath: CLUSTER_IMAGE_SCANNING_CONFIG_HELP_PATH,
-    type: REPORT_TYPE_CLUSTER_IMAGE_SCANNING,
-  },
   {
     name: SECRET_DETECTION_NAME,
     description: SECRET_DETECTION_DESCRIPTION,
diff --git a/ee/spec/features/projects/security/user_views_security_configuration_spec.rb b/ee/spec/features/projects/security/user_views_security_configuration_spec.rb
index 94cd52a227e0b..4e1fdb11ceffe 100644
--- a/ee/spec/features/projects/security/user_views_security_configuration_spec.rb
+++ b/ee/spec/features/projects/security/user_views_security_configuration_spec.rb
@@ -19,7 +19,7 @@
     before do
       stub_licensed_features(security_dashboard: true, sast: true, sast_iac: true, dast: true,
                              dependency_scanning: true, container_scanning: true, coverage_fuzzing: true,
-                             cluster_image_scanning: true, api_fuzzing: true, security_configuration_in_ui: true)
+                             api_fuzzing: true, security_configuration_in_ui: true)
     end
 
     context 'with no SAST report' do
@@ -132,18 +132,6 @@
       end
     end
 
-    context 'with no Cluster Image scanning report' do
-      it 'shows Cluster Image scanning is disabled' do
-        visit_configuration_page
-
-        within_cluster_image_card do
-          expect(page).to have_text('Cluster Image Scanning')
-          expect(page).to have_text('Not enabled')
-          expect(page).to have_link('Configuration guide')
-        end
-      end
-    end
-
     context 'with no Secret Detection report' do
       it 'shows Secret Detection is disabled' do
         visit_configuration_page
@@ -215,26 +203,20 @@ def within_container_scanning_card
     end
   end
 
-  def within_cluster_image_card
-    within '[data-testid="security-testing-card"]:nth-of-type(6)' do
-      yield
-    end
-  end
-
   def within_secret_detection_card
-    within '[data-testid="security-testing-card"]:nth-of-type(7)' do
+    within '[data-testid="security-testing-card"]:nth-of-type(6)' do
       yield
     end
   end
 
   def within_api_fuzzing_card
-    within '[data-testid="security-testing-card"]:nth-of-type(8)' do
+    within '[data-testid="security-testing-card"]:nth-of-type(7)' do
       yield
     end
   end
 
   def within_coverage_fuzzing_card
-    within '[data-testid="security-testing-card"]:nth-of-type(9)' do
+    within '[data-testid="security-testing-card"]:nth-of-type(8)' do
       yield
     end
   end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 512432a0a0cee..83e20191dba7a 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -8293,9 +8293,6 @@ msgstr ""
 msgid "Check your Docker images for known vulnerabilities."
 msgstr ""
 
-msgid "Check your Kubernetes cluster images for known vulnerabilities."
-msgstr ""
-
 msgid "Check your sign-up restrictions"
 msgstr ""
 
-- 
GitLab