|
|
|
@ -6,151 +6,86 @@ |
|
|
|
|
</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> |
|
|
|
|
<div class="col-sm-1"> |
|
|
|
|
<%= link_to t('Refresh'), { action: :refresh }, class: %i(btn btn-default) %> |
|
|
|
|
</div> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
<% |
|
|
|
|
@result.hosts.each do |host| |
|
|
|
|
if host.error |
|
|
|
|
error, host = host.error, host.host |
|
|
|
|
%> |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-sm-12"> |
|
|
|
|
<h2><%= host.name %> - <%= host.ip %> : <%= host.port %></h2> |
|
|
|
|
<%= t 'Error during analysis:' %> |
|
|
|
|
<span class="label label-error"><%= error %></span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<% |
|
|
|
|
else |
|
|
|
|
host, grade, handshake = host.host, host.grade, host.handshake |
|
|
|
|
%> |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-sm-12"> |
|
|
|
|
<h2><%= host.name %> - <%= host.ip %> : <%= host.port %></h2> |
|
|
|
|
|
|
|
|
|
<% @result.hosts.each do |host| %> |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-sm-12"> |
|
|
|
|
<h2> |
|
|
|
|
<%= rank_label host.grade %> |
|
|
|
|
<%= host.ip %> : <%= host.port %> |
|
|
|
|
<span class="small">(<%= host.hostname %>)</span></h2> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-sm-6"> |
|
|
|
|
<table class="table table-bordered table-condensed table-striped"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th colspan="2"> |
|
|
|
|
Scores |
|
|
|
|
<%= rank_label grade.rank %> |
|
|
|
|
</th> |
|
|
|
|
</tr> |
|
|
|
|
</thead> |
|
|
|
|
<tbody> |
|
|
|
|
<% |
|
|
|
|
{ 'Protocol' => 'protocol', |
|
|
|
|
'Key exchange' => 'key_exchange', |
|
|
|
|
'Cipher' => 'cipher_strengths', |
|
|
|
|
'Overall' => 'score'}.each do |name, v| %> |
|
|
|
|
<tr> |
|
|
|
|
<th class="col-sm-4"><%= t name %></th> |
|
|
|
|
<td class="col-sm-8"><%= score_progress grade.details[v] %></td> |
|
|
|
|
</tr> |
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-sm-12"> |
|
|
|
|
<h3><%= t 'Checks' %></h3> |
|
|
|
|
<table class="table table-bordered table-condensed table-striped"> |
|
|
|
|
<thead> |
|
|
|
|
<th><%= t 'Severity' %></th> |
|
|
|
|
<td></td> |
|
|
|
|
</thead> |
|
|
|
|
<tbody> |
|
|
|
|
<% ::CryptCheck::State.each do |level| %> |
|
|
|
|
<tr> |
|
|
|
|
<th><%= label level, "state-#{level}" %></th> |
|
|
|
|
<td><%= labels level, host.states[level] %></td> |
|
|
|
|
</tr> |
|
|
|
|
<% end %> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="col-sm-6"> |
|
|
|
|
<table class="table table-bordered table-condensed table-striped"> |
|
|
|
|
<tbody> |
|
|
|
|
<tr> |
|
|
|
|
<th class="col-sm-4"><%= t 'Protocols' %></th> |
|
|
|
|
<td class="col-sm-8"><%= protocol_labels handshake.protocols %></td> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<th><%= t 'Keys' %></th> |
|
|
|
|
<td> |
|
|
|
|
<p><%= t 'Certificates:' %> <%= key_label handshake[:key] %></p> |
|
|
|
|
<p>Diffie Hellman : <%= key_labels handshake.dh %></p> |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
<% { 'Good practices' => :success, |
|
|
|
|
'Warning' => :warning, |
|
|
|
|
'Critical' => :danger, |
|
|
|
|
'Fatal' => :error }.each do |name, color| |
|
|
|
|
names = grade[color] |
|
|
|
|
next if names.nil? or names.empty? |
|
|
|
|
%> |
|
|
|
|
<tr> |
|
|
|
|
<th><%= t name %></th> |
|
|
|
|
<td> |
|
|
|
|
<% names.each do |name| %> |
|
|
|
|
<span class="label label-<%= color %>"><%= name.upcase %></span> |
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-sm-12"> |
|
|
|
|
<h3><%= t 'Certificates' %></h3> |
|
|
|
|
<table class="table table-bordered table-condensed table-striped"> |
|
|
|
|
<thead> |
|
|
|
|
<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> |
|
|
|
|
<% host.handshakes.certs.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> |
|
|
|
|
<td><%= states cert.states %></td> |
|
|
|
|
</tr> |
|
|
|
|
<% 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 %> |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
<% end %> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
<% end %> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
</div> |
|
|
|
|
</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> |
|
|
|
|
<% CryptCheck::Tls::Server::EXISTING_METHODS.each do |protocol| |
|
|
|
|
ciphers = CryptCheck::Tls::Cipher.sort(handshake.ciphers.select { |c| c.protocol == protocol.to_s } |
|
|
|
|
.collect { |c| CryptCheck::Tls::Cipher.new protocol, [c.name, nil, c[:size]], c.dh, handshake[:key] }) |
|
|
|
|
unless ciphers.empty? %> |
|
|
|
|
<tr> |
|
|
|
|
<th colspan="12"><%= protocol_label protocol %></th> |
|
|
|
|
</tr> |
|
|
|
|
<% ciphers.each do |cipher| |
|
|
|
|
params = cipher.params |
|
|
|
|
kex = params[:kex] |
|
|
|
|
auth = params[:auth] |
|
|
|
|
enc = params[:enc] |
|
|
|
|
mac = params[:mac] |
|
|
|
|
pfs = params[:pfs] |
|
|
|
|
%> |
|
|
|
|
<tr> |
|
|
|
|
<th><%= cipher_name_label cipher %></th> |
|
|
|
|
<%= cipher_kex_type_cell kex&.first %> |
|
|
|
|
<%= cipher_kex_size_cell kex&.last %> |
|
|
|
|
<%= cipher_auth_type_cell auth&.first %> |
|
|
|
|
<%= cipher_auth_size_cell auth&.last %> |
|
|
|
|
<%= cipher_enc_type_cell enc&.first %> |
|
|
|
|
<%= cipher_enc_key_size_cell enc&.[] 1 %> |
|
|
|
|
<%= cipher_enc_block_size_cell enc&.[] 2 %> |
|
|
|
|
<%= cipher_enc_mode_cell enc&.last %> |
|
|
|
|
<%= cipher_mac_type_cell mac&.first %> |
|
|
|
|
<%= cipher_mac_size_cell mac&.last %> |
|
|
|
|
<%= cipher_pfs_cell pfs %> |
|
|
|
|
</tr> |
|
|
|
|
<% end end end %> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<% end |
|
|
|
|
end %> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|