Controllare un server prima di metterlo in produzione è sicuramente meglio di doverlo manutenere dopo un attacco. La cosa importante è quindi fare il possibile affinché tutto sia aggiornato e configurato al meglio.
Oggi vi consiglio un semplice tool a riga di comando, che permette un check veloce delle vulnerabilità della propria Linux Box: Lynis.
L’installazione sui sistemi GNU/Debian può essere fatta con il classico:
|
1 2 3 4 5 |
curl -fsSL https://packages.cisofy.com/keys/cisofy-software-public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/cisofy-software-public.gpg echo "deb https://packages.cisofy.com/community/lynis/deb/ stable main" | sudo tee /etc/apt/sources.list.d/cisofy-lynis.list apt install apt-transport-https apt update apt install lynis |
oppure, se preferite, è possibile scaricare ed usare l’ultima versione disponibile sul sito degli sviluppatori, es (al momento la 1.30):
|
1 2 3 |
wget http://www.rootkit.nl/files/lynis-1.3.0.tar.gz tar xvfvz lynis-1.3.0.tar.gz -C /opt cd /opt/lynis-1.3.0/ |
A questo punto il tool può essere avviato con:
|
1 |
lynis --check-all -Q |
oppure se preferite un piccolo help, basta digitare:
|
1 |
lynis |
Bene, finita la scansione, viene visualizzato un riepilogo con qualcosa del tipo:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
-[ Lynis 1.3.0 Results ]- Tests performed: 151 Warnings: ---------------------------- - [09:42:50] Warning: No password set on GRUB bootloader [test:BOOT-5121] [impact:M] - [09:42:52] Warning: grpck binary found errors in one or more group files [test:AUTH-9216] [impact:M] - [09:42:54] Warning: No password set for single mode [test:AUTH-9308] [impact:L] - [09:42:58] Warning: Found BIND version in banner [test:NAME-4210] [impact:M] - [09:43:07] Warning: Couldn't find 2 responsive nameservers [test:NETW-2705] [impact:L] Suggestions: ---------------------------- - [09:42:41] Suggestion: update to the latest stable release. - [09:42:50] Suggestion: Run grub-md5-crypt and create a hashed password. After that, add a line below the line saying timeout=: password --md5 [test:BOOT-5121] - [09:42:52] Suggestion: Run grpck manually and check your group files [test:AUTH-9216] - [09:42:53] Suggestion: Install a PAM module for password strength testing like pam_cracklib or pam_passwdqc [test:AUTH-9262] - [09:42:54] Suggestion: When possible set expire dates for all password protected accounts [test:AUTH-9282] - [09:43:26] Suggestion: Harden the system by removing unneeded compilers. This can decrease the chance of customized trojans, backdoors and rootkits to be compiled and installed [test:HRDN-7220] ================================================================================ Files: - Test and debug information : /var/log/lynis.log - Report data : /var/log/lynis-report.dat |
A questo punto sapete cosa c’è da sitemare prima di andare in produzione, occhio!
enjoy!
Ti interessa acquistare un dominio a prezzi ultraconvenienti? clicca qui
Se hai trovato utili le informazioni su questo blog,
Fai una donazione!
Clicca sul bottone qui sotto o almeno clicca sul banner pubblicitario 🙂
Commenta