mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-22 10:31:41 +01:00
Fixed recommendation output function from suppressing some algorithms inappropriately.
This commit is contained in:
parent
53300047e5
commit
175bd2cf66
@ -158,6 +158,7 @@ For convenience, a web front-end on top of the command-line tool is available at
|
|||||||
|
|
||||||
## ChangeLog
|
## ChangeLog
|
||||||
### v2.3.1-dev (???)
|
### v2.3.1-dev (???)
|
||||||
|
- Fixed bug in recommendation output which suppressed some algorithms inappropriately.
|
||||||
- Flag `ssh-rsa-cert-v01@openssh.com` as a failure due to SHA-1 hash.
|
- Flag `ssh-rsa-cert-v01@openssh.com` as a failure due to SHA-1 hash.
|
||||||
- Now parses public key sizes for `rsa-sha2-256-cert-v01@openssh.com` and `rsa-sha2-512-cert-v01@openssh.com` host key types.
|
- Now parses public key sizes for `rsa-sha2-256-cert-v01@openssh.com` and `rsa-sha2-512-cert-v01@openssh.com` host key types.
|
||||||
- Built-in policies now include CA key requirements (if certificates are in use).
|
- Built-in policies now include CA key requirements (if certificates are in use).
|
||||||
|
@ -189,19 +189,7 @@ class Algorithms:
|
|||||||
add_count = len(rec[sshv][alg_type]['add'])
|
add_count = len(rec[sshv][alg_type]['add'])
|
||||||
del_count = len(rec[sshv][alg_type]['del'])
|
del_count = len(rec[sshv][alg_type]['del'])
|
||||||
chg_count = len(rec[sshv][alg_type]['chg'])
|
chg_count = len(rec[sshv][alg_type]['chg'])
|
||||||
new_alg_count = len(alg_list) + add_count - del_count
|
|
||||||
if new_alg_count < 1 and del_count > 0:
|
|
||||||
mf = min(rec[sshv][alg_type]['del'].values())
|
|
||||||
new_del = {}
|
|
||||||
for k, cf in rec[sshv][alg_type]['del'].items():
|
|
||||||
if cf != mf:
|
|
||||||
new_del[k] = cf
|
|
||||||
if del_count != len(new_del):
|
|
||||||
rec[sshv][alg_type]['del'] = new_del
|
|
||||||
new_alg_count += del_count - len(new_del)
|
|
||||||
if new_alg_count < 1:
|
|
||||||
del rec[sshv][alg_type]
|
|
||||||
else:
|
|
||||||
if add_count == 0:
|
if add_count == 0:
|
||||||
del rec[sshv][alg_type]['add']
|
del rec[sshv][alg_type]['add']
|
||||||
if del_count == 0:
|
if del_count == 0:
|
||||||
|
@ -71,13 +71,16 @@
|
|||||||
[0;31m(rec) -ecdh-sha2-nistp256 -- kex algorithm to remove [0m
|
[0;31m(rec) -ecdh-sha2-nistp256 -- kex algorithm to remove [0m
|
||||||
[0;31m(rec) -ecdh-sha2-nistp384 -- kex algorithm to remove [0m
|
[0;31m(rec) -ecdh-sha2-nistp384 -- kex algorithm to remove [0m
|
||||||
[0;31m(rec) -ecdh-sha2-nistp521 -- kex algorithm to remove [0m
|
[0;31m(rec) -ecdh-sha2-nistp521 -- kex algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ecdsa-sha2-nistp256 -- key algorithm to remove [0m
|
||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
[0;32m(rec) +diffie-hellman-group16-sha512 -- kex algorithm to append [0m
|
[0;32m(rec) +diffie-hellman-group16-sha512 -- kex algorithm to append [0m
|
||||||
[0;32m(rec) +twofish128-ctr -- enc algorithm to append [0m
|
[0;32m(rec) +twofish128-ctr -- enc algorithm to append [0m
|
||||||
[0;32m(rec) +twofish256-ctr -- enc algorithm to append [0m
|
[0;32m(rec) +twofish256-ctr -- enc algorithm to append [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
||||||
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
|
[0;33m(rec) -hmac-sha2-256 -- mac algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
@ -133,6 +133,9 @@
|
|||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
|
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
@ -141,7 +141,10 @@
|
|||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
|
[0;33m(rec) -umac-64@openssh.com -- mac algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
[0;31m(key) ssh-rsa (1024-bit) -- [fail] using weak hashing algorithm[0m
|
[0;31m(key) ssh-rsa (1024-bit) -- [fail] using weak hashing algorithm[0m
|
||||||
[0;33m `- [warn] using small 1024-bit modulus[0m
|
[0;33m `- [warn] using small 1024-bit modulus[0m
|
||||||
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
||||||
[0;31m(key) ssh-rsa-cert-v01@openssh.com (1024-bit cert/1024-bit CA) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(key) ssh-rsa-cert-v01@openssh.com (1024-bit cert/1024-bit CA) -- [fail] using weak hashing algorithm[0m
|
||||||
|
[0;33m `- [warn] using small 1024-bit modulus[0m
|
||||||
`- [info] available since OpenSSH 5.6
|
`- [info] available since OpenSSH 5.6
|
||||||
|
|
||||||
[0;36m# encryption algorithms (ciphers)[0m
|
[0;36m# encryption algorithms (ciphers)[0m
|
||||||
@ -121,7 +122,6 @@
|
|||||||
|
|
||||||
[0;36m# algorithm recommendations (for OpenSSH 5.6)[0m
|
[0;36m# algorithm recommendations (for OpenSSH 5.6)[0m
|
||||||
[0;31m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
[0;31m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
||||||
[0;31m(rec) !ssh-rsa-cert-v01@openssh.com -- key algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
|
||||||
[0;31m(rec) -3des-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -3des-cbc -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -aes192-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -aes192-cbc -- enc algorithm to remove [0m
|
||||||
@ -140,7 +140,10 @@
|
|||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ssh-rsa-cert-v01@openssh.com -- key algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
|
[0;33m(rec) -umac-64@openssh.com -- mac algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
[0;31m(key) ssh-rsa (1024-bit) -- [fail] using weak hashing algorithm[0m
|
[0;31m(key) ssh-rsa (1024-bit) -- [fail] using weak hashing algorithm[0m
|
||||||
[0;33m `- [warn] using small 1024-bit modulus[0m
|
[0;33m `- [warn] using small 1024-bit modulus[0m
|
||||||
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
||||||
[0;31m(key) ssh-rsa-cert-v01@openssh.com (1024-bit cert/3072-bit CA) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(key) ssh-rsa-cert-v01@openssh.com (1024-bit cert/3072-bit CA) -- [fail] using weak hashing algorithm[0m
|
||||||
|
[0;33m `- [warn] using small 1024-bit modulus[0m
|
||||||
`- [info] available since OpenSSH 5.6
|
`- [info] available since OpenSSH 5.6
|
||||||
|
|
||||||
[0;36m# encryption algorithms (ciphers)[0m
|
[0;36m# encryption algorithms (ciphers)[0m
|
||||||
@ -121,7 +122,6 @@
|
|||||||
|
|
||||||
[0;36m# algorithm recommendations (for OpenSSH 5.6)[0m
|
[0;36m# algorithm recommendations (for OpenSSH 5.6)[0m
|
||||||
[0;31m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
[0;31m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
||||||
[0;31m(rec) !ssh-rsa-cert-v01@openssh.com -- key algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
|
||||||
[0;31m(rec) -3des-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -3des-cbc -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -aes192-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -aes192-cbc -- enc algorithm to remove [0m
|
||||||
@ -140,7 +140,10 @@
|
|||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ssh-rsa-cert-v01@openssh.com -- key algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
|
[0;33m(rec) -umac-64@openssh.com -- mac algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
[0;36m# host-key algorithms[0m
|
[0;36m# host-key algorithms[0m
|
||||||
[0;31m(key) ssh-rsa (3072-bit) -- [fail] using weak hashing algorithm[0m
|
[0;31m(key) ssh-rsa (3072-bit) -- [fail] using weak hashing algorithm[0m
|
||||||
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
||||||
[0;31m(key) ssh-rsa-cert-v01@openssh.com (3072-bit cert/1024-bit CA) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(key) ssh-rsa-cert-v01@openssh.com (3072-bit cert/1024-bit CA) -- [fail] using weak hashing algorithm[0m
|
||||||
|
[0;33m `- [warn] using small 1024-bit modulus[0m
|
||||||
`- [info] available since OpenSSH 5.6
|
`- [info] available since OpenSSH 5.6
|
||||||
|
|
||||||
[0;36m# encryption algorithms (ciphers)[0m
|
[0;36m# encryption algorithms (ciphers)[0m
|
||||||
@ -120,7 +121,6 @@
|
|||||||
|
|
||||||
[0;36m# algorithm recommendations (for OpenSSH 5.6)[0m
|
[0;36m# algorithm recommendations (for OpenSSH 5.6)[0m
|
||||||
[0;31m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
[0;31m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
||||||
[0;31m(rec) !ssh-rsa-cert-v01@openssh.com -- key algorithm to change (increase modulus size to 2048 bits or larger) [0m
|
|
||||||
[0;31m(rec) -3des-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -3des-cbc -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -aes192-cbc -- enc algorithm to remove [0m
|
[0;31m(rec) -aes192-cbc -- enc algorithm to remove [0m
|
||||||
@ -139,7 +139,10 @@
|
|||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ssh-rsa-cert-v01@openssh.com -- key algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
|
[0;33m(rec) -umac-64@openssh.com -- mac algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
[0;36m# host-key algorithms[0m
|
[0;36m# host-key algorithms[0m
|
||||||
[0;31m(key) ssh-rsa (3072-bit) -- [fail] using weak hashing algorithm[0m
|
[0;31m(key) ssh-rsa (3072-bit) -- [fail] using weak hashing algorithm[0m
|
||||||
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
|
||||||
[0;32m(key) ssh-rsa-cert-v01@openssh.com (3072-bit cert/3072-bit CA) -- [info] available since OpenSSH 5.6[0m
|
[0;31m(key) ssh-rsa-cert-v01@openssh.com (3072-bit cert/3072-bit CA) -- [fail] using weak hashing algorithm[0m
|
||||||
|
`- [info] available since OpenSSH 5.6
|
||||||
|
|
||||||
[0;36m# encryption algorithms (ciphers)[0m
|
[0;36m# encryption algorithms (ciphers)[0m
|
||||||
[0;32m(enc) aes128-ctr -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52[0m
|
[0;32m(enc) aes128-ctr -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52[0m
|
||||||
@ -137,7 +138,10 @@
|
|||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
[0;31m(rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
|
[0;31m(rec) -ssh-rsa-cert-v01@openssh.com -- key algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
|
[0;33m(rec) -umac-64@openssh.com -- mac algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
Loading…
Reference in New Issue
Block a user