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
a2121125
Commit
a2121125
authored
May 26, 2020
by
can eldem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check valid confidence and severity level when parsing
parent
db5d4783
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
ee/lib/gitlab/ci/parsers/security/common.rb
ee/lib/gitlab/ci/parsers/security/common.rb
+12
-5
No files found.
ee/lib/gitlab/ci/parsers/security/common.rb
View file @
a2121125
...
@@ -58,8 +58,8 @@ module Gitlab
...
@@ -58,8 +58,8 @@ module Gitlab
name:
data
[
'message'
],
name:
data
[
'message'
],
compare_key:
data
[
'cve'
]
||
''
,
compare_key:
data
[
'cve'
]
||
''
,
location:
create_location
(
data
[
'location'
]
||
{}),
location:
create_location
(
data
[
'location'
]
||
{}),
severity:
parse_
level
(
data
[
'severity'
]
),
severity:
parse_
severity_level
(
data
[
'severity'
]
&
.
downcase
),
confidence:
parse_
level
(
data
[
'confidence'
]
),
confidence:
parse_
confidence_level
(
data
[
'confidence'
]
&
.
downcase
),
scanner:
scanner
,
scanner:
scanner
,
identifiers:
identifiers
,
identifiers:
identifiers
,
raw_metadata:
data
.
to_json
,
raw_metadata:
data
.
to_json
,
...
@@ -99,9 +99,16 @@ module Gitlab
...
@@ -99,9 +99,16 @@ module Gitlab
{
'id'
=>
tool
,
'name'
=>
tool
.
capitalize
}
if
tool
{
'id'
=>
tool
,
'name'
=>
tool
.
capitalize
}
if
tool
end
end
def
parse_level
(
input
)
def
parse_severity_level
(
input
)
input
=
input
&
.
downcase
return
input
if
::
Vulnerabilities
::
Occurrence
::
SEVERITY_LEVELS
.
key?
(
input
)
input
.
blank?
||
input
==
'undefined'
?
'unknown'
:
input
'unknown'
end
def
parse_confidence_level
(
input
)
return
input
if
::
Vulnerabilities
::
Occurrence
::
CONFIDENCE_LEVELS
.
key?
(
input
)
'unknown'
end
end
def
create_location
(
location_data
)
def
create_location
(
location_data
)
...
...
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