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
144ab22b
Commit
144ab22b
authored
Feb 14, 2019
by
Olivier Gonzalez
Committed by
Kamil Trzciński
Feb 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip whitelisted vulnerabilities in Container Scanning
Update fixture to provide meaningful data.
parent
9d95687e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
6 deletions
+28
-6
ee/changelogs/unreleased/9251-skip_whitelisted_vulnerabilities.yml
...logs/unreleased/9251-skip_whitelisted_vulnerabilities.yml
+5
-0
ee/lib/gitlab/ci/parsers/security/container_scanning.rb
ee/lib/gitlab/ci/parsers/security/container_scanning.rb
+4
-0
ee/spec/lib/gitlab/ci/parsers/security/container_scanning_spec.rb
...lib/gitlab/ci/parsers/security/container_scanning_spec.rb
+1
-1
spec/fixtures/security-reports/master/gl-container-scanning-report.json
...security-reports/master/gl-container-scanning-report.json
+18
-5
No files found.
ee/changelogs/unreleased/9251-skip_whitelisted_vulnerabilities.yml
0 → 100644
View file @
144ab22b
---
title
:
Skip whitelisted vulnerabilities in Container Scanning reports
merge_request
:
9528
author
:
type
:
fixed
ee/lib/gitlab/ci/parsers/security/container_scanning.rb
View file @
144ab22b
...
...
@@ -26,9 +26,13 @@ module Gitlab
# Transforms the Clair JSON report into the expected format
def
format_report
(
data
)
vulnerabilities
=
data
[
'vulnerabilities'
]
unapproved
=
data
[
'unapproved'
]
results
=
[]
vulnerabilities
.
each
do
|
vulnerability
|
# We only report unapproved vulnerabilities
next
unless
unapproved
.
include?
(
vulnerability
[
'vulnerability'
])
results
.
append
(
format_vulnerability
(
vulnerability
))
end
...
...
ee/spec/lib/gitlab/ci/parsers/security/container_scanning_spec.rb
View file @
144ab22b
...
...
@@ -25,7 +25,7 @@ describe Gitlab::Ci::Parsers::Security::ContainerScanning do
end
end
it
"parses all identifiers and occurrences"
do
it
"parses all identifiers and occurrences
for unapproved vulnerabilities
"
do
expect
(
report
.
occurrences
.
length
).
to
eq
(
8
)
expect
(
report
.
identifiers
.
length
).
to
eq
(
8
)
expect
(
report
.
scanners
.
length
).
to
eq
(
1
)
...
...
spec/fixtures/security-reports/master/gl-container-scanning-report.json
View file @
144ab22b
{
"image"
:
"registry.gitlab.com/groulot/container-scanning-test/master:5f21de6956aee99ddb68ae49498662d9872f50ff"
,
"unapproved"
:
[
"CVE-2017-18018"
,
"CVE-2016-2781"
,
"CVE-2017-12424"
,
"CVE-2007-5686"
,
"CVE-2013-4235"
"CVE-2017-18269"
,
"CVE-2017-16997"
,
"CVE-2018-1000001"
,
"CVE-2016-10228"
,
"CVE-2018-18520"
,
"CVE-2010-4052"
,
"CVE-2018-16869"
,
"CVE-2018-18311"
],
"vulnerabilities"
:
[
{
...
...
@@ -87,6 +90,16 @@
"link"
:
"https://security-tracker.debian.org/tracker/CVE-2018-18311"
,
"severity"
:
"Unknown"
,
"fixedby"
:
"5.24.1-3+deb9u5"
},
{
"featurename"
:
"foo"
,
"featureversion"
:
"1.3"
,
"vulnerability"
:
"CVE-2018-666"
,
"namespace"
:
"debian:9"
,
"description"
:
"Foo has a vulnerability nobody cares about and whitelist."
,
"link"
:
"https://security-tracker.debian.org/tracker/CVE-2018-666"
,
"severity"
:
"Unknown"
,
"fixedby"
:
"1.4"
}
]
}
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