Whitelisting ports for detection in rkhunter

You edit /etc/rkhunter.conf

# command line
sudo -e /etc/rkhunter.conf

# graphical
gksu gedit /etc/rkhunter.conf

Under the WHITELIST_PORTS section , add your whitelist. The configuration file has examples.

# Syntax /full/path/to/binary Protocol:port
# Protocol = TCP / UDP 
# You may use wildcards

PORT_WHITELIST=”/usr/sbin/privoxy TCP:8118″

#for multiple binaries / ports , list them as per the config file
PORT_WHITELIST="/usr/sbin/privoxy /usr/sbin/squid TCP:8118 TCP:3128"

# Alternate
PORT_WHITELIST="* TCP:22 TCP:80 TCP:443 TCP:8080"

The response from @Panther is correct. However you can also white-list whole path of executable. Example:

  • White-list all open ports for executable /usr/sbin/squid

PORT_PATH_WHITELIST=/usr/sbin/squid

  • White-list TCP port 3801 for executable /usr/sbin/squid

PORT_PATH_WHITELIST=/usr/sbin/squid:TCP:3801

All this with additional explanation is written in rkhunter.conf file.

P.S.: I just bumped into this and I feel that somebody can benefit from it in the future.