Audytujemy algorytmy szyfrowania SSH
Napisał: Patryk Krawaczyński
17/10/2016 w Bezpieczeństwo 1 komentarz. (artykuł nr 561, ilość słów: 1003)
K
onfiguracja SSH oprócz: zezwolenia wybranych użytkowników; wyłączenia / podkręcenia niektórych funkcji; zastanawiania się czy hasłem, czy kluczem i którym portem – przede wszystkim powinna się skupić na rodzajach algorytmów, które oferują nam bezpieczną, szyfrowaną transmisję. Od strony manualnej możemy skorzystać z dobrego przewodnika Mozilli lub zaprząc do tego automat, który podpowie nam, jakie algorytmy są już przestarzałe i nie powinny być już oferowane od strony serwera w naszej wersji:
wget 'https://github.com/arthepsy/ssh-audit/archive/v1.6.0.tar.gz' tar -xvf v1.6.0.tar.gz cd ssh-audit-1.6.0/ ./ssh-audit.py localhost:22
W odpowiedzi otrzymamy wiadomość informującą jakie szyfry powinny zostać wyłączone:
# general (gen) banner: SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 (gen) software: OpenSSH 6.6.1p1 (gen) compatibility: OpenSSH 6.5-6.6, Dropbear SSH 2013.62+ (some functionality from 0.52) (gen) compression: enabled (zlib@openssh.com) # algorithm recommendations (for OpenSSH 6.6.1) (rec) -diffie-hellman-group14-sha1 -- kex algorithm to remove (rec) -diffie-hellman-group-exchange-sha1 -- kex algorithm to remove (rec) -diffie-hellman-group1-sha1 -- kex algorithm to remove (rec) -ecdh-sha2-nistp256 -- kex algorithm to remove (rec) -ecdh-sha2-nistp521 -- kex algorithm to remove (rec) -ecdh-sha2-nistp384 -- kex algorithm to remove (rec) -ecdsa-sha2-nistp256 -- key algorithm to remove (rec) -ssh-dss -- key algorithm to remove (rec) -arcfour -- enc algorithm to remove (rec) -rijndael-cbc@lysator.liu.se -- enc algorithm to remove (rec) -blowfish-cbc -- enc algorithm to remove (rec) -3des-cbc -- enc algorithm to remove (rec) -aes256-cbc -- enc algorithm to remove (rec) -arcfour256 -- enc algorithm to remove (rec) -cast128-cbc -- enc algorithm to remove (rec) -aes192-cbc -- enc algorithm to remove (rec) -arcfour128 -- enc algorithm to remove (rec) -aes128-cbc -- enc algorithm to remove (rec) -hmac-sha2-512 -- mac algorithm to remove (rec) -hmac-md5-96 -- mac algorithm to remove (rec) -hmac-md5-etm@openssh.com -- mac algorithm to remove (rec) -hmac-sha1-96-etm@openssh.com -- mac algorithm to remove (rec) -hmac-ripemd160-etm@openssh.com -- mac algorithm to remove (rec) -hmac-md5-96-etm@openssh.com -- mac algorithm to remove (rec) -hmac-sha2-256 -- mac algorithm to remove (rec) -hmac-ripemd160 -- mac algorithm to remove (rec) -umac-128@openssh.com -- mac algorithm to remove (rec) -hmac-sha1-96 -- mac algorithm to remove (rec) -umac-64@openssh.com -- mac algorithm to remove (rec) -hmac-md5 -- mac algorithm to remove (rec) -hmac-ripemd160@openssh.com -- mac algorithm to remove (rec) -hmac-sha1 -- mac algorithm to remove (rec) -hmac-sha1-etm@openssh.com -- mac algorithm to remove (rec) -umac-64-etm@openssh.com -- mac algorithm to remove
Jeśli wiemy już, jakie algorytmy są passé możemy dodać wszystkie obsługiwane (ssh -Q cipher; ssh -Q mac; ssh -Q kex) oprócz tych wyszczególnionych wyżej do /etc/ssh/sshd_config
w opcjach KexAlgorithms
, Ciphers
oraz MACs
.
Więcej informacji: SSH server auditing, man sshd_config
Kontynuacja projektu jest dostępna tutaj.