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
d43a1ed5
Commit
d43a1ed5
authored
Dec 09, 2020
by
nmccorrison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added DAST path to display on vulnerabilities list
Previously the path/URL wasn't displayed for DAST items
parent
4d105437
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
...ipts/security_dashboard/components/vulnerability_list.vue
+6
-2
ee/app/assets/javascripts/security_dashboard/graphql/vulnerability.fragment.graphql
...security_dashboard/graphql/vulnerability.fragment.graphql
+4
-0
ee/spec/frontend/security_dashboard/components/mock_data.js
ee/spec/frontend/security_dashboard/components/mock_data.js
+13
-0
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
.../security_dashboard/components/vulnerability_list_spec.js
+10
-0
No files found.
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
View file @
d43a1ed5
...
...
@@ -213,7 +213,7 @@ export default {
},
methods
:
{
createLocationString
(
location
)
{
const
{
image
,
file
,
startLine
}
=
location
;
const
{
image
,
file
,
startLine
,
path
}
=
location
;
if
(
image
)
{
return
image
;
...
...
@@ -223,6 +223,10 @@ export default {
return
`
${
file
}
${
sprintf
(
__
(
'
(line: %{startLine})
'
),
{
startLine
})}
`
;
}
if
(
path
)
{
return
path
;
}
return
file
;
},
deselectVulnerability
(
vulnerabilityId
)
{
...
...
@@ -253,7 +257,7 @@ export default {
return
identifiers
?.
length
>
1
;
},
shouldShowVulnerabilityPath
(
item
)
{
return
Boolean
(
item
.
location
.
image
||
item
.
location
.
file
);
return
Boolean
(
item
.
location
.
image
||
item
.
location
.
file
||
item
.
location
.
path
);
},
toggleAllVulnerabilities
()
{
if
(
this
.
hasSelectedAllVulnerabilities
)
{
...
...
ee/app/assets/javascripts/security_dashboard/graphql/vulnerability.fragment.graphql
View file @
d43a1ed5
...
...
@@ -37,6 +37,10 @@ fragment Vulnerability on Vulnerability {
file
startLine
}
...
on
VulnerabilityLocationDast
{
hostname
path
}
}
project
{
nameWithNamespace
...
...
ee/spec/frontend/security_dashboard/components/mock_data.js
View file @
d43a1ed5
...
...
@@ -97,6 +97,19 @@ export const generateVulnerabilities = () => [
},
scanner
:
{},
},
{
id
:
'
id_5
'
,
title
:
'
Vulnerability 5
'
,
severity
:
'
high
'
,
state
:
'
DETECTED
'
,
location
:
{
path
:
'
/v1/trees
'
},
project
:
{
nameWithNamespace
:
'
Administrator / Security reports
'
,
},
scanner
:
{},
},
];
export
const
vulnerabilities
=
generateVulnerabilities
();
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
View file @
d43a1ed5
...
...
@@ -234,6 +234,16 @@ describe('Vulnerability list component', () => {
expect
(
cellText
).
toEqual
(
project
.
nameWithNamespace
);
expect
(
cellText
).
not
.
toContain
(
'
(line:
'
);
});
it
(
'
should display the vulnerability locations for path
'
,
()
=>
{
const
{
id
,
project
,
location
}
=
newVulnerabilities
[
5
];
const
cell
=
findDataCell
(
`location-
${
id
}
`
);
expect
(
cell
.
text
()).
toContain
(
project
.
nameWithNamespace
);
expect
(
findLocationTextWrapper
(
cell
).
props
()).
toEqual
({
text
:
location
.
path
,
position
:
'
middle
'
,
});
});
});
describe
(
'
when displayed on a project level dashboard
'
,
()
=>
{
...
...
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