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
50a9baf7
Commit
50a9baf7
authored
Oct 07, 2020
by
Fernando Arias
Committed by
Mark Florian
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update modal to show fuzzing data
* Add additional fields
parent
59ff37b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
15 deletions
+81
-15
ee/app/assets/javascripts/vue_shared/security_reports/components/vulnerability_details.vue
...red/security_reports/components/vulnerability_details.vue
+30
-12
ee/changelogs/unreleased/254650-modal-fuzz-updates.yml
ee/changelogs/unreleased/254650-modal-fuzz-updates.yml
+5
-0
ee/spec/frontend/vue_shared/security_reports/components/__snapshots__/vulnerability_details_spec.js.snap
...mponents/__snapshots__/vulnerability_details_spec.js.snap
+16
-0
ee/spec/frontend/vue_shared/security_reports/components/vulnerability_details_spec.js
...security_reports/components/vulnerability_details_spec.js
+23
-2
locale/gitlab.pot
locale/gitlab.pot
+7
-1
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/vulnerability_details.vue
View file @
50a9baf7
<
script
>
import
{
GlFriendlyWrap
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlFriendlyWrap
,
GlLink
,
GlBadge
}
from
'
@gitlab/ui
'
;
import
{
REPORT_TYPES
}
from
'
ee/security_dashboard/store/constants
'
;
import
CodeBlock
from
'
~/vue_shared/components/code_block.vue
'
;
import
SeverityBadge
from
'
./severity_badge.vue
'
;
...
...
@@ -9,11 +9,11 @@ import { s__, sprintf } from '~/locale';
export
default
{
name
:
'
VulnerabilityDetails
'
,
components
:
{
CodeBlock
,
GlFriendlyWrap
,
SeverityBadge
,
VulnerabilityDetail
,
GlLink
},
components
:
{
CodeBlock
,
GlFriendlyWrap
,
SeverityBadge
,
VulnerabilityDetail
,
GlLink
,
GlBadge
},
props
:
{
vulnerability
:
{
type
:
Object
,
required
:
true
}
},
computed
:
{
url
()
{
return
this
.
vulnerability
.
request
?.
url
||
getFileLocation
(
this
.
vuln
erability
.
l
ocation
);
return
this
.
vulnerability
.
request
?.
url
||
getFileLocation
(
this
.
vuln
L
ocation
);
},
file
()
{
const
file
=
this
.
vulnerability
?.
location
?.
file
;
...
...
@@ -21,7 +21,7 @@ export default {
return
null
;
}
let
lineSuffix
=
''
;
const
{
start_line
:
startLine
,
end_line
:
endLine
}
=
this
.
vuln
erability
.
l
ocation
;
const
{
start_line
:
startLine
,
end_line
:
endLine
}
=
this
.
vuln
L
ocation
;
if
(
startLine
)
{
lineSuffix
+=
`:
${
startLine
}
`
;
if
(
endLine
&&
startLine
!==
endLine
)
{
...
...
@@ -33,20 +33,29 @@ export default {
identifiers
()
{
return
this
.
asNonEmptyListOrNull
(
this
.
vulnerability
.
identifiers
);
},
vulnLocation
()
{
return
this
.
vulnerability
.
location
;
},
crashAddress
()
{
return
this
.
vulnerability
.
location
?.
crash_address
;
return
this
.
vulnLocation
?.
crash_address
;
},
crashType
()
{
return
this
.
vulnLocation
?.
crash_type
;
},
crashState
()
{
return
this
.
vulnLocation
?.
crash_state
;
},
className
()
{
return
this
.
vuln
erability
.
l
ocation
?.
class
;
return
this
.
vuln
L
ocation
?.
class
;
},
methodName
()
{
return
this
.
vuln
erability
.
l
ocation
?.
method
;
return
this
.
vuln
L
ocation
?.
method
;
},
image
()
{
return
this
.
vuln
erability
.
l
ocation
?.
image
;
return
this
.
vuln
L
ocation
?.
image
;
},
namespace
()
{
return
this
.
vuln
erability
.
l
ocation
?.
operating_system
;
return
this
.
vuln
L
ocation
?.
operating_system
;
},
links
()
{
return
this
.
asNonEmptyListOrNull
(
this
.
vulnerability
.
links
);
...
...
@@ -82,7 +91,7 @@ export default {
});
},
stacktraceSnippet
()
{
return
this
.
vuln
erability
.
l
ocation
?.
stacktrace_snippet
;
return
this
.
vuln
L
ocation
?.
stacktrace_snippet
;
},
},
methods
:
{
...
...
@@ -100,6 +109,9 @@ export default {
</
script
>
<
template
>
<div
class=
"border-white mb-0 px-3"
>
<vulnerability-detail
v-if=
"vulnerability.state"
:label=
"s__('Vulnerability|Status')"
>
<gl-badge
variant=
"warning"
class=
"text-capitalize"
>
{{
vulnerability
.
state
}}
</gl-badge>
</vulnerability-detail>
<vulnerability-detail
v-if=
"vulnerability.description"
:label=
"s__('Vulnerability|Description')"
...
...
@@ -142,8 +154,14 @@ export default {
<vulnerability-detail
v-if=
"vulnerability.evidence"
:label=
"s__('Vulnerability|Evidence')"
>
<gl-friendly-wrap
:text=
"vulnerability.evidence"
/>
</vulnerability-detail>
<vulnerability-detail
v-if=
"crashAddress"
:label=
"s__('Vulnerability|Crash Address')"
>
<gl-friendly-wrap
ref=
"crashAddress"
:text=
"crashAddress"
/>
<vulnerability-detail
v-if=
"crashAddress"
:label=
"s__('Vulnerability|Crash address')"
>
<span
ref=
"crashAddress"
>
{{
crashAddress
}}
</span>
</vulnerability-detail>
<vulnerability-detail
v-if=
"crashType"
:label=
"s__('Vulnerability|Crash type')"
>
<span
ref=
"crashType"
>
{{
crashType
}}
</span>
</vulnerability-detail>
<vulnerability-detail
v-if=
"crashState"
:label=
"s__('Vulnerability|Crash state')"
>
<span
ref=
"crashState"
>
{{
crashState
}}
</span>
</vulnerability-detail>
<vulnerability-detail
v-if=
"stacktraceSnippet"
:label=
"s__('Stacktrace snippet')"
>
<code-block
ref=
"stacktraceSnippet"
:code=
"stacktraceSnippet"
max-height=
"225px"
/>
...
...
ee/changelogs/unreleased/254650-modal-fuzz-updates.yml
0 → 100644
View file @
50a9baf7
---
title
:
Update security vulnerability modal to show fuzzing data
merge_request
:
43983
author
:
type
:
added
ee/spec/frontend/vue_shared/security_reports/components/__snapshots__/vulnerability_details_spec.js.snap
View file @
50a9baf7
...
...
@@ -4,6 +4,18 @@ exports[`VulnerabilityDetails component pin test renders correctly 1`] = `
<div
class="border-white mb-0 px-3"
>
<vulnerability-detail-stub
label="Status"
>
<gl-badge-stub
class="text-capitalize"
size="md"
variant="warning"
>
opened
</gl-badge-stub>
</vulnerability-detail-stub>
<vulnerability-detail-stub
label="Description"
>
...
...
@@ -99,6 +111,10 @@ key2: value2"
<!---->
<!---->
<!---->
<vulnerability-detail-stub
label="Identifiers"
>
...
...
ee/spec/frontend/vue_shared/security_reports/components/vulnerability_details_spec.js
View file @
50a9baf7
...
...
@@ -3,7 +3,7 @@ import VulnerabilityDetails from 'ee/vue_shared/security_reports/components/vuln
import
SeverityBadge
from
'
ee/vue_shared/security_reports/components/severity_badge.vue
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlBadge
}
from
'
@gitlab/ui
'
;
import
{
mockFindings
}
from
'
../mock_data
'
;
import
CodeBlock
from
'
~/vue_shared/components/code_block.vue
'
;
...
...
@@ -34,6 +34,8 @@ describe('VulnerabilityDetails component', () => {
const
findResponseHeaders
=
()
=>
wrapper
.
find
({
ref
:
'
responseHeaders
'
});
const
findResponseStatusCode
=
()
=>
wrapper
.
find
({
ref
:
'
responseStatusCode
'
});
const
findCrashAddress
=
()
=>
wrapper
.
find
({
ref
:
'
crashAddress
'
});
const
findCrashState
=
()
=>
wrapper
.
find
({
ref
:
'
crashState
'
});
const
findCrashType
=
()
=>
wrapper
.
find
({
ref
:
'
crashType
'
});
const
findStacktraceSnippet
=
()
=>
wrapper
.
find
({
ref
:
'
stacktraceSnippet
'
});
afterEach
(()
=>
{
...
...
@@ -48,6 +50,14 @@ describe('VulnerabilityDetails component', () => {
expect
(
badge
.
props
(
'
severity
'
)).
toBe
(
vulnerability
.
severity
);
});
it
(
'
renders status with a badge
'
,
()
=>
{
const
vulnerability
=
makeVulnerability
({
state
:
'
detected
'
});
componentFactory
(
vulnerability
);
const
badge
=
wrapper
.
find
(
GlBadge
);
expect
(
badge
.
text
()).
toContain
(
vulnerability
.
state
);
});
it
(
'
renders link fields with link
'
,
()
=>
{
const
vulnerability
=
makeVulnerability
();
componentFactory
(
vulnerability
);
...
...
@@ -124,8 +134,9 @@ describe('VulnerabilityDetails component', () => {
});
describe
(
'
with coverage fuzzing information
'
,
()
=>
{
let
vulnerability
;
beforeEach
(()
=>
{
const
vulnerability
=
makeVulnerability
({
vulnerability
=
makeVulnerability
({
location
:
{
crash_address
:
'
0x602000001573
'
,
crash_state
:
'
FuzzMe
\n
start
\n
start+0x0
\n\n
'
,
...
...
@@ -140,6 +151,16 @@ describe('VulnerabilityDetails component', () => {
expect
(
findCrashAddress
().
exists
()).
toBe
(
true
);
expect
(
findStacktraceSnippet
().
exists
()).
toBe
(
true
);
});
it
(
'
renders crash_state
'
,
()
=>
{
expect
(
findCrashState
().
exists
()).
toBe
(
true
);
expect
(
findCrashState
().
html
()).
toContain
(
vulnerability
.
location
.
crash_state
);
});
it
(
'
renders crash_type
'
,
()
=>
{
expect
(
findCrashType
().
exists
()).
toBe
(
true
);
expect
(
findCrashType
().
text
()).
toContain
(
vulnerability
.
location
.
crash_type
);
});
});
describe
(
'
with request information
'
,
()
=>
{
...
...
locale/gitlab.pot
View file @
50a9baf7
...
...
@@ -28716,7 +28716,13 @@ msgstr ""
msgid "Vulnerability|Comments"
msgstr ""
msgid "Vulnerability|Crash Address"
msgid "Vulnerability|Crash address"
msgstr ""
msgid "Vulnerability|Crash state"
msgstr ""
msgid "Vulnerability|Crash type"
msgstr ""
msgid "Vulnerability|Description"
...
...
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