Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dd1533c0
Commit
dd1533c0
authored
Sep 30, 2020
by
Fernando Arias
Committed by
Natalia Tepluhina
Sep 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update getter in group security reports
* Update getters to be aware of coverage fuzzing
parent
ecefdd6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
ee/app/assets/javascripts/vue_shared/security_reports/store/getters.js
.../javascripts/vue_shared/security_reports/store/getters.js
+16
-7
ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
...red/security_reports/grouped_security_reports_app_spec.js
+1
-1
ee/spec/frontend/vue_shared/security_reports/store/getters_spec.js
...rontend/vue_shared/security_reports/store/getters_spec.js
+7
-2
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/store/getters.js
View file @
dd1533c0
...
...
@@ -44,6 +44,7 @@ export const summaryCounts = ({
dependencyScanning
,
sast
,
secretScanning
,
coverageFuzzing
,
}
=
{})
=>
{
const
allNewVulns
=
[
...
containerScanning
.
newIssues
,
...
...
@@ -51,6 +52,7 @@ export const summaryCounts = ({
...
dependencyScanning
.
newIssues
,
...
sast
.
newIssues
,
...
secretScanning
.
newIssues
,
...
coverageFuzzing
.
newIssues
,
];
return
countVulnerabilities
(
allNewVulns
);
...
...
@@ -123,49 +125,56 @@ export const areReportsLoading = state =>
state
.
dast
.
isLoading
||
state
.
containerScanning
.
isLoading
||
state
.
dependencyScanning
.
isLoading
||
state
.
secretScanning
.
isLoading
;
state
.
secretScanning
.
isLoading
||
state
.
coverageFuzzing
.
isLoading
;
export
const
areAllReportsLoading
=
state
=>
state
.
sast
.
isLoading
&&
state
.
dast
.
isLoading
&&
state
.
containerScanning
.
isLoading
&&
state
.
dependencyScanning
.
isLoading
&&
state
.
secretScanning
.
isLoading
;
state
.
secretScanning
.
isLoading
&&
state
.
coverageFuzzing
.
isLoading
;
export
const
allReportsHaveError
=
state
=>
state
.
sast
.
hasError
&&
state
.
dast
.
hasError
&&
state
.
containerScanning
.
hasError
&&
state
.
dependencyScanning
.
hasError
&&
state
.
secretScanning
.
hasError
;
state
.
secretScanning
.
hasError
&&
state
.
coverageFuzzing
.
hasError
;
export
const
anyReportHasError
=
state
=>
state
.
sast
.
hasError
||
state
.
dast
.
hasError
||
state
.
containerScanning
.
hasError
||
state
.
dependencyScanning
.
hasError
||
state
.
secretScanning
.
hasError
;
state
.
secretScanning
.
hasError
||
state
.
coverageFuzzing
.
hasError
;
export
const
noBaseInAllReports
=
state
=>
!
state
.
sast
.
hasBaseReport
&&
!
state
.
dast
.
hasBaseReport
&&
!
state
.
containerScanning
.
hasBaseReport
&&
!
state
.
dependencyScanning
.
hasBaseReport
&&
!
state
.
secretScanning
.
hasBaseReport
;
!
state
.
secretScanning
.
hasBaseReport
&&
!
state
.
coverageFuzzing
.
hasBaseReport
;
export
const
anyReportHasIssues
=
state
=>
state
.
sast
.
newIssues
.
length
>
0
||
state
.
dast
.
newIssues
.
length
>
0
||
state
.
containerScanning
.
newIssues
.
length
>
0
||
state
.
dependencyScanning
.
newIssues
.
length
>
0
||
state
.
secretScanning
.
newIssues
.
length
>
0
;
state
.
secretScanning
.
newIssues
.
length
>
0
||
state
.
coverageFuzzing
.
newIssues
.
length
>
0
;
export
const
isBaseSecurityReportOutOfDate
=
state
=>
state
.
sast
.
baseReportOutofDate
||
state
.
dast
.
baseReportOutofDate
||
state
.
containerScanning
.
baseReportOutofDate
||
state
.
dependencyScanning
.
baseReportOutofDate
||
state
.
secretScanning
.
baseReportOutofDate
;
state
.
secretScanning
.
baseReportOutofDate
||
state
.
coverageFuzzing
.
baseReportOutofDate
;
export
const
canCreateIssue
=
state
=>
Boolean
(
state
.
createVulnerabilityFeedbackIssuePath
);
...
...
ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
View file @
dd1533c0
...
...
@@ -273,7 +273,7 @@ describe('Grouped security reports app', () => {
// Renders the summary text
expect
(
wrapper
.
vm
.
$el
.
querySelector
(
'
.js-code-text
'
).
textContent
.
trim
()).
toEqual
(
'
Security scanning detected
5 critical and 3
high severity vulnerabilities.
'
,
'
Security scanning detected
6 critical and 4
high severity vulnerabilities.
'
,
);
// Renders the expand button
...
...
ee/spec/frontend/vue_shared/security_reports/store/getters_spec.js
View file @
dd1533c0
...
...
@@ -5,6 +5,7 @@ import {
groupedDastText
,
groupedDependencyText
,
groupedSecretScanningText
,
groupedCoverageFuzzingText
,
groupedSummaryText
,
allReportsHaveError
,
noBaseInAllReports
,
...
...
@@ -44,6 +45,7 @@ describe('Security reports getters', () => {
${
'
Dependency scanning
'
}
|
${
'
dependencyScanning
'
}
|
${
groupedDependencyText
}
${
'
Container scanning
'
}
|
${
'
containerScanning
'
}
|
${
groupedContainerScanningText
}
${
'
DAST
'
}
|
${
'
dast
'
}
|
${
groupedDastText
}
${
'
Coverage fuzzing
'
}
|
${
'
coverageFuzzing
'
}
|
${
groupedCoverageFuzzingText
}
`
(
'
grouped text for $name
'
,
({
name
,
scanner
,
getter
})
=>
{
describe
(
'
with no issues
'
,
()
=>
{
it
(
'
returns no issues text
'
,
()
=>
{
...
...
@@ -79,9 +81,10 @@ describe('Security reports getters', () => {
state
.
containerScanning
.
newIssues
=
[
generateVuln
(
CRITICAL
)];
state
.
dast
.
newIssues
=
[
generateVuln
(
CRITICAL
)];
state
.
dependencyScanning
.
newIssues
=
[
generateVuln
(
CRITICAL
)];
state
.
coverageFuzzing
.
newIssues
=
[
generateVuln
(
CRITICAL
)];
expect
(
summaryCounts
(
state
)).
toEqual
({
critical
:
3
,
critical
:
4
,
high
:
0
,
other
:
0
,
});
...
...
@@ -91,10 +94,11 @@ describe('Security reports getters', () => {
state
.
containerScanning
.
newIssues
=
[
generateVuln
(
CRITICAL
)];
state
.
dast
.
newIssues
=
[
generateVuln
(
CRITICAL
),
generateVuln
(
HIGH
)];
state
.
dependencyScanning
.
newIssues
=
[
generateVuln
(
LOW
)];
state
.
coverageFuzzing
.
newIssues
=
[
generateVuln
(
HIGH
)];
expect
(
summaryCounts
(
state
)).
toEqual
({
critical
:
2
,
high
:
1
,
high
:
2
,
other
:
1
,
});
});
...
...
@@ -221,6 +225,7 @@ describe('Security reports getters', () => {
state
.
containerScanning
.
hasError
=
true
;
state
.
dependencyScanning
.
hasError
=
true
;
state
.
secretScanning
.
hasError
=
true
;
state
.
coverageFuzzing
.
hasError
=
true
;
expect
(
allReportsHaveError
(
state
)).
toEqual
(
true
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment