Installation de Lynis sous Centos et Ubuntu 16.04
Doc issue du site officiel https://packages.cisofy.com/
Testé Sur Centos 6 & 7
Testé sur Ubuntu 16.04
Centos
Assurez-vous que les paquets suivants sont sont à jours ou installés.
1 |
$ sudo yum update ca-certificates curl nss openssl |
Créer du repo Cisofy et completer le
1 |
$ sudo vi /etc/yum.repos.d/cisofy-lynis.repo |
1 2 3 4 5 6 |
[lynis] name=CISOfy Software - Lynis package baseurl=https://packages.cisofy.com/community/lynis/rpm/ enabled=1 gpgkey=https://packages.cisofy.com/keys/cisofy-software-rpms-public.key gpgcheck=1 |
Recharger la mémoire cache
1 |
$ sudo yum makecache fast |
Installer le paquet Lynis
1 |
$ sudo yum install lynis |
Simplement pour l’execution.
1 |
$ sudo lynis audit system |
Voici les options possible a l’exécution.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
Usage: lynis command [options] Command: audit audit system : Perform local security scan audit system remote <host> : Remote security scan audit dockerfile <file> : Analyze Dockerfile show show : Show all commands show version : Show Lynis version show help : Show help update update info : Show update details update release : Update Lynis release Options --no-log : Don't create a log file --pentest : Non-privileged scan (useful for pentest) --profile <profile> : Scan the system with the given profile file --quick (-Q) : Quick mode, don't wait for user input Layout options --no-colors : Don't use colors in output --quiet (-q) : No output --reverse-colors : Optimize color display for light backgrounds Misc options --debug : Debug logging to screen --view-manpage (--man) : View man page --verbose : Show more details on screen --version (-V) : Display version number and quit |
Ubuntu
Récupérer la clé depuis le serveur Ubuntu:
1 |
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C80E383C3DE9F082E01391A0366C67DE91CA5D5F |
Ou manuellement l’importer:
1 |
$ sudo wget -O - http://packages.cisofy.com/keys/cisofy-software-public.key | apt-key add - |
Ajouter un référentiel de logiciels
Le référentiel logiciel utilise de préférence HTTPS pour un transport sécurisé.
Installez la méthode ‘https’ pour APT, si elle n’était pas encore disponible.
1 |
$ sudo apt install apt-transport-https |
ajouter le dépôt
1 |
$ echo "deb https://packages.cisofy.com/community/lynis/deb/ CODENAME main" > sudo /etc/apt/sources.list.d/cisofy-lynis.list |
/!\ Remarque: Remplacez CODENAME par votre nom de distribution (jessie, trusty, xenial).
Ci joint en fonction de l’infra
1 2 3 4 5 6 7 8 9 10 11 12 |
Debian Debian 7 echo "deb https://packages.cisofy.com/community/lynis/deb/ wheezy main" > /etc/apt/sources.list.d/cisofy-lynis.list Debian 8 echo "deb https://packages.cisofy.com/community/lynis/deb/ jessie main" > /etc/apt/sources.list.d/cisofy-lynis.list Debian (other versions) echo "deb https://packages.cisofy.com/community/lynis/deb/ stable main" > /etc/apt/sources.list.d/cisofy-lynis.list Ubuntu Ubuntu 14.04 echo "deb https://packages.cisofy.com/community/lynis/deb/ trusty main" > /etc/apt/sources.list.d/cisofy-lynis.list Ubuntu 16.04 echo "deb https://packages.cisofy.com/community/lynis/deb/ xenial main" > /etc/apt/sources.list.d/cisofy-lynis.list Ubuntu (other versions) echo "deb https://packages.cisofy.com/community/lynis/deb/ stable main" > /etc/apt/sources.list.d/cisofy-lynis.list Other Debian derivatives (like Kali) Stable repository echo "deb https://packages.cisofy.com/community/lynis/deb/ stable main" > /etc/apt/sources.list.d/cisofy-lynis.list |
Mettre a jour la base de données de paquetages locaux avec les nouvelles données de référentiel
1 |
$ sudo apt update |
Installer Lynis
1 |
$ sudo apt install lynis |
/!\ Notez que les anciennes versions d’Ubuntu peuvent nécessiter l’installation d’apt-get install lynis
les options possible a l’exécution reste identique a toutes les versions