Known false positives and whitelisting strategies for Ubuntu Server.
rkhunter performs paranoid security checks that often flag legitimate system files as suspicious. This guide documents common false positives and how to handle them.
Warning:
Warning: Suspicious file types found in /usr/bin:
/usr/bin/lwp-request: Perl script text executable
Cause: rkhunter flags Perl scripts as suspicious in /usr/bin.
Legitimacy: Part of libwww-perl package, commonly installed.
Verification:
dpkg -S /usr/bin/lwp-request
# Output: libwww-perl: /usr/bin/lwp-request
file /usr/bin/lwp-request
# Output: Perl script text executableWhitelist:
sudo nano /etc/rkhunter.confAdd:
SCRIPTWHITELIST=/usr/bin/lwp-requestWarning:
Warning: Hidden file found: /etc/.updated
Cause: systemd package management marker file.
Legitimacy: Created by dpkg/apt after package updates.
Verification:
ls -la /etc/.updated
cat /etc/.updated # Shows timestampWhitelist:
ALLOWHIDDENFILE=/etc/.updatedWarning:
Warning: Suspicious file found: /etc/.resolv.conf.systemd-resolved.bak
Warning: Hidden file found: /etc/.*.bak
Cause: systemd creates backup files for configuration.
Legitimacy: Normal systemd behavior for config backups.
Verification:
ls -la /etc/.*.bak
# Lists systemd backup filesWhitelist:
ALLOWHIDDENFILE=/etc/.resolv.conf.systemd-resolved.bak
ALLOWHIDDENFILE=/etc/.*.bak4. Hidden Directories in /dev
Warning:
Warning: Hidden directory found: /dev/.udev
Warning: Hidden directory found: /dev/.lxd-mounts
Cause: systemd udev and LXD use hidden directories.
Legitimacy: Normal for modern Ubuntu systems.
Verification:
ls -la /dev/ | grep "^\."
systemctl status systemd-udevdWhitelist:
ALLOWHIDDENDIR=/dev/.udev
ALLOWHIDDENDIR=/dev/.lxd-mountsWarning:
Warning: Interface 'docker0' is in promiscuous mode
Warning: Interface 'virbr0' is in promiscuous mode
Cause: Docker/libvirt network bridges operate in promiscuous mode.
Legitimacy: Required for container networking.
Verification:
ip link show docker0
# Flags include PROMISC
docker network lsWhitelist:
ALLOWPROMISCIF=docker0
ALLOWPROMISCIF=virbr0
ALLOWPROMISCIF=br-* # Docker custom bridgesWarning:
Warning: Process '/usr/bin/some-daemon' has deleted files open
Cause: Long-running processes with outdated libraries after updates.
Legitimacy: Normal until service restart.
Solution: Restart affected services after system updates:
sudo systemctl restart servicenameOr disable test:
DISABLE_TESTS=deleted_filesWarning:
Warning: Possible rootkit string found in /usr/bin/program: 'bindshell'
Cause: Legitimate programs may contain rootkit-related strings for detection/testing.
Verification:
strings /usr/bin/program | grep bindshell
dpkg -S /usr/bin/programWhitelist (if verified safe):
DISABLE_TESTS=suspscanWarning: Only disable after manual verification!
Pros: Maintains security, precise control Cons: Requires manual configuration
# Whitelist specific files/directories
ALLOWHIDDENDIR=/etc/.git
ALLOWHIDDENFILE=/etc/.updated
SCRIPTWHITELIST=/usr/bin/lwp-request
ALLOWPROMISCIF=docker0Pros: Quick solution Cons: Reduces detection capability
# Disable tests with many false positives
DISABLE_TESTS=suspscan hidden_procs deleted_files appsUse sparingly! Each disabled test reduces security.
Pros: Handles legitimate changes automatically Cons: Won't prevent recurring warnings
# After system updates
sudo rkhunter --propupdBest for: File hash mismatches after package updates.
# Identify warning
sudo rkhunter --check --report-warnings-only
# Verify legitimacy
file /path/to/suspicious/file
dpkg -S /path/to/suspicious/file
ls -la /path/to/suspicious/fileLegitimate if:
- Part of installed package (
dpkg -Sshows package name) - Created by system service (systemd, Docker, etc.)
- Expected behavior (backups, temporary files)
Suspicious if:
- Unknown origin
- Not in package database
- Unexpected location
- Recent appearance without system changes
If legitimate:
sudo nano /etc/rkhunter.conf
# Add appropriate whitelist
sudo rkhunter --propupdIf suspicious:
# Quarantine file
sudo mv /path/to/file /root/quarantine/
# Investigate further
sudo rkhunter --check --enable suspscanSymptoms: Many warnings about binary changes
Solution:
# Update properties after system updates
sudo rkhunter --propupd
# Or disable if too noisy
DISABLE_TESTS=appshidden_procs Test
Symptoms: False positives about hidden processes (systemd)
Solution:
DISABLE_TESTS=hidden_procsWhy: Modern systemd creates many process structures that trigger false positives.
Symptoms: Strings like "backdoor", "rootkit" in legitimate binaries
Solution:
DISABLE_TESTS=suspscanWarning: This test has high false-positive rate but also catches real threats. Disable only if overwhelming legitimate matches.
After apt upgrade, run:
# Update rkhunter properties
sudo rkhunter --propupd
# Verify no new warnings
sudo rkhunter --check --skip-keypressThis prevents false positives from:
- Binary hash changes (legitimate updates)
- Library replacements
- Configuration file updates
# Whitelist Docker interfaces
ALLOWPROMISCIF=docker0
ALLOWPROMISCIF=br-*
ALLOWPROMISCIF=veth*Docker Hidden Directories
ALLOWHIDDENDIR=/dev/.lxd-mounts
ALLOWHIDDENDIR=/var/lib/docker/.docker-*# Disable if Docker causes process warnings
DISABLE_TESTS=hidden_procsALLOWHIDDENFILE=/etc/.*.bak
ALLOWHIDDENFILE=/etc/.resolv.conf.systemd-resolved.bakALLOWHIDDENDIR=/dev/.udev
ALLOWHIDDENDIR=/run/systemdComplete /etc/rkhunter.conf whitelist section:
# ===== FALSE POSITIVE WHITELISTS =====
# Perl Scripts (Ubuntu packages)
SCRIPTWHITELIST=/usr/bin/lwp-request
SCRIPTWHITELIST=/usr/bin/GET
SCRIPTWHITELIST=/usr/bin/POST
# systemd Files
ALLOWHIDDENFILE=/etc/.updated
ALLOWHIDDENFILE=/etc/.*.bak
ALLOWHIDDENFILE=/etc/.resolv.conf.systemd-resolved.bak
ALLOWHIDDENDIR=/dev/.udev
ALLOWHIDDENDIR=/dev/.lxd-mounts
# Docker Network
ALLOWPROMISCIF=docker0
ALLOWPROMISCIF=br-*
ALLOWPROMISCIF=veth*
# Disable Noisy Tests
DISABLE_TESTS=suspscan hidden_procs deleted_files apps
# Enable Critical Tests Only
ENABLE_TESTS=known_rkits hidden_files passwd_changes group_changes system_commands
# ===== END WHITELISTS =====# Count warnings over time
sudo grep Warning /var/log/rkhunter.log | wc -l
# Group by warning type
sudo grep Warning /var/log/rkhunter.log | cut -d: -f2 | sort | uniq -c#!/bin/bash
# /opt/scripts/rkhunter-new-warnings.sh
LAST_WARNINGS="/var/lib/rkhunter/last_warnings.txt"
CURRENT_WARNINGS=$(sudo rkhunter --check --report-warnings-only 2>&1 | grep Warning)
if [ -f "$LAST_WARNINGS" ]; then
DIFF=$(comm -13 <(sort "$LAST_WARNINGS") <(echo "$CURRENT_WARNINGS" | sort))
if [ -n "$DIFF" ]; then
echo "New rkhunter warnings detected:"
echo "$DIFF" | mail -s "rkhunter: New Warnings" root
fi
fi
echo "$CURRENT_WARNINGS" > "$LAST_WARNINGS"- File not in package database
- Appears in critical system directories (
/bin,/sbin,/usr/bin) - Recent appearance without system updates
- Unknown origin or purpose
- Located in
/tmp,/dev/shm, or user directories
- Part of installed package (
dpkg -Sconfirms) - Created by known system service
- Documented Ubuntu/systemd behavior
- Matches known false positive patterns
- Verified hash against clean system