- Bonnes pratiques pour la configuration sécurisée de Zabbix
- Access control
- Windows installer paths
- Zabbix Security Advisories and CVE database
- Web server hardening
- Désactiver les pages d'erreurs par défaut du serveur web
- Suppression de la page de test du serveur web
- Disabling web server information exposure
- Disabling default web server error pages
- Removing web server test page
- Set X-Frame-Options HTTP response header
- Hiding the file with list of common passwords
- Displaying URL content in the sandbox
- Cryptography
Bonnes pratiques pour la configuration sécurisée de Zabbix
Aperçu
Cette section contient les bonnes pratiques à suivre pour configurer Zabbix de manière sécurisée.
Les pratiques expliquées ici ne sont pas obligatoire pour faire fonctionner Zabbix. Elles sont recommandées pour une meilleure sécurité du système.
Access control
Principle of least privilege
The principle of least privilege should be used at all times for Zabbix. This principle means that user accounts (in Zabbix frontend) or process user (for Zabbix server/proxy or agent) have only those privileges that are essential to perform intended functions. In other words, user accounts at all times should run with as few privileges as possible.
Giving extra permissions to 'zabbix' user will allow it to access configuration files and execute operations that can compromise the overall security of the infrastructure.
When implementing the least privilege principle for user accounts, Zabbix frontend user types should be taken into account. It is important to understand that while a "Admin" user type has less privileges than "Super Admin" user type, it has administrative permissions that allow managing configuration and execute custom scripts.
Some information is available even for non-privileged users. For example, while Administration → Scripts is not available for non-Super Admins, scripts themselves are available for retrieval by using Zabbix API. Limiting script permissions and not adding sensitive information (like access credentials, etc) should be used to avoid exposure of sensitive information available in global scripts.
Mettre en place le SSL pour l'interface Web
Sur RHEL/Centos, installez le package mod_ssl :
yum install mod_ssl
Créez un repertoire pour les clés SSL :
mkdir /etc/httpd/ssl
Ajoutez les paramètres SSL :
Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:localhost
Email Address []:
Éditez la configuration SSL Apache :
/etc/httpd/conf.d/ssl.conf
DocumentRoot "/usr/share/zabbix"
ServerName localhost:443
SSLCertificateFile /etc/httpd/ssl/apache.crt
SSLCertificateKeyFile /etc/httpd/ssl/apache.key
Redémarrez le service Apache pour appliquer les changements :
systemctl restart httpd.service
Activation de Zabbix dans le répertoire racine de l'URL
Ajoutez un hôte virtuel à la configuration Apache et définissez une redirection permanente pour le document racine vers l'URL sécurisée de Zabbix. Remplacez localhost par le nom réel du serveur.
/etc/httpd/conf/httpd.conf
#Add lines
<VirtualHost *:*>
ServerName localhost
Redirect permanent / http://localhost
</VirtualHost>
Redémarrez le service Apache pour appliquer les modifications :
systemctl restart httpd.service
Windows installer paths
When using Windows installers, it is recommended to use default paths provided by the installer as using custom paths without proper permissions could compromise the security of the installation.
Zabbix Security Advisories and CVE database
See Zabbix Security Advisories and CVE database.
Désactiver l'exposition des informations du serveur Web
Il est recommandé de désactiver toutes les signatures de serveur Web dans le cadre du processus de renforcement du serveur Web. Le serveur Web expose la signature logicielle par défaut :

La signature peut être désactivée en ajoutant deux lignes au fichier de configuration Apache (utilisé comme exemple) :
ServerSignature Off
ServerTokens Prod
La signature PHP (X-Powered-By HTTP header) peut être désactivée en changeant le fichier de configuration php.ini (la signature est désactivée par défaut) :
expose_php = Off
Le redémarrage du serveur Web est obligatoire pour qur les changements dans le fichier de configuration soient appliqués.
Un niveau de sécurité supplémentaire peut être atteint en utilisant le mod_security (package libapache2-mod-security2) avec Apache. mod_security permet de supprimer la signature du serveur au lieu de supprimer uniquement la version de la signature du serveur. La signature peut être modifiée en n'importe quelle valeur en changeant "SecServerSignature" après l'installation de mod_security.
Reportez-vous à la documentation de votre serveur Web pour obtenir de l'aide sur la suppression/modification des signatures logicielles.
Web server hardening
Désactiver les pages d'erreurs par défaut du serveur web
Il est recommandé de désactiver les pages d'erreur par défaut pour éviter toute exposition d'informations. Le serveur Web utilise par défaut les pages d'erreur intégrées :

