Commit eecc0d19 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch 'jnnkl-secret-detection-refactoring' into 'master'

Refactor the usage of Secret Scanning to Secret Detection

See merge request gitlab-org/gitlab!71824
parents 339c68b4 bbf11b1b
...@@ -289,7 +289,7 @@ export default class MergeRequestStore { ...@@ -289,7 +289,7 @@ export default class MergeRequestStore {
// Security reports // Security reports
this.sastComparisonPath = data.sast_comparison_path; this.sastComparisonPath = data.sast_comparison_path;
this.secretScanningComparisonPath = data.secret_scanning_comparison_path; this.secretDetectionComparisonPath = data.secret_detection_comparison_path;
} }
get isNothingToMergeState() { get isNothingToMergeState() {
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
secretScanningComparisonPath: { secretDetectionComparisonPath: {
type: String, type: String,
required: false, required: false,
default: '', default: '',
...@@ -149,8 +149,8 @@ export default { ...@@ -149,8 +149,8 @@ export default {
this.canShowCounts = true; this.canShowCounts = true;
} }
if (this.secretScanningComparisonPath && this.hasSecretDetectionReports) { if (this.secretDetectionComparisonPath && this.hasSecretDetectionReports) {
this.setSecretDetectionDiffEndpoint(this.secretScanningComparisonPath); this.setSecretDetectionDiffEndpoint(this.secretDetectionComparisonPath);
this.fetchSecretDetectionDiff(); this.fetchSecretDetectionDiff();
this.canShowCounts = true; this.canShowCounts = true;
} }
......
...@@ -325,7 +325,7 @@ Note the following: ...@@ -325,7 +325,7 @@ Note the following:
- For a secret detection scan, only rules with the default ruleset are supported. [Custom rulesets](../secret_detection/index.md#custom-rulesets) - For a secret detection scan, only rules with the default ruleset are supported. [Custom rulesets](../secret_detection/index.md#custom-rulesets)
are not supported. are not supported.
- A secret detection scan runs in `normal` mode when executed as part of a pipeline, and in - A secret detection scan runs in `normal` mode when executed as part of a pipeline, and in
[`historic`](../secret_detection/index.md#full-history-secret-scan) [`historic`](../secret_detection/index.md#full-history-secret-detection)
mode when executed as part of a scheduled scan. mode when executed as part of a scheduled scan.
- A container scanning and cluster image scanning scans configured for the `pipeline` rule type will ignore the cluster defined in the `clusters` object. - A container scanning and cluster image scanning scans configured for the `pipeline` rule type will ignore the cluster defined in the `clusters` object.
They will use predefined CI/CD variables defined for your project. Cluster selection with the `clusters` object is supported for the `schedule` rule type. They will use predefined CI/CD variables defined for your project. Cluster selection with the `clusters` object is supported for the `schedule` rule type.
......
...@@ -285,20 +285,20 @@ sequenceDiagram ...@@ -285,20 +285,20 @@ sequenceDiagram
Cloud Vendor-->>+RevocationAPI: ACCEPTED Cloud Vendor-->>+RevocationAPI: ACCEPTED
``` ```
## Full History Secret Scan ## Full History Secret Detection
GitLab 12.11 introduced support for scanning the full history of a repository. This new functionality GitLab 12.11 introduced support for scanning the full history of a repository. This new functionality
is particularly useful when you are enabling Secret Detection in a repository for the first time and you is particularly useful when you are enabling Secret Detection in a repository for the first time and you
want to perform a full secret scan. Running a secret scan on the full history can take a long time, want to perform a full secret detection scan. Running a secret detection scan on the full history can take a long time,
especially for larger repositories with lengthy Git histories. We recommend not setting this CI/CD variable especially for larger repositories with lengthy Git histories. We recommend not setting this CI/CD variable
as part of your normal job definition. as part of your normal job definition.
A new configuration variable ([`SECRET_DETECTION_HISTORIC_SCAN`](#available-cicd-variables)) A new configuration variable ([`SECRET_DETECTION_HISTORIC_SCAN`](#available-cicd-variables))
can be set to change the behavior of the GitLab Secret Detection scan to run on the entire Git history of a repository. can be set to change the behavior of the GitLab Secret Detection scan to run on the entire Git history of a repository.
We have created a [short video walkthrough](https://youtu.be/wDtc_K00Y0A) showcasing how you can perform a full history secret scan. We have created a [short video walkthrough](https://youtu.be/wDtc_K00Y0A) showcasing how you can perform a full history secret detection scan.
<div class="video-fallback"> <div class="video-fallback">
See the video: <a href="https://www.youtube.com/watch?v=wDtc_K00Y0A">Walkthrough of historical secret scan</a>. See the video: <a href="https://www.youtube.com/watch?v=wDtc_K00Y0A">Walkthrough of historical secret detection scan</a>.
</div> </div>
<figure class="video-container"> <figure class="video-container">
<iframe src="https://www.youtube.com/embed/wDtc_K00Y0A" frameborder="0" allowfullscreen="true"> </iframe> <iframe src="https://www.youtube.com/embed/wDtc_K00Y0A" frameborder="0" allowfullscreen="true"> </iframe>
......
...@@ -363,7 +363,7 @@ export default { ...@@ -363,7 +363,7 @@ export default {
:project-id="mr.sourceProjectId" :project-id="mr.sourceProjectId"
:security-reports-docs-path="mr.securityReportsDocsPath" :security-reports-docs-path="mr.securityReportsDocsPath"
:sast-comparison-path="mr.sastComparisonPath" :sast-comparison-path="mr.sastComparisonPath"
:secret-scanning-comparison-path="mr.secretScanningComparisonPath" :secret-detection-comparison-path="mr.secretDetectionComparisonPath"
:target-project-full-path="mr.targetProjectFullPath" :target-project-full-path="mr.targetProjectFullPath"
:mr-iid="mr.iid" :mr-iid="mr.iid"
:discover-project-security-path="mr.discoverProjectSecurityPath" :discover-project-security-path="mr.discoverProjectSecurityPath"
...@@ -381,7 +381,7 @@ export default { ...@@ -381,7 +381,7 @@ export default {
:coverage-fuzzing-help-path="mr.coverageFuzzingHelp" :coverage-fuzzing-help-path="mr.coverageFuzzingHelp"
:container-scanning-help-path="mr.containerScanningHelp" :container-scanning-help-path="mr.containerScanningHelp"
:dependency-scanning-help-path="mr.dependencyScanningHelp" :dependency-scanning-help-path="mr.dependencyScanningHelp"
:secret-scanning-help-path="mr.secretScanningHelp" :secret-detection-help-path="mr.secretDetectionHelp"
:can-read-vulnerability-feedback="mr.canReadVulnerabilityFeedback" :can-read-vulnerability-feedback="mr.canReadVulnerabilityFeedback"
:vulnerability-feedback-path="mr.vulnerabilityFeedbackPath" :vulnerability-feedback-path="mr.vulnerabilityFeedbackPath"
:create-vulnerability-feedback-issue-path="mr.createVulnerabilityFeedbackIssuePath" :create-vulnerability-feedback-issue-path="mr.createVulnerabilityFeedbackIssuePath"
...@@ -404,7 +404,7 @@ export default { ...@@ -404,7 +404,7 @@ export default {
:dast-comparison-path="mr.dastComparisonPath" :dast-comparison-path="mr.dastComparisonPath"
:dependency-scanning-comparison-path="mr.dependencyScanningComparisonPath" :dependency-scanning-comparison-path="mr.dependencyScanningComparisonPath"
:sast-comparison-path="mr.sastComparisonPath" :sast-comparison-path="mr.sastComparisonPath"
:secret-scanning-comparison-path="mr.secretScanningComparisonPath" :secret-detection-comparison-path="mr.secretDetectionComparisonPath"
:target-project-full-path="mr.targetProjectFullPath" :target-project-full-path="mr.targetProjectFullPath"
:mr-iid="mr.iid" :mr-iid="mr.iid"
class="js-security-widget" class="js-security-widget"
......
...@@ -12,7 +12,7 @@ export default class MergeRequestStore extends CEMergeRequestStore { ...@@ -12,7 +12,7 @@ export default class MergeRequestStore extends CEMergeRequestStore {
this.dastHelp = data.dast_help_path; this.dastHelp = data.dast_help_path;
this.apiFuzzingHelp = data.api_fuzzing_help_path; this.apiFuzzingHelp = data.api_fuzzing_help_path;
this.coverageFuzzingHelp = data.coverage_fuzzing_help_path; this.coverageFuzzingHelp = data.coverage_fuzzing_help_path;
this.secretScanningHelp = data.secret_scanning_help_path; this.secretDetectionHelp = data.secret_detection_help_path;
this.dependencyScanningHelp = data.dependency_scanning_help_path; this.dependencyScanningHelp = data.dependency_scanning_help_path;
this.canReadVulnerabilities = data.can_read_vulnerabilities; this.canReadVulnerabilities = data.can_read_vulnerabilities;
this.vulnerabilityFeedbackPath = data.vulnerability_feedback_path; this.vulnerabilityFeedbackPath = data.vulnerability_feedback_path;
......
<script> <script>
/** /**
* Renders Security Issues (SAST, DAST, Container * Renders Security Issues (SAST, DAST, Container
* Scanning, Secret Scanning) body text * Scanning, Secret Detection) body text
* [severity-badge] [name] in [link]:[line] * [severity-badge] [name] in [link]:[line]
*/ */
import { GlBadge } from '@gitlab/ui'; import { GlBadge } from '@gitlab/ui';
......
<script> <script>
import { mapActions, mapState, mapGetters } from 'vuex';
import { once } from 'lodash';
import { import {
GlButton, GlButton,
GlSprintf, GlSprintf,
...@@ -6,8 +8,6 @@ import { ...@@ -6,8 +8,6 @@ import {
GlModalDirective, GlModalDirective,
GlTooltipDirective as GlTooltip, GlTooltipDirective as GlTooltip,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { once } from 'lodash';
import { mapActions, mapState, mapGetters } from 'vuex';
import { componentNames } from 'ee/reports/components/issue_body'; import { componentNames } from 'ee/reports/components/issue_body';
import { fetchPolicies } from '~/lib/graphql'; import { fetchPolicies } from '~/lib/graphql';
import { mrStates } from '~/mr_popover/constants'; import { mrStates } from '~/mr_popover/constants';
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
secretScanningHelpPath: { secretDetectionHelpPath: {
type: String, type: String,
required: false, required: false,
default: '', default: '',
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
secretScanningComparisonPath: { secretDetectionComparisonPath: {
type: String, type: String,
required: false, required: false,
default: '', default: '',
...@@ -386,8 +386,8 @@ export default { ...@@ -386,8 +386,8 @@ export default {
this.fetchDependencyScanningDiff(); this.fetchDependencyScanningDiff();
} }
if (this.secretScanningComparisonPath && this.hasSecretDetectionReports) { if (this.secretDetectionComparisonPath && this.hasSecretDetectionReports) {
this.setSecretDetectionDiffEndpoint(this.secretScanningComparisonPath); this.setSecretDetectionDiffEndpoint(this.secretDetectionComparisonPath);
this.fetchSecretDetectionDiff(); this.fetchSecretDetectionDiff();
} }
...@@ -640,9 +640,9 @@ export default { ...@@ -640,9 +640,9 @@ export default {
<summary-row <summary-row
:nested-summary="true" :nested-summary="true"
:status-icon="secretDetectionStatusIcon" :status-icon="secretDetectionStatusIcon"
:popover-options="secretScanningPopover" :popover-options="secretDetectionPopover"
class="js-secret-scanning" class="js-secret-detection"
data-testid="secret-scan-report" data-testid="secret-detection-report"
> >
<template #summary> <template #summary>
<security-summary :message="groupedSecretDetectionText" /> <security-summary :message="groupedSecretDetectionText" />
...@@ -655,7 +655,7 @@ export default { ...@@ -655,7 +655,7 @@ export default {
:unresolved-issues="secretDetection.newIssues" :unresolved-issues="secretDetection.newIssues"
:resolved-issues="secretDetection.resolvedIssues" :resolved-issues="secretDetection.resolvedIssues"
:component="$options.componentNames.SecurityIssueBody" :component="$options.componentNames.SecurityIssueBody"
data-testid="secret-scanning-issues-list" data-testid="secret-detection-issues-list"
/> />
</template> </template>
......
...@@ -71,15 +71,15 @@ export default { ...@@ -71,15 +71,15 @@ export default {
), ),
}; };
}, },
secretScanningPopover() { secretDetectionPopover() {
return { return {
title: s__( title: s__(
'ciReport|Secret scanning detects secrets and credentials vulnerabilities in your source code.', 'ciReport|Secret Detection detects secrets and credentials vulnerabilities in your source code.',
), ),
content: sprintf( content: sprintf(
s__('ciReport|%{linkStartTag}Learn more about Secret Detection %{linkEndTag}'), s__('ciReport|%{linkStartTag}Learn more about Secret Detection %{linkEndTag}'),
{ {
linkStartTag: getLinkStartTag(this.secretScanningHelpPath), linkStartTag: getLinkStartTag(this.secretDetectionHelpPath),
linkEndTag, linkEndTag,
}, },
false, false,
......
...@@ -8,7 +8,7 @@ const SAST = s__('ciReport|SAST'); ...@@ -8,7 +8,7 @@ const SAST = s__('ciReport|SAST');
const DAST = s__('ciReport|DAST'); const DAST = s__('ciReport|DAST');
const CONTAINER_SCANNING = s__('ciReport|Container scanning'); const CONTAINER_SCANNING = s__('ciReport|Container scanning');
const DEPENDENCY_SCANNING = s__('ciReport|Dependency scanning'); const DEPENDENCY_SCANNING = s__('ciReport|Dependency scanning');
const SECRET_SCANNING = s__('ciReport|Secret scanning'); const SECRET_DETECTION = s__('ciReport|Secret detection');
const COVERAGE_FUZZING = s__('ciReport|Coverage fuzzing'); const COVERAGE_FUZZING = s__('ciReport|Coverage fuzzing');
const API_FUZZING = s__('ciReport|API fuzzing'); const API_FUZZING = s__('ciReport|API fuzzing');
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
DAST, DAST,
CONTAINER_SCANNING, CONTAINER_SCANNING,
DEPENDENCY_SCANNING, DEPENDENCY_SCANNING,
SECRET_SCANNING, SECRET_DETECTION,
COVERAGE_FUZZING, COVERAGE_FUZZING,
API_FUZZING, API_FUZZING,
TRANSLATION_IS_LOADING, TRANSLATION_IS_LOADING,
...@@ -36,10 +36,10 @@ export default { ...@@ -36,10 +36,10 @@ export default {
DEPENDENCY_SCANNING_HAS_ERROR: sprintf(TRANSLATION_HAS_ERROR, { DEPENDENCY_SCANNING_HAS_ERROR: sprintf(TRANSLATION_HAS_ERROR, {
reportType: DEPENDENCY_SCANNING, reportType: DEPENDENCY_SCANNING,
}), }),
SECRET_SCANNING_IS_LOADING: sprintf(TRANSLATION_IS_LOADING, { SECRET_DETECTION_IS_LOADING: sprintf(TRANSLATION_IS_LOADING, {
reportType: SECRET_SCANNING, reportType: SECRET_DETECTION,
}), }),
SECRET_SCANNING_HAS_ERROR: sprintf(TRANSLATION_HAS_ERROR, { reportType: SECRET_SCANNING }), SECRET_DETECTION_HAS_ERROR: sprintf(TRANSLATION_HAS_ERROR, { reportType: SECRET_DETECTION }),
COVERAGE_FUZZING_IS_LOADING: sprintf(TRANSLATION_IS_LOADING, { COVERAGE_FUZZING_IS_LOADING: sprintf(TRANSLATION_IS_LOADING, {
reportType: COVERAGE_FUZZING, reportType: COVERAGE_FUZZING,
}), }),
......
...@@ -4,9 +4,9 @@ import { statusIcon, groupedReportText } from '../../utils'; ...@@ -4,9 +4,9 @@ import { statusIcon, groupedReportText } from '../../utils';
export const groupedSecretDetectionText = (state) => export const groupedSecretDetectionText = (state) =>
groupedReportText( groupedReportText(
state, state,
messages.SECRET_SCANNING, messages.SECRET_DETECTION,
messages.SECRET_SCANNING_HAS_ERROR, messages.SECRET_DETECTION_HAS_ERROR,
messages.SECRET_SCANNING_IS_LOADING, messages.SECRET_DETECTION_IS_LOADING,
); );
export const secretDetectionStatusIcon = ({ isLoading, hasError, newIssues }) => export const secretDetectionStatusIcon = ({ isLoading, hasError, newIssues }) =>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
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_scanning_help_path = '#{help_page_path("user/application_security/secret_detection/index")}'; window.gl.mrWidgetData.secret_detection_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")}';
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
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)}' window.gl.mrWidgetData.secret_detection_comparison_path = '#{secret_detection_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:secret_detection)}'
window.gl.mrWidgetData.coverage_fuzzing_comparison_path = '#{coverage_fuzzing_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:coverage_fuzzing)}' window.gl.mrWidgetData.coverage_fuzzing_comparison_path = '#{coverage_fuzzing_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:coverage_fuzzing)}'
window.gl.mrWidgetData.api_fuzzing_comparison_path = '#{api_fuzzing_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:api_fuzzing)}' window.gl.mrWidgetData.api_fuzzing_comparison_path = '#{api_fuzzing_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:api_fuzzing)}'
...@@ -20,7 +20,7 @@ import { ...@@ -20,7 +20,7 @@ import {
dastDiffSuccessMock, dastDiffSuccessMock,
containerScanningDiffSuccessMock, containerScanningDiffSuccessMock,
dependencyScanningDiffSuccessMock, dependencyScanningDiffSuccessMock,
secretScanningDiffSuccessMock, secretDetectionDiffSuccessMock,
coverageFuzzingDiffSuccessMock, coverageFuzzingDiffSuccessMock,
apiFuzzingDiffSuccessMock, apiFuzzingDiffSuccessMock,
} from 'ee_jest/vue_shared/security_reports/mock_data'; } from 'ee_jest/vue_shared/security_reports/mock_data';
...@@ -55,7 +55,7 @@ const SAST_SELECTOR = '.js-sast-widget'; ...@@ -55,7 +55,7 @@ const SAST_SELECTOR = '.js-sast-widget';
const DAST_SELECTOR = '.js-dast-widget'; const DAST_SELECTOR = '.js-dast-widget';
const DEPENDENCY_SCANNING_SELECTOR = '.js-dependency-scanning-widget'; const DEPENDENCY_SCANNING_SELECTOR = '.js-dependency-scanning-widget';
const CONTAINER_SCANNING_SELECTOR = '.js-container-scanning'; const CONTAINER_SCANNING_SELECTOR = '.js-container-scanning';
const SECRET_SCANNING_SELECTOR = '.js-secret-scanning'; const SECRET_DETECTION_SELECTOR = '.js-secret-detection';
const COVERAGE_FUZZING_SELECTOR = '.js-coverage-fuzzing-widget'; const COVERAGE_FUZZING_SELECTOR = '.js-coverage-fuzzing-widget';
const API_FUZZING_SELECTOR = '.js-api-fuzzing-widget'; const API_FUZZING_SELECTOR = '.js-api-fuzzing-widget';
...@@ -836,8 +836,8 @@ describe('ee merge request widget options', () => { ...@@ -836,8 +836,8 @@ describe('ee merge request widget options', () => {
}); });
}); });
describe('Secret Scanning', () => { describe('Secret Detection', () => {
const SECRET_SCANNING_ENDPOINT = 'secret_detection_report'; const SECRET_DETECTION_ENDPOINT = 'secret_detection_report';
beforeEach(() => { beforeEach(() => {
gl.mrWidgetData = { gl.mrWidgetData = {
...@@ -845,31 +845,31 @@ describe('ee merge request widget options', () => { ...@@ -845,31 +845,31 @@ describe('ee merge request widget options', () => {
enabled_reports: { enabled_reports: {
secret_detection: 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 Detection is implemented in backend
// Or for some other reason I'm yet to find // Or for some other reason I'm yet to find
dast: true, dast: true,
}, },
secret_scanning_comparison_path: SECRET_SCANNING_ENDPOINT, secret_detection_comparison_path: SECRET_DETECTION_ENDPOINT,
vulnerability_feedback_path: VULNERABILITY_FEEDBACK_ENDPOINT, vulnerability_feedback_path: VULNERABILITY_FEEDBACK_ENDPOINT,
}; };
}); });
describe('when it is loading', () => { describe('when it is loading', () => {
it('should render loading indicator', () => { it('should render loading indicator', () => {
mock.onGet(SECRET_SCANNING_ENDPOINT).reply(200, secretScanningDiffSuccessMock); mock.onGet(SECRET_DETECTION_ENDPOINT).reply(200, secretDetectionDiffSuccessMock);
mock.onGet(VULNERABILITY_FEEDBACK_ENDPOINT).reply(200, []); mock.onGet(VULNERABILITY_FEEDBACK_ENDPOINT).reply(200, []);
createComponent({ propsData: { mrData: gl.mrWidgetData } }); createComponent({ propsData: { mrData: gl.mrWidgetData } });
expect( expect(
trimText(findExtendedSecurityWidget().find(SECRET_SCANNING_SELECTOR).text()), trimText(findExtendedSecurityWidget().find(SECRET_DETECTION_SELECTOR).text()),
).toContain('Secret scanning is loading'); ).toContain('Secret detection is loading');
}); });
}); });
describe('with successful request', () => { describe('with successful request', () => {
beforeEach(() => { beforeEach(() => {
mock.onGet(SECRET_SCANNING_ENDPOINT).reply(200, secretScanningDiffSuccessMock); mock.onGet(SECRET_DETECTION_ENDPOINT).reply(200, secretDetectionDiffSuccessMock);
mock.onGet(VULNERABILITY_FEEDBACK_ENDPOINT).reply(200, []); mock.onGet(VULNERABILITY_FEEDBACK_ENDPOINT).reply(200, []);
createComponent({ propsData: { mrData: gl.mrWidgetData } }); createComponent({ propsData: { mrData: gl.mrWidgetData } });
...@@ -880,11 +880,11 @@ describe('ee merge request widget options', () => { ...@@ -880,11 +880,11 @@ describe('ee merge request widget options', () => {
expect( expect(
trimText( trimText(
findExtendedSecurityWidget() findExtendedSecurityWidget()
.find(`${SECRET_SCANNING_SELECTOR} .report-block-list-issue-description`) .find(`${SECRET_DETECTION_SELECTOR} .report-block-list-issue-description`)
.text(), .text(),
), ),
).toEqual( ).toEqual(
'Secret scanning detected 2 potential vulnerabilities 1 Critical 1 High and 0 Others', 'Secret detection detected 2 potential vulnerabilities 1 Critical 1 High and 0 Others',
); );
done(); done();
}); });
...@@ -893,7 +893,7 @@ describe('ee merge request widget options', () => { ...@@ -893,7 +893,7 @@ describe('ee merge request widget options', () => {
describe('with failed request', () => { describe('with failed request', () => {
beforeEach(() => { beforeEach(() => {
mock.onGet(SECRET_SCANNING_ENDPOINT).reply(500, {}); mock.onGet(SECRET_DETECTION_ENDPOINT).reply(500, {});
mock.onGet(VULNERABILITY_FEEDBACK_ENDPOINT).reply(500, []); mock.onGet(VULNERABILITY_FEEDBACK_ENDPOINT).reply(500, []);
createComponent({ propsData: { mrData: gl.mrWidgetData } }); createComponent({ propsData: { mrData: gl.mrWidgetData } });
...@@ -901,8 +901,8 @@ describe('ee merge request widget options', () => { ...@@ -901,8 +901,8 @@ describe('ee merge request widget options', () => {
it('should render error indicator', (done) => { it('should render error indicator', (done) => {
setImmediate(() => { setImmediate(() => {
expect(findExtendedSecurityWidget().find(SECRET_SCANNING_SELECTOR).text()).toContain( expect(findExtendedSecurityWidget().find(SECRET_DETECTION_SELECTOR).text()).toContain(
'Secret scanning: Loading resulted in an error', 'Secret detection: Loading resulted in an error',
); );
done(); done();
}); });
......
...@@ -75,7 +75,7 @@ describe('MergeRequestStore', () => { ...@@ -75,7 +75,7 @@ describe('MergeRequestStore', () => {
'dependency_scanning_comparison_path', 'dependency_scanning_comparison_path',
'sast_comparison_path', 'sast_comparison_path',
'dast_comparison_path', 'dast_comparison_path',
'secret_scanning_comparison_path', 'secret_detection_comparison_path',
'api_fuzzing_comparison_path', 'api_fuzzing_comparison_path',
'coverage_fuzzing_comparison_path', 'coverage_fuzzing_comparison_path',
])('should set %s path', (property) => { ])('should set %s path', (property) => {
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
sastParsedIssues, sastParsedIssues,
dockerReportParsed, dockerReportParsed,
parsedDast, parsedDast,
secretScanningParsedIssues, secretDetectionParsedIssues,
} from 'ee_jest/vue_shared/security_reports/mock_data'; } from 'ee_jest/vue_shared/security_reports/mock_data';
import mountComponent, { mountComponentWithStore } from 'helpers/vue_mount_component_helper'; import mountComponent, { mountComponentWithStore } from 'helpers/vue_mount_component_helper';
import reportIssues from '~/reports/components/report_item.vue'; import reportIssues from '~/reports/components/report_item.vue';
...@@ -137,10 +137,10 @@ describe('Report issues', () => { ...@@ -137,10 +137,10 @@ describe('Report issues', () => {
}); });
}); });
describe('for secret scanning issues', () => { describe('for secret Detection issues', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponent(ReportIssues, { vm = mountComponent(ReportIssues, {
issue: secretScanningParsedIssues[0], issue: secretDetectionParsedIssues[0],
component: componentNames.SecurityIssueBody, component: componentNames.SecurityIssueBody,
status: STATUS_FAILED, status: STATUS_FAILED,
}); });
...@@ -148,13 +148,13 @@ describe('Report issues', () => { ...@@ -148,13 +148,13 @@ describe('Report issues', () => {
it('renders severity', () => { it('renders severity', () => {
expect(vm.$el.textContent.trim().toLowerCase()).toContain( expect(vm.$el.textContent.trim().toLowerCase()).toContain(
secretScanningParsedIssues[0].severity, secretDetectionParsedIssues[0].severity,
); );
}); });
it('renders CVE name', () => { it('renders CVE name', () => {
expect(vm.$el.querySelector('.report-block-list-issue button').textContent.trim()).toEqual( expect(vm.$el.querySelector('.report-block-list-issue button').textContent.trim()).toEqual(
secretScanningParsedIssues[0].title, secretDetectionParsedIssues[0].title,
); );
}); });
}); });
......
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
sastParsedIssues, sastParsedIssues,
dockerReportParsed, dockerReportParsed,
parsedDast, parsedDast,
secretScanningParsedIssues, secretDetectionParsedIssues,
licenseComplianceParsedIssues, licenseComplianceParsedIssues,
} from 'ee_jest/vue_shared/security_reports/mock_data'; } from 'ee_jest/vue_shared/security_reports/mock_data';
import mountComponent, { mountComponentWithStore } from 'helpers/vue_mount_component_helper'; import mountComponent, { mountComponentWithStore } from 'helpers/vue_mount_component_helper';
...@@ -143,10 +143,10 @@ describe('Report issue', () => { ...@@ -143,10 +143,10 @@ describe('Report issue', () => {
}); });
}); });
describe('for secret scanning issue', () => { describe('for secret Description issue', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponent(ReportIssue, { vm = mountComponent(ReportIssue, {
issue: secretScanningParsedIssues[0], issue: secretDetectionParsedIssues[0],
component: componentNames.SecurityIssueBody, component: componentNames.SecurityIssueBody,
status: STATUS_FAILED, status: STATUS_FAILED,
}); });
...@@ -154,13 +154,13 @@ describe('Report issue', () => { ...@@ -154,13 +154,13 @@ describe('Report issue', () => {
it('renders severity', () => { it('renders severity', () => {
expect(vm.$el.textContent.trim().toLowerCase()).toContain( expect(vm.$el.textContent.trim().toLowerCase()).toContain(
secretScanningParsedIssues[0].severity, secretDetectionParsedIssues[0].severity,
); );
}); });
it('renders CVE name', () => { it('renders CVE name', () => {
expect(vm.$el.querySelector('button').textContent.trim()).toEqual( expect(vm.$el.querySelector('button').textContent.trim()).toEqual(
secretScanningParsedIssues[0].title, secretDetectionParsedIssues[0].title,
); );
}); });
}); });
......
...@@ -15,7 +15,7 @@ import { ...@@ -15,7 +15,7 @@ import {
dockerReportParsed, dockerReportParsed,
parsedDast, parsedDast,
dependencyScanningIssues, dependencyScanningIssues,
secretScanningParsedIssues, secretDetectionParsedIssues,
} from '../mock_data'; } from '../mock_data';
describe('Security Issue Body', () => { describe('Security Issue Body', () => {
...@@ -44,7 +44,7 @@ describe('Security Issue Body', () => { ...@@ -44,7 +44,7 @@ describe('Security Issue Body', () => {
['DAST', parsedDast[0], false, LOW], ['DAST', parsedDast[0], false, LOW],
['Container Scanning', dockerReportParsed.vulnerabilities[0], false, MEDIUM], ['Container Scanning', dockerReportParsed.vulnerabilities[0], false, MEDIUM],
['Dependency Scanning', dependencyScanningIssues[0], true], ['Dependency Scanning', dependencyScanningIssues[0], true],
['Secret Scanning', secretScanningParsedIssues[0], false, CRITICAL], ['Secret Detection', secretDetectionParsedIssues[0], false, CRITICAL],
])('for a %s vulnerability', (name, vuln, hasReportLink, severity) => { ])('for a %s vulnerability', (name, vuln, hasReportLink, severity) => {
beforeEach(() => { beforeEach(() => {
createComponent(vuln); createComponent(vuln);
......
...@@ -21,7 +21,7 @@ import { ...@@ -21,7 +21,7 @@ import {
dastDiffSuccessMock, dastDiffSuccessMock,
containerScanningDiffSuccessMock, containerScanningDiffSuccessMock,
dependencyScanningDiffSuccessMock, dependencyScanningDiffSuccessMock,
secretScanningDiffSuccessMock, secretDetectionDiffSuccessMock,
coverageFuzzingDiffSuccessMock, coverageFuzzingDiffSuccessMock,
apiFuzzingDiffSuccessMock, apiFuzzingDiffSuccessMock,
mockFindings, mockFindings,
...@@ -44,7 +44,7 @@ describe('Grouped security reports app', () => { ...@@ -44,7 +44,7 @@ describe('Grouped security reports app', () => {
const findReportSummary = () => wrapper.find('[data-testid="report-section-code-text"]'); const findReportSummary = () => wrapper.find('[data-testid="report-section-code-text"]');
const findCollapseButton = () => wrapper.find('.js-collapse-btn'); const findCollapseButton = () => wrapper.find('.js-collapse-btn');
const findSpinner = () => wrapper.find('.gl-spinner'); const findSpinner = () => wrapper.find('.gl-spinner');
const findSecretScanReport = () => wrapper.find('[data-testid="secret-scan-report"]'); const findSecretDetectionReport = () => wrapper.find('[data-testid="secret-detection-report"]');
const findViewFullReportButton = () => wrapper.find('.report-btn'); const findViewFullReportButton = () => wrapper.find('.report-btn');
const findDastJobLink = () => wrapper.find('[data-testid="dast-ci-job-link"]'); const findDastJobLink = () => wrapper.find('[data-testid="dast-ci-job-link"]');
...@@ -55,7 +55,7 @@ describe('Grouped security reports app', () => { ...@@ -55,7 +55,7 @@ describe('Grouped security reports app', () => {
containerScanningHelpPath: 'path', containerScanningHelpPath: 'path',
dastHelpPath: 'path', dastHelpPath: 'path',
dependencyScanningHelpPath: 'path', dependencyScanningHelpPath: 'path',
secretScanningHelpPath: 'path', secretDetectionHelpPath: 'path',
canReadVulnerabilityFeedbackPath: true, canReadVulnerabilityFeedbackPath: true,
vulnerabilityFeedbackPath: 'vulnerability_feedback_path.json', vulnerabilityFeedbackPath: 'vulnerability_feedback_path.json',
coverageFuzzingHelpPath: 'path', coverageFuzzingHelpPath: 'path',
...@@ -71,7 +71,7 @@ describe('Grouped security reports app', () => { ...@@ -71,7 +71,7 @@ describe('Grouped security reports app', () => {
dastComparisonPath: DAST_DIFF_ENDPOINT, dastComparisonPath: DAST_DIFF_ENDPOINT,
dependencyScanningComparisonPath: DEPENDENCY_SCANNING_DIFF_ENDPOINT, dependencyScanningComparisonPath: DEPENDENCY_SCANNING_DIFF_ENDPOINT,
sastComparisonPath: SAST_DIFF_ENDPOINT, sastComparisonPath: SAST_DIFF_ENDPOINT,
secretScanningComparisonPath: SECRET_DETECTION_DIFF_ENDPOINT, secretDetectionComparisonPath: SECRET_DETECTION_DIFF_ENDPOINT,
}; };
const defaultDastSummary = { const defaultDastSummary = {
...@@ -180,7 +180,7 @@ describe('Grouped security reports app', () => { ...@@ -180,7 +180,7 @@ describe('Grouped security reports app', () => {
expect(wrapperText).toContain('DAST: Loading resulted in an error'); expect(wrapperText).toContain('DAST: Loading resulted in an error');
expect(wrapperText).toContain('Secret scanning: Loading resulted in an error'); expect(wrapperText).toContain('Secret detection: Loading resulted in an error');
}); });
}); });
...@@ -278,7 +278,7 @@ describe('Grouped security reports app', () => { ...@@ -278,7 +278,7 @@ describe('Grouped security reports app', () => {
mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, dependencyScanningDiffSuccessMock); mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, dependencyScanningDiffSuccessMock);
mock.onGet(DAST_DIFF_ENDPOINT).reply(200, dastDiffSuccessMock); mock.onGet(DAST_DIFF_ENDPOINT).reply(200, dastDiffSuccessMock);
mock.onGet(SAST_DIFF_ENDPOINT).reply(200, sastDiffSuccessMock); mock.onGet(SAST_DIFF_ENDPOINT).reply(200, sastDiffSuccessMock);
mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, secretScanningDiffSuccessMock); mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, secretDetectionDiffSuccessMock);
mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, coverageFuzzingDiffSuccessMock); mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, coverageFuzzingDiffSuccessMock);
mock.onGet(API_FUZZING_DIFF_ENDPOINT).reply(200, apiFuzzingDiffSuccessMock); mock.onGet(API_FUZZING_DIFF_ENDPOINT).reply(200, apiFuzzingDiffSuccessMock);
...@@ -363,7 +363,7 @@ describe('Grouped security reports app', () => { ...@@ -363,7 +363,7 @@ describe('Grouped security reports app', () => {
${'dependency-scanning'} | ${dependencyScanningDiffSuccessMock.fixed} | ${dependencyScanningDiffSuccessMock.added} ${'dependency-scanning'} | ${dependencyScanningDiffSuccessMock.fixed} | ${dependencyScanningDiffSuccessMock.added}
${'container-scanning'} | ${containerScanningDiffSuccessMock.fixed} | ${containerScanningDiffSuccessMock.added} ${'container-scanning'} | ${containerScanningDiffSuccessMock.fixed} | ${containerScanningDiffSuccessMock.added}
${'dast'} | ${dastDiffSuccessMock.fixed} | ${dastDiffSuccessMock.added} ${'dast'} | ${dastDiffSuccessMock.fixed} | ${dastDiffSuccessMock.added}
${'secret-scanning'} | ${secretScanningDiffSuccessMock.fixed} | ${secretScanningDiffSuccessMock.added} ${'secret-detection'} | ${secretDetectionDiffSuccessMock.fixed} | ${secretDetectionDiffSuccessMock.added}
${'coverage-fuzzing'} | ${coverageFuzzingDiffSuccessMock.fixed} | ${coverageFuzzingDiffSuccessMock.added} ${'coverage-fuzzing'} | ${coverageFuzzingDiffSuccessMock.fixed} | ${coverageFuzzingDiffSuccessMock.added}
${'api-fuzzing'} | ${apiFuzzingDiffSuccessMock.fixed} | ${apiFuzzingDiffSuccessMock.added} ${'api-fuzzing'} | ${apiFuzzingDiffSuccessMock.fixed} | ${apiFuzzingDiffSuccessMock.added}
`( `(
...@@ -615,9 +615,9 @@ describe('Grouped security reports app', () => { ...@@ -615,9 +615,9 @@ describe('Grouped security reports app', () => {
}); });
}); });
describe('secret scanning reports', () => { describe('secret Detection reports', () => {
const initSecretScan = (isEnabled = true) => { const initSecretDetection = (isEnabled = true) => {
mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, secretScanningDiffSuccessMock); mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, secretDetectionDiffSuccessMock);
createWrapper({ createWrapper({
...props, ...props,
...@@ -634,11 +634,11 @@ describe('Grouped security reports app', () => { ...@@ -634,11 +634,11 @@ describe('Grouped security reports app', () => {
describe('enabled', () => { describe('enabled', () => {
beforeEach(() => { beforeEach(() => {
return initSecretScan(); return initSecretDetection();
}); });
it('should render the component', () => { it('should render the component', () => {
expect(findSecretScanReport().exists()).toBe(true); expect(findSecretDetectionReport().exists()).toBe(true);
}); });
it('should set diffEndpoint', () => { it('should set diffEndpoint', () => {
...@@ -649,18 +649,18 @@ describe('Grouped security reports app', () => { ...@@ -649,18 +649,18 @@ describe('Grouped security reports app', () => {
it('should display the correct numbers of vulnerabilities', () => { it('should display the correct numbers of vulnerabilities', () => {
expect(trimText(wrapper.text())).toContain( expect(trimText(wrapper.text())).toContain(
'Secret scanning detected 2 potential vulnerabilities 1 Critical 1 High and 0 Others', 'Secret detection detected 2 potential vulnerabilities 1 Critical 1 High and 0 Others',
); );
}); });
}); });
describe('disabled', () => { describe('disabled', () => {
beforeEach(() => { beforeEach(() => {
initSecretScan(false); initSecretDetection(false);
}); });
it('should not render the component', () => { it('should not render the component', () => {
expect(findSecretScanReport().exists()).toBe(false); expect(findSecretDetectionReport().exists()).toBe(false);
}); });
}); });
}); });
......
...@@ -216,7 +216,7 @@ export const parsedDast = [ ...@@ -216,7 +216,7 @@ export const parsedDast = [
}, },
]; ];
export const secretScanningParsedIssues = [ export const secretDetectionParsedIssues = [
{ {
title: 'AWS SecretKey detected', title: 'AWS SecretKey detected',
path: 'Gemfile.lock', path: 'Gemfile.lock',
......
...@@ -26,7 +26,7 @@ import { ...@@ -26,7 +26,7 @@ import {
} from 'ee/vue_shared/security_reports/store/getters'; } from 'ee/vue_shared/security_reports/store/getters';
import createApiFuzzingState from 'ee/vue_shared/security_reports/store/modules/api_fuzzing/state'; import createApiFuzzingState from 'ee/vue_shared/security_reports/store/modules/api_fuzzing/state';
import createSastState from 'ee/vue_shared/security_reports/store/modules/sast/state'; import createSastState from 'ee/vue_shared/security_reports/store/modules/sast/state';
import createSecretScanningState from 'ee/vue_shared/security_reports/store/modules/secret_detection/state'; import createSecretDetectionState from 'ee/vue_shared/security_reports/store/modules/secret_detection/state';
import createState from 'ee/vue_shared/security_reports/store/state'; import createState from 'ee/vue_shared/security_reports/store/state';
import { groupedTextBuilder } from 'ee/vue_shared/security_reports/store/utils'; import { groupedTextBuilder } from 'ee/vue_shared/security_reports/store/utils';
...@@ -40,7 +40,7 @@ describe('Security reports getters', () => { ...@@ -40,7 +40,7 @@ describe('Security reports getters', () => {
beforeEach(() => { beforeEach(() => {
state = createState(); state = createState();
state.sast = createSastState(); state.sast = createSastState();
state.secretDetection = createSecretScanningState(); state.secretDetection = createSecretDetectionState();
state.apiFuzzing = createApiFuzzingState(); state.apiFuzzing = createApiFuzzingState();
}); });
......
...@@ -12,14 +12,14 @@ describe('groupedSecretDetectionText', () => { ...@@ -12,14 +12,14 @@ describe('groupedSecretDetectionText', () => {
const report = createReport({ hasError: true }); const report = createReport({ hasError: true });
const result = getters.groupedSecretDetectionText(report); const result = getters.groupedSecretDetectionText(report);
expect(result).toStrictEqual({ message: messages.SECRET_SCANNING_HAS_ERROR }); expect(result).toStrictEqual({ message: messages.SECRET_DETECTION_HAS_ERROR });
}); });
it("should return the loading message if it's still loading", () => { it("should return the loading message if it's still loading", () => {
const report = createReport({ isLoading: true }); const report = createReport({ isLoading: true });
const result = getters.groupedSecretDetectionText(report); const result = getters.groupedSecretDetectionText(report);
expect(result).toStrictEqual({ message: messages.SECRET_SCANNING_IS_LOADING }); expect(result).toStrictEqual({ message: messages.SECRET_DETECTION_IS_LOADING });
}); });
it('should call groupedTextBuilder if everything is fine', () => { it('should call groupedTextBuilder if everything is fine', () => {
...@@ -30,7 +30,7 @@ describe('groupedSecretDetectionText', () => { ...@@ -30,7 +30,7 @@ describe('groupedSecretDetectionText', () => {
countMessage: '', countMessage: '',
critical: 0, critical: 0,
high: 0, high: 0,
message: 'Secret scanning detected %{totalStart}no%{totalEnd} vulnerabilities.', message: 'Secret detection detected %{totalStart}no%{totalEnd} vulnerabilities.',
other: 0, other: 0,
status: '', status: '',
total: 0, total: 0,
......
...@@ -40089,10 +40089,10 @@ msgstr "" ...@@ -40089,10 +40089,10 @@ msgstr ""
msgid "ciReport|Secret Detection" msgid "ciReport|Secret Detection"
msgstr "" msgstr ""
msgid "ciReport|Secret scanning" msgid "ciReport|Secret Detection detects secrets and credentials vulnerabilities in your source code."
msgstr "" msgstr ""
msgid "ciReport|Secret scanning detects secrets and credentials vulnerabilities in your source code." msgid "ciReport|Secret detection"
msgstr "" msgstr ""
msgid "ciReport|Security scanning" msgid "ciReport|Security scanning"
......
...@@ -280,7 +280,7 @@ export default { ...@@ -280,7 +280,7 @@ export default {
merge_train_index: 1, merge_train_index: 1,
security_reports_docs_path: 'security-reports-docs-path', security_reports_docs_path: 'security-reports-docs-path',
sast_comparison_path: '/sast_comparison_path', sast_comparison_path: '/sast_comparison_path',
secret_scanning_comparison_path: '/secret_scanning_comparison_path', secret_detection_comparison_path: '/secret_detection_comparison_path',
gitpod_enabled: true, gitpod_enabled: true,
show_gitpod_button: true, show_gitpod_button: true,
gitpod_url: 'http://gitpod.localhost', gitpod_url: 'http://gitpod.localhost',
......
...@@ -162,7 +162,7 @@ describe('MergeRequestStore', () => { ...@@ -162,7 +162,7 @@ describe('MergeRequestStore', () => {
expect(store.securityReportsDocsPath).toBe('security-reports-docs-path'); expect(store.securityReportsDocsPath).toBe('security-reports-docs-path');
}); });
it.each(['sast_comparison_path', 'secret_scanning_comparison_path'])( it.each(['sast_comparison_path', 'secret_detection_comparison_path'])(
'should set %s path', 'should set %s path',
(property) => { (property) => {
// Ensure something is set in the mock data // Ensure something is set in the mock data
......
...@@ -314,7 +314,7 @@ export const sastDiffSuccessMock = { ...@@ -314,7 +314,7 @@ export const sastDiffSuccessMock = {
head_report_created_at: '2020-01-10T10:00:00.000Z', head_report_created_at: '2020-01-10T10:00:00.000Z',
}; };
export const secretScanningDiffSuccessMock = { export const secretDetectionDiffSuccessMock = {
added: [mockFindings[0], mockFindings[1]], added: [mockFindings[0], mockFindings[1]],
fixed: [mockFindings[2]], fixed: [mockFindings[2]],
base_report_created_at: '2020-01-01T10:00:00.000Z', base_report_created_at: '2020-01-01T10:00:00.000Z',
......
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
securityReportMergeRequestDownloadPathsQueryNoArtifactsResponse, securityReportMergeRequestDownloadPathsQueryNoArtifactsResponse,
securityReportMergeRequestDownloadPathsQueryResponse, securityReportMergeRequestDownloadPathsQueryResponse,
sastDiffSuccessMock, sastDiffSuccessMock,
secretScanningDiffSuccessMock, secretDetectionDiffSuccessMock,
} from 'jest/vue_shared/security_reports/mock_data'; } from 'jest/vue_shared/security_reports/mock_data';
import createFlash from '~/flash'; import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -31,7 +31,7 @@ Vue.use(VueApollo); ...@@ -31,7 +31,7 @@ Vue.use(VueApollo);
Vue.use(Vuex); Vue.use(Vuex);
const SAST_COMPARISON_PATH = '/sast.json'; const SAST_COMPARISON_PATH = '/sast.json';
const SECRET_SCANNING_COMPARISON_PATH = '/secret_detection.json'; const SECRET_DETECTION_COMPARISON_PATH = '/secret_detection.json';
describe('Security reports app', () => { describe('Security reports app', () => {
let wrapper; let wrapper;
...@@ -175,12 +175,12 @@ describe('Security reports app', () => { ...@@ -175,12 +175,12 @@ describe('Security reports app', () => {
const SAST_SUCCESS_MESSAGE = const SAST_SUCCESS_MESSAGE =
'Security scanning detected 1 potential vulnerability 1 Critical 0 High and 0 Others'; 'Security scanning detected 1 potential vulnerability 1 Critical 0 High and 0 Others';
const SECRET_SCANNING_SUCCESS_MESSAGE = const SECRET_DETECTION_SUCCESS_MESSAGE =
'Security scanning detected 2 potential vulnerabilities 1 Critical 1 High and 0 Others'; 'Security scanning detected 2 potential vulnerabilities 1 Critical 1 High and 0 Others';
describe.each` describe.each`
reportType | pathProp | path | successResponse | successMessage reportType | pathProp | path | successResponse | successMessage
${REPORT_TYPE_SAST} | ${'sastComparisonPath'} | ${SAST_COMPARISON_PATH} | ${sastDiffSuccessMock} | ${SAST_SUCCESS_MESSAGE} ${REPORT_TYPE_SAST} | ${'sastComparisonPath'} | ${SAST_COMPARISON_PATH} | ${sastDiffSuccessMock} | ${SAST_SUCCESS_MESSAGE}
${REPORT_TYPE_SECRET_DETECTION} | ${'secretScanningComparisonPath'} | ${SECRET_SCANNING_COMPARISON_PATH} | ${secretScanningDiffSuccessMock} | ${SECRET_SCANNING_SUCCESS_MESSAGE} ${REPORT_TYPE_SECRET_DETECTION} | ${'secretDetectionComparisonPath'} | ${SECRET_DETECTION_COMPARISON_PATH} | ${secretDetectionDiffSuccessMock} | ${SECRET_DETECTION_SUCCESS_MESSAGE}
`( `(
'given a $pathProp and $reportType artifact', 'given a $pathProp and $reportType artifact',
({ pathProp, path, successResponse, successMessage }) => { ({ pathProp, path, successResponse, successMessage }) => {
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
summaryCounts, summaryCounts,
} from '~/vue_shared/security_reports/store/getters'; } from '~/vue_shared/security_reports/store/getters';
import createSastState from '~/vue_shared/security_reports/store/modules/sast/state'; import createSastState from '~/vue_shared/security_reports/store/modules/sast/state';
import createSecretScanningState from '~/vue_shared/security_reports/store/modules/secret_detection/state'; import createSecretDetectionState from '~/vue_shared/security_reports/store/modules/secret_detection/state';
import createState from '~/vue_shared/security_reports/store/state'; import createState from '~/vue_shared/security_reports/store/state';
import { groupedTextBuilder } from '~/vue_shared/security_reports/store/utils'; import { groupedTextBuilder } from '~/vue_shared/security_reports/store/utils';
import { CRITICAL, HIGH, LOW } from '~/vulnerabilities/constants'; import { CRITICAL, HIGH, LOW } from '~/vulnerabilities/constants';
...@@ -21,7 +21,7 @@ describe('Security reports getters', () => { ...@@ -21,7 +21,7 @@ describe('Security reports getters', () => {
beforeEach(() => { beforeEach(() => {
state = createState(); state = createState();
state.sast = createSastState(); state.sast = createSastState();
state.secretDetection = createSecretScanningState(); state.secretDetection = createSecretDetectionState();
}); });
describe('summaryCounts', () => { describe('summaryCounts', () => {
......
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