Commit c4b497a2 authored by Alan (Maciej) Paruszewski's avatar Alan (Maciej) Paruszewski Committed by Ash McKenzie

Remove safe navigation operator from Vulnerability description

parent 23e63699
...@@ -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