Les pages d'erreur par défaut doivent être remplacées/supprimées dans le cadre du processus de renforcement du serveur Web. La directive "ErrorDocument" peut être utilisée pour définir une page/texte d'erreur personnalisé pour le serveur web Apache (utilisé comme exemple).
Reportez-vous à la documentation de votre serveur Web pour obtenir de l'aide sur la façon de remplacer/supprimer les pages d'erreur par défaut.
Suppression de la page de test du serveur web
Il est recommandé de supprimer la page de test du serveur Web pour éviter toute exposition d'informations. Par défaut, le webroot du serveur web contient une page de test appelée index.html (Apache2 sur Ubuntu est utilisé comme exemple) :

La page de test doit être supprimée ou doit être rendue indisponible dans le cadre du processus de renforcement du serveur Web.
Disabling web server information exposure
It is recommended to disable all web server signatures as part of the web server hardening process. The web server is exposing software signature by default:

The signature can be disabled by adding two lines to the Apache (used as an example) configuration file:
ServerSignature Off
ServerTokens Prod
PHP signature (X-Powered-By HTTP header) can be disabled by changing the php.ini configuration file (signature is disabled by default):
expose_php = Off
Web server restart is required for configuration file changes to be applied.
Additional security level can be achieved by using the mod_security (package libapache2-mod-security2) with Apache. mod_security allows to remove server signature instead of only removing version from server signature. Signature can be altered to any value by changing "SecServerSignature" to any desired value after installing mod_security.
Please refer to documentation of your web server to find help on how to remove/change software signatures.
Disabling default web server error pages
It is recommended to disable default error pages to avoid information exposure. Web server is using built-in error pages by default:

Default error pages should be replaced/removed as part of the web server hardening process. The "ErrorDocument" directive can be used to define a custom error page/text for Apache web server (used as an example).
Please refer to documentation of your web server to find help on how to replace/remove default error pages.
Removing web server test page
It is recommended to remove the web server test page to avoid information exposure. By default, web server webroot contains a test page called index.html (Apache2 on Ubuntu is used as an example):

The test page should be removed or should be made unavailable as part of the web server hardening process.
Set X-Frame-Options HTTP response header
By default, Zabbix is configured with X-Frame-Options HTTP response
header set to SAMEORIGIN, meaning that content can only be loaded in
a frame that has the same origin as the page itself.
Zabbix frontend elements that pull content from external URLs (namely, the URL dashboard widget) display retrieved content in a sandbox with all sandboxing restrictions enabled.
These settings enhance the security of the Zabbix frontend and provide protection against XSS and clickjacking attacks. Super Admins can modify iframe sandboxing and X-Frame-Options HTTP response header parameters as needed. Please carefully weigh the risks and benefits before changing default settings. Turning sandboxing or X-Frame-Options off completely is not recommended.
Hiding the file with list of common passwords
To increase the complexity of password brute force attacks, it is
suggested to limit access to the file ui/data/top_passwords.txt by
modifying web server configuration. This file contains a list of the
most common and context-specific passwords, and is used to prevent users
from setting such passwords if Avoid easy-to-guess passwords parameter
is enabled in the password
policy.
For example, on NGINX file access can be limited by using the location
directive:
location = /data/top_passwords.txt {
deny all;
return 404;
}
On Apache - by using .htacess file:
<Files "top_passwords.txt">
Order Allow,Deny
Deny from all
</Files>
Displaying URL content in the sandbox
Since version 5.0.2, some Zabbix frontend elements (for example, the URL dashboard widget) are preconfigured to sandbox content retrieved from the URL. It is recommended to keep all sandboxing restrictions enabled to ensure protection against XSS attacks.
Zabbix Windows agent with OpenSSL
Zabbix Windows agent compiled with OpenSSL will try to reach the SSL configuration file in c:\openssl-64bit. The "openssl-64bit" directory on disk C: can be created by non-privileged users.
So for security hardening, it is required to create this directory manually and revoke write access from non-admin users.
Please note that the directory names will be different on 32-bit and 64-bit versions of Windows.