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

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