1

So due to problems with my hostname I just changed it. The problem with that is that in the tripwire configuration I left the hostname variable within the name of the dbfile and the local keyfile as it was. (like {$hostname}-abc.key)
First I tried simply renaming the files to match my new hostname. That didn't work.
I then used a backup and updated the tripwire configuration file as described here without that hostname-variable to match my old hostname.
This also didn't work as I get:

Error: Policy file does not match policy used to create database.
Exiting...

How can this be fixed without having to reinitialize the tripwire database? I still have an untouched (but moved and hence potentially differing ownership?) backup of my tripwire files. Maybe chown and alike could be used to solve this? I'm running Debian 9.1 with KDE.

And on a related note: where can I find a hash of the siggen file? It was missing after compilation so I had to copy it from another compilation that worked. Not sure if that warrants a separate question.

1

Ok I solved this now. Here are the steps I took for that:

  1. Change your hostname back to what it was before by changing it via sudo texteditor /etc/hosts & sudo texteditor /etc/hostname
  2. Reboot computer and check that the name is set correctly by running uname -n
  3. Run a check: tripwire --check
  4. Check/save/backup the report
  5. Repeat steps 1 & 2 but change the hostname to the new hostname
  6. Get a backup of all the relevant tripwire files in place
  7. Rebuild configuration: sudo twadmin --create-cfgfile -S site.key twcfg.txt
  8. Regenerate local key: sudo twadmin --generate-keys --local-keyfile {hostname}.key
  9. Recreate policy: sudo twadmin -m P -S site.key twpol.txt
  10. Initialize the database: sudo tripwire --init
  11. Create a new offline backup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.