You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
4.9 KiB

7 years ago
<div class="container">
<div class="row">
<div class="col-sm-11">
<h1>
7 years ago
[<%= self.type.to_s.upcase %>] <%= @host %> <span class="small">(<%= l @result.date %>)</span>
7 years ago
</h1>
</div>
<% if Time.now - @result.date >= Rails.configuration.refresh_delay %>
<div class="col-sm-1">
<%= link_to t('Refresh'), { action: :refresh }, class: %i(btn btn-default) %>
</div>
7 years ago
<% end %>
</div>
5 years ago
<% @result.result.each do |host| %>
<div class="row">
<div class="col-sm-12">
<h2>
5 years ago
<%= rank_label host[:grade] %>
<%= host[:ip] %> : <%= host[:port] %>
<span class="small">(<%= host[:hostname] %>)</span></h2>
</div>
</div>
<div class="row">
<div class="col-sm-12">
5 years ago
<% ::CryptCheck::State.each do |level|
host[:states][level].each do |state, value|
next unless value
%>
<div class="alert alert-<%= level %>"><%= t "alert.#{level}.#{state}" %></div>
<% end
end %>
<!--
<h3><%= t 'Checks' %></h3>
<table class="table table-bordered table-condensed table-striped">
<thead>
<th><%= t 'Severity' %></th>
5 years ago
<td>
<%= t 'Checks' %>
(
<%= label 'OK', :success, false %>
<%= label 'KO', :danger, false %>
<%= label 'N/A', :default, false %>
)
</td>
</thead>
<tbody>
<% ::CryptCheck::State.each do |level| %>
<tr>
5 years ago
<th><%= label level, "state-#{level}", false %></th>
<td><%= labels level, host[:states][level], false %></td>
</tr>
7 years ago
<% end %>
</tbody>
</table>
5 years ago
-->
</div>
7 years ago
</div>
5 years ago
<!--div class="row">
<div class="col-sm-12">
<h3><%= t 'Certificates' %></h3>
<table class="table table-bordered table-condensed table-striped">
<thead>
5 years ago
<tr>
<th>
<%= t 'Subject' %>
<span class="small">[<%= t 'Serial' %>]</span>
<div class="small"><%= t 'Fingerprint' %></div>
</th>
<td><%= t 'Issuer' %></td>
<td><%= t 'Not before' %></td>
<td><%= t 'Not after' %></td>
<th></th>
</tr>
</thead>
<tbody>
5 years ago
<% host[:handshakes][:certs].each do |cert| %>
<tr>
<th>
5 years ago
<%= cert[:subject] %> [<%= cert[:serial] %>]
<div class="small"><%= cert[:fingerprint] %></div>
</th>
5 years ago
<td><%= cert[:issuer] %></td>
<td><%= l cert[:lifetime][:not_before] %></td>
<td><%= l cert[:lifetime][:not_after] %></td>
<td><%= states cert[:states] %></td>
</tr>
5 years ago
<% cert[:chain].each do |cert| %>
<tr>
<th>
<%= cert[:subject] %> [<%= cert[:serial] %>]
<div class="small"><%= cert[:fingerprint] %></div>
</th>
<td><%= cert[:issuer] %></td>
<td><%= l cert[:lifetime][:not_before] %></td>
<td><%= l cert[:lifetime][:not_after] %></td>
</tr>
<% end %>
5 years ago
<% end %>
</tbody>
</table>
</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 colspan="2"><%= t 'Key exchange' %></th>
<th colspan="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 'Type' %></th>
<th><%= t 'Key size' %></th>
<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, [])
.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><%= cipher_name_label cipher %></th>
<%= cipher_kex_type_cell kex %>
<th/>
<%#= cipher_kex_size_cell kex&.last %>
<%= cipher_auth_type_cell auth %>
<th/>
<%#= cipher_auth_size_cell auth&.last %>
<%= 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>
7 years ago
</div>
<% end %>
7 years ago
</div>