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
2823acc2
Commit
2823acc2
authored
Mar 12, 2020
by
celdem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup undefined severity and confidence level from code
parent
55d0427e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
7 additions
and
10 deletions
+7
-10
ee/app/models/vulnerabilities/occurrence.rb
ee/app/models/vulnerabilities/occurrence.rb
+1
-1
ee/app/services/security/dependency_list_service.rb
ee/app/services/security/dependency_list_service.rb
+2
-2
ee/lib/api/vulnerability_findings.rb
ee/lib/api/vulnerability_findings.rb
+1
-1
ee/lib/gitlab/vulnerabilities/history.rb
ee/lib/gitlab/vulnerabilities/history.rb
+1
-1
ee/lib/gitlab/vulnerabilities/summary.rb
ee/lib/gitlab/vulnerabilities/summary.rb
+0
-1
ee/spec/controllers/groups/security/vulnerability_findings_controller_spec.rb
...groups/security/vulnerability_findings_controller_spec.rb
+0
-1
ee/spec/controllers/projects/dependencies_controller_spec.rb
ee/spec/controllers/projects/dependencies_controller_spec.rb
+1
-1
ee/spec/models/vulnerability_spec.rb
ee/spec/models/vulnerability_spec.rb
+1
-1
ee/spec/requests/security/vulnerability_findings_spec.rb
ee/spec/requests/security/vulnerability_findings_spec.rb
+0
-1
No files found.
ee/app/models/vulnerabilities/occurrence.rb
View file @
2823acc2
...
...
@@ -39,7 +39,7 @@ module Vulnerabilities
}.
with_indifferent_access
.
freeze
SEVERITY_LEVELS
=
{
undefined:
0
,
# undefined: 0, no longer applicable
info:
1
,
unknown:
2
,
# experimental: 3, formerly used by confidence, no longer applicable
...
...
ee/app/services/security/dependency_list_service.rb
View file @
2823acc2
...
...
@@ -72,8 +72,8 @@ module Security
# will have highest severity
def
sort_by_severity
(
collection
)
collection
.
sort
do
|
dep_i
,
dep_j
|
level_i
=
dep_i
.
dig
(
:vulnerabilities
,
0
,
:severity
)
||
:un
defined
level_j
=
dep_j
.
dig
(
:vulnerabilities
,
0
,
:severity
)
||
:un
defined
level_i
=
dep_i
.
dig
(
:vulnerabilities
,
0
,
:severity
)
||
:un
known
level_j
=
dep_j
.
dig
(
:vulnerabilities
,
0
,
:severity
)
||
:un
known
::
Vulnerabilities
::
Occurrence
::
SEVERITY_LEVELS
[
level_j
]
<=>
::
Vulnerabilities
::
Occurrence
::
SEVERITY_LEVELS
[
level_i
]
end
...
...
ee/lib/api/vulnerability_findings.rb
View file @
2823acc2
...
...
@@ -41,7 +41,7 @@ module API
optional
:severity
,
type:
Array
[
String
],
desc:
'Returns vulnerabilities belonging to specified severity level: '
\
'`
undefined`, `
info`, `unknown`, `low`, `medium`, `high`, or `critical`. Defaults to all'
,
'`info`, `unknown`, `low`, `medium`, `high`, or `critical`. Defaults to all'
,
values:
::
Vulnerabilities
::
Occurrence
.
severities
.
keys
,
default:
::
Vulnerabilities
::
Occurrence
.
severities
.
keys
optional
:confidence
,
...
...
ee/lib/gitlab/vulnerabilities/history.rb
View file @
2823acc2
...
...
@@ -29,7 +29,7 @@ module Gitlab
end
def
cached_vulnerability_history
history
=
{
undefined:
{},
info:
{},
unknown:
{},
low:
{},
medium:
{},
high:
{},
critical:
{},
total:
{}
}
history
=
{
info:
{},
unknown:
{},
low:
{},
medium:
{},
high:
{},
critical:
{},
total:
{}
}
project_ids_to_fetch
.
each
do
|
project_id
|
project_history
=
Gitlab
::
Vulnerabilities
::
HistoryCache
.
new
(
vulnerable
,
project_id
).
fetch
(
HISTORY_RANGE
)
...
...
ee/lib/gitlab/vulnerabilities/summary.rb
View file @
2823acc2
...
...
@@ -21,7 +21,6 @@ module Gitlab
def
cached_vulnerability_summary
summary
=
{
undefined:
0
,
info:
0
,
unknown:
0
,
low:
0
,
...
...
ee/spec/controllers/groups/security/vulnerability_findings_controller_spec.rb
View file @
2823acc2
...
...
@@ -103,7 +103,6 @@ describe Groups::Security::VulnerabilityFindingsController do
end
expect
(
json_response
).
to
eq
({
"undefined"
=>
{},
"info"
=>
{},
"unknown"
=>
{},
"low"
=>
{},
...
...
ee/spec/controllers/projects/dependencies_controller_spec.rb
View file @
2823acc2
...
...
@@ -117,7 +117,7 @@ describe Projects::DependenciesController do
it
'returns sorted list'
do
expect
(
json_response
[
'dependencies'
].
first
[
'name'
]).
to
eq
(
'nokogiri'
)
expect
(
json_response
[
'dependencies'
].
second
[
'name'
]).
to
eq
(
'
debug
'
)
expect
(
json_response
[
'dependencies'
].
second
[
'name'
]).
to
eq
(
'
mini_portile2
'
)
end
end
end
...
...
ee/spec/models/vulnerability_spec.rb
View file @
2823acc2
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
Vulnerability
do
let
(
:state_values
)
{
{
detected:
1
,
dismissed:
2
,
resolved:
3
,
confirmed:
4
}
}
let
(
:severity_values
)
{
{
undefined:
0
,
info:
1
,
unknown:
2
,
low:
4
,
medium:
5
,
high:
6
,
critical:
7
}
}
let
(
:severity_values
)
{
{
info:
1
,
unknown:
2
,
low:
4
,
medium:
5
,
high:
6
,
critical:
7
}
}
let
(
:confidence_values
)
do
{
undefined:
0
,
ignore:
1
,
unknown:
2
,
experimental:
3
,
low:
4
,
medium:
5
,
high:
6
,
confirmed:
7
}
...
...
ee/spec/requests/security/vulnerability_findings_spec.rb
View file @
2823acc2
...
...
@@ -302,7 +302,6 @@ describe 'GET /-/security/vulnerability_findings/history' do
end
expect
(
json_response
).
to
eq
({
"undefined"
=>
{},
"info"
=>
{},
"unknown"
=>
{},
"low"
=>
{},
...
...
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