|
|
|
@ -12,77 +12,158 @@ |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<% @result.hosts.each do |host| %> |
|
|
|
|
<% @result.result.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> |
|
|
|
|
<%= 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"> |
|
|
|
|
<% ::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> |
|
|
|
|
<td></td> |
|
|
|
|
<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> |
|
|
|
|
<th><%= label level, "state-#{level}" %></th> |
|
|
|
|
<td><%= labels level, host.states[level] %></td> |
|
|
|
|
<th><%= label level, "state-#{level}", false %></th> |
|
|
|
|
<td><%= labels level, host[:states][level], false %></td> |
|
|
|
|
</tr> |
|
|
|
|
<% end %> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
--> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
|
<!--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> |
|
|
|
|
<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| %> |
|
|
|
|
<% host[:handshakes][:certs].each do |cert| %> |
|
|
|
|
<tr> |
|
|
|
|
<th> |
|
|
|
|
<%= cert.subject %> [<%= cert.serial %>] |
|
|
|
|
<div class="small"><%= cert.fingerprint %></div> |
|
|
|
|
<%= 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> |
|
|
|
|
<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 %> |
|
|
|
|
<% 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 %> |
|
|
|
|
<% 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> |
|
|
|
|