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.

https.erb 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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>Status SSL/TLS banque &amp; commerce en ligne</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="https://www.ssllabs.com/ssltest/analyze.html?d=<%= s.hostname %>" target="_blank">
  75. <%= s.hostname %>
  76. </a>
  77. </th>
  78. <% if s.is_a? Tls::TlsNotSupportedServer %>
  79. <td class="critical" colspan="16">
  80. No SSL/TLS
  81. </td>
  82. <%
  83. else
  84. rank_color = case n.grade
  85. when 'A+' then :info
  86. when 'A', 'A-' then :success
  87. when 'B', 'C' then :warning
  88. when 'T', 'M' then :critical
  89. else :danger
  90. end
  91. %>
  92. <td class="<%= rank_color %>">
  93. <%= n.grade %>
  94. </td>
  95. <td class="<%= s.key_size < 2048 ? :danger : s.key_size < 4096 ? :warning : :success %>">
  96. <% type, size = s.key %>
  97. <%= "#{size} (#{type.to_s.upcase})" %>
  98. <span class="sr-only">(<%= s.key_size < 2048 ? '☹' : '☺' %>)</span>
  99. </td>
  100. <td class="<%= s.sha1_sig? ? :warning : :success %>">
  101. <%= s.sha1_sig? ? '✓' : '✗' %>
  102. <span class="sr-only">(<%= s.sha1_sig? ? '☹' : '☺' %>)</span>
  103. </td>
  104. <td class="<%= s.sslv2? ? :critical : :success %>">
  105. <%= s.sslv2? ? '✓' : '✗' %>
  106. <span class="sr-only">(<%= s.sslv2? ? '☹' : '☺' %>)</span>
  107. </td>
  108. <td class="<%= s.sslv3? ? :critical : :success %>">
  109. <%= s.sslv3? ? '✓' : '✗' %>
  110. <span class="sr-only">(<%= s.sslv3? ? '☹' : '☺' %>)</span>
  111. </td>
  112. <td class="<%= s.tlsv1_2? ? :success : :danger %>">
  113. <%= s.tlsv1_2? ? '✓' : '✗' %>
  114. <span class="sr-only">(<%= s.tlsv1_2? ? '☺' : '☹' %>)</span>
  115. </td>
  116. <td class="<%= s.tls? ? (s.tls_only? ? :info : :success) : :danger %>">
  117. <%= s.tls? ? '✓' : '✗' %>
  118. <span class="sr-only">(<%= s.tls? ? '☺' : '☹' %>)</span>
  119. </td>
  120. <% cipher_size = s.cipher_size[:worst] %>
  121. <td class="<%= cipher_size < 112 ? :danger : cipher_size < 128 ? :warning : :success %>">
  122. <%= cipher_size %>
  123. <span class="sr-only">(<%= cipher_size < 128 ? '☹' : '☺' %>)</span>
  124. </td>
  125. <td class="<%= s.md5? ? :critical : :success %>">
  126. <%= s.md5? ? '✓' : '✗' %>
  127. <span class="sr-only">(<%= s.md5? ? '☹' : '☺' %>)</span>
  128. </td>
  129. <td class="<%= s.sha1? ? :warning : :success %>">
  130. <%= s.sha1? ? '✓' : '✗' %>
  131. <span class="sr-only">(<%= s.sha1? ? '☹' : '☺' %>)</span>
  132. </td>
  133. <td class="<%= (s.rc4? or s.des?) ? :critical : :success %>">
  134. <%= (s.rc4? or s.des?) ? '✓' : '✗' %>
  135. <span class="sr-only">(<%= (s.rc4? or s.des?) ? '☹' : '☺' %>)</span>
  136. </td>
  137. <td class="<%= s.des3? ? :danger : :success %>">
  138. <%= s.des3? ? '✓' : '✗' %>
  139. <span class="sr-only">(<%= s.des3? ? '☹' : '☺' %>)</span>
  140. </td>
  141. <td class="<%= s.pfs? ? (s.pfs_only? ? :info : :success) : :danger %>">
  142. <%= s.pfs? ? '✓' : '✗' %>
  143. <span class="sr-only">(<%= s.pfs? ? '☺' : '☹' %>)</span>
  144. </td>
  145. <td class="<%= s.hsts? ? (s.hsts_long? ? :info : :success) : :danger %>">
  146. <%= s.hsts? ? '✓' : '✗' %>
  147. <span class="sr-only">(<%= s.hsts? ? '☺' : '☹' %>)</span>
  148. </td>
  149. <% end %>
  150. </tr>
  151. <% end %>
  152. <tr>
  153. <th rowspan="2">Site</th>
  154. <td rowspan="2">Grade</td>
  155. <td>Key size (bits)</td>
  156. <td class="warning">SHA1 sig</td>
  157. <td class="critical">SSL v2</td>
  158. <td class="critical">SSL v3</td>
  159. <td class="success">TLS 1.2</td>
  160. <td class="info">TLS</td>
  161. <td>Strength (bits)</td>
  162. <td class="critical">MD5</td>
  163. <td class="warning">SHA1</td>
  164. <td class="critical">DES/RC4</td>
  165. <td class="danger">3DES</td>
  166. <td class="info">PFS</td>
  167. <td class="info">HSTS</td>
  168. </tr>
  169. <tr>
  170. <td colspan="2">Certificate</td>
  171. <td colspan="4">Protocols</td>
  172. <td colspan="5">Ciphers</td>
  173. <td colspan="2">Best practices</td>
  174. </tr>
  175. <% end %>
  176. </tbody>
  177. </table>
  178. </div>
  179. </div>
  180. </div>
  181. </body>
  182. </html>