You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SMTPBatchOutput bot
Hi, we use this bot in CSIRT.cz since 2015 to inform our constituents about all recent incidents twice a week. Events are aggregated in a redis cache by the abuse e-mail and sent at once.
Since we are reaching the external organisations, we've put together some experience to tune up the format of the CSV so that people of various IT skills were able to open it in their spreadsheet software, we use GPG signing and pack the events into ZIP files as we sometimes hit the ceiling of an SMTP server.
We've recently upgraded the syntax to honour the IntelMQ 3, cleaned up the code, put some tips (like CRON setup) to bots.rst and be glad if the community would accept the bot.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ CHANGELOG
48
48
#### Outputs
49
49
-`intelmq.bots.outputs.cif3.output`: Added (PR#2244 by Michael Davis).
50
50
-`intelmq.bots.outputs.sql.output`: New parameter `fail_on_errors` (PR#2362 by Sebastian Wagner).
51
+
-`intelmq.bots.outputs.smtp_batch.output`: Added a bot to gathering the events and sending them by e-mails at a stroke as CSV files (PR#2253 by Edvard Rejthar)
Copy file name to clipboardExpand all lines: docs/user/bots.rst
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4050,6 +4050,73 @@ The prime motivation for creating this feature was to protect users from badness
4050
4050
More information: https://dnsrpz.info
4051
4051
4052
4052
4053
+
.. _intelmq.bots.outputs.smtp_batch.output:
4054
+
4055
+
SMTP Batch Output Bot
4056
+
4057
+
Aggregate events by e-mail addresses in the `source.abuse_contact` field and batch send them at once as a zipped CSV file attachment in a GPG signed message.
4058
+
4059
+
**Information**
4060
+
4061
+
*`name:` intelmq.bots.outputs.smtp_batch.output
4062
+
*`lookup:` no
4063
+
*`public:` yes
4064
+
*`cache (redis db):` none
4065
+
*`description:` Sends events collected over a period of time via SMTP in a GPG signed messages
4066
+
4067
+
**Configuration Parameters**
4068
+
4069
+
*`alternative_mails`: string or null. Path to CSV in the form `original@email.com,alternative@email.com`.
4070
+
- Needed when some of the recipients ask you to forward their e-mails to another address.
4071
+
*`attachment_name`: string. Attachment file name for the outgoing messages. May contain date formatting like this `%Y-%m-%d`. Example: "events_%Y-%m-%d" will appear as "events_2022-12-01.zip".
4072
+
*`bcc`: list or null. A list of e-mails to be put in the `Bcc` field for every mail.
4073
+
*`email_from`: string. Sender's e-mail of the outgoing messages.
4074
+
* `gpg_key`: string or null. The Key or the fingerprint of a GPG key stored in ~/.gnupg keyring folder.
4075
+
* `gpg_pass`: string or null. Password for the GPG key if needed.
4076
+
* `mail_template`: string. Path to the file containing the body of the mail for the outgoing messages.
4077
+
* `ignore_older_than_days`: int or null, default 0. If 1..n skip all events with time.observation older than 1..n day; 0 disabled (allow all).
4078
+
- If your queue gets stuck for a reason, you do not want to send old (and probably already solved) events.
4079
+
* `limit_results`: int or null. Intended as a debugging option, allows loading just first N e-mails from the queue.
4080
+
* `redis_cache_db`: int. Redis database used for event aggregation. As the databases < 10 are reserved for the IntelMQ core, recommended is a bigger number.
4081
+
* `redis_cache_host`: string
4082
+
* `redis_cache_port`: int
4083
+
* `redis_cache_ttl`: int. Recommended 1728000 for 20 days.
4084
+
* `smtp_server`: mixed. SMTP server information and credentials.
4085
+
- See SMTP parameter of https://github.com/CZ-NIC/envelope#sending
* `subject`: string. Subject for the outgoing messages. May contain date formatting like this `%Y-%m-%d`. Example: "IntelMQ weekly warning (%d.%m.%Y)".
4088
+
* `testing_to`: string or null. Tester's e-mail.
4089
+
4090
+
When the bot is run normally by IntelMQ, it just aggregates the events for later use into a custom Redis database.
4091
+
If run through CLI (by a cron or manually), it shows e-mail messages that are ready to be sent and let you send them to the tester's e-mail OR to abuse contact e-mails.
4092
+
E-mails are sent in a zipped CSV file, delimited by a comma, while keeping strings in double quotes.
4093
+
Note: The field "raw" gets base64 decoded if possible. Bytes `\n` and `\r` are replaced with "\n" and "\r" strings in order to guarantee best CSV files readability both in Microsoft Office and LibreOffice. (A multiline string may be stored in "raw" which completely confused Microsoft Excel.)
0 commit comments