Browse Source

Report analysis error

master
aeris 1 month ago
parent
commit
8ce7f2abfc
1 changed files with 71 additions and 57 deletions
  1. +71
    -57
      app/views/check/show.html.erb

+ 71
- 57
app/views/check/show.html.erb View File

@@ -2,7 +2,8 @@
<div class="row">
<div class="col-sm-11">
<h1>
[<%= self.type.to_s.upcase %>] <%= @host %> <span class="small">(<%= l @analysis.updated_at %>)</span>
[<%= self.type.to_s.upcase %>] <%= @host %>
<span class="small">(<%= l @analysis.updated_at %>)</span>
</h1>
</div>
<% if Time.now - @analysis.updated_at >= Rails.configuration.refresh_delay %>
@@ -12,71 +13,84 @@
<% end %>
</div>

<% @result.each do |host| %>
<% @result.each do |host|
if host.error %>
<div class="row">
<div class="col-sm-12">
<h2>
<%= rank_label host[:grade].to_sym %>
<%= rank_label :X %>
<%= host[:ip] %> : <%= host[:port] %>
<span class="small">(<%= host[:hostname] %>)</span></h2>
<span class="small">(<%= host[:hostname] %>)</span>
</h2>
<%= t 'Error during analysis:' %>
<span class="label label-error"><%= host.error %></span>
</div>
</div>
<% next; end %>
<div class="row">
<div class="col-sm-12">
<h2>
<%= rank_label host[:grade].to_sym %>
<%= host[:ip] %> : <%= host[:port] %>
<span class="small">(<%= host[:hostname] %>)</span></h2>
</div>
</div>

<div class="row">
<div class="col-sm-12">
<table class="table table-bordered table-condensed table-striped center">
<thead>
<tr>
<th rowspan="2"><%= t 'Name' %></th>
<th rowspan="2"><%= t 'Key exchange' %></th>
<th rowspan="2"><%= t 'Authentication' %></th>
<th colspan="4"><%= t 'Encryption' %></th>
<th colspan="2"><%= t 'MAC' %></th>
<th rowspan="2"><%= t 'PFS' %></th>
</tr>
<tr>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Block size' %></th>
<th><%= t 'Mode' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Size' %></th>
</tr>
</thead>
<tbody>
<%
handshakes = host[:handshakes]
all_ciphers = handshakes[:ciphers].group_by { |c| c[:protocol] }
CryptCheck::Tls::Method.each do |protocol|
ciphers = all_ciphers.fetch(protocol.to_sym.to_s, [])
.collect { |c| CryptCheck::Tls::Cipher.new protocol, c[:name] }.sort
unless ciphers.empty? %>
<div class="row">
<div class="col-sm-12">
<table class="table table-bordered table-condensed table-striped center">
<thead>
<tr>
<th rowspan="2"><%= t 'Name' %></th>
<th rowspan="2"><%= t 'Key exchange' %></th>
<th rowspan="2"><%= t 'Authentication' %></th>
<th colspan="4"><%= t 'Encryption' %></th>
<th colspan="2"><%= t 'MAC' %></th>
<th rowspan="2"><%= t 'PFS' %></th>
</tr>
<tr>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Block size' %></th>
<th><%= t 'Mode' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Size' %></th>
</tr>
</thead>
<tbody>
<%
handshakes = host[:handshakes]
all_ciphers = handshakes[:ciphers].group_by { |c| c[:protocol] }
CryptCheck::Tls::Method.each do |protocol|
ciphers = all_ciphers.fetch(protocol.to_sym.to_s, [])
.collect { |c| CryptCheck::Tls::Cipher.new protocol, c[:name] }.sort
unless ciphers.empty? %>
<tr>
<th colspan="12"><%= protocol_label protocol %></th>
</tr>
<% ciphers.each do |cipher|
kex = cipher.kex
auth = cipher.auth
enc = cipher.encryption
mac = cipher.hmac
pfs = cipher.pfs?
%>
<tr>
<th colspan="12"><%= protocol_label protocol %></th>
<th><%= cipher_name_label cipher %></th>
<%= cipher_kex_type_cell kex %>
<%= cipher_auth_type_cell auth %>
<%= cipher_enc_type_cell enc[0] %>
<%= cipher_enc_key_size_cell enc[1] %>
<%= cipher_enc_block_size_cell enc[2] %>
<%= cipher_enc_mode_cell enc[3] %>
<%= cipher_mac_type_cell mac[0] %>
<%= cipher_mac_size_cell mac[1] %>
<%= cipher_pfs_cell pfs %>
</tr>
<% ciphers.each do |cipher|
kex = cipher.kex
auth = cipher.auth
enc = cipher.encryption
mac = cipher.hmac
pfs = cipher.pfs?
%>
<tr>
<th><%= cipher_name_label cipher %></th>
<%= cipher_kex_type_cell kex %>
<%= cipher_auth_type_cell auth %>
<%= cipher_enc_type_cell enc[0] %>
<%= cipher_enc_key_size_cell enc[1] %>
<%= cipher_enc_block_size_cell enc[2] %>
<%= cipher_enc_mode_cell enc[3] %>
<%= cipher_mac_type_cell mac[0] %>
<%= cipher_mac_size_cell mac[1] %>
<%= cipher_pfs_cell pfs %>
</tr>
<% end end end %>
</tbody>
</table>
</div>
<% end end end %>
</tbody>
</table>
</div>
</div>
<% end %>
</div>

Loading…
Cancel
Save