Skip to content

Commit e8aaf48

Browse files
007: add example with multiple bots
1 parent 818a4c8 commit e8aaf48

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

007/README.md

+33-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The bot class is instantiated, passing a few parameters.
1919
from intelmq.bots.experts.domain_suffix.expert import DomainSuffixExpertBot
2020
domain_suffix = DomainSuffixExpertBot('domain-suffix', # bot id
2121
settings={'logging_path': None,
22-
'source_pipeline_broker': 'Pythonlistsimple', # TBD: Should this be default when called as lib?
22+
'source_pipeline_broker': 'Pythonlistsimple', # TODO: simplify
2323
'destination_pipeline_broker': 'Pythonlistsimple',
2424
'field': 'fqdn',
2525
'suffix_file': '/usr/share/publicsuffix/public_suffix_list.dat',
@@ -33,21 +33,49 @@ queues = domain_suffix.process_message({'source.fqdn': 'www.example.com'})
3333

3434
### Use cases
3535

36-
#### Generic
36+
#### General
3737
Any IntelMQ-related or third-party program may use IntelMQ's most potent components - IntelMQ's bots.
3838

39+
The full potential shows off when stacking multiple bots together and iterating over lots of data:
40+
41+
```python
42+
# instantiate all bots first, for an example see above
43+
domain_suffix = DomainSuffixExpertBot(...)
44+
url2fqdn = Url2fqdnExpertBot(...)
45+
http_status = HttpstatusExpertBot(...)
46+
tuency = TuencyExpertBot(...)
47+
lookyloo = LookylooExpertBot(...)
48+
49+
# a list of input messages
50+
messages = [{...}]
51+
52+
for message in message:
53+
for bot in (domain_suffix,
54+
url2fqdn,
55+
http_status,
56+
tuency,
57+
lookyloo):
58+
# for simiplicity we assume that the bots always send one message
59+
message = bot.process_message(message)['output'][0]
60+
# message now has the cumulated data of five bots
61+
62+
# messages now is a list of output messages
63+
```
64+
3965
#### IntelMQ Webinput Preview
4066

41-
The IntelMQ webinput could show previews of the *processed* data to the operator, not just the input data, adding much more value to the preview functionality.
67+
The IntelMQ webinput can show previews of the *processed* data to the operator, not just the input data, adding much more value to the preview functionality.
4268
Currently the preview gives the operator feedback on the parsing step. The further processing of the data by the bots is invisible to the operator.
4369
This causes confusion and uncertainty for the operators.
4470

71+
The Webinput backend can call the bots and process the events, without any interference to the running bot processes, pipelines and bot management.
72+
The data flow illustrated:
4573
```
4674
Data provided by operator -> webinput backend parser -> IntelMQ bots as configured in the webinput configuration -> preview shown to operator
4775
```
48-
The implementation details for the webinput are not part of the IEP.
76+
The implementation details for the webinput are not part of this proposal document.
4977

50-
In the next step, the webinput can also show previews of notifications (e.g. Emails):
78+
In the next step, the webinput can also show previews of notifications (e.g. Emails). This is also not part of this proposal document.
5179
```
5280
Data provided by operator -> webinput backend parser -> IntelMQ bots as configured in the webinput configuration -> notification tool (preview mode) -> notification preview shown to operator
5381
```

0 commit comments

Comments
 (0)