Hello, I thought it might be useful to share the easiest way I have found to duplicate 'freebsd-update IDS' within a pkgbase system.
It should be noted that 'freebsd-update IDS' is NOT an Intrusion Detection System - it would be very easy for someone with root access to modify freebsd-update to not highlight malicious files or changes. It is simply a comparison of the whole filesystem against a known copy of a FreeBSD installation (with system updates) before any changes have been made. So it's useful for seeing what changes you have made over the years, identifying any files you left around that are no longer needed, etc. If you were doing a reinstall of FreeBSD you would then know which system files to alter.
First, make a directory to install the copy (doesn't need to be /ids):
Then create a copy of FreeBSD as would be installed:
Then create mtree information for the copy (you can change the information stored if you want):
exclude.mtree contains directories that we expect to be changed, so there's no point including these. For me I use:
Then compare your current system against the copy:
ids.out then shows you what has changed in a readable format.
If you have kept your system up-to-date this procedure will work, as bsdinstall pkgbase will include the latest patches.
It should be noted that 'freebsd-update IDS' is NOT an Intrusion Detection System - it would be very easy for someone with root access to modify freebsd-update to not highlight malicious files or changes. It is simply a comparison of the whole filesystem against a known copy of a FreeBSD installation (with system updates) before any changes have been made. So it's useful for seeing what changes you have made over the years, identifying any files you left around that are no longer needed, etc. If you were doing a reinstall of FreeBSD you would then know which system files to alter.
First, make a directory to install the copy (doesn't need to be /ids):
mkdir /idsThen create a copy of FreeBSD as would be installed:
export BSDINSTALL_CHROOT=/ids
bsdinstall pkgbaseThen create mtree information for the copy (you can change the information stored if you want):
mtree -c -R time,size,nlink -K sha512 -p /ids -X exclude.mtree >ids.mtreeexclude.mtree contains directories that we expect to be changed, so there's no point including these. For me I use:
Code:
./boot/kernel.old/*
./tmp/*
./var/*
./usr/local/*
./dev/*
./proc/*
./media/*
Then compare your current system against the copy:
mtree -p / -f ids.mtree -X exclude.mtree >ids.outids.out then shows you what has changed in a readable format.
If you have kept your system up-to-date this procedure will work, as bsdinstall pkgbase will include the latest patches.