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.

xmpp.erb 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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; XMPP</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. <thead>
  31. <tr>
  32. <th rowspan="2">Host</th>
  33. <td rowspan="2">Grade</td>
  34. <td colspan="2">Certificate</td>
  35. <td colspan="4">Protocols</td>
  36. <td colspan="5">Ciphers</td>
  37. <td colspan="2">Best practices</td>
  38. </tr>
  39. <tr>
  40. <td>Key size (bits)</td>
  41. <td class="warning">SHA1 sig</td>
  42. <td class="critical">SSL v2</td>
  43. <td class="critical">SSL v3</td>
  44. <td class="success">TLS 1.2</td>
  45. <td class="info">TLS</td>
  46. <td>Strength (bits)</td>
  47. <td class="critical">MD5</td>
  48. <td class="warning">SHA1</td>
  49. <td class="critical">DES/RC4</td>
  50. <td class="danger">3DES</td>
  51. <td class="info">PFS</td>
  52. <td class="success">Required</td>
  53. </tr>
  54. </thead>
  55. <tfoot>
  56. <tr>
  57. <th rowspan="2">Host</th>
  58. <td rowspan="2">Grade</td>
  59. <td colspan="2">Certificate</td>
  60. <td colspan="4">Protocols</td>
  61. <td colspan="5">Ciphers</td>
  62. <td colspan="2">Best practices</td>
  63. </tr>
  64. <tr>
  65. <td>Key size (bits)</td>
  66. <td class="warning">SHA1 sig</td>
  67. <td class="critical">SSL v2</td>
  68. <td class="critical">SSL v3</td>
  69. <td class="success">TLS 1.2</td>
  70. <td class="info">TLS</td>
  71. <td>Strength (bits)</td>
  72. <td class="critical">MD5</td>
  73. <td class="warning">SHA1</td>
  74. <td class="critical">DES/RC4</td>
  75. <td class="danger">3DES</td>
  76. <td class="info">PFS</td>
  77. <td class="success">Required</td>
  78. </tr>
  79. </tfoot>
  80. <tbody>
  81. <% servers.each do |n|
  82. s = n.server
  83. %>
  84. <tr>
  85. <th id="<%= s.hostname %>">
  86. <a href="#<%= s.hostname %>"><%= s.hostname %></a>
  87. </th>
  88. <% if s.is_a? Tls::TlsNotSupportedServer %>
  89. <td class="critical" colspan="16">
  90. No SSL/TLS
  91. </td>
  92. <% else
  93. rank_color = case n.grade
  94. when 'A+' then :info
  95. when 'A', 'A-' then :success
  96. when 'B', 'C' then :warning
  97. when 'T', 'M' then :critical
  98. else :danger
  99. end %>
  100. <td class="<%= rank_color %>">
  101. <%= n.grade %>
  102. </td>
  103. <td class="<%= s.key_size < 2048 ? :danger : s.key_size < 4096 ? :warning : :success %>">
  104. <% type, size = s.key %>
  105. <%= "#{size} (#{type.to_s.upcase})" %>
  106. <span class="sr-only">(<%= s.key_size < 2048 ? '☹' : '☺' %>)</span>
  107. </td>
  108. <td class="<%= s.sha1_sig? ? :warning : :success %>">
  109. <%= s.sha1_sig? ? '✓' : '✗' %>
  110. <span class="sr-only">(<%= s.sha1_sig? ? '☹' : '☺' %>)</span>
  111. </td>
  112. <td class="<%= s.sslv2? ? :critical : :success %>">
  113. <%= s.sslv2? ? '✓' : '✗' %>
  114. <span class="sr-only">(<%= s.sslv2? ? '☹' : '☺' %>)</span>
  115. </td>
  116. <td class="<%= s.sslv3? ? :critical : :success %>">
  117. <%= s.sslv3? ? '✓' : '✗' %>
  118. <span class="sr-only">(<%= s.sslv3? ? '☹' : '☺' %>)</span>
  119. </td>
  120. <td class="<%= s.tlsv1_2? ? :success : :danger %>">
  121. <%= s.tlsv1_2? ? '✓' : '✗' %>
  122. <span class="sr-only">(<%= s.tlsv1_2? ? '☺' : '☹' %>)</span>
  123. </td>
  124. <td class="<%= s.tls? ? (s.tls_only? ? :info : :success) : :danger %>">
  125. <%= s.tls? ? '✓' : '✗' %>
  126. <span class="sr-only">(<%= s.tls? ? '☺' : '☹' %>)</span>
  127. </td>
  128. <% cipher_size = s.cipher_size[:worst] %>
  129. <td class="<%= cipher_size < 112 ? :danger : cipher_size < 128 ? :warning : :success %>">
  130. <%= cipher_size %>
  131. <span class="sr-only">(<%= cipher_size < 128 ? '☹' : '☺' %>)</span>
  132. </td>
  133. <td class="<%= s.md5? ? :critical : :success %>">
  134. <%= s.md5? ? '✓' : '✗' %>
  135. <span class="sr-only">(<%= s.md5? ? '☹' : '☺' %>)</span>
  136. </td>
  137. <td class="<%= s.sha1? ? :warning : :success %>">
  138. <%= s.sha1? ? '✓' : '✗' %>
  139. <span class="sr-only">(<%= s.sha1? ? '☹' : '☺' %>)</span>
  140. </td>
  141. <td class="<%= (s.rc4? or s.des?) ? :critical : :success %>">
  142. <%= (s.rc4? or s.des?) ? '✓' : '✗' %>
  143. <span class="sr-only">(<%= (s.rc4? or s.des?) ? '☹' : '☺' %>)</span>
  144. </td>
  145. <td class="<%= s.des3? ? :danger : :success %>">
  146. <%= s.des3? ? '✓' : '✗' %>
  147. <span class="sr-only">(<%= s.des3? ? '☹' : '☺' %>)</span>
  148. </td>
  149. <td class="<%= s.pfs? ? (s.pfs_only? ? :info : :success) : :danger %>">
  150. <%= s.pfs? ? '✓' : '✗' %>
  151. <span class="sr-only">(<%= s.pfs? ? '☺' : '☹' %>)</span>
  152. </td>
  153. <td class="<%= s.required? ? :success : :danger %>">
  154. <%= s.required? ? '✓' : '✗' %>
  155. <span class="sr-only">(<%= s.required? ? '☺' : '☹' %>)</span>
  156. </td>
  157. <% end %>
  158. </tr>
  159. <% end %>
  160. </tbody>
  161. </table>
  162. <div class="pull-right">
  163. Generated on <%= Time.now.strftime '%FT%T%:z' %>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </body>
  169. </html>