Skip to content
代码片段 群组 项目
提交 752d9a59 编辑于 作者: Brian Williams's avatar Brian Williams 提交者: Mehmet Emin INAC
浏览文件

Correctly deduplicate vulnerabilities with 8 digit image tags

Exclude 8-digit numbers from the location fingerprint when performing
vulnerability deduplication. This means that when two different images
are tagged with short hashes such as my-image:62011677 and
my-image:e2e32c98, these will be grouped in the vulnerability report
instead of being displayed as separate line items. It's still ambiguous
as to whether 62011677 is a hash or a number, but since version numbers
rarely become that large this is the quickest way to fix the case where
we have a short-ref tagging scheme.

Changelog: fixed
EE: true
上级 a1958ada
No related branches found
No related tags found
无相关合并请求
...@@ -51,13 +51,9 @@ def prepare_image_name ...@@ -51,13 +51,9 @@ def prepare_image_name
end end
def version_semver_like?(version) def version_semver_like?(version)
hash_like = /\A[0-9a-f]{32,128}\z/i hash_like = /\A[0-9a-f]{8,128}\z/i
if Gem::Version.correct?(version) Gem::Version.correct?(version) && !hash_like.match?(version)
!hash_like.match?(version)
else
false
end
end end
end end
end end
......
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
false, false,
'registry.gitlab.com/group/project/tmp:glibc' 'registry.gitlab.com/group/project/tmp:glibc'
], ],
[
'registry.gitlab.com/group/project/tmp:38960416',
nil,
false,
'registry.gitlab.com/group/project/tmp:glibc'
],
[ [
'registry.gitlab.com/group/project/feature:5b1a4a921d7a50c3757aae3f7df2221878775af4', 'registry.gitlab.com/group/project/feature:5b1a4a921d7a50c3757aae3f7df2221878775af4',
'registry.gitlab.com/group/project/master:ec301f43f14a2b477806875e49cfc4d3fa0d22c3', 'registry.gitlab.com/group/project/master:ec301f43f14a2b477806875e49cfc4d3fa0d22c3',
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册