First implementation of the enrichment modularity

pull/1050/head
Iglocska 2016-02-21 23:11:56 +01:00
parent a1e457f76c
commit 947e6a73a1
4 changed files with 34 additions and 32 deletions

View File

@ -2702,40 +2702,13 @@ class EventsController extends AppController {
$typeCategoryMapping[$type][$k] = $k;
}
}
$defaultCategories = array(
'md5' => 'Payload delivery',
'sha1' => 'Payload delivery',
'sha224' =>'Payload delivery',
'sha256' => 'Payload delivery',
'sha384' => 'Payload delivery',
'sha512' => 'Payload delivery',
'sha512/224' => 'Payload delivery',
'sha512/256' => 'Payload delivery',
'authentihash' => 'Payload delivery',
'imphash' => 'Payload delivery',
'pehash' => 'Payload delivery',
'filename|md5' => 'Payload delivery',
'filename|sha1' => 'Payload delivery',
'filename|sha256' => 'Payload delivery',
'regkey' => 'Persistence mechanism',
'filename' => 'Payload delivery',
'ip-src' => 'Network activity',
'ip-dst' => 'Network activity',
'hostname' => 'Network activity',
'domain' => 'Network activity',
'url' => 'Network activity',
'link' => 'External analysis',
'email-src' => 'Payload delivery',
'email-dst' => 'Payload delivery',
'text' => 'Other',
);
$this->set('event', $event);
$this->set('typeList', array_keys($this->Event->Attribute->typeDefinitions));
$this->set('defaultCategories', $this->Event->Attribute->defaultCategories);
$this->set('typeCategoryMapping', $typeCategoryMapping);
debug($resultArray);
$this->set('resultArray', $resultArray);
$this->render('free_text_results');
$this->set('title', 'Freetext Import Results');
$this->render('resolved_attributes');
}
}
@ -3461,6 +3434,7 @@ class EventsController extends AppController {
$this->set('typeCategoryMapping', $typeCategoryMapping);
$this->set('title', 'Enrichment Results');
$this->render('resolved_attributes');
}
}
}

View File

@ -249,6 +249,34 @@ class Attribute extends AppModel {
)
);
public $defaultCategories = array(
'md5' => 'Payload delivery',
'sha1' => 'Payload delivery',
'sha224' =>'Payload delivery',
'sha256' => 'Payload delivery',
'sha384' => 'Payload delivery',
'sha512' => 'Payload delivery',
'sha512/224' => 'Payload delivery',
'sha512/256' => 'Payload delivery',
'authentihash' => 'Payload delivery',
'imphash' => 'Payload delivery',
'pehash' => 'Payload delivery',
'filename|md5' => 'Payload delivery',
'filename|sha1' => 'Payload delivery',
'filename|sha256' => 'Payload delivery',
'regkey' => 'Persistence mechanism',
'filename' => 'Payload delivery',
'ip-src' => 'Network activity',
'ip-dst' => 'Network activity',
'hostname' => 'Network activity',
'domain' => 'Network activity',
'url' => 'Network activity',
'link' => 'External analysis',
'email-src' => 'Payload delivery',
'email-dst' => 'Payload delivery',
'text' => 'Other',
);
// typeGroupings are a mapping to high level groups for attributes
// for example, IP addresses, domain names, hostnames e-mail addresses are all network related attribute types
// whilst filenames and hashes are all file related attribute types

View File

@ -1,8 +1,8 @@
<div class="index">
<h2><?php echo h($title);?></h2>
<p>Below you can see the attributes that are to be created based on the results of the free-text import. Make sure that the categories and the types are correct, often several options will be offered based on an inconclusive automatic resolution. </p>
<p>Below you can see the attributes that are to be created. Make sure that the categories and the types are correct, often several options will be offered based on an inconclusive automatic resolution. </p>
<?php
echo $this->Form->create('Attribute', array('url' => '/events/saveFreeText/' . $event['Event']['id']));
echo $this->Form->create('Attribute', array('url' => '/events/saveFreeText/' . $event['Event']['id'], 'class' => 'mainForm'));
if ($isSiteAdmin) {
echo $this->Form->input('force', array(
'checked' => false,

View File

@ -1590,7 +1590,7 @@ function freetextImportResultsSubmit(id, count) {
}
}
$("#AttributeJsonObject").val(JSON.stringify(attributeArray));
var formData = $("#AttributeFreeTextImportForm").serialize();
var formData = $(".mainForm").serialize();
$.ajax({
type: "post",
cache: false,