Skip to content →

Auditer la configuration sécurité de votre Unix avec Lynis

Lynis est un outil d’audit de votre système Unix/Linux (et d’autres systèmes type AIX).

L’objectif est d’améliorer la sécurité de votre système par une vérification de certains éléments de sécurité. Bien sûr, il ne faut pas s’attendre à une vérification complète de votre système d’un point de vue applicatif, mais il s’agit d’un bon début pour auditer ce qui pourrait poser un problème de sécurisation de votre machine, en cas d’attaque sur un de vos applicatifs par exemple.

Pour téléchargez Lynis, rendez vous ici : http://cisofy.com/lynis/ (http://rootkit.nl/software/lynis/)

Les options sont les suivantes :

[20:53 user@server lynis] > sudo sh lynis

[ Lynis 1.6.0 ]

################################################################################
 Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
 welcome to redistribute it under the terms of the GNU General Public License.
 See the LICENSE file for details about using this software.

 Copyright 2007-2014 - Michael Boelen, http://cisofy.com
 Enterprise support and plugins available via CISOfy - http://cisofy.com
################################################################################

[+] Initializing program
------------------------------------
  Scan options:
    --auditor "<name>"            : Auditor name
    --check-all (-c)              : Check system
    --no-log                      : Don't create a log file
    --profile <profile>           : Scan the system with the given profile file
    --quick (-Q)                  : Quick mode, don't wait for user input
    --tests "<tests>"             : Run only tests defined by <tests>
    --tests-category "<category>" : Run only tests defined by <category>

  Layout options:
    --no-colors                   : Don't use colors in output
    --quiet (-q)                  : No output, except warnings
    --reverse-colors              : Optimize color display for light backgrounds

  Misc options:
    --check-update                : Check for updates
    --debug                       : Debug logging to screen
    --view-manpage (--man)        : View man page
    --version (-V)                : Display version number and quit

  Enterprise options:
    --plugin-dir "<path">         : Define path of available plugins
    --upload                      : Upload data to central node

  Error: No parameters specified!
  See man page and documentation for all available options.

Exiting..

 

Personnellement, j’utilise le mode suivant depuis la 1.6.0 :

[20:58 user@serveur lynis] > sudo sh lynis --check-all --quick

 

L’outil vous fournit alors un rapport détaillé écrit dans un log, avec des “Warnings”, des “Suggestions” et un “Hardening index”. L’avantage, c’est que les conseils sont détaillés, et qu’il est facilement possible des les considérer et comprendre pour ensuite les corriger !

================================================================================

  -[ Lynis 1.6.0 Results ]-

  Warnings:
  ----------------------------
  - grpck binary found errors in one or more group files [AUTH-9216]
      http://cisofy.com/controls/AUTH-9216/

  - PHP option expose_php is possibly turned on, which can reveal useful information for attackers. [PHP-2372]
      http://cisofy.com/controls/PHP-2372/

 Suggestions:
  ----------------------------
  - Check process listing for processes waiting for IO requests [PROC-3614]
      http://cisofy.com/controls/PROC-3614/
  - Run grpck manually and check your group files [AUTH-9216]
      http://cisofy.com/controls/AUTH-9216/
  - Install a PAM module for password strength testing like pam_cracklib or pam_passwdqc [AUTH-9262]
      http://cisofy.com/controls/AUTH-9262/
  - Configure password aging limits to enforce password changing on a regular base [AUTH-9286]
      http://cisofy.com/controls/AUTH-9286/
  - Default umask in /etc/login.defs could be more strict like 027 [AUTH-9328]
      http://cisofy.com/controls/AUTH-9328/
  - Default umask in /etc/init.d/rc could be more strict like 027 [AUTH-9328]
      http://cisofy.com/controls/AUTH-9328/

[...]

  Follow-up:
  ----------------------------
  - Check the logfile (less /var/log/lynis.log)
  - Read security controls texts (http://cisofy.com)
  - Use --upload to upload data (Lynis Enterprise users)

[...]

================================================================================
  Lynis Scanner (details):

  Hardening index : 66 [#############       ]
  Tests performed : 192
  Plugins enabled : 0

  Lynis Modules:

 

Bref, vous n’avez plus d’excuses, et vous pouvez même charger des tests en fonction de vos critères de normes à respecter !

Published in Linux Scanner Sécurité

en_USEN