Commit 1d54afb2 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '282413-remove-safe-operator-from-issue-description' into 'master'

Remove safe navigation operator from Vulnerability description

See merge request gitlab-org/gitlab!47768
parents 4ea8b7b0 c4b497a2
...@@ -36,6 +36,14 @@ class VulnerabilityPresenter < Gitlab::View::Presenter::Delegated ...@@ -36,6 +36,14 @@ class VulnerabilityPresenter < Gitlab::View::Presenter::Delegated
add_line_numbers(path, finding.location['start_line'], finding.location['end_line']) add_line_numbers(path, finding.location['start_line'], finding.location['end_line'])
end end
def scanner
finding.scanner || {}
end
def scan
finding.scan || {}
end
private private
def root_url def root_url
......
...@@ -61,22 +61,22 @@ ...@@ -61,22 +61,22 @@
<% end %> <% end %>
<% end %> <% end %>
<% if vulnerability.try(:scan).present? && vulnerability.try(:scanner).present? %> <% if vulnerability.scanner.present? || vulnerability.scan.present? %>
### <%= _("Scanner") %>: ### <%= _("Scanner") %>:
<% if vulnerability&.scanner[:name].present? %> <% if vulnerability.scanner.present? %>
* <%= _("Name") %>: <%= vulnerability.scanner[:name] %> * <%= _("Name") %>: <%= vulnerability.scanner[:name] %>
<% end %> <% end %>
<% if vulnerability&.scan[:type].present? %> <% if vulnerability.scan[:type].present? %>
* <%= _("Type") %>: <%= vulnerability.scan[:type] %> * <%= _("Type") %>: <%= vulnerability.scan[:type] %>
<% end %> <% end %>
<% if vulnerability&.scan[:status].present? %> <% if vulnerability.scan[:status].present? %>
* <%= _("Status") %>: <%= vulnerability.scan[:status] %> * <%= _("Status") %>: <%= vulnerability.scan[:status] %>
<% end %> <% end %>
<% if vulnerability&.scan[:start_time].present? %> <% if vulnerability.scan[:start_time].present? %>
* <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %> * <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %>
<% end %> <% end %>
<% if vulnerability&.scan[:end_time].present? %> <% if vulnerability.scan[:end_time].present? %>
* <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %> * <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %>
<% end %> <% end %>
<% end %> <% end %>
...@@ -52,22 +52,22 @@ h3. <%= _("Links") %>: ...@@ -52,22 +52,22 @@ h3. <%= _("Links") %>:
<%= _("See vulnerability %{vulnerability_link} for any Remediation details.".html_safe) % { vulnerability_link: "[#{vulnerability.id}|#{vulnerability_url(vulnerability)}]" } %> <%= _("See vulnerability %{vulnerability_link} for any Remediation details.".html_safe) % { vulnerability_link: "[#{vulnerability.id}|#{vulnerability_url(vulnerability)}]" } %>
<% end %> <% end %>
<% if vulnerability.try(:scan).present? && vulnerability.try(:scanner).present? %> <% if vulnerability.scanner.present? || vulnerability.scan.present? %>
h3. <%= _("Scanner") %>: h3. <%= _("Scanner") %>:
<% if vulnerability&.scanner[:name].present? %> <% if vulnerability.scanner.present? %>
* <%= _("Name") %>: <%= vulnerability.scanner[:name] %> * <%= _("Name") %>: <%= vulnerability.scanner[:name] %>
<% end %> <% end %>
<% if vulnerability&.scan[:type].present? %> <% if vulnerability.scan[:type].present? %>
* <%= _("Type") %>: <%= vulnerability.scan[:type] %> * <%= _("Type") %>: <%= vulnerability.scan[:type] %>
<% end %> <% end %>
<% if vulnerability&.scan[:status].present? %> <% if vulnerability.scan[:status].present? %>
* <%= _("Status") %>: <%= vulnerability.scan[:status] %> * <%= _("Status") %>: <%= vulnerability.scan[:status] %>
<% end %> <% end %>
<% if vulnerability&.scan[:start_time].present? %> <% if vulnerability.scan[:start_time].present? %>
* <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %> * <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %>
<% end %> <% end %>
<% if vulnerability&.scan[:end_time].present? %> <% if vulnerability.scan[:end_time].present? %>
* <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %> * <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %>
<% end %> <% end %>
<% end %> <% end %>
...@@ -181,6 +181,9 @@ RSpec.describe VulnerabilitiesHelper do ...@@ -181,6 +181,9 @@ RSpec.describe VulnerabilitiesHelper do
* [Cipher does not check for integrity first?|https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first] * [Cipher does not check for integrity first?|https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first]
h3. Scanner:
* Name: Find Security Bugs
JIRA JIRA
end end
......
...@@ -118,6 +118,11 @@ RSpec.describe Issues::CreateFromVulnerabilityService, '#execute' do ...@@ -118,6 +118,11 @@ RSpec.describe Issues::CreateFromVulnerabilityService, '#execute' do
### Links: ### Links:
* [Cipher does not check for integrity first?](https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first) * [Cipher does not check for integrity first?](https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first)
### Scanner:
* Name: Find Security Bugs
DESC DESC
end end
......
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