Commit 4be72478 authored by Dheeraj Joshi's avatar Dheeraj Joshi Committed by Stan Hu

Enable secret detection in MR Widget

parent 1ec95ad8
...@@ -229,6 +229,7 @@ export default { ...@@ -229,6 +229,7 @@ export default {
'dependencyScanning', 'dependencyScanning',
'containerScanning', 'containerScanning',
'coverageFuzzing', 'coverageFuzzing',
'secretDetection',
], ],
}; };
</script> </script>
......
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
return this.enabledReports.sast; return this.enabledReports.sast;
}, },
hasSecretScanningReports() { hasSecretScanningReports() {
return this.enabledReports.secretScanning; return this.enabledReports.secretDetection;
}, },
isMRActive() { isMRActive() {
return this.mrState !== mrStates.merged && this.mrState !== mrStates.closed; return this.mrState !== mrStates.merged && this.mrState !== mrStates.closed;
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
'ciReport|Secret scanning detects secrets and credentials vulnerabilities in your source code.', 'ciReport|Secret scanning detects secrets and credentials vulnerabilities in your source code.',
), ),
content: sprintf( content: sprintf(
s__('ciReport|%{linkStartTag}Learn more about Secret Scanning %{linkEndTag}'), s__('ciReport|%{linkStartTag}Learn more about Secret Detection %{linkEndTag}'),
{ {
linkStartTag: getLinkStartTag(this.secretScanningHelpPath), linkStartTag: getLinkStartTag(this.secretScanningHelpPath),
linkEndTag, linkEndTag,
......
...@@ -203,7 +203,7 @@ export const receiveSecretScanningDiffError = ({ commit }) => ...@@ -203,7 +203,7 @@ export const receiveSecretScanningDiffError = ({ commit }) =>
export const fetchSecretScanningDiff = ({ state, dispatch }) => { export const fetchSecretScanningDiff = ({ state, dispatch }) => {
dispatch('requestSecretScanningDiff'); dispatch('requestSecretScanningDiff');
return fetchDiffData(state, state.secretScanning.paths.diffEndpoint, 'secret_scanning') return fetchDiffData(state, state.secretScanning.paths.diffEndpoint, 'secret_detection')
.then(data => { .then(data => {
dispatch('receiveSecretScanningDiffSuccess', data); dispatch('receiveSecretScanningDiffSuccess', data);
}) })
......
...@@ -164,7 +164,8 @@ module EE ...@@ -164,7 +164,8 @@ module EE
dast: report_type_enabled?(:dast), dast: report_type_enabled?(:dast),
dependency_scanning: report_type_enabled?(:dependency_scanning), dependency_scanning: report_type_enabled?(:dependency_scanning),
license_scanning: report_type_enabled?(:license_scanning), license_scanning: report_type_enabled?(:license_scanning),
coverage_fuzzing: report_type_enabled?(:coverage_fuzzing) coverage_fuzzing: report_type_enabled?(:coverage_fuzzing),
secret_detection: report_type_enabled?(:secret_detection)
} }
end end
......
...@@ -7,11 +7,10 @@ ...@@ -7,11 +7,10 @@
window.gl.mrWidgetData.is_geo_secondary_node = '#{Gitlab::Geo.secondary?}' === 'true'; window.gl.mrWidgetData.is_geo_secondary_node = '#{Gitlab::Geo.secondary?}' === 'true';
window.gl.mrWidgetData.geo_secondary_help_path = '#{help_page_path("administration/geo/replication/configuration.md")}'; window.gl.mrWidgetData.geo_secondary_help_path = '#{help_page_path("administration/geo/replication/configuration.md")}';
window.gl.mrWidgetData.sast_help_path = '#{help_page_path("user/application_security/sast/index")}'; window.gl.mrWidgetData.sast_help_path = '#{help_page_path("user/application_security/sast/index")}';
window.gl.mrWidgetData.secret_detection_help_path = '#{help_page_path("user/application_security/secret_detection/index")}'; window.gl.mrWidgetData.secret_scanning_help_path = '#{help_page_path("user/application_security/secret_detection/index")}';
window.gl.mrWidgetData.container_scanning_help_path = '#{help_page_path("user/application_security/container_scanning/index")}'; window.gl.mrWidgetData.container_scanning_help_path = '#{help_page_path("user/application_security/container_scanning/index")}';
window.gl.mrWidgetData.dast_help_path = '#{help_page_path("user/application_security/dast/index")}'; window.gl.mrWidgetData.dast_help_path = '#{help_page_path("user/application_security/dast/index")}';
window.gl.mrWidgetData.dependency_scanning_help_path = '#{help_page_path("user/application_security/dependency_scanning/index")}'; window.gl.mrWidgetData.dependency_scanning_help_path = '#{help_page_path("user/application_security/dependency_scanning/index")}';
window.gl.mrWidgetData.secret_scanning_help_path = '#{help_page_path('user/application_security/sast/index', anchor: 'secret-detection')}';
window.gl.mrWidgetData.coverage_fuzzinghelp_path = '#{help_page_path("user/application_security/coverage_fuzzing/index")}'; window.gl.mrWidgetData.coverage_fuzzinghelp_path = '#{help_page_path("user/application_security/coverage_fuzzing/index")}';
window.gl.mrWidgetData.vulnerability_feedback_help_path = '#{help_page_path("user/application_security/index")}'; window.gl.mrWidgetData.vulnerability_feedback_help_path = '#{help_page_path("user/application_security/index")}';
window.gl.mrWidgetData.visual_review_app_available = '#{@project.feature_available?(:visual_review_app)}' === 'true'; window.gl.mrWidgetData.visual_review_app_available = '#{@project.feature_available?(:visual_review_app)}' === 'true';
...@@ -20,3 +19,4 @@ ...@@ -20,3 +19,4 @@
window.gl.mrWidgetData.dependency_scanning_comparison_path = '#{dependency_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dependency_scanning)}' window.gl.mrWidgetData.dependency_scanning_comparison_path = '#{dependency_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dependency_scanning)}'
window.gl.mrWidgetData.sast_comparison_path = '#{sast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:sast)}' window.gl.mrWidgetData.sast_comparison_path = '#{sast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:sast)}'
window.gl.mrWidgetData.dast_comparison_path = '#{dast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dast)}' window.gl.mrWidgetData.dast_comparison_path = '#{dast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dast)}'
window.gl.mrWidgetData.secret_scanning_comparison_path = '#{secret_detection_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:secret_detection)}'
---
title: Enable secret detection for MR Widget
merge_request: 41582
author:
type: fixed
...@@ -810,13 +810,13 @@ describe('ee merge request widget options', () => { ...@@ -810,13 +810,13 @@ describe('ee merge request widget options', () => {
}); });
describe('Secret Scanning', () => { describe('Secret Scanning', () => {
const SECRET_SCANNING_ENDPOINT = 'secret_scanning'; const SECRET_SCANNING_ENDPOINT = 'secret_detection_report';
beforeEach(() => { beforeEach(() => {
gl.mrWidgetData = { gl.mrWidgetData = {
...mockData, ...mockData,
enabled_reports: { enabled_reports: {
secret_scanning: true, secret_detection: true,
// The below property needs to exist until // The below property needs to exist until
// secret scanning is implemented in backend // secret scanning is implemented in backend
// Or for some other reason I'm yet to find // Or for some other reason I'm yet to find
...@@ -1070,7 +1070,7 @@ describe('ee merge request widget options', () => { ...@@ -1070,7 +1070,7 @@ describe('ee merge request widget options', () => {
sast: false, sast: false,
container_scanning: false, container_scanning: false,
dependency_scanning: false, dependency_scanning: false,
secret_scanning: false, secret_detection: false,
}, },
]; ];
......
...@@ -29,7 +29,7 @@ const CONTAINER_SCANNING_DIFF_ENDPOINT = 'container_scanning.json'; ...@@ -29,7 +29,7 @@ const CONTAINER_SCANNING_DIFF_ENDPOINT = 'container_scanning.json';
const DEPENDENCY_SCANNING_DIFF_ENDPOINT = 'dependency_scanning.json'; const DEPENDENCY_SCANNING_DIFF_ENDPOINT = 'dependency_scanning.json';
const DAST_DIFF_ENDPOINT = 'dast.json'; const DAST_DIFF_ENDPOINT = 'dast.json';
const SAST_DIFF_ENDPOINT = 'sast.json'; const SAST_DIFF_ENDPOINT = 'sast.json';
const SECRET_SCANNING_DIFF_ENDPOINT = 'secret_scanning.json'; const SECRET_SCANNING_DIFF_ENDPOINT = 'secret_detection.json';
const COVERAGE_FUZZING_DIFF_ENDPOINT = 'coverage_fuzzing.json'; const COVERAGE_FUZZING_DIFF_ENDPOINT = 'coverage_fuzzing.json';
describe('Grouped security reports app', () => { describe('Grouped security reports app', () => {
...@@ -103,7 +103,7 @@ describe('Grouped security reports app', () => { ...@@ -103,7 +103,7 @@ describe('Grouped security reports app', () => {
dast: true, dast: true,
containerScanning: true, containerScanning: true,
dependencyScanning: true, dependencyScanning: true,
secretScanning: true, secretDetection: true,
coverageFuzzing: true, coverageFuzzing: true,
}, },
}; };
...@@ -515,7 +515,7 @@ describe('Grouped security reports app', () => { ...@@ -515,7 +515,7 @@ describe('Grouped security reports app', () => {
createWrapper({ createWrapper({
...props, ...props,
enabledReports: { enabledReports: {
secretScanning: isEnabled, secretDetection: isEnabled,
}, },
}); });
......
...@@ -284,7 +284,7 @@ export const secretScanningFeedbacks = [ ...@@ -284,7 +284,7 @@ export const secretScanningFeedbacks = [
author_id: 1, author_id: 1,
issue_iid: null, issue_iid: null,
pipeline_id: 132, pipeline_id: 132,
category: 'secret_scanning', category: 'secret_detection',
feedback_type: 'dismissal', feedback_type: 'dismissal',
branch: 'try_new_secret_scanning', branch: 'try_new_secret_scanning',
project_fingerprint: libTiffCveFingerprint2, project_fingerprint: libTiffCveFingerprint2,
...@@ -295,7 +295,7 @@ export const secretScanningFeedbacks = [ ...@@ -295,7 +295,7 @@ export const secretScanningFeedbacks = [
author_id: 1, author_id: 1,
issue_iid: 123, issue_iid: 123,
pipeline_id: 132, pipeline_id: 132,
category: 'secret_scanning', category: 'secret_detection',
feedback_type: 'issue', feedback_type: 'issue',
branch: 'try_new_secret_scanning', branch: 'try_new_secret_scanning',
project_fingerprint: libTiffCveFingerprint2, project_fingerprint: libTiffCveFingerprint2,
......
...@@ -1781,7 +1781,7 @@ describe('security reports actions', () => { ...@@ -1781,7 +1781,7 @@ describe('security reports actions', () => {
mock mock
.onGet('vulnerabilities_feedback', { .onGet('vulnerabilities_feedback', {
params: { params: {
category: 'secret_scanning', category: 'secret_detection',
}, },
}) })
.reply(200, secretScanningFeedbacks); .reply(200, secretScanningFeedbacks);
......
...@@ -29386,7 +29386,7 @@ msgstr "" ...@@ -29386,7 +29386,7 @@ msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about SAST %{linkEndTag}" msgid "ciReport|%{linkStartTag}Learn more about SAST %{linkEndTag}"
msgstr "" msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about Secret Scanning %{linkEndTag}" msgid "ciReport|%{linkStartTag}Learn more about Secret Detection %{linkEndTag}"
msgstr "" msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about codequality reports %{linkEndTag}" msgid "ciReport|%{linkStartTag}Learn more about codequality reports %{linkEndTag}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment