diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-26 03:09:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-26 03:09:31 +0300 |
commit | b3618e799d30ae6df5c55e47b8ec8ebedb1af5a0 (patch) | |
tree | f2e68cff99dfa77096177caf86f7ac11e6793fd4 /lib/gitlab/ci/parsers | |
parent | 52f765baf4931efd40d10b1eb5f2818923ddf26f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/parsers')
-rw-r--r-- | lib/gitlab/ci/parsers/security/common.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/ci/parsers/security/common.rb b/lib/gitlab/ci/parsers/security/common.rb index 41acb4d5040..1cf4f252ab9 100644 --- a/lib/gitlab/ci/parsers/security/common.rb +++ b/lib/gitlab/ci/parsers/security/common.rb @@ -86,6 +86,7 @@ module Gitlab def create_finding(data, remediations = []) identifiers = create_identifiers(data['identifiers']) + flags = create_flags(data['flags']) links = create_links(data['links']) location = create_location(data['location'] || {}) signatures = create_signatures(tracking_data(data)) @@ -111,6 +112,7 @@ module Gitlab scanner: create_scanner(data['scanner']), scan: report&.scan, identifiers: identifiers, + flags: flags, links: links, remediations: remediations, raw_metadata: data.to_json, @@ -205,6 +207,18 @@ module Gitlab url: identifier['url'])) end + def create_flags(flags) + return [] unless flags.is_a?(Array) + + flags.map { |flag| create_flag(flag) }.compact + end + + def create_flag(flag) + return unless flag.is_a?(Hash) + + ::Gitlab::Ci::Reports::Security::Flag.new(type: flag['type'], origin: flag['origin'], description: flag['description']) + end + def create_links(links) return [] unless links.is_a?(Array) |