/usr/pkgsrc/security/aide/ make && make install && make cleanalternatively you can install AIDE as precompiled package, available at ftp.netbsd.org.
database = file:///etc/aide.db # path to AIDE database in URl format database_new = file:///root/aide.db.new # path to new AIDE database which shall be created report_url = file:///root/aide.report # path to generated report #p : permissions #n : number of links #u : user #g : group #s : size #b : block count #m : mtime #c : ctime #a : atime #i : inode #S : check for growing size #E : empty group #md5 : MD5 checksum #sha1 : SHA1 checksum #rmd160 : RMD160 checksum #tiger : TIGER checksum #R : p+i+n+u+g+s+m+c+md5 #L : p+i+n+u+g #> : growing logfile and p+g+u+n+i+SThese options are almost self-explanatory, each submitted option will check in and compare the regarding fileattribute. "R", "L" and ">" are just macros for the mentioned options, so you can also build your own macro in the same way, e.g.:
daemon : md5+sha1+rmd160+tiger heavy : sha1+p+u+g+m+c+a+i+n"daemon" will create and check MD5, SHA1, RMD160 and TIGER checksums. Now it's time to configure the files to be checked:
/etc heavy /bin heavy /sbin heavy /usr/bin heavy /usr/sbin heavy /usr/pkg/bin heavy /usr/pkg/sbin heavy # check with heavy-settings /root md5 /dev u+g+i+s+S #check with specified options !/var/spool/ !/home/students # do not checkThis also done very easily, just list each directory and the options which should apply to it. Directories that should not be checked e. g. because they change very often, like /var/spool, or privacy of users might be violated, can be excluded with a single !.
aide -iThe created database is usually stored in /usr/pkg/etc/, except you specified another path in aide.conf. Since this database is the fingerprint each other AIDE comparison run uses to compare with, you should ensure its integrity by protecting it. This can be done by cryptography (e.g. encrypt or sign the database with PGP/GnuPG) or simply moving it to a protected media like CDROM or write protected floppy / ZIP disk. If you are paranoid (Who isn't?), you can also move AIDEs binary onto that media and deinstall the package to deceipt an intruder.
aide -CAIDE now builds a new database with the current status of all files and compares it against he initial database.
/etc/ld.so.conf 4217405 100644 0 0 55 156666 1 56ALmHB6PCPZN8bkbYHXvg== R+47jcSQFV59spXxQip+VJd+Jdw= /etc/ttyaction 4217405 100644 0 0 123 156667 1 wHSegaYfbPPg1MbNbvSVOQ== kufrktfUPSYfMp4zyym2M7pyJE8= /etc/motd 4217405 100664 0 0 1551 156668 1 PQ27jGbXvZUXb+Jsi7uNkg== X82oOZx8XV47nA9zF939H7aHc+A= /etc/hosts.equiv 4217405 100600 0 0 2 156669 1 Ch8ho0FzieDAoTOSx5p6iQ== 4Axzy+iVsOK5B7wmqjQs0xAKgEs=Now /etc/motd has been modified and aide -c has been run, excerpt from the produced report:
changed:/etc/motd Detailed information about changes: File: /etc/motd Size : 1551 , 1547 Inode : 156668 , 156819 MD5 : PQ27jGbXvZUXb+Jsi7uNkg== , BPOFEUF6A8ttOxkeHnT2ow== RMD160 : X82oOZx8XV47nA9zF939H7aHc+A= , S6ZmfxjVOSYPpoBrt5TS3Z7fnO0=
\$Id: aide-en.html,v 1.34 2014/08/21 09:24:02 stefan Exp $Autor: Stefan Schumacher für net-tex.de/cryptomancer.de, PGP-Key 0xB3FBAE33
$Log: aide-en.html,v $ Revision 1.34 2014/08/21 09:24:02 stefan Umlaute und Makefile clean up