mirror of https://github.com/MISP/MISP
fix: [sync] prevent local tags from being pulled
parent
38f785ea63
commit
14b9463fb5
|
@ -286,6 +286,14 @@ class Server extends AppModel
|
|||
$event['Event']['distribution'] = '1';
|
||||
break;
|
||||
}
|
||||
// We remove local tags obtained via pull
|
||||
if (isset($event['Event']['Tag'])) {
|
||||
foreach ($event['Event']['Tag'] as $key => $a) {
|
||||
if ($a['local']) {
|
||||
unset($event['Event']['Tag'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($event['Event']['Attribute']) && !empty($event['Event']['Attribute'])) {
|
||||
foreach ($event['Event']['Attribute'] as $key => $a) {
|
||||
switch ($a['distribution']) {
|
||||
|
@ -296,6 +304,14 @@ class Server extends AppModel
|
|||
$event['Event']['Attribute'][$key]['distribution'] = '1';
|
||||
break;
|
||||
}
|
||||
// We remove local tags obtained via pull
|
||||
if (isset($a['Tag'])) {
|
||||
foreach ($a['Tag'] as $k => $v) {
|
||||
if ($v['local']) {
|
||||
unset($event['Event']['Attribute'][$key]['Tag'][$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($event['Event']['Object']) && !empty($event['Event']['Object'])) {
|
||||
|
@ -318,6 +334,14 @@ class Server extends AppModel
|
|||
$event['Event']['Object'][$i]['Attribute'][$j]['distribution'] = '1';
|
||||
break;
|
||||
}
|
||||
// We remove local tags obtained via pull
|
||||
if (isset($a['Tag'])) {
|
||||
foreach ($a['Tag'] as $k => $v) {
|
||||
if ($v['local']) {
|
||||
unset($event['Event']['Object'][$i]['Attribute'][$j]['Tag'][$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue