fix: [internal] Bad merge

pull/7806/head
Jakub Onderka 2021-10-05 19:41:57 +02:00
parent 9a6d0b2b96
commit 923f2501d3
2 changed files with 47 additions and 123 deletions

View File

@ -563,30 +563,6 @@ class AdminShell extends AppShell
echo 'Updated, new key:' . PHP_EOL . $authKey . PHP_EOL;
}
public function getOptionParser()
{
$this->ConfigLoad->execute();
$parser = parent::getOptionParser();
$parser->addSubcommand('updateJSON', array(
'help' => __('Update the JSON definitions of MISP.'),
'parser' => array(
'arguments' => array(
'update' => array('help' => __('Update the submodules before ingestion.'), 'short' => 'u', 'boolean' => 1)
)
)
));
$parser->addOption('force', array(
'short' => 'f',
'help' => 'Force the command.',
'default' => false,
'boolean' => true
));
return $parser;
}
public function recoverSinceLastSuccessfulUpdate()
{
$this->ConfigLoad->execute();

View File

@ -139,100 +139,6 @@ class Server extends AppModel
5 => __('Password change required'),
6 => __('Terms not accepted')
);
$this->command_line_functions = array(
'console_admin_tasks' => array(
'data' => array(
'Get setting' => 'MISP/app/Console/cake Admin getSetting [setting|all]',
'Set setting' => 'MISP/app/Console/cake Admin setSetting [setting] [value]',
'Get authkey' => 'MISP/app/Console/cake Admin getAuthkey [user_email]',
'Change authkey' => 'MISP/app/Console/cake Admin change_authkey [user_email] [authkey]',
'Set baseurl' => 'MISP/app/Console/cake Baseurl [baseurl]',
'Change password' => 'MISP/app/Console/cake Password [email] [new_password] [--override_password_change]',
'Clear Bruteforce entries' => 'MISP/app/Console/cake Admin clearBruteforce [user_email]',
'Clean caches' => 'MISP/app/Console/cake Admin cleanCaches',
'Set database version' => 'MISP/app/Console/cake Admin setDatabaseVersion [version]',
'Run database update' => 'MISP/app/Console/cake Admin updateDatabase',
'Run updates' => 'MISP/app/Console/cake Admin runUpdates',
'Update all JSON structures' => 'MISP/app/Console/cake Admin updateJSON',
'Update Galaxy definitions' => 'MISP/app/Console/cake Admin updateGalaxies',
'Update taxonomy definitions' => 'MISP/app/Console/cake Admin updateTaxonomies',
'Update object templates' => 'MISP/app/Console/cake Admin updateObjectTemplates [user_id]',
'Update Warninglists' => 'MISP/app/Console/cake Admin updateWarningLists',
'Update Noticelists' => 'MISP/app/Console/cake Admin updateNoticeLists',
'Set default role' => 'MISP/app/Console/cake Admin setDefaultRole [role_id]',
'Get IPs for user ID' => 'MISP/app/Console/cake Admin UserIP [user_id]',
'Get user ID for user IP' => 'MISP/app/Console/cake Admin IPUser [ip]',
'Generate correlation' => 'MISP/app/Console/cake Admin jobGenerateCorrelation [job_id]',
'Purge correlation' => 'MISP/app/Console/cake Admin jobPurgeCorrelation [job_id]',
'Generate shadow attribute correlation' => 'MISP/app/Console/cake Admin jobGenerateShadowAttributeCorrelation [job_id]',
'Update MISP' => 'MISP/app/Console/cake Admin updateMISP',
'Update after pull' => 'MISP/app/Console/cake Admin updateAfterPull [submodule_name] [job_id] [user_id]',
'Job upgrade' => 'MISP/app/Console/cake Admin jobUpgrade24 [job_id] [user_id]',
'Prune update logs' => 'MISP/app/Console/cake Admin prune_update_logs [job_id] [user_id]',
'Recover since last successful update' => 'MISP/app/Console/cake Admin recoverSinceLastSuccessfulUpdate',
'Reset sync authkeys' => 'MISP/app/Console/cake Admin resetSyncAuthkeys [user_id]',
'Purge feed events' => 'MISP/app/Console/cake Admin purgeFeedEvents [user_id] [feed_id]',
'Dump current database schema' => 'MISP/app/Console/cake Admin dumpCurrentDatabaseSchema',
'Scan attachment' => 'MISP/app/Console/cake Admin scanAttachment [input] [attribute_id] [job_id]',
'Clean excluded correlations' => 'MISP/app/Console/cake Admin cleanExcludedCorrelations [job_id]',
),
'description' => __('Certain administrative tasks are exposed to the API, these help with maintaining and configuring MISP in an automated way / via external tools.'),
'header' => __('Administering MISP via the CLI')
),
'console_automation_tasks' => array(
'data' => array(
'PullAll' => 'MISP/app/Console/cake Server pullAll [user_id] [full|update]',
'Pull' => 'MISP/app/Console/cake Server pull [user_id] [server_id] [full|update]',
'PushAll' => 'MISP/app/Console/cake Server pushAll [user_id]',
'Push' => 'MISP/app/Console/cake Server push [user_id] [server_id]',
'Cache server' => 'MISP/app/Console/cake server cacheServer [user_id] [server_id]',
'Cache all servers' => 'MISP/app/Console/cake server cacheServerAll [user_id]',
'Cache feeds for quick lookups' => 'MISP/app/Console/cake Server cacheFeed [user_id] [feed_id|all|csv|text|misp]',
'Fetch feeds as local data' => 'MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp]',
'Run enrichment' => 'MISP/app/Console/cake Event enrichment [user_id] [event_id] [json_encoded_module_list]',
'Test' => 'MISP/app/Console/cake Server test [server_id]',
'List' => 'MISP/app/Console/cake Server list',
'Enqueue pull' => 'MISP/app/Console/cake Server enqueuePull [timestamp] [user_id] [task_id]',
'Enqueue push' => 'MISP/app/Console/cake Server enqueuePush [timestamp] [task_id] [user_id]',
'Enqueue feed fetch' => 'MISP/app/Console/cake Server enqueueFeedFetch [timestamp] [user_id] [task_id]',
'Enqueue feed cache' => 'MISP/app/Console/cake Server enqueueFeedCache [timestamp] [user_id] [task_id]',
),
'description' => __('If you would like to automate tasks such as caching feeds or pulling from server instances, you can do it using the following command line tools. Simply execute the given commands via the command line / create cron jobs easily out of them.'),
'header' => __('Automating certain console tasks')
),
'event_management_tasks' => array(
'data' => array(
'Publish event' => 'MISP/app/Console/cake Event publish [event_id] [pass_along] [job_id] [user_id]',
'Publish sightings' => 'MISP/app/Console/cake Event publish_sightings [event_id] [pass_along] [job_id] [user_id]',
'Publish Galaxy clusters' => 'MISP/app/Console/cake Event publish_galaxy_clusters [cluster_id] [job_id] [user_id] [pass_along]',
'Cache event' => 'MISP/app/Console/cake Event cache [user_id] [event_id] [export_type]',
'Cache bro' => 'MISP/app/Console/cake Event cachebro [user_id] [event_id]',
'Recover event' => 'MISP/app/Console/cake Event recoverEvent [job_id] [event_id]',
'Alert email' => 'MISP/app/Console/cake Event alertemail [user_id] [job_id] [event_id] [old_publish]',
'Contact email' => 'MISP/app/Console/cake Event contactemail [event_id] [message] [all] [user_id] [process_id]',
'Posts email' => 'MISP/app/Console/cake Event postsemail [user_id] [post_id] [event_id] [title] [message] [process_id]',
'Enqueue caching' => 'MISP/app/Console/cake Event enqueueCaching [timestamp]',
'Do publish' => 'MISP/app/Console/cake Event doPublish [event_id]',
'Run enrichment' => 'MISP/app/Console/cake Event enrichment [user_id] [event_id] [json_encoded_module_list]',
'Process free text' => 'MISP/app/Console/cake Event processfreetext [input]',
'Process module result' => 'MISP/app/Console/cake Event processmoduleresult [input]',
),
'description' => __('The events can be managed via the CLI in addition to the UI / API management tools'),
'header' => __('Managing the events')
),
'worker_management_tasks' => array(
'data' => array(
'Get list of workers' => 'MISP/app/Console/cake Admin getWorkers [all|dead]',
'Start a worker' => 'MISP/app/Console/cake Admin startWorker [queue_name]',
'Restart a worker' => 'MISP/app/Console/cake Admin restartWorker [worker_pid]',
'Restart all workers' => 'MISP/app/Console/cake Admin restartWorkers',
'Kill a worker' => 'MISP/app/Console/cake Admin killWorker [worker_pid]',
),
'description' => __('The background workers can be managed via the CLI in addition to the UI / API management tools'),
'header' => __('Managing the background workers')
)
);
}
public $actions_description = array(
@ -7190,22 +7096,39 @@ class Server extends AppModel
return array(
'console_admin_tasks' => array(
'data' => array(
'Get setting' => 'MISP/app/Console/cake Admin getSetting [setting]',
'Get setting' => 'MISP/app/Console/cake Admin getSetting [setting|all]',
'Set setting' => 'MISP/app/Console/cake Admin setSetting [setting] [value]',
'Get authkey' => 'MISP/app/Console/cake Admin getAuthkey [email]',
'Get authkey' => 'MISP/app/Console/cake Admin getAuthkey [user_email]',
'Change authkey' => 'MISP/app/Console/cake Admin change_authkey [user_email] [authkey]',
'Set baseurl' => 'MISP/app/Console/cake Baseurl [baseurl]',
'Change password' => 'MISP/app/Console/cake Password [email] [new_password] [--override_password_change]',
'Clear Bruteforce Entries' => 'MISP/app/Console/cake Admin clearBruteforce [user_email]',
'Clear Bruteforce entries' => 'MISP/app/Console/cake Admin clearBruteforce [user_email]',
'Clean caches' => 'MISP/app/Console/cake Admin cleanCaches',
'Set database version' => 'MISP/app/Console/cake Admin setDatabaseVersion [version]',
'Run database update' => 'MISP/app/Console/cake Admin updateDatabase',
'Run updates' => 'MISP/app/Console/cake Admin runUpdates',
'Update all JSON structures' => 'MISP/app/Console/cake Admin updateJSON',
'Update Galaxy definitions' => 'MISP/app/Console/cake Admin updateGalaxies',
'Update taxonomy definitions' => 'MISP/app/Console/cake Admin updateTaxonomies',
'Update object templates' => 'MISP/app/Console/cake Admin updateObjectTemplates',
'Update object templates' => 'MISP/app/Console/cake Admin updateObjectTemplates [user_id]',
'Update Warninglists' => 'MISP/app/Console/cake Admin updateWarningLists',
'Update Noticelists' => 'MISP/app/Console/cake Admin updateNoticeLists',
'Set default role' => 'MISP/app/Console/cake Admin setDefaultRole [role_id]',
'Get IPs for user ID' => 'MISP/app/Console/cake Admin UserIP [user_id]',
'Get user ID for user IP' => 'MISP/app/Console/cake Admin IPUser [ip]',
'Generate correlation' => 'MISP/app/Console/cake Admin jobGenerateCorrelation [job_id]',
'Purge correlation' => 'MISP/app/Console/cake Admin jobPurgeCorrelation [job_id]',
'Generate shadow attribute correlation' => 'MISP/app/Console/cake Admin jobGenerateShadowAttributeCorrelation [job_id]',
'Update MISP' => 'MISP/app/Console/cake Admin updateMISP',
'Update after pull' => 'MISP/app/Console/cake Admin updateAfterPull [submodule_name] [job_id] [user_id]',
'Job upgrade' => 'MISP/app/Console/cake Admin jobUpgrade24 [job_id] [user_id]',
'Prune update logs' => 'MISP/app/Console/cake Admin prune_update_logs [job_id] [user_id]',
'Recover since last successful update' => 'MISP/app/Console/cake Admin recoverSinceLastSuccessfulUpdate',
'Reset sync authkeys' => 'MISP/app/Console/cake Admin resetSyncAuthkeys [user_id]',
'Purge feed events' => 'MISP/app/Console/cake Admin purgeFeedEvents [user_id] [feed_id]',
'Dump current database schema' => 'MISP/app/Console/cake Admin dumpCurrentDatabaseSchema',
'Scan attachment' => 'MISP/app/Console/cake Admin scanAttachment [input] [attribute_id] [job_id]',
'Clean excluded correlations' => 'MISP/app/Console/cake Admin cleanExcludedCorrelations [job_id]',
),
'description' => __('Certain administrative tasks are exposed to the API, these help with maintaining and configuring MISP in an automated way / via external tools.'),
'header' => __('Administering MISP via the CLI')
@ -7222,16 +7145,41 @@ class Server extends AppModel
'Fetch feeds as local data' => 'MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp]',
'Run enrichment' => 'MISP/app/Console/cake Event enrichment [user_id] [event_id] [json_encoded_module_list]',
'Test' => 'MISP/app/Console/cake Server test [server_id]',
'List' => 'MISP/app/Console/cake Server list'
'List' => 'MISP/app/Console/cake Server list',
'Enqueue pull' => 'MISP/app/Console/cake Server enqueuePull [timestamp] [user_id] [task_id]',
'Enqueue push' => 'MISP/app/Console/cake Server enqueuePush [timestamp] [task_id] [user_id]',
'Enqueue feed fetch' => 'MISP/app/Console/cake Server enqueueFeedFetch [timestamp] [user_id] [task_id]',
'Enqueue feed cache' => 'MISP/app/Console/cake Server enqueueFeedCache [timestamp] [user_id] [task_id]',
),
'description' => __('If you would like to automate tasks such as caching feeds or pulling from server instances, you can do it using the following command line tools. Simply execute the given commands via the command line / create cron jobs easily out of them.'),
'header' => __('Automating certain console tasks')
),
'event_management_tasks' => array(
'data' => array(
'Publish event' => 'MISP/app/Console/cake Event publish [event_id] [pass_along] [job_id] [user_id]',
'Publish sightings' => 'MISP/app/Console/cake Event publish_sightings [event_id] [pass_along] [job_id] [user_id]',
'Publish Galaxy clusters' => 'MISP/app/Console/cake Event publish_galaxy_clusters [cluster_id] [job_id] [user_id] [pass_along]',
'Cache event' => 'MISP/app/Console/cake Event cache [user_id] [event_id] [export_type]',
'Cache bro' => 'MISP/app/Console/cake Event cachebro [user_id] [event_id]',
'Recover event' => 'MISP/app/Console/cake Event recoverEvent [job_id] [event_id]',
'Alert email' => 'MISP/app/Console/cake Event alertemail [user_id] [job_id] [event_id] [old_publish]',
'Contact email' => 'MISP/app/Console/cake Event contactemail [event_id] [message] [all] [user_id] [process_id]',
'Posts email' => 'MISP/app/Console/cake Event postsemail [user_id] [post_id] [event_id] [title] [message] [process_id]',
'Enqueue caching' => 'MISP/app/Console/cake Event enqueueCaching [timestamp]',
'Do publish' => 'MISP/app/Console/cake Event doPublish [event_id]',
'Run enrichment' => 'MISP/app/Console/cake Event enrichment [user_id] [event_id] [json_encoded_module_list]',
'Process free text' => 'MISP/app/Console/cake Event processfreetext [input]',
'Process module result' => 'MISP/app/Console/cake Event processmoduleresult [input]',
),
'description' => __('The events can be managed via the CLI in addition to the UI / API management tools'),
'header' => __('Managing the events')
),
'worker_management_tasks' => array(
'data' => array(
'Get list of workers' => 'MISP/app/Console/cake Admin getWorkers [all|dead]',
'Start a worker' => 'MISP/app/Console/cake Admin startWorker [queue_name]',
'Restart a worker' => 'MISP/app/Console/cake Admin restartWorker [worker_pid]',
'Restart all workers' => 'MISP/app/Console/cake Admin restartWorkers',
'Kill a worker' => 'MISP/app/Console/cake Admin killWorker [worker_pid]',
),
'description' => __('The background workers can be managed via the CLI in addition to the UI / API management tools'),