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
30d09b56
Commit
30d09b56
authored
Jul 14, 2020
by
Alan Paruszewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parse scanner from security report scan.scanner
parent
4d8b81b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
ee/lib/gitlab/ci/parsers/security/common.rb
ee/lib/gitlab/ci/parsers/security/common.rb
+1
-0
ee/spec/lib/gitlab/ci/parsers/security/common_spec.rb
ee/spec/lib/gitlab/ci/parsers/security/common_spec.rb
+11
-6
No files found.
ee/lib/gitlab/ci/parsers/security/common.rb
View file @
30d09b56
...
...
@@ -12,6 +12,7 @@ module Gitlab
raise
SecurityReportParserError
,
"Invalid report format"
unless
report_data
.
is_a?
(
Hash
)
report
.
scanned_resources
=
report_data
.
dig
(
'scan'
,
'scanned_resources'
)
||
[]
create_scanner
(
report
,
report_data
.
dig
(
'scan'
,
'scanner'
))
collate_remediations
(
report_data
).
each
do
|
vulnerability
|
create_vulnerability
(
report
,
vulnerability
,
report_data
[
"version"
])
...
...
ee/spec/lib/gitlab/ci/parsers/security/common_spec.rb
View file @
30d09b56
...
...
@@ -36,7 +36,7 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
"cve"
:
"CVE-1020"
,
"severity"
:
"High"
,
"solution"
:
"Upgrade to latest version."
,
"scanner"
:
{
"id"
:
"gemnasium"
,
"name"
:
"Gemnasium"
,
"vendor"
:
{
"name"
:
"GitLab"
}
},
"scanner"
:
{
"id"
:
"gemnasium"
,
"name"
:
"Gemnasium"
},
"location"
:
{},
"identifiers"
:
[],
"links"
:
[{
"url"
:
""
}]
...
...
@@ -52,8 +52,7 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
"solution"
:
"Upgrade to latest versions."
,
"scanner"
:
{
"id"
:
"gemnasium"
,
"name"
:
"Gemnasium"
,
"vendor"
:
{
"name"
:
"GitLab"
}
"name"
:
"Gemnasium"
},
"location"
:
{},
"identifiers"
:
[],
...
...
@@ -69,8 +68,7 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
"solution"
:
"Upgrade to fixed version.
\r\n
"
,
"scanner"
:
{
"id"
:
"gemnasium"
,
"name"
:
"Gemnasium"
,
"vendor"
:
{
"name"
:
"GitLab"
}
"name"
:
"Gemnasium"
},
"location"
:
{},
"identifiers"
:
[],
...
...
@@ -78,7 +76,14 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
}
],
"remediations"
:
[],
"dependency_files"
:
[]
"dependency_files"
:
[],
"scan"
:
{
"scanner"
:
{
"id"
:
"gemnasium"
,
"name"
:
"Gemnasium"
,
"vendor"
:
{
"name"
:
"GitLab"
}
}
}
}
end
...
...
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