<div dir="ltr">Hello Hannes,<div><br></div><div>I wanted to express a huge *thank you* for your help! Your solutions of upgrading to aide 0.17.3 and the configuration you provided has worked for me. I see that 0.17.3 is a big improvement.</div><div><br></div><div>Thanks again!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 25, 2021 at 2:25 PM Hannes von Haugwitz <<a href="mailto:hannes@vonhaugwitz.com">hannes@vonhaugwitz.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
On Wed, Mar 24, 2021 at 11:00:38AM -0700, M wrote:<br>
> Is there any advantage to upgrading to the latest AIDE version (I am<br>
> on 0.15.1)?<br>
<br>
AIDE 0.15.1 has been released over 10 years ago. Please check the NEWS<br>
file[0] for the changes since then.<br>
<br>
> > On Wed, 24 Mar 2021 at 11:44, M <<a href="mailto:linuxntwrk@gmail.com" target="_blank">linuxntwrk@gmail.com</a>> wrote:<br>
> >> I've found some other discussions about this (<br>
> >> <a href="https://www.ipi.fi/pipermail/aide/2015-November/001504.html" rel="noreferrer" target="_blank">https://www.ipi.fi/pipermail/aide/2015-November/001504.html</a>) but I can't<br>
> >> seem to get it working with PCREs in AIDE either (negative lookahead?).<br>
<br>
PCRE support has been added in AIDE 0.16.<br>
<br>
> >> Goal is: to recursively include all subdirectories, exclude one<br>
> >> directory, but *include* a specific file only from the excluded<br>
> >> subdirectory.<br>
<br>
The difficulty here is that directories matching negative rules are<br>
completely ignored.<br>
<br>
To achieve your goal please try the following rules (AIDE >= 0.16):<br>
<br>
!/dir/sub/(?!file)<br>
!/dir/sub$ d<br>
/dir R<br>
<br>
Assuming the following files in the filesytem:<br>
<br>
/<br>
/dir<br>
/dir/file<br>
/dir/sub<br>
/dir/sub/not<br>
/dir/sub/file<br>
<br>
You can now use `--dry-init` to see which entries would be added to the<br>
database:<br>
<br>
$ aide --config aide.conf --dry-init<br>
[ ] d '/': no matching rule<br>
[X] d '/dir': selective rule: '/dir (none) l+p+u+g+s+c+m+i+n+md5+acl+selinux+xattrs+ftype+e2fsattrs+caps' (aide.conf:3: '/dir R')<br>
[X] f '/dir/file': selective rule: '/dir (none) l+p+u+g+s+c+m+i+n+md5+acl+selinux+xattrs+ftype+e2fsattrs+caps' (aide.conf:3: '/dir R')<br>
[ ] d '/dir/sub': negative rule: '!/dir/sub$ d' (aide.conf:2: '!/dir/sub$ d')<br>
[ ] f '/dir/sub/not': negative rule: '!/dir/sub/(?!file) (none)' (aide.conf:1: '!/dir/sub/(?!file)')<br>
[X] f '/dir/sub/file': selective rule: '/dir (none) l+p+u+g+s+c+m+i+n+md5+acl+selinux+xattrs+ftype+e2fsattrs+caps' (aide.conf:3: '/dir R')<br>
<br>
You can also use `--path-check` to test your rules:<br>
<br>
$ aide --config aide.conf --path-check f:/dir/sub/another-file<br>
[ ] f '/dir/sub/another-file': negative rule: '!/dir/sub/(?!file) (none)' (aide.conf:1: '!/dir/sub/(?!file)')<br>
<br>
Both `--dry-init` and `--path-check` have been added in AIDE 0.17.<br>
<br>
Best regards<br>
<br>
Hannes<br>
<br>
[0] <a href="https://github.com/aide/aide/blob/master/NEWS" rel="noreferrer" target="_blank">https://github.com/aide/aide/blob/master/NEWS</a><br>
_______________________________________________<br>
Aide mailing list<br>
<a href="mailto:Aide@ipi.fi" target="_blank">Aide@ipi.fi</a><br>
<a href="https://www.ipi.fi/mailman/listinfo/aide" rel="noreferrer" target="_blank">https://www.ipi.fi/mailman/listinfo/aide</a><br>
</blockquote></div>