CIS Nagios Core Benchmark

Security configuration benchmark for Nagios Core monitoring system

v1.0.0 03-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for Nagios Core. It covers web interface HTTPS, authentication, NRPE SSL, file permissions, notification settings, CGI authorization, resource file protection, and operational best practices.

14Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1Installation & PermissionsProcess user, configuration file security
2Web Interface SecurityHTTPS enforcement, authentication hardening
3Communication SecurityExternal commands, NRPE SSL configuration
4Notifications & LoggingAlert contacts, event logging settings
5Check ConfigurationProcessing intervals, flap detection
6Authorization & SecretsCGI access control, resource file protection
7Maintenance & ValidationVersion updates, pre-reload verification

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — StandardEssential security for all Nagios Core deployments; minimal performance impact.
L2Level 2 — HardenedAdvanced hardening for PCI-DSS, HIPAA, or high-security environments.

1 — Installation & Permissions

▶

1.1 Process & File Security

▶
1.1.1 Ensure Nagios runs as a dedicated non-root user (Automated)
L1 Auto
Description

This recommendation verifies that Nagios runs as a dedicated non-root user on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify Nagios runs as nagios user
ps -eo user,pid,comm | grep nagios
grep 'nagios_user\|nagios_group' /usr/local/nagios/etc/nagios.cfg
Remediation
# Ensure Nagios runs as dedicated user
useradd -r -s /usr/sbin/nologin nagios
groupadd nagcmd
usermod -aG nagcmd nagios
# In nagios.cfg:
# nagios_user=nagios
# nagios_group=nagios
1.1.2 Ensure configuration file permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that configuration file permissions are restricted on the Nagios Core monitoring system. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Nagios Core monitoring system is essential for defense in depth.

Audit
# Check configuration file permissions
stat -c '%a %U %G' /usr/local/nagios/etc/nagios.cfg
find /usr/local/nagios/etc -type f -exec stat -c '%a %n' {} \; | head -20
Remediation
# Restrict configuration permissions
chmod 640 /usr/local/nagios/etc/nagios.cfg
chown root:nagios /usr/local/nagios/etc/nagios.cfg
chmod -R 640 /usr/local/nagios/etc/objects/
chmod 750 /usr/local/nagios/etc/

2 — Web Interface Security

▶

2.1 HTTPS & Authentication

▶
2.1.1 Ensure HTTPS is configured for web interface (Automated)
L1 Auto
Description

This recommendation verifies that HTTPS is configured for web interface on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify HTTPS is configured for web interface
grep -E 'SSLEngine|SSLCert' /etc/apache2/sites-enabled/nagios*.conf 2>/dev/null
grep -E 'SSLEngine|SSLCert' /etc/httpd/conf.d/nagios*.conf 2>/dev/null
Remediation
# Configure HTTPS for Nagios web UI
# In Apache site config:
<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/nagios.pem
    SSLCertificateKeyFile /etc/ssl/private/nagios-key.pem
    SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
</VirtualHost>
2.1.2 Ensure strong web authentication is configured (Automated)
L1 Auto
Description

This recommendation verifies that strong web authentication is configured on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check web authentication configuration
grep -E 'AuthType|AuthUserFile' /etc/apache2/sites-enabled/nagios*.conf 2>/dev/null
cat /usr/local/nagios/etc/htpasswd.users | wc -l
Remediation
# Configure strong web authentication
# Ensure htpasswd uses strong hashing:
htpasswd -Bc /usr/local/nagios/etc/htpasswd.users nagiosadmin
# In Apache config, enforce auth:
# AuthType Basic
# AuthName "Nagios Access"
# AuthUserFile /usr/local/nagios/etc/htpasswd.users
# Require valid-user

3 — Communication Security

▶

3.1 Commands & NRPE

▶
3.1.1 Ensure external command file permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that external command file permissions are restricted on the Nagios Core monitoring system. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Nagios Core monitoring system is essential for defense in depth.

Audit
# Verify command file permissions
stat -c '%a %U %G' /usr/local/nagios/var/rw/nagios.cmd
grep 'command_file' /usr/local/nagios/etc/nagios.cfg
Remediation
# Restrict external command file
chmod 660 /usr/local/nagios/var/rw/nagios.cmd
chown nagios:nagcmd /usr/local/nagios/var/rw/nagios.cmd
# Review check_external_commands in nagios.cfg
3.1.2 Ensure NRPE uses SSL with host restrictions (Automated)
L1 Auto
Description

This recommendation verifies that NRPE uses SSL with host restrictions on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check if NRPE uses SSL
grep -E 'ssl\|allowed_hosts' /usr/local/nagios/etc/nrpe.cfg 2>/dev/null
Remediation
# Configure NRPE with SSL and host restrictions
# In nrpe.cfg:
# ssl=1
# ssl_cert_file=/etc/nagios/ssl/nrpe.pem
# ssl_privatekey_file=/etc/nagios/ssl/nrpe-key.pem
# ssl_cacert_file=/etc/nagios/ssl/ca.pem
# allowed_hosts=10.0.0.5

4 — Notifications & Logging

▶

4.1 Alerting & Event Logs

▶
4.1.1 Ensure notifications are enabled and contacts configured (Automated)
L1 Auto
Description

This recommendation verifies that notifications are enabled and contacts configured on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check notification settings
grep -E 'enable_notifications|notification_period' /usr/local/nagios/etc/nagios.cfg
grep 'contact_name\|email' /usr/local/nagios/etc/objects/contacts.cfg
Remediation
# Enable and configure notifications
# In nagios.cfg:
# enable_notifications=1
# In contacts.cfg, define contacts with email:
# define contact{
#     contact_name  admin
#     email         admin@example.com
#     service_notification_period 24x7
#     host_notification_period    24x7
# }
4.1.2 Ensure comprehensive event logging is enabled (Automated)
L1 Auto
Description

This recommendation verifies that comprehensive event logging is enabled on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify event logging
grep -E 'log_file|log_rotation' /usr/local/nagios/etc/nagios.cfg
ls -la /usr/local/nagios/var/nagios.log
Remediation
# Configure comprehensive logging
# In nagios.cfg:
# log_file=/usr/local/nagios/var/nagios.log
# log_rotation_method=d
# log_host_retries=1
# log_service_retries=1
# log_event_handlers=1
# log_external_commands=1
# log_passive_checks=1

5 — Check Configuration

▶

5.1 Processing & Detection

▶
5.1.1 Ensure check result processing intervals are configured (Automated)
L1 Auto
Description

This recommendation verifies that check result processing intervals are configured on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify check result processing intervals
grep -E 'check_result_reaper_frequency|max_check_result_reaper_time' /usr/local/nagios/etc/nagios.cfg
Remediation
# Configure check result processing
# In nagios.cfg:
# check_result_reaper_frequency=10
# max_check_result_reaper_time=30
# max_concurrent_checks=0
# (0 = unlimited, set based on server capacity)
5.1.2 Ensure flap detection is enabled (Automated)
L1 Auto
Description

This recommendation verifies that flap detection is enabled on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check if flap detection is enabled
grep 'enable_flap_detection' /usr/local/nagios/etc/nagios.cfg
Remediation
# Enable flap detection
# In nagios.cfg:
# enable_flap_detection=1
# low_service_flap_threshold=5.0
# high_service_flap_threshold=20.0
# low_host_flap_threshold=5.0
# high_host_flap_threshold=20.0

6 — Authorization & Secrets

▶

6.1 CGI & Resource Files

▶
6.1.1 Ensure resource file permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that resource file permissions are restricted on the Nagios Core monitoring system. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Nagios Core monitoring system is essential for defense in depth.

Audit
# Verify resource file permissions (contains macros/passwords)
stat -c '%a %U %G' /usr/local/nagios/etc/resource.cfg
grep 'resource_file' /usr/local/nagios/etc/nagios.cfg
Remediation
# Protect resource file containing sensitive macros
chmod 600 /usr/local/nagios/etc/resource.cfg
chown nagios:nagios /usr/local/nagios/etc/resource.cfg
6.1.2 Ensure CGI authorization is restrictive (Automated)
L1 Auto
Description

This recommendation verifies that CGI authorization is restrictive on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check CGI authorization settings
grep -E 'authorized_for|use_authentication' /usr/local/nagios/etc/cgi.cfg
Remediation
# Restrict CGI access
# In cgi.cfg:
# use_authentication=1
# authorized_for_system_information=nagiosadmin
# authorized_for_configuration_information=nagiosadmin
# authorized_for_system_commands=nagiosadmin
# authorized_for_all_services=nagiosadmin
# authorized_for_all_hosts=nagiosadmin

7 — Maintenance & Validation

▶

7.1 Updates & Config Verification

▶
7.1.1 Ensure Nagios Core is running the latest stable version (Manual)
L1 Manual
Description

This recommendation verifies that Nagios Core is running the latest stable version on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Nagios version
/usr/local/nagios/bin/nagios --version | head -3
Remediation
# Update Nagios Core to latest stable
# Download from: https://www.nagios.org/downloads/
cd /tmp
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.x.x.tar.gz
tar xzf nagios-*.tar.gz
cd nagios-*
./configure && make all
make install
7.1.2 Ensure configuration is verified before reload (Automated)
L1 Auto
Description

This recommendation verifies that configuration is verified before reload on the Nagios Core monitoring system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Nagios Core monitoring system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify configuration before restart
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Remediation
# Always verify config before reload
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# Only reload if verification passes:
if [ $? -eq 0 ]; then
    systemctl reload nagios
fi