Skip to content

Commit 12744c5

Browse files
committed
docs: pipeline configration fixes
fix links add sections add missing types and default values add missing typing hints to Amqp pipeline class
1 parent 27b718f commit 12744c5

File tree

3 files changed

+64
-57
lines changed

3 files changed

+64
-57
lines changed

docs/admin/beta-features.md

Lines changed: 29 additions & 22 deletions
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

Lines changed: 18 additions & 18 deletions
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

intelmq/lib/pipeline.py

Lines changed: 17 additions & 17 deletions
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)

0 commit comments

Comments
 (0)