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.

137 lines
3.8KB

  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. <%= rank_label @result.score.rank %>
  7. </h1>
  8. </div>
  9. <% if Time.now - @result.date >= Rails.configuration.refresh_delay %>
  10. <div class="col-sm-1">
  11. <%= link_to 'Rafraîchir', {action: :refresh}, class: %i(btn btn-default) %>
  12. </div>
  13. <% end %>
  14. </div>
  15. <br/>
  16. <div class="row">
  17. <div class="col-sm-6">
  18. <% scores = @result.score.details %>
  19. <table class="table table-bordered table-condensed table-striped">
  20. <thead>
  21. <tr>
  22. <th colspan="2">
  23. Scores
  24. <%= rank_label @result.score.rank %>
  25. </th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <%
  30. { 'Protocole' => 'protocol',
  31. 'Échange de clef' => 'key_exchange',
  32. 'Chiffrement' => 'cipher_strengths',
  33. 'Total' => 'score'}.each do |name, v| %>
  34. <tr>
  35. <th class="col-sm-4"><%= name %></th>
  36. <td class="col-sm-8"><%= score_progress scores[v] %></td>
  37. </tr>
  38. <% end %>
  39. </tbody>
  40. </table>
  41. </div>
  42. <div class="col-sm-6">
  43. <table class="table table-bordered table-condensed table-striped">
  44. <tbody>
  45. <tr>
  46. <th class="col-sm-4">Protocoles</th>
  47. <td class="col-sm-8"><%= protocol_labels @result.protocols %></td>
  48. </tr>
  49. <tr>
  50. <th>Clefs</th>
  51. <td>
  52. <p>Certificat : <%= key_label @result[:key] %></p>
  53. <p>Diffie Hellman : <%= key_labels @result.dh %></p>
  54. </td>
  55. </tr>
  56. <% { 'Bonnes pratiques' => :success,
  57. 'Alertes' => :warning,
  58. 'Dangers' => :danger,
  59. 'Erreurs' => :error }.each do |name, color|
  60. names = @result.score[color]
  61. next if names.nil? or names.empty?
  62. %>
  63. <tr>
  64. <th><%= name %></th>
  65. <td>
  66. <% names.each do |name| %>
  67. <span class="label label-<%= color %>"><%= name.upcase %></span>
  68. <% end %>
  69. </td>
  70. </tr>
  71. <% end %>
  72. </tbody>
  73. </table>
  74. </div>
  75. </div>
  76. <div class="row">
  77. <div class="col-sm-12">
  78. <table class="table table-bordered table-condensed table-striped center">
  79. <thead>
  80. <tr>
  81. <th rowspan="2">Name</th>
  82. <th colspan="2">Key exchange</th>
  83. <th colspan="2">Authentification</th>
  84. <th colspan="4">Encryption</th>
  85. <th colspan="2">MAC</th>
  86. <th rowspan="2">PFS</th>
  87. </tr>
  88. <tr>
  89. <th>Type</th>
  90. <th>Key size</th>
  91. <th>Type</th>
  92. <th>Key size</th>
  93. <th>Type</th>
  94. <th>Key size</th>
  95. <th>Block size</th>
  96. <th>Mode</th>
  97. <th>Type</th>
  98. <th>Size</th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. <% CryptCheck::Tls::Server::EXISTING_METHODS.each do |protocol|
  103. ciphers = CryptCheck::Tls::Cipher.sort(@result.ciphers.select { |c| c.protocol == protocol.to_s }
  104. .collect { |c| CryptCheck::Tls::Cipher.new protocol, [c.name, nil, c[:size]], c.dh, @result[:key] })
  105. unless ciphers.empty? %>
  106. <tr>
  107. <th colspan="12"><%= protocol_label protocol %></th>
  108. </tr>
  109. <% ciphers.each do |cipher|
  110. params = cipher.params
  111. kex = params[:kex]
  112. auth = params[:auth]
  113. enc = params[:enc]
  114. mac = params[:mac]
  115. pfs = params[:pfs]
  116. %>
  117. <tr>
  118. <th><%= cipher_name_label cipher %></th>
  119. <%= cipher_kex_type_cell kex&.first %>
  120. <%= cipher_kex_size_cell kex&.last %>
  121. <%= cipher_auth_type_cell auth&.first %>
  122. <%= cipher_auth_size_cell auth&.last %>
  123. <%= cipher_enc_type_cell enc&.first %>
  124. <%= cipher_enc_key_size_cell enc&.[] 1 %>
  125. <%= cipher_enc_block_size_cell enc&.[] 2 %>
  126. <%= cipher_enc_mode_cell enc&.last %>
  127. <%= cipher_mac_type_cell mac&.first %>
  128. <%= cipher_mac_size_cell mac&.last %>
  129. <%= cipher_pfs_cell pfs %>
  130. </tr>
  131. <% end end end %>
  132. </tbody>
  133. </table>
  134. </div>
  135. </div>
  136. </div>