Skip to content

Commit 5bc2ab5

Browse files
authored
Merge branch 'develop' into shodan-alert
2 parents 24215b0 + 34ead79 commit 5bc2ab5

37 files changed

+301
-357
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
1414
--------------------------------
1515

1616
### Configuration
17+
- New parameter `stop_retry_limit` (PR#2598 by Lukas Heindl).
1718

1819
### Core
1920
- Drop support for Python 3.8 (fixes #2616, PR#2617 by Sebastian Wagner).
2021
- `intelmq.lib.splitreports`: Handle bot parameter `chunk_size` values empty string, due to missing parameter typing checks (PR#2604 by Sebastian Wagner).
2122
- `intelmq.lib.mixins.sql` Add Support for MySQL (PR#2625 by Karl-Johan Karlsson).
23+
- New parameter `stop_retry_limit` to gracefully handle stopping bots which take longer to shutdown (PR#2598 by Lukas Heindl, fixes #2595).
24+
- `intelmq.lib.datatypes`: Remove unneeded Dict39 alias (PR#2639 by Nakul Rajpal, fixes #2635)
2225

2326
### Development
2427

@@ -27,9 +30,11 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
2730
### Bots
2831
#### Collectors
2932
- `intelmq.bots.collectors.shodan.collector_alert`: Added a new collector to query the Shodan Alert API (PR#2618 by Sebastian Wagner and Malawi CERT).
33+
- Remove `intelmq.bots.collectors.blueliv` as it uses an unmaintained library, does not work any more and breaks other CI tests (fixes #2593, PR#2632 by Sebastian Wagner).
3034

3135
#### Parsers
3236
- `intelmq.bots.parsers.cymru.parser_cap_program`: Add mapping for TOR and ipv6-icmp protocol (PR#2621 by Mikk Margus Möll).
37+
- Remove `intelmq.bots.collectors.blueliv` as it is obsolete with the removed collector (PR#2632 by Sebastian Wagner).
3338

3439
#### Experts
3540
- `intelmq.bots.experts.asn_lookup.expert`:
@@ -40,6 +45,7 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
4045
- Use database path matching to installation type (PR#2606 by Sebastian Wagner).
4146
- Add new mode `random_single_value` (PR#2601 by Sebastian Wagner).
4247
- `intelmq.bots.experts.sieve.expert`: Test for textX dependency in self-check (PR#2605 by Sebastian Wagner).
48+
- `intelmq.bots.experts.trusted_introducer_lookup.expert`: Change to new TI database URL (fixes #2620, PR#2633 by Sebastian Wagner).
4349

4450
#### Outputs
4551
- `intelmq.bots.outputs.smtp_batch.output`:
@@ -56,6 +62,7 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
5662
### Packaging
5763
- Replace `/opt/intelmq` example paths in bots with variable `VAR_STATE_PATH` for correct paths in LSB-path setups like with packages (PR#2587 by Sebastian Wagner).
5864
- New deb-package `intelmq-contrib` with all `contrib/` scripts and documentation (PR#2614 by Sebastian Wagner).
65+
- New deb-package `intelmq-autostart` containing systemd services and timers to start all enabled IntelMQ bots at boot and periodically (PR#2638 by Sebastian Wagner).
5966

6067
### Tests
6168
- `intelmq.tests.lib.test_pipeline.TestAmqp.test_acknowledge`: Skip on all Python versions when running on CI (PR#2602 by Sebastian Wagner).
@@ -67,8 +74,10 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
6774
- `intelmq.bin.intelmq_psql_initdb`: Use `JSONB` type by default, Postgres supports it since version 9 (PR#2597 by Sebastian Wagner).
6875
- `intelmq.bin.rewrite_config_files`: Removed obsolete JSON configuration file rewriter (PR#2613 by Sebastian Wagner).
6976
- `intelmq/lib/bot_debugger.py`: Fix overwriting the runtime logging level by command line parameter (PR#2603 by Sebastian Wagner, fixes #2563).
77+
- `intelmq.bin.intelmqctl`: Fix bot log level filtering (PR#2607 by Sebastian Wagner, fixes #2596).
7078

7179
### Contrib
80+
- Bash Completion: Adapt to YAML-style runtime configuration (PR#2642 by Sebastian Wagner, fixes #2094).
7281

7382
### Known issues
7483

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ test:
2222

2323
codestyle:
2424
pycodestyle intelmq/{bots,lib,bin}
25+
26+
licenses:
27+
reuse lint
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-FileCopyrightText: 2025 Institute for Common Good Technology
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
4+
[Unit]
5+
Description=Periodically start all enabled IntelMQ bots
6+
7+
[Timer]
8+
# run every 5 minutes
9+
OnUnitActiveSec=5minutes
10+
Unit=intelmq-start.service
11+
Persistent=true
12+
13+
[Install]
14+
WantedBy=multi-user.target timers.target
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-FileCopyrightText: 2025 Institute for Common Good Technology
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
4+
[Unit]
5+
Description=Start all enabled IntelMQ bots
6+
After=network.target
7+
# will be replaced by valkey in next distribution versions
8+
Requires=redis-server.service
9+
10+
[Service]
11+
# oneshot does not work as it stops the remaining processes
12+
Type=simple
13+
ExecStart=/usr/bin/intelmq-start.sh
14+
User=intelmq
15+
Group=intelmq
16+
RemainAfterExit=yes
17+
KillMode=process
18+
19+
[Install]
20+
WantedBy=multi-user.target

contrib/autostart/intelmq-start.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: 2025 Institute for Common Good Technology
3+
# SPDX-License-Identifier: AGPL-3.0-or-later
4+
5+
# suppress stdout output. Errors go to stderr and are kept
6+
7+
if [ "$UID" -eq 0 ]; then
8+
sudo -u intelmq intelmqctl start > /dev/null
9+
else
10+
nohup intelmqctl start > /dev/null
11+
fi

contrib/bash-completion/intelmqctl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2018 Sebastian Wagner
1+
# SPDX-FileCopyrightText: 2018-2020 nic.at GmbH, 2025 Institute for Common Good Technology
22
#
33
# SPDX-License-Identifier: AGPL-3.0-or-later
44
# bash completion for intelmqctl -*- shell-script -*-
@@ -18,6 +18,9 @@ _intelmqctl ()
1818
return 0
1919
fi
2020

21+
which yq >& /dev/null
22+
misses_yq=$?
23+
2124
#echo "posice: $COMP_CWORD $COMP_WORDS";
2225
case $COMP_CWORD in
2326
1)
@@ -26,19 +29,20 @@ _intelmqctl ()
2629
return 0
2730
;;
2831
2)
29-
pipeline='/opt/intelmq/etc/pipeline.conf';
30-
[ -f ${pipeline} ] || pipeline='/etc/intelmq/pipeline.conf';
32+
runtime='/opt/intelmq/etc/runtime.yaml';
33+
[ -f ${runtime} ] || runtime='/etc/intelmq/runtime.yaml';
3134
case "${COMP_WORDS[1]}" in
3235
start | stop | restart | status | reload | log | run | enable | disable)
33-
runtime='/opt/intelmq/etc/runtime.conf';
34-
[ -f ${runtime} ] || runtime='/etc/intelmq/runtime.conf';
35-
local bots=$(jq 'keys[]' $runtime);
36+
[[ "$misses_yq" -eq 1 ]] && return 0
37+
local bots=$(yq 'keys[]' $runtime | grep -v '^global$');
3638
COMPREPLY=($(compgen -W "${bots}" -- ${cur}));
3739
return 0
3840
;;
3941
clear)
40-
local bots=$(jq '.[] | .["source-queue"]' $pipeline | grep -v '^null$'; jq '.[] | .["destination-queues"]' $pipeline | grep -v '^null$' | jq '.[]');
41-
COMPREPLY=($(compgen -W "${bots}" -- ${cur}));
42+
[[ "$misses_yq" -eq 1 ]] && return 0
43+
local destination_queues=$(yq '.[] | .["parameters"] | .["destination_queues"] | .[] | .[]' $runtime);
44+
local source_queues=$(yq 'keys[]' $runtime | grep -v '^global$' | while read line; do echo "$line-queue"; done)
45+
COMPREPLY=($(compgen -W "${source_queues} ${destination_queues}" -- ${cur}));
4246
return 0
4347
;;
4448
list)

debian/changelog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
intelmq (3.4.1-1) UNRELEASED; urgency=medium
1+
intelmq (3.4.1~alpha1-1) UNRELEASED; urgency=medium
22

33
* 3.4.1 Bugfix release
44

debian/compat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9
1+
10

debian/control

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,31 @@ Architecture: all
3434
Depends: bash-completion,
3535
cron,
3636
jq,
37-
python3-dateutil (>= 2.5),
37+
python3-intelmq,
38+
redis-server,
39+
systemd,
40+
${misc:Depends}
41+
Recommends: intelmq-contrib
42+
Description: Solution for IT security teams for collecting and processing security feeds
43+
IntelMQ is a solution for IT security teams (CERTs, CSIRTs, abuse
44+
departments,...) for collecting and processing security feeds (such as log
45+
files) using a message queuing protocol. It's a community driven initiative
46+
called IHAP (Incident Handling Automation Project) which was conceptually
47+
designed by European CERTs/CSIRTs during several InfoSec events. Its main goal
48+
is to give to incident responders an easy way to collect & process threat
49+
intelligence thus improving the incident handling processes of CERTs.
50+
.
51+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
57+
SOFTWARE.
58+
59+
Package: python3-intelmq
60+
Architecture: all
61+
Depends: python3-dateutil (>= 2.5),
3862
python3-dnspython (>= 2.0.0),
3963
python3-openssl,
4064
python3-psutil (>= 1.2.1),
@@ -44,12 +68,7 @@ Depends: bash-completion,
4468
python3-termstyle (>= 0.1.10),
4569
python3-tz,
4670
python3-importlib-metadata,
47-
redis-server,
48-
systemd,
49-
${misc:Depends},
50-
${sphinxdoc:Depends},
5171
${python3:Depends}
52-
Recommends: intelmq-contrib
5372
Suggests: python3-geoip2 (>= 2.2.0),
5473
python3-imbox (>= 0.8),
5574
python3-psycopg2 (>= 2.5.5),
@@ -58,14 +77,8 @@ Suggests: python3-geoip2 (>= 2.2.0),
5877
python3-sleekxmpp (>= 1.3.1),
5978
python3-stomp (>= 4.1.12),
6079
python3-pendulum
61-
Description: Solution for IT security teams for collecting and processing security feeds
62-
IntelMQ is a solution for IT security teams (CERTs, CSIRTs, abuse
63-
departments,...) for collecting and processing security feeds (such as log
64-
files) using a message queuing protocol. It's a community driven initiative
65-
called IHAP (Incident Handling Automation Project) which was conceptually
66-
designed by European CERTs/CSIRTs during several InfoSec events. Its main goal
67-
is to give to incident responders an easy way to collect & process threat
68-
intelligence thus improving the incident handling processes of CERTs.
80+
Description: Python Data of IntelMQ
81+
Contains the Python Libraries and Executables for IntelMQ
6982
.
7083
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
7184
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@@ -91,3 +104,20 @@ Description: Contributed scripts for IntelMQ
91104
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92105
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
93106
SOFTWARE.
107+
108+
Package: intelmq-autostart
109+
Architecture: all
110+
Depends: intelmq,
111+
${misc:Depends},
112+
${python3:Depends}
113+
Suggests:
114+
Description: Automatic start for all IntelMQ bots
115+
FIXME
116+
.
117+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
118+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
119+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
120+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
121+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
122+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
123+
SOFTWARE.

debian/intelmq-autostart.install

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
contrib/autostart/intelmq-periodic-start.timer /lib/systemd/system/
2+
contrib/autostart/intelmq-start.service /lib/systemd/system/
3+
contrib/autostart/intelmq-start.sh /usr/bin/

0 commit comments

Comments
 (0)