Commit 60aae797 authored by can eldem's avatar can eldem

Use scan information in issue template

parent ccb66e2f
...@@ -60,3 +60,23 @@ ...@@ -60,3 +60,23 @@
</details> </details>
<% end %> <% end %>
<% end %> <% end %>
<% if vulnerability.try(:scan).present? && vulnerability.try(:scanner).present? %>
### <%= _("Scanner") %>:
<% if vulnerability&.scanner[:name].present? %>
* <%= _("Name") %>: <%= vulnerability.scanner[:name] %>
<% end %>
<% if vulnerability&.scan[:type].present? %>
* <%= _("Type") %>: <%= vulnerability.scan[:type] %>
<% end %>
<% if vulnerability&.scan[:status].present? %>
* <%= _("Status") %>: <%= vulnerability.scan[:status] %>
<% end %>
<% if vulnerability&.scan[:start_time].present? %>
* <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %>
<% end %>
<% if vulnerability&.scan[:end_time].present? %>
* <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %>
<% end %>
<% end %>
---
title: Include additional information related from scan in issue template
merge_request: 44620
author:
type: added
...@@ -21,7 +21,7 @@ RSpec.describe Gitlab::Vulnerabilities::BaseVulnerability do ...@@ -21,7 +21,7 @@ RSpec.describe Gitlab::Vulnerabilities::BaseVulnerability do
location: { file: 'main.rb', start_line: 14, blob_path: '/bar/foo/main.rb#14' }, location: { file: 'main.rb', start_line: 14, blob_path: '/bar/foo/main.rb#14' },
solution: 'upgrade dependencies', solution: 'upgrade dependencies',
scanner: { external_id: 'gemnasium', name: 'Gemnasium' }, scanner: { external_id: 'gemnasium', name: 'Gemnasium' },
scan: { external_id: 'gemnasium', name: 'Gemnasium' } scan: { type: 'dependency_scanning', status: 'success', start_time: 'placeholder', end_time: 'placeholder' }
} }
end end
......
...@@ -86,7 +86,9 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do ...@@ -86,7 +86,9 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
url: 'https;//example.com/blog-post' url: 'https;//example.com/blog-post'
}, { }, {
url: 'https://example.com/another-link' url: 'https://example.com/another-link'
}] }],
scanner: { external_id: 'gemnasium', name: 'Gemnasium' },
scan: { type: 'dependency_scanning', status: 'success', start_time: 'placeholder', end_time: 'placeholder' }
} }
end end
...@@ -115,6 +117,15 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do ...@@ -115,6 +117,15 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
* [Awesome-security blog post](https;//example.com/blog-post) * [Awesome-security blog post](https;//example.com/blog-post)
* https://example.com/another-link * https://example.com/another-link
### Scanner:
* Name: Gemnasium
* Type: dependency_scanning
* Status: success
* Start Time: placeholder
* End Time: placeholder
DESC DESC
end end
...@@ -132,7 +143,9 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do ...@@ -132,7 +143,9 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
line: '15', line: '15',
cve: '818bf5dacb291e15d9e6dc3c5ac32178:PREDICTABLE_RANDOM', cve: '818bf5dacb291e15d9e6dc3c5ac32178:PREDICTABLE_RANDOM',
title: 'Predictable pseudorandom number generator', title: 'Predictable pseudorandom number generator',
tool: 'find_sec_bugs' tool: 'find_sec_bugs',
scanner: { external_id: 'gemnasium', name: 'Gemnasium' },
scan: { type: 'dependency_scanning', status: 'success', start_time: 'placeholder', end_time: 'placeholder' }
} }
end end
...@@ -150,6 +163,17 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do ...@@ -150,6 +163,17 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
### Solution: ### Solution:
Please do something! Please do something!
### Scanner:
* Name: Gemnasium
* Type: dependency_scanning
* Status: success
* Start Time: placeholder
* End Time: placeholder
DESC DESC
end end
......
...@@ -9808,6 +9808,9 @@ msgstr "" ...@@ -9808,6 +9808,9 @@ msgstr ""
msgid "Encountered an error while rendering: %{err}" msgid "Encountered an error while rendering: %{err}"
msgstr "" msgstr ""
msgid "End Time"
msgstr ""
msgid "Ends at (UTC)" msgid "Ends at (UTC)"
msgstr "" msgstr ""
...@@ -22554,6 +22557,9 @@ msgstr "" ...@@ -22554,6 +22557,9 @@ msgstr ""
msgid "Saving project." msgid "Saving project."
msgstr "" msgstr ""
msgid "Scanner"
msgstr ""
msgid "Schedule a new pipeline" msgid "Schedule a new pipeline"
msgstr "" msgstr ""
...@@ -24643,6 +24649,9 @@ msgstr "" ...@@ -24643,6 +24649,9 @@ msgstr ""
msgid "Start Date" msgid "Start Date"
msgstr "" msgstr ""
msgid "Start Time"
msgstr ""
msgid "Start Web Terminal" msgid "Start Web Terminal"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment