Skip to content

Commit c00c355

Browse files
authored
Merge pull request certtools#2560 from sebix/docs
Docs: Add redis docs, fix existing pipeline docs, add unlinked file
2 parents 6721678 + 0407934 commit c00c355

File tree

7 files changed

+112
-58
lines changed

7 files changed

+112
-58
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
### Documentation
5151
- `docs/admin/installation/linux-packages`: Add `[signed-by=]` options, add wget command as alternative to curl (PR#2547 by Sebastian Wagner).
52+
- Add documentation on the Redis pipeline (databases, configuration), fix generic pipeline documentation and add missing information on parameters, add unlinked intelmqctl docs to the index and TOC (PR#2560 by Sebastian Wagner).
5253

5354
### Packaging
5455

docs/admin/beta-features.md

+29-22
Original file line numberDiff line numberDiff line change
@@ -56,78 +56,84 @@ only RabbitMQ as broker has been tested.
5656
You can change the broker for single bots (set the parameters in the runtime configuration per bot) or for the whole
5757
botnet (using the global configuration).
5858

59+
### Settings
60+
5961
You need to set the parameter
6062
`source_pipeline_broker`/`destination_pipeline_broker` to `amqp`. There are more parameters available:
6163

62-
!!! bug
63-
This section of the documentation is currently incomplete and will be updated later.
64-
6564
**`destination_pipeline_broker`**
6665

6766
(required, string) `"amqp"`
6867

69-
7068
**`destination_pipeline_host`**
7169

72-
() (default: `'127.0.0.1'`)
70+
(optional, string) (default: `'127.0.0.1'`)
7371

7472
**`destination_pipeline_port`**
7573

76-
() (default: 5672)
74+
(optional, integer) (default: 5672)
7775

7876
**`destination_pipeline_username`**
7977

80-
()
78+
(optional, string)
8179

8280
**`destination_pipeline_password`**
8381

84-
()
82+
(optional, string)
83+
84+
**`destination_pipeline_ssl`**
85+
86+
(optional, boolean) (default: false)
8587

8688
**`destination_pipeline_socket_timeout`**
8789

88-
() (default: no timeout)
90+
(optional, integer) (default: no timeout)
8991

9092
**`destination_pipeline_amqp_exchange`**
9193

92-
() Only change/set this if you know what you do. If set, the destination queues are not declared as queues, but used as routing key. (default: `''`).
94+
(optional, string) Only change/set this if you know what you do. If set, the destination queues are not declared as queues, but used as routing key. (default: `''`).
9395

9496
**`destination_pipeline_amqp_virtual_host`**
9597

96-
() (default: `'/'`)
98+
(optional, string) (default: `'/'`)
9799

98100
**`source_pipeline_host`**
99101

100-
() (default: `'127.0.0.1'`)
101-
102+
(optional, string) (default: `'127.0.0.1'`)
102103

103104
**`source_pipeline_port`**
104105

105-
() (default: 5672)
106+
(optional, port) (default: 5672)
106107

107108
**`source_pipeline_username`**
108109

109-
()
110+
(optional, string)
110111

111112
**`source_pipeline_password`**
112113

113-
()
114+
(optional, string)
115+
116+
**`source_pipeline_ssl`**
117+
118+
(optional, boolean) (default: false)
114119

115120
**`source_pipeline_socket_timeout`**
116121

117-
() (default: no timeout)
122+
(optional, string) (default: no timeout)
118123

119124
**`source_pipeline_amqp_exchange`**
120125

121-
() Only change/set this if you know what you do. If set, the destination queues are not declared as queues, but used as routing key. (default: ['']).
122-
126+
(optional, string) Only change/set this if you know what you do. If set, the destination queues are not declared as queues, but used as routing key. (default: `""`]).
123127

124128
**`source_pipeline_amqp_virtual_host`**
125129

126-
() (default: `'/'`)
130+
(optional, string) (default: `'/'`)
127131

128132
**`intelmqctl_rabbitmq_monitoring_url`**
129133

130-
() string, see below (default: `"http://{host}:15672"`)
134+
(optional, string) string, see below (default: `"http://{host}:15672"`)
135+
136+
### Monitoring queues
131137

132138
For getting the queue sizes, `intelmqctl` needs to connect to the monitoring interface of RabbitMQ. If the monitoring
133139
interface is not available under `http://{host}:15672` you can manually set using the
@@ -137,10 +143,11 @@ user account, make sure to add the tag "monitoring" to it, otherwise IntelMQ can
137143

138144
![](../static/images/rabbitmq-user-monitoring.png)
139145

146+
### Statistics
147+
140148
Setting the statistics (and cache) parameters is necessary when the local redis is running under a non-default
141149
host/port. If this is the case, you can set them explicitly:
142150

143-
144151
**`statistics_database`**
145152

146153
() `3`

docs/admin/configuration/intelmq.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -156,30 +156,14 @@ Some information can as well be found in Python's documentation on the used
156156

157157
If the path `_on_error` exists for a bot, the message is also sent to this queue, instead of (only) dumping the file if
158158
configured to do so.
159-
160-
##### Miscellaneous
161-
162-
**`load_balance`**
163-
164-
(required, boolean) this option allows you to choose the behavior of the queue. Use the following values:
165-
166-
- **true** - splits the messages into several queues without duplication
167-
- **false** - duplicates the messages into each queue - When using AMQP as message broker, take a look at the `multithreading`{.interpreted-text role="ref"} section and the `instances_threads` parameter.
168-
169-
**`rate_limit`**
170-
171-
(required, integer) time interval (in seconds) between messages processing. int value.
172-
173-
**`ssl_ca_certificate`**
174-
175-
(optional, string) trusted CA certificate for IMAP connections (supported by some bots).
159+
##### Pipeline
176160

177161
**`source_pipeline_broker`**
178162

179163
(optional, string) Allowed values are `redis` and `amqp`. Selects the message broker IntelMQ should use. As this parameter can be overridden by each bot, this allows usage of different broker systems and hosts, as well as switching between them on the same IntelMQ instance. Defaults to `redis`.
180164

181165
- **redis** - Please note that persistence has to be [manually activated](http://redis.io/topics/persistence).
182-
- **amqp** - [Using the AMQP broker]() is currently beta but there are no known issues. A popular AMQP broker is [RabbitMQ](https://www.rabbitmq.com/).
166+
- **amqp** - [Using the AMQP broker](../beta-features.md#using-amqp-message-broker) is currently beta but there are no known issues. A popular AMQP broker is [RabbitMQ](https://www.rabbitmq.com/).
183167

184168
**`destination_pipeline_broker`**
185169

@@ -220,6 +204,22 @@ configured to do so.
220204

221205
(required, integer) broker database that the bot will use to connect and send messages (requirement from
222206
redis broker).
207+
##### Miscellaneous
208+
209+
**`load_balance`**
210+
211+
(required, boolean) this option allows you to choose the behavior of the queue. Use the following values:
212+
213+
- **true** - splits the messages into several queues without duplication
214+
- **false** - duplicates the messages into each queue - When using AMQP as message broker, take a look at the `multithreading`{.interpreted-text role="ref"} section and the `instances_threads` parameter.
215+
216+
**`rate_limit`**
217+
218+
(required, integer) time interval (in seconds) between messages processing. int value.
219+
220+
**`ssl_ca_certificate`**
221+
222+
(optional, string) trusted CA certificate for IMAP connections (supported by some bots).
223223

224224
**`http_proxy`**
225225

docs/admin/configuration/redis.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Redis Pipeline (Message broker)
2+
<!-- comment
3+
SPDX-FileCopyrightText: 2025 Sebastian Wagner, Intevation GmbH <[email protected]>
4+
SPDX-License-Identifier: AGPL-3.0-or-later
5+
-->
6+
7+
The default IntelMQ Pipeline (the message exchange between bots) is [Redis](https://redis.io/) or its OpenSource successor [Valkey](https://valkey.io/).
8+
9+
For AMQP (RabbitMQ) see [Using AMQP Message Broker](../beta-features.md#using-amqp-message-broker) in the section about Beta features.
10+
11+
## Usage of databases
12+
13+
You can use any redis database for any purpose. There are no hardcoded defaults or other requirements in IntelMQ.
14+
15+
It's also possible to use the same database for two different bots. Just make sure, that their data doesn't collide.
16+
17+
These are some of the usages of redis databases using the IntelMQ default values:
18+
19+
- 2: Pipeline (Queues)
20+
- 4: IntelMQ Tests
21+
- 6: Deduplicator Expert
22+
- 7: Reverse DNS Expert
23+
- 8: RDAP Expert, Aggregate Expert
24+
- 10: RIPE Expert
25+
- 12: Shadowserver Reports API Collector
26+
- 15: SMTP Batch Output
27+
28+
By default, Redis/valkey have a maximum of 16 databases (0-15). In it the Redis/valkey server configuration file, this value can be increased.
29+
While the number of maximum databases [is unlimited](https://redis.io/docs/latest/embeds/how-many-databases-software/), the practical limit is INT_32.
30+
31+
## Setup tips
32+
33+
SWAP space should be bigger or equal to your memory. See also [Hardware requirements](../hardware-requirements.md).
34+
35+
### Redis memory overcommitting
36+
37+
It is [recommended](https://redis.io/docs/latest/operate/oss_and_stack/management/admin/#linux) to enable memory overcommitting for Redis.
38+
39+
Run `sysctl vm.overcommit_memory=1` to set it for the current session.
40+
To enable it permanently, create a file with `vm.overcommit_memory = 1` in `/etc/sysctl.d/intelmq.conf`.
41+
42+
### Maxmemory
43+
44+
To limit the maximum memory used by Redis and also to mitigate possible downsides of memory overcommitting, you can set a maximum memory usage in the Redis/Valkey server configuration with setting `maxmemory <bytes>`.

intelmq/lib/pipeline.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -488,23 +488,23 @@ def receive(self) -> str:
488488

489489
class Amqp(Pipeline):
490490
queue_args = {'x-queue-mode': 'lazy'}
491-
source_pipeline_host = '127.0.0.1'
492-
destination_pipeline_host = '127.0.0.1'
493-
source_pipeline_db = 2
494-
destination_pipeline_db = 2
495-
source_pipeline_username = None
496-
destination_pipeline_username = None
497-
source_pipeline_password = None
498-
destination_pipeline_password = None
499-
source_pipeline_socket_timeout = None
500-
destination_pipeline_socket_timeout = None
501-
source_pipeline_amqp_virtual_host = '/'
502-
destination_pipeline_amqp_virtual_host = '/'
503-
source_pipeline_ssl = False
504-
destination_pipeline_ssl = False
505-
source_pipeline_amqp_exchange = ""
506-
destination_pipeline_amqp_exchange = ""
507-
intelmqctl_rabbitmq_monitoring_url = None
491+
source_pipeline_host: str = '127.0.0.1'
492+
destination_pipeline_host: str = '127.0.0.1'
493+
source_pipeline_db: int = 2
494+
destination_pipeline_db: int = 2
495+
source_pipeline_username: Optional[str] = None
496+
destination_pipeline_username: Optional[str] = None
497+
source_pipeline_password: Optional[str] = None
498+
destination_pipeline_password: Optional[str] = None
499+
source_pipeline_socket_timeout: Optional[int] = None
500+
destination_pipeline_socket_timeout: Optional[int] = None
501+
source_pipeline_amqp_virtual_host: str = '/'
502+
destination_pipeline_amqp_virtual_host: str = '/'
503+
source_pipeline_ssl: bool = False
504+
destination_pipeline_ssl: bool = False
505+
source_pipeline_amqp_exchange: str = ""
506+
destination_pipeline_amqp_exchange: str = ""
507+
intelmqctl_rabbitmq_monitoring_url: Optional[str] = None
508508

509509
def __init__(self, logger, pipeline_args: dict = None, load_balance=False, is_multithreaded=False):
510510
super().__init__(logger, pipeline_args, load_balance, is_multithreaded)

mkdocs.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ nav:
116116
- IntelMQ: 'admin/configuration/intelmq.md'
117117
- IntelMQ API: 'admin/configuration/intelmq-api.md'
118118
- IntelMQ Manager: 'admin/configuration/intelmq-manager.md'
119+
- Redis: 'admin/configuration/redis.md'
119120
- Management:
120121
- IntelMQ: 'admin/management/intelmq.md'
121122
- IntelMQ API: 'admin/management/intelmq-api.md'
123+
- intelmqctl: 'admin/management/intelmqctl-more.md'
122124
- Database:
123125
- PostgreSQL: 'admin/database/postgresql.md'
124126
- Elasticsearch: 'admin/database/elasticsearch.md'
@@ -152,4 +154,4 @@ nav:
152154
- Changelog: 'changelog.md'
153155
- Security: 'security.md'
154156
- Community: 'community.md'
155-
- Help: 'help.md'
157+
- Help: 'help.md'

0 commit comments

Comments
 (0)