Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

show.html.erb 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <div class="container">
  2. <div class="row">
  3. <div class="col-sm-11">
  4. <h1>
  5. [<%= self.type.to_s.upcase %>] <%= @host %> <span class="small">(<%= l @result.date %>)</span>
  6. </h1>
  7. </div>
  8. <% if Time.now - @result.date >= Rails.configuration.refresh_delay %>
  9. <div class="col-sm-1">
  10. <%= link_to t('Refresh'), { action: :refresh }, class: %i(btn btn-default) %>
  11. </div>
  12. <% end %>
  13. </div>
  14. <% @result.result.each do |host| %>
  15. <div class="row">
  16. <div class="col-sm-12">
  17. <h2>
  18. <%= rank_label host[:grade] %>
  19. <%= host[:ip] %> : <%= host[:port] %>
  20. <span class="small">(<%= host[:hostname] %>)</span></h2>
  21. </div>
  22. </div>
  23. <div class="row">
  24. <div class="col-sm-12">
  25. <% ::CryptCheck::State.each do |level|
  26. host[:states][level].each do |state, value|
  27. next unless value
  28. %>
  29. <div class="alert alert-<%= level %>"><%= t "alert.#{level}.#{state}" %></div>
  30. <% end
  31. end %>
  32. <!--
  33. <h3><%= t 'Checks' %></h3>
  34. <table class="table table-bordered table-condensed table-striped">
  35. <thead>
  36. <th><%= t 'Severity' %></th>
  37. <td>
  38. <%= t 'Checks' %>
  39. (
  40. <%= label 'OK', :success, false %>
  41. <%= label 'KO', :danger, false %>
  42. <%= label 'N/A', :default, false %>
  43. )
  44. </td>
  45. </thead>
  46. <tbody>
  47. <% ::CryptCheck::State.each do |level| %>
  48. <tr>
  49. <th><%= label level, "state-#{level}", false %></th>
  50. <td><%= labels level, host[:states][level], false %></td>
  51. </tr>
  52. <% end %>
  53. </tbody>
  54. </table>
  55. -->
  56. </div>
  57. </div>
  58. <!--div class="row">
  59. <div class="col-sm-12">
  60. <h3><%= t 'Certificates' %></h3>
  61. <table class="table table-bordered table-condensed table-striped">
  62. <thead>
  63. <tr>
  64. <th>
  65. <%= t 'Subject' %>
  66. <span class="small">[<%= t 'Serial' %>]</span>
  67. <div class="small"><%= t 'Fingerprint' %></div>
  68. </th>
  69. <td><%= t 'Issuer' %></td>
  70. <td><%= t 'Not before' %></td>
  71. <td><%= t 'Not after' %></td>
  72. <th></th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. <% host[:handshakes][:certs].each do |cert| %>
  77. <tr>
  78. <th>
  79. <%= cert[:subject] %> [<%= cert[:serial] %>]
  80. <div class="small"><%= cert[:fingerprint] %></div>
  81. </th>
  82. <td><%= cert[:issuer] %></td>
  83. <td><%= l cert[:lifetime][:not_before] %></td>
  84. <td><%= l cert[:lifetime][:not_after] %></td>
  85. <td><%= states cert[:states] %></td>
  86. </tr>
  87. <% cert[:chain].each do |cert| %>
  88. <tr>
  89. <th>
  90. <%= cert[:subject] %> [<%= cert[:serial] %>]
  91. <div class="small"><%= cert[:fingerprint] %></div>
  92. </th>
  93. <td><%= cert[:issuer] %></td>
  94. <td><%= l cert[:lifetime][:not_before] %></td>
  95. <td><%= l cert[:lifetime][:not_after] %></td>
  96. </tr>
  97. <% end %>
  98. <% end %>
  99. </tbody>
  100. </table>
  101. </div>
  102. </div-->
  103. <div class="row">
  104. <div class="col-sm-12">
  105. <table class="table table-bordered table-condensed table-striped center">
  106. <thead>
  107. <tr>
  108. <th rowspan="2"><%= t 'Name' %></th>
  109. <th rowspan="2"><%= t 'Key exchange' %></th>
  110. <th rowspan="2"><%= t 'Authentication' %></th>
  111. <th colspan="4"><%= t 'Encryption' %></th>
  112. <th colspan="2"><%= t 'MAC' %></th>
  113. <th rowspan="2"><%= t 'PFS' %></th>
  114. </tr>
  115. <tr>
  116. <th><%= t 'Type' %></th>
  117. <th><%= t 'Key size' %></th>
  118. <th><%= t 'Block size' %></th>
  119. <th><%= t 'Mode' %></th>
  120. <th><%= t 'Type' %></th>
  121. <th><%= t 'Size' %></th>
  122. </tr>
  123. </thead>
  124. <tbody>
  125. <%
  126. handshakes = host[:handshakes]
  127. all_ciphers = handshakes[:ciphers].group_by { |c| c[:protocol] }
  128. CryptCheck::Tls::Method.each do |protocol|
  129. ciphers = all_ciphers.fetch(protocol, [])
  130. .collect { |c| CryptCheck::Tls::Cipher.new protocol, c[:name] }.sort
  131. unless ciphers.empty? %>
  132. <tr>
  133. <th colspan="12"><%= protocol_label protocol %></th>
  134. </tr>
  135. <% ciphers.each do |cipher|
  136. kex = cipher.kex
  137. auth = cipher.auth
  138. enc = cipher.encryption
  139. mac = cipher.hmac
  140. pfs = cipher.pfs?
  141. %>
  142. <tr>
  143. <th><%= cipher_name_label cipher %></th>
  144. <%= cipher_kex_type_cell kex %>
  145. <%= cipher_auth_type_cell auth %>
  146. <%= cipher_enc_type_cell enc[0] %>
  147. <%= cipher_enc_key_size_cell enc[1] %>
  148. <%= cipher_enc_block_size_cell enc[2] %>
  149. <%= cipher_enc_mode_cell enc[3] %>
  150. <%= cipher_mac_type_cell mac[0] %>
  151. <%= cipher_mac_size_cell mac[1] %>
  152. <%= cipher_pfs_cell pfs %>
  153. </tr>
  154. <% end end end %>
  155. </tbody>
  156. </table>
  157. </div>
  158. </div>
  159. <% end %>
  160. </div>