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.
$ sudo yum update ca-certificates curl nss openssl
Créer du repo Cisofy et completer le
$ sudo vi /etc/yum.repos.d/cisofy-lynis.repo
[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
$ sudo yum makecache fast
Installer le paquet Lynis
$ sudo yum install lynis
Simplement pour l’execution.
$ sudo lynis audit system
Voici les options possible a l’exécution.
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:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C80E383C3DE9F082E01391A0366C67DE91CA5D5F
Ou manuellement l’importer:
$ 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.
$ sudo apt install apt-transport-https
ajouter le dépôt
$ 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
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
$ sudo apt update
Installer Lynis
$ 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