- wipe objects

- update taxonomies, warninglists, galaxies and objectTemplates after wipe
pull/2899/head
Richard van den Berg 2018-02-01 20:21:06 +01:00
parent 938180c004
commit 2f54353c81
2 changed files with 24 additions and 0 deletions

View File

@ -82,4 +82,18 @@ git clean -f -x app/webroot/img/orgs
git clean -f -x app/tmp/logs/
git clean -f -d -x app/files
echo "Updating taxonomies"
baseurl=$(grep -o -P "(?<='baseurl' => ').*(?=')" $MISPPath/app/Config/config.php)
AuthKey=$(echo 'select authkey from users where role_id = 1 order by id limit 1;' | mysql -u $MySQLRUser -p$MySQLRPass $MISPDB 2>/dev/null | tail -1)
curl --header "Authorization: $AuthKey" --header "Accept: application/json" --header "Content-Type: application/json" -o /dev/null -s -X POST ${baseurl}/taxonomies/update
echo "Updating warninglists"
curl --header "Authorization: $AuthKey" --header "Accept: application/json" --header "Content-Type: application/json" -o /dev/null -s -X POST ${baseurl}/warninglists/update
echo "Updating galaxies"
curl --header "Authorization: $AuthKey" --header "Accept: application/json" --header "Content-Type: application/json" -o /dev/null -s -X POST ${baseurl}/galaxies/update
echo "Updating objectTemplates"
curl --header "Authorization: $AuthKey" --header "Accept: application/json" --header "Content-Type: application/json" -o /dev/null -s -X POST ${baseurl}/objectTemplates/update
echo 'MISP Wipe Complete!!!'

View File

@ -1,12 +1,21 @@
-- Clear tables that should be empty
TRUNCATE `attributes`;
TRUNCATE `attribute_tags`;
TRUNCATE `cake_sessions`;
TRUNCATE `correlations`;
TRUNCATE `events`;
TRUNCATE `event_blacklists`;
TRUNCATE `event_delegations`;
TRUNCATE `event_tags`;
TRUNCATE `favourite_tags`;
TRUNCATE `jobs`;
TRUNCATE `logs`;
TRUNCATE `objects`;
TRUNCATE `object_references`;
TRUNCATE `object_relationships`;
TRUNCATE `object_templates`;
TRUNCATE `object_template_elements`;
TRUNCATE `org_blacklists`;
TRUNCATE `posts`;
TRUNCATE `servers`;
TRUNCATE `shadow_attributes`;
@ -15,6 +24,7 @@ TRUNCATE `sharing_groups`;
TRUNCATE `sharing_group_orgs`;
TRUNCATE `sharing_group_servers`;
TRUNCATE `sightings`;
TRUNCATE `tags`;
TRUNCATE `threads`;
TRUNCATE `bruteforces`;
TRUNCATE `news`;