SecurityRiskAdvisors / VECTR

VECTR is a tool that facilitates tracking of your red and blue team testing activities to measure detection and prevention capabilities across different attack scenarios
1.39k stars 164 forks source link

DB restore procedure #13

Closed mikkos1 closed 5 years ago

mikkos1 commented 5 years ago

What's the proper way to restore VECTR database during version change?

I tried (and failed) with following steps:

  1. DB backup was taken via GUI in previous version (ce-5.0.0).
  2. Imported with mongorestore -d /tmp/backup/
  3. Restarted the mongodb docker instance
  4. GUI detected DB that needs to be migrated and failed with error message:

[INFO] com.sra.purpletools.dbmigrations.changelogs.v0029_update_tagging_map migration instantiated. Migration Failure, attempting to restore from backup. Details: /tmp/v0029_update_tagging_map.json (No such file or directory) Backup restored but application can not continue. Please see log file for information on correcting data.

I've tried with two separate DB's created in previous version, both give the same error message about missing "v0029_update_tagging_map.json". I also tried 'recommended upgrade path' (by copying old /data/ folder contents to new instance). That way I wasn't able to login anymore with old (migrated) or new (fresh install) username/password combination.

carlvonderheid commented 5 years ago

Can you email VECTR@securityriskadvisors.com with a contact email address and we can set something up?

mikkos1 commented 5 years ago

Can you email VECTR@securityriskadvisors.com with a contact email address and we can set something up?

Yep, let's continue there.

thebleucheese commented 5 years ago

For any users encountering a similar issue (unable to login to a site with upgraded data), we believe we've identified the issue. When following the recommended upgrade path we missed adding a set of documentation steps in the upgrade instructions on Github. Those are added now.

With the latest VECTR release we updated our authentication service to add the ability to manage local users as well as pave the road for some future enterprise features. This upgrade required an overhaul of our underlying authentication back-end. After backing up, deleting the mongo SRAUSERSDB and restarting the VECTR tomcat and mongo containers should force the auth service to create a new default admin account and should allow for default login credentials to be used to access the application.

Please see the wiki for more detailed instructions.