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.

https.erb 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>SSL/TLS &mdash; HTTP</title>
  8. <link rel="stylesheet" href="bootstrap.min.css">
  9. <style>
  10. body {
  11. margin-top: 10px;
  12. }
  13. td {
  14. text-align: center;
  15. }
  16. .critical {
  17. background-color: #000;
  18. color: #fff;
  19. }
  20. tr:hover > td.critical, td:hover.critical {
  21. background-color: #333 !important;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <div class="container-fluid">
  27. <div class="row">
  28. <div class="col-md-12">
  29. <table class="table table-bordered table-hover table-condensed">
  30. <tbody>
  31. <%
  32. first = true
  33. results.each do |r|
  34. unless first
  35. %>
  36. <tr>
  37. <th colspan="15">&nbsp;</th>
  38. </tr>
  39. <%
  40. end
  41. first = false
  42. %>
  43. <tr>
  44. <th colspan="15" id="<%= r[0] %>"><%= r[0] %></th>
  45. </tr>
  46. <tr>
  47. <th rowspan="2">Site</th>
  48. <td rowspan="2">Grade</td>
  49. <td colspan="2">Certificate</td>
  50. <td colspan="4">Protocols</td>
  51. <td colspan="5">Ciphers</td>
  52. <td colspan="2">Best practices</td>
  53. </tr>
  54. <tr>
  55. <td>Key size (bits)</td>
  56. <td class="warning">SHA1 sig</td>
  57. <td class="critical">SSL v2</td>
  58. <td class="critical">SSL v3</td>
  59. <td class="success">TLS 1.2</td>
  60. <td class="info">TLS</td>
  61. <td>Strength (bits)</td>
  62. <td class="critical">MD5</td>
  63. <td class="warning">SHA1</td>
  64. <td class="critical">DES/RC4</td>
  65. <td class="danger">3DES</td>
  66. <td class="info">PFS</td>
  67. <td class="info">HSTS</td>
  68. </tr>
  69. <% r[1].each do |n|
  70. s = n.server
  71. %>
  72. <tr>
  73. <th id="<%= s.hostname %>">
  74. <a href="#<%= s.hostname %>"><%= s.hostname %></a>
  75. </th>
  76. <% if s.is_a? Tls::TlsNotSupportedServer %>
  77. <td class="critical" colspan="16">
  78. No SSL/TLS
  79. </td>
  80. <%
  81. else
  82. rank_color = case n.grade
  83. when 'A+' then :info
  84. when 'A', 'A-' then :success
  85. when 'B', 'C' then :warning
  86. when 'T', 'M' then :critical
  87. else :danger
  88. end
  89. %>
  90. <td class="<%= rank_color %>">
  91. <%= n.grade %>
  92. </td>
  93. <td class="<%= s.key_size < 2048 ? :danger : s.key_size < 4096 ? :warning : :success %>">
  94. <% type, size = s.key %>
  95. <%= "#{size} (#{type.to_s.upcase})" %>
  96. <span class="sr-only">(<%= s.key_size < 2048 ? '☹' : '☺' %>)</span>
  97. </td>
  98. <td class="<%= s.sha1_sig? ? :warning : :success %>">
  99. <%= s.sha1_sig? ? '✓' : '✗' %>
  100. <span class="sr-only">(<%= s.sha1_sig? ? '☹' : '☺' %>)</span>
  101. </td>
  102. <td class="<%= s.sslv2? ? :critical : :success %>">
  103. <%= s.sslv2? ? '✓' : '✗' %>
  104. <span class="sr-only">(<%= s.sslv2? ? '☹' : '☺' %>)</span>
  105. </td>
  106. <td class="<%= s.sslv3? ? :critical : :success %>">
  107. <%= s.sslv3? ? '✓' : '✗' %>
  108. <span class="sr-only">(<%= s.sslv3? ? '☹' : '☺' %>)</span>
  109. </td>
  110. <td class="<%= s.tlsv1_2? ? :success : :danger %>">
  111. <%= s.tlsv1_2? ? '✓' : '✗' %>
  112. <span class="sr-only">(<%= s.tlsv1_2? ? '☺' : '☹' %>)</span>
  113. </td>
  114. <td class="<%= s.tls? ? (s.tls_only? ? :info : :success) : :danger %>">
  115. <%= s.tls? ? '✓' : '✗' %>
  116. <span class="sr-only">(<%= s.tls? ? '☺' : '☹' %>)</span>
  117. </td>
  118. <% cipher_size = s.cipher_size[:worst] %>
  119. <td class="<%= cipher_size < 112 ? :danger : cipher_size < 128 ? :warning : :success %>">
  120. <%= cipher_size %>
  121. <span class="sr-only">(<%= cipher_size < 128 ? '☹' : '☺' %>)</span>
  122. </td>
  123. <td class="<%= s.md5? ? :critical : :success %>">
  124. <%= s.md5? ? '✓' : '✗' %>
  125. <span class="sr-only">(<%= s.md5? ? '☹' : '☺' %>)</span>
  126. </td>
  127. <td class="<%= s.sha1? ? :warning : :success %>">
  128. <%= s.sha1? ? '✓' : '✗' %>
  129. <span class="sr-only">(<%= s.sha1? ? '☹' : '☺' %>)</span>
  130. </td>
  131. <td class="<%= (s.rc4? or s.des?) ? :critical : :success %>">
  132. <%= (s.rc4? or s.des?) ? '✓' : '✗' %>
  133. <span class="sr-only">(<%= (s.rc4? or s.des?) ? '☹' : '☺' %>)</span>
  134. </td>
  135. <td class="<%= s.des3? ? :danger : :success %>">
  136. <%= s.des3? ? '✓' : '✗' %>
  137. <span class="sr-only">(<%= s.des3? ? '☹' : '☺' %>)</span>
  138. </td>
  139. <td class="<%= s.pfs? ? (s.pfs_only? ? :info : :success) : :danger %>">
  140. <%= s.pfs? ? '✓' : '✗' %>
  141. <span class="sr-only">(<%= s.pfs? ? '☺' : '☹' %>)</span>
  142. </td>
  143. <td class="<%= s.hsts? ? (s.hsts_long? ? :info : :success) : :danger %>">
  144. <%= s.hsts? ? '✓' : '✗' %>
  145. <span class="sr-only">(<%= s.hsts? ? '☺' : '☹' %>)</span>
  146. </td>
  147. <% end %>
  148. </tr>
  149. <% end %>
  150. <tr>
  151. <th rowspan="2">Site</th>
  152. <td rowspan="2">Grade</td>
  153. <td>Key size (bits)</td>
  154. <td class="warning">SHA1 sig</td>
  155. <td class="critical">SSL v2</td>
  156. <td class="critical">SSL v3</td>
  157. <td class="success">TLS 1.2</td>
  158. <td class="info">TLS</td>
  159. <td>Strength (bits)</td>
  160. <td class="critical">MD5</td>
  161. <td class="warning">SHA1</td>
  162. <td class="critical">DES/RC4</td>
  163. <td class="danger">3DES</td>
  164. <td class="info">PFS</td>
  165. <td class="info">HSTS</td>
  166. </tr>
  167. <tr>
  168. <td colspan="2">Certificate</td>
  169. <td colspan="4">Protocols</td>
  170. <td colspan="5">Ciphers</td>
  171. <td colspan="2">Best practices</td>
  172. </tr>
  173. <% end %>
  174. </tbody>
  175. </table>
  176. <div class="pull-right">
  177. Generated on <%= Time.now.strftime '%FT%T%:z' %>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </body>
  183. </html>