add: [enrichment] Fetching data fields from the view

pull/4584/head
chrisr3d 2019-06-20 14:37:33 +02:00
parent c87de816a8
commit 9b9ef64b1f
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 9 additions and 1 deletions

View File

@ -2457,6 +2457,7 @@ function freetextImportResultsSubmit(id, count) {
}
function moduleResultsSubmit(id) {
var typesWithData = ['attachment', 'malware-sample'];
var data_collected = {};
var temp;
if ($('.meta_table').length) {
@ -2506,10 +2507,11 @@ function moduleResultsSubmit(id) {
if ($(this).find('.ObjectAttribute').length) {
var object_attributes = [];
$(this).find('.ObjectAttribute').each(function(a) {
var attribute_type = $(this).find('.AttributeType').text();
attribute = {
object_relation: $(this).find('.ObjectRelation').text(),
category: $(this).find('.AttributeCategory').text(),
type: $(this).find('.AttributeType').text(),
type: attribute_type,
value: $(this).find('.AttributeValue').text(),
uuid: $(this).find('.AttributeUuid').text(),
to_ids: $(this).find('.AttributeToIds')[0].checked,
@ -2528,6 +2530,9 @@ function moduleResultsSubmit(id) {
});
attribute['Tag'] = tags;
}
if (typesWithData.indexOf(attribute_type) != -1 && $(this).find('.AttributeData').length) {
attribute['data'] = $(this).find('.AttributeData').val();
}
object_attributes.push(attribute);
});
temp['Attribute'] = object_attributes;
@ -2572,6 +2577,9 @@ function moduleResultsSubmit(id) {
});
temp['Tag'] = tags;
}
if (typesWithData.indexOf(type_value) != -1 && $(this).find('.AttributeData').length) {
temp['data'] = $(this).find('.AttributeData').val();
}
attributes.push(temp);
});
data_collected['Attribute'] = attributes;