Skip to content

Commit 85ddfb3

Browse files
committed
ENH: Add tagging, check, and improved docs
1 parent b1ac8e2 commit 85ddfb3

File tree

4 files changed

+384
-67
lines changed

4 files changed

+384
-67
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
- Allow saving messages in bulks instead of refreshing the feed immediately (PR#2509 by Kamil Mankowski).
4646
- Add `attribute_mapping` parameter to allow selecting a subset of event attributes as well as additional attribute parameters (PR#2509 by Kamil Mankowski).
4747
- Add `event_separator` parameter to allow keeping IntelMQ events in separated MISP Events based on a given field (PR#2509 by Kamil Mankowski).
48+
- Add `tagging` parameter to allow adding tags to MISP events (PR#2509 by Kamil Mankowski).
4849
- Add `additional_info` parameter to extend the default description of MISP Events (PR#2509 by Kamil Mankowski).
4950
- `intelmq.bots.outputs.smtp_batch.output`: Documentation on multiple recipients added (PR#2501 by Edvard Rejthar).
5051

docs/user/bots.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4585,6 +4585,12 @@ Create a directory layout in the MISP Feed format.
45854585
The PyMISP library >= 2.4.119.1 is required, see
45864586
[REQUIREMENTS.txt](https://github.com/certtools/intelmq/blob/master/intelmq/bots/outputs/misp/REQUIREMENTS.txt).
45874587

4588+
Note: please test the produced feed before using in production. This bot allows you to do an
4589+
extensive customisation of the MISP feed, including creating multiple events and tags, but it can
4590+
be tricky to configure properly. Misconfiguration can prevent bot from starting or have bad
4591+
consequences for your MISP Instance (e.g. spaming with events). Use `intelmqctl check` command
4592+
to validate your configuration against common mistakes.
4593+
45884594
**Module:** `intelmq.bots.outputs.misp.output_feed`
45894595

45904596
**Parameters:**
@@ -4614,7 +4620,7 @@ hour", string.
46144620
(optional, int) If set to a non-0 value, the bot won't refresh the MISP feed immediately, but will cache
46154621
incoming messages until the given number of them. Use it if your bot proceeds a high number of messages
46164622
and constant saving to the disk is a problem. Reloading or restarting bot as well as generating
4617-
a new MISP event based on `interval_event` triggers saving regardless of the cache size.
4623+
a new MISP event based on `interval_event` triggers regenerating MISP feed regardless of the cache size.
46184624

46194625
**`attribute_mapping`**
46204626

@@ -4625,6 +4631,10 @@ dictionary represents additional parameters PyMISP can take when creating an att
46254631
names of other IntelMQ fields (then the value of such field will be used), or static values. If not needed,
46264632
leave empty dict.
46274633

4634+
For available attribute parameters, refer to the
4635+
[PyMISP documentation](https://pymisp.readthedocs.io/en/latest/_modules/pymisp/mispevent.html#MISPObjectAttribute)
4636+
for the `MISPObjectAttribute`.
4637+
46284638
For example:
46294639

46304640
```yaml
@@ -4668,6 +4678,40 @@ attribute_mapping:
46684678
source.ip:
46694679
```
46704680

4681+
**`tagging`
4682+
4683+
(optional, dict): Allows setting MISP tags to MISP events. The structure is a *dict of list of dicts*.
4684+
The keys refers to which MISP events you want to tag. If you want to tag all of them, use `__all__`.
4685+
If you use `event_separator` and want to add additional tags to some events, use the expected values
4686+
of the separation field. The *list of dicts* defines MISP tags as parameters to create `MISPTag`
4687+
objects from. Each dictonary has to have at least `name`. For all available parameters refer to the
4688+
[PyMISP documentation](https://pymisp.readthedocs.io/en/latest/_modules/pymisp/abstract.html#MISPTag)
4689+
for `MISPTag`.
4690+
4691+
Note: setting `name` is enough for MISP to match a correct tag from the global collection. You may
4692+
see it lacking the colour in the MISP Feed view, but it will be retriven after importing to your
4693+
instance.
4694+
4695+
Example 1 - set two tags for every MISP event:
4696+
4697+
```yaml
4698+
tagging:
4699+
__all__:
4700+
- name: tlp:red
4701+
- name: source:intelmq
4702+
```
4703+
4704+
Example 2 - create separated events based on `malware.name` and set additional family tag:
4705+
4706+
```yaml
4707+
event_separator: malware.name
4708+
tagging:
4709+
__all__:
4710+
- name: tlp:red
4711+
njrat:
4712+
- name: njrat
4713+
```
4714+
46714715
**Usage in MISP**
46724716

46734717
Configure the destination directory of this feed as feed in MISP, either as local location, or served via a web server.

0 commit comments

Comments
 (0)