Browse Source

Colorize output

master
Nicolas Vinot 4 years ago
parent
commit
1b8ed72057
2 changed files with 87 additions and 72 deletions
  1. 85
    70
      output/sslcheck.erb
  2. 2
    2
      output/ssllabs.erb

+ 85
- 70
output/sslcheck.erb View File

@@ -1,3 +1,6 @@
<%

%>
<!DOCTYPE html>
<html lang="fr">
<head>
@@ -20,7 +23,7 @@
color: #fff;
}

td.critical:hover {
tr:hover > td.critical, td:hover.critical {
background-color: #333 !important;
}
</style>
@@ -37,33 +40,40 @@
unless first
%>
<tr>
<th colspan="17">&nbsp;</th>
<th colspan="15">&nbsp;</th>
</tr>
<%
end
first = false
%>
<tr>
<th colspan="17" id="<%= r[0] %>"><%= r[0] %></th>
<th colspan="15" id="<%= r[0] %>"><%= r[0] %></th>
</tr>
<tr>
<th rowspan="2">Site</th>
<td rowspan="2">Grade</td>
<td colspan="2">Certificate</td>
<td colspan="4">Protocols</td>
<td colspan="5">Ciphers</td>
<td colspan="2">Best practices</td>
</tr>
<tr>
<th>Site (IP)</th>
<td>Rang</td>
<td>Clef (bits)</td>
<td>Chiff. (bits)</td>
<td class="danger">SSL v2</td>
<td class="danger">SSL v3</td>
<td class="success">TLS</td>
<td>Key size (bits)</td>
<td class="warning">SHA1 sig</td>

<td class="critical">SSL v2</td>
<td class="critical">SSL v3</td>
<td class="success">TLS 1.2</td>
<td class="success">TLS only</td>
<td class="danger">SHA1 sig</td>
<td class="danger">RC4</td>
<td class="danger">DES/3DES</td>
<td class="danger">MD5</td>
<td class="success">PFS</td>
<td class="success">PFS only</td>
<td class="success">HSTS</td>
<td class="success">HSTS long</td>
<td class="info">TLS</td>

<td>Strength (bits)</td>
<td class="critical">MD5</td>
<td class="warning">SHA1</td>
<td class="critical">DES/RC4</td>
<td class="danger">3DES</td>

<td class="info">PFS</td>
<td class="info">HSTS</td>
</tr>
<% r[1].each do |n|
s = n.server
@@ -84,95 +94,100 @@
when 'A+' then :info
when 'A', 'A-' then :success
when 'B', 'C' then :warning
when 'T', 'X' then :critical
else :danger
end
%>
<td class="<%= rank_color %>">
<%= n.grade %>
</td>

<td class="<%= s.key_size < 2048 ? :danger : s.key_size < 4096 ? :warning : :success %>">
<% type, size = s.key %>
<%= "#{size} (#{type.to_s.upcase})" %>
<span class="sr-only">(<%= s.key_size < 2048 ? '☹' : '☺' %>)</span>
</td>
<% cipher_size = s.cipher_size[:worst] %>
<td class="<%= cipher_size < 112 ? :danger : cipher_size < 128 ? :warning : :success %>">
<%= cipher_size %>
<span class="sr-only">(<%= cipher_size < 128 ? '☹' : '☺' %>)</span>
<td class="<%= s.sha1_sig? ? :warning : :success %>">
<%= s.sha1_sig? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.sha1_sig? ? '☹' : '☺' %>)</span>
</td>
<td class="<%= s.sslv2? ? :danger : :success %>">

<td class="<%= s.sslv2? ? :critical : :success %>">
<%= s.sslv2? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.sslv2? ? '☹' : '☺' %>)</span>
</td>
<td class="<%= s.sslv3? ? :danger : :success %>">
<td class="<%= s.sslv3? ? :critical : :success %>">
<%= s.sslv3? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.sslv3? ? '☹' : '☺' %>)</span>
</td>
<td class="<%= s.tls? ? :success : :danger %>">
<%= s.tls? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.tls? ? '☺' : '☹' %>)</span>
</td>
<td class="<%= s.tlsv1_2? ? :success : :danger %>">
<%= s.tlsv1_2? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.tlsv1_2? ? '☺' : '☹' %>)</span>
</td>
<td class="<%= s.tls_only? ? :success : :danger %>">
<%= s.tls_only? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.tls_only? ? '☺' : '☹' %>)</span>
</td>
<td class="<%= s.sha1_sig? ? :danger : :success %>">
<%= s.sha1_sig? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.sha1_sig? ? '☹' : '☺' %>)</span>
</td>
<td class="<%= s.rc4? ? :danger : :success %>">
<%= s.rc4? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.rc4? ? '☹' : '☺' %>)</span>
<td class="<%= s.tls? ? (s.tls_only? ? :info : :success) : :danger %>">
<%= s.tls? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.tls? ? '☺' : '☹' %>)</span>
</td>
<td class="<%= s.any_des? ? :danger : :success %>">
<%= s.any_des? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.any_des? ? '☹' : '☺' %>)</span>

<% cipher_size = s.cipher_size[:worst] %>
<td class="<%= cipher_size < 112 ? :danger : cipher_size < 128 ? :warning : :success %>">
<%= cipher_size %>
<span class="sr-only">(<%= cipher_size < 128 ? '☹' : '☺' %>)</span>
</td>
<td class="<%= s.md5? ? :danger : :success %>">
<td class="<%= s.md5? ? :critical : :success %>">
<%= s.md5? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.md5? ? '☹' : '☺' %>)</span>
</td>
<td class="<%= s.pfs? ? :success : :danger %>">
<td class="<%= s.sha1? ? :warning : :success %>">
<%= s.sha1? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.sha1? ? '☹' : '☺' %>)</span>
</td>
<td class="<%= (s.rc4? or s.des?) ? :critical : :success %>">
<%= (s.rc4? or s.des?) ? '✓' : '✗' %>
<span class="sr-only">(<%= (s.rc4? or s.des?) ? '☹' : '☺' %>)</span>
</td>
<td class="<%= s.des3? ? :danger : :success %>">
<%= s.des3? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.des3? ? '☹' : '☺' %>)</span>
</td>

<td class="<%= s.pfs? ? (s.pfs_only? ? :info : :success) : :danger %>">
<%= s.pfs? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.pfs? ? '☺' : '☹' %>)</span>
</td>
<td class="<%= s.pfs_only? ? :success : :danger %>">
<%= s.pfs_only? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.pfs_only? ? '☺' : '☹' %>)</span>
</td>
<td class="<%= s.hsts? ? :success : :danger %>">
<td class="<%= s.hsts? ? (s.hsts_long? ? :info : :success) : :danger %>">
<%= s.hsts? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.hsts? ? '☺' : '☹' %>)</span>
</td>
<td class="<%= s.hsts_long? ? :success : :danger %>">
<%= s.hsts_long? ? '✓' : '✗' %>
<span class="sr-only">(<%= s.hsts_long? ? '☺' : '☹' %>)</span>
</td>
<% end %>
</tr>
<% end %>
<tr>
<th>Site</th>
<td>Rang</td>
<td>Clef (bits)</td>
<td>Chiff. (bits)</td>
<td class="danger">SSL v2</td>
<td class="danger">SSL v3</td>
<td class="success">TLS</td>
<th rowspan="2">Site</th>
<td rowspan="2">Grade</td>

<td>Key size (bits)</td>
<td class="warning">SHA1 sig</td>

<td class="critical">SSL v2</td>
<td class="critical">SSL v3</td>
<td class="success">TLS 1.2</td>
<td class="success">TLS only</td>
<td class="danger">SHA1 sig</td>
<td class="danger">RC4</td>
<td class="danger">DES/3DES</td>
<td class="danger">MD5</td>
<td class="success">PFS</td>
<td class="success">PFS only</td>
<td class="success">HSTS</td>
<td class="success">HSTS long</td>
<td class="info">TLS</td>

<td>Strength (bits)</td>
<td class="critical">MD5</td>
<td class="warning">SHA1</td>
<td class="critical">DES/RC4</td>
<td class="danger">3DES</td>

<td class="info">PFS</td>
<td class="info">HSTS</td>
</tr>
<tr>
<td colspan="2">Certificate</td>
<td colspan="4">Protocols</td>
<td colspan="5">Ciphers</td>
<td colspan="2">Best practices</td>
</tr>
<% end %>
</tbody>

+ 2
- 2
output/ssllabs.erb View File

@@ -44,8 +44,8 @@
<td class="danger">SSL 2/3 (obsolète)</td>
<td class="success">TLS 1.2 (actuel)</td>
<td class="danger">RC4</td>
<td class="success">PFS</td>
<td class="success">HSTS</td>
<td class="info">PFS</td>
<td class="info">HSTS</td>
</tr>
<% r[1].each do |s|
rank_color = case s.rank

Loading…
Cancel
Save