Comment 3 for bug 1453952

Revision history for this message
Jared Fernandez (jared-fernandez) wrote : Re: Wildcards in "ALLOWDEVFILE" Not Working

I was able to solve the issue I was seeing here by changing the rkhunter configuration to include the following lines:

ALLOWDEVFILE=/dev/shm/byobu-*-????????/.last.tmux/*
ALLOWDEVFILE=/dev/shm/byobu-*-????????/*/*
ALLOWDEVFILE=/dev/shm/byobu-*-????????/*
ALLOWDEVFILE=/dev/shm/sem.*

There are two things at play here:

1.) As Roger Binns pointed out, the asterisk at the end of the line is only good for a single directory level of wildcard match, so to match all the levels, multiple lines must be added, one for each level.

2.) The wildcard match does not appear to be working correctly for directories that start with a period (such as .last.tmux), which I do believe to actually be a bug. By manually specifying ".last.tmux" instead of an asterisk for that level, the ALLOWDEVFILE declaration will then function correctly.

In my case, I used the question marks to limit what is to be whitelisted since the string here will always be exactly 8 characters. For extra security, if you have very few users that login (or only a single user), rather than using an asterisk after the "byobu-", you could manually specify the allowed user here to narrow down the whitelist even further.

I will update the title on this bug to reflect the issue of the wildcard not matching directories that begin with a period.