mirror of https://github.com/MISP/MISP
new: [attackMatrix] added instance UUID in rest response
parent
5cefdb3096
commit
929946f055
|
@ -4567,13 +4567,14 @@ class EventsController extends AppController {
|
|||
$attackTactic = $attackTacticData['attackTactic'];
|
||||
$attackTags = $attackTacticData['attackTags'];
|
||||
$killChainOrders = $attackTacticData['killChain'];
|
||||
$instanceUUID = $attackTacticData['instance-uuid'];
|
||||
|
||||
$scoresData = $this->Event->Attribute->AttributeTag->getTagScores($eventId, $attackTags);
|
||||
$maxScore = $scoresData['maxScore'];
|
||||
$scores = $scoresData['scores'];
|
||||
|
||||
if ($this->_isRest()) {
|
||||
$json = array('matrix' => $attackTactic, 'scores' => $scores);
|
||||
$json = array('matrix' => $attackTactic, 'scores' => $scores, 'instance-uuid' => $instanceUUID);
|
||||
$this->response->type('json');
|
||||
return new CakeResponse(array('body' => json_encode($json), 'status' => 200, 'type' => 'json'));
|
||||
} else {
|
||||
|
|
|
@ -1639,14 +1639,15 @@ class UsersController extends AppController {
|
|||
$attackTactic = $attackTacticData['attackTactic'];
|
||||
$attackTags = $attackTacticData['attackTags'];
|
||||
$killChainOrders = $attackTacticData['killChain'];
|
||||
$instanceUUID = $attackTacticData['instance-uuid'];
|
||||
|
||||
$scoresData = $this->Event->Attribute->AttributeTag->getTagScores(0, $attackTags);
|
||||
$maxScore = $scoresData['maxScore'];
|
||||
$scores = $scoresData['scores'];
|
||||
|
||||
if ($this->_isRest()) {
|
||||
$data = array('matrix' => $attackTactic, 'scores' => $scores);
|
||||
return $this->RestResponse->viewData($data, $this->response->type());
|
||||
$json = array('matrix' => $attackTactic, 'scores' => $scores, 'instance-uuid' => $instanceUUID);
|
||||
return $this->RestResponse->viewData($json, $this->response->type());
|
||||
} else {
|
||||
App::uses('ColourGradientTool', 'Tools');
|
||||
$gradientTool = new ColourGradientTool();
|
||||
|
|
|
@ -291,10 +291,13 @@ class Galaxy extends AppModel{
|
|||
throw new NotFoundException('Galaxies not found.');
|
||||
}
|
||||
|
||||
$mispUUID = Configure::read('MISP')['uuid'];
|
||||
|
||||
$attackTactic = array(
|
||||
'killChain' => $killChainOrders,
|
||||
'attackTactic' => array(),
|
||||
'attackTags' => array()
|
||||
'attackTags' => array(),
|
||||
'instance-uuid' => $mispUUID
|
||||
);
|
||||
|
||||
foreach ($galaxies as $galaxy) {
|
||||
|
|
Loading…
Reference in New Issue