Skip to content

Commit 993aeb1

Browse files
committed
ENH: Add tagging, check, and improved docs
1 parent e2d940f commit 993aeb1

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
@@ -39,6 +39,7 @@
3939
- Allow saving messages in bulks instead of refreshing the feed immediately (PR#2509 by Kamil Mankowski).
4040
- Add `attribute_mapping` parameter to allow selecting a subset of event attributes as well as additional attribute parameters (PR#2509 by Kamil Mankowski).
4141
- Add `event_separator` parameter to allow keeping IntelMQ events in separated MISP Events based on a given field (PR#2509 by Kamil Mankowski).
42+
- Add `tagging` parameter to allow adding tags to MISP events (PR#2509 by Kamil Mankowski).
4243
- Add `additional_info` parameter to extend the default description of MISP Events (PR#2509 by Kamil Mankowski).
4344
- `intelmq.bots.outputs.smtp_batch.output`: Documentation on multiple recipients added (PR#2501 by Edvard Rejthar).
4445

docs/user/bots.md

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

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

45764582
**Parameters:**
@@ -4600,7 +4606,7 @@ hour", string.
46004606
(optional, int) If set to a non-0 value, the bot won't refresh the MISP feed immediately, but will cache
46014607
incoming messages until the given number of them. Use it if your bot proceeds a high number of messages
46024608
and constant saving to the disk is a problem. Reloading or restarting bot as well as generating
4603-
a new MISP event based on `interval_event` triggers saving regardless of the cache size.
4609+
a new MISP event based on `interval_event` triggers regenerating MISP feed regardless of the cache size.
46044610

46054611
**`attribute_mapping`**
46064612

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

4620+
For available attribute parameters, refer to the
4621+
[PyMISP documentation](https://pymisp.readthedocs.io/en/latest/_modules/pymisp/mispevent.html#MISPObjectAttribute)
4622+
for the `MISPObjectAttribute`.
4623+
46144624
For example:
46154625

46164626
```yaml
@@ -4654,6 +4664,40 @@ attribute_mapping:
46544664
source.ip:
46554665
```
46564666

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

46594703
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)