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
38c86c73
Commit
38c86c73
authored
Sep 29, 2020
by
can eldem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parse scan object
parent
9e4d74e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
ee/lib/gitlab/ci/parsers/security/common.rb
ee/lib/gitlab/ci/parsers/security/common.rb
+1
-0
ee/lib/gitlab/ci/reports/security/finding.rb
ee/lib/gitlab/ci/reports/security/finding.rb
+3
-1
ee/lib/gitlab/ci/reports/security/scan.rb
ee/lib/gitlab/ci/reports/security/scan.rb
+21
-0
No files found.
ee/lib/gitlab/ci/parsers/security/common.rb
View file @
38c86c73
...
...
@@ -65,6 +65,7 @@ module Gitlab
severity:
parse_severity_level
(
data
[
'severity'
]
&
.
downcase
),
confidence:
parse_confidence_level
(
data
[
'confidence'
]
&
.
downcase
),
scanner:
scanner
,
scan:
create_scan
(
data
[
'scan'
]),
identifiers:
identifiers
,
raw_metadata:
data
.
to_json
,
metadata_version:
version
))
...
...
ee/lib/gitlab/ci/reports/security/finding.rb
View file @
38c86c73
...
...
@@ -18,12 +18,13 @@ module Gitlab
attr_reader
:raw_metadata
attr_reader
:report_type
attr_reader
:scanner
attr_reader
:scan
attr_reader
:severity
attr_reader
:uuid
delegate
:file_path
,
:start_line
,
:end_line
,
to: :location
def
initialize
(
compare_key
:,
identifiers
:,
location
:,
metadata_version
:,
name
:,
raw_metadata
:,
report_type
:,
scanner
:,
uuid
:,
confidence:
nil
,
severity:
nil
)
# rubocop:disable Metrics/ParameterLists
def
initialize
(
compare_key
:,
identifiers
:,
location
:,
metadata_version
:,
name
:,
raw_metadata
:,
report_type
:,
scanner
:,
scan
:,
uuid
:,
confidence:
nil
,
severity:
nil
)
# rubocop:disable Metrics/ParameterLists
@compare_key
=
compare_key
@confidence
=
confidence
@identifiers
=
identifiers
...
...
@@ -33,6 +34,7 @@ module Gitlab
@raw_metadata
=
raw_metadata
@report_type
=
report_type
@scanner
=
scanner
@scan
=
scan
@severity
=
severity
@uuid
=
uuid
...
...
ee/lib/gitlab/ci/reports/security/scan.rb
0 → 100644
View file @
38c86c73
# frozen_string_literal: true
module
Gitlab
module
Ci
module
Reports
module
Security
class
Scan
attr_accessor
:type
,
:status
,
:start_time
,
:end_time
def
initialize
(
params
=
{})
@type
=
params
.
dig
(
'type'
)
@status
=
params
.
dig
(
'success'
)
@start_time
=
params
.
dig
(
'start_time'
)
@end_time
=
params
.
dig
(
'end_time'
)
end
end
end
end
end
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