Skip to content

Commit aa23e12

Browse files
Copy tag names from MISP data into events (#21664) (#22331)
For each tag in the MISP data copy the name attribute into the `tags` array. (cherry picked from commit 1933672) Co-authored-by: hungnguyen-elastic <[email protected]>
1 parent a8cabad commit aa23e12

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

CHANGELOG.next.asciidoc

+1
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ field. You can revert this change by configuring tags for the module and omittin
730730
- Add max_number_of_messages config into s3 input. {pull}21993[21993]
731731
- Update Okta documentation for new stateful restarts. {pull}22091[22091]
732732
- Add SSL option to checkpoint module {pull}19560[19560]
733+
- Copy tag names from MISP data into events. {pull}21664[21664]
733734

734735
*Heartbeat*
735736

x-pack/filebeat/module/misp/threat/config/pipeline.js

+14
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ var threat = (function () {
3737
ignore_missing: true,
3838
});
3939

40+
// Copy tag names from MISP event to tags field.
41+
var copyTags = function (evt) {
42+
var mispTags = evt.Get("json.Tag");
43+
if (!mispTags) {
44+
return;
45+
}
46+
mispTags.forEach(function (tag) {
47+
if (tag.name) {
48+
evt.AppendTo("tags", tag.name);
49+
}
50+
});
51+
};
52+
4053
var setAttackPattern = function (evt) {
4154
var indicator_type = evt.Get("json.type");
4255
var attackPattern;
@@ -202,6 +215,7 @@ var threat = (function () {
202215
.Add(setThreatFeedField)
203216
.Add(convertFields)
204217
.Add(setAttackPattern)
218+
.Add(copyTags)
205219
.Build();
206220

207221
return {

x-pack/filebeat/module/misp/threat/test/misp-test.json.log

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
{"id":"2","event_id":"2","object_id":"0","object_relation":null,"category":"Payload delivery","type":"md5","to_ids":true,"uuid":"5d159be2-d4b4-4d97-9e14-406a02de0b81","timestamp":"1490878466","distribution":"5","sharing_group_id":"0","comment":"","deleted":false,"disable_correlation":false,"value":"89357a1b2e32f2b9bddff94b8136810b","Event":{"org_id":"1","distribution":"3","id":"1","info":"OSINT - OSX/Linker: New Mac malware attempts zero-day Gatekeeper bypass","orgc_id":"2","uuid":"5d159be2-d4b4-4d97-9e14-406a02de0b81"}}
33
{"id":"3","event_id":"3","object_id":"0","object_relation":null,"category":"Payload delivery","type":"filename","to_ids":true,"uuid":"5d159be2-d4b4-4d97-9e14-406a02de0b81","timestamp":"1490878466","distribution":"5","sharing_group_id":"0","comment":"","deleted":false,"disable_correlation":false,"value":"f6bf5b8bb2400aad4ac844f2b94a4e556907f35b44c5ff462fb4e70c0208c9de","Event":{"org_id":"1","distribution":"3","id":"1","info":"OSINT - OSX/Linker: New Mac malware attempts zero-day Gatekeeper bypass","orgc_id":"2","uuid":"5d159be2-d4b4-4d97-9e14-406a02de0b81"}}
44
{"id":"4","event_id":"4","object_id":"0","object_relation":null,"category":"Bad Domain","type":"domain","to_ids":true,"uuid":"563b3ea6-b26c-401f-a68b-4d84950d210b","timestamp":"1490878466","distribution":"5","sharing_group_id":"0","comment":"","deleted":false,"disable_correlation":false,"value":"f6bf5b8bb2400aad4ac844f2b94a4e556907f35b44c5ff462fb4e70c0208c9de","Event":{"org_id":"4","distribution":"3","id":"4","info":"OSINT Expansion on Systematic cyber attacks against Israeli and Palestinian targets going on for a year by Norman","orgc_id":"2","uuid":"563b3ea6-b26c-401f-a68b-4d84950d210b"}}
5+
{"Galaxy":[],"ShadowAttribute":[],"Tag":[{"colour":"#eb2323","exportable":true,"hide_tag":false,"id":"966","local":0,"name":"critical-ioc-quarantine","numerical_value":null,"user_id":"1"}],"category":"Network activity","comment":"","deleted":false,"disable_correlation":false,"distribution":"5","event_id":"693","first_seen":null,"id":"170814","last_seen":null,"object_id":"0","object_relation":null,"sharing_group_id":"0","timestamp":"1602078120","to_ids":false,"type":"url","uuid":"83078f8c-3d38-4fec-87a1-8be22a0be0a6","value":"endgame.hungmnguyen.us"}

x-pack/filebeat/module/misp/threat/test/misp-test.json.log-expected.json

+21
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,26 @@
105105
"rule.id": "4",
106106
"rule.uuid": "563b3ea6-b26c-401f-a68b-4d84950d210b",
107107
"service.type": "misp"
108+
},
109+
{
110+
"@timestamp": "2020-10-07T13:42:00.000Z",
111+
"event.category": "threat-intel",
112+
"event.dataset": "misp.threat",
113+
"event.id": "83078f8c-3d38-4fec-87a1-8be22a0be0a6",
114+
"event.kind": "event",
115+
"event.module": "misp",
116+
"event.type": "indicator",
117+
"fileset.name": "threat",
118+
"input.type": "log",
119+
"log.offset": 2149,
120+
"message": "endgame.hungmnguyen.us",
121+
"misp.threat_indicator.attack_pattern": "[url:full = 'endgame.hungmnguyen.us']",
122+
"misp.threat_indicator.attack_pattern_kql": "url.full: \"endgame.hungmnguyen.us\"",
123+
"misp.threat_indicator.feed": "misp",
124+
"misp.threat_indicator.type": "url",
125+
"rule.category": "Network activity",
126+
"service.type": "misp",
127+
"tags": "critical-ioc-quarantine",
128+
"url.full": "endgame.hungmnguyen.us"
108129
}
109130
]

0 commit comments

Comments
 (0)