Skip to content

Commit 05de946

Browse files
committed
Merge branch 'develop' into monoidic-develop
2 parents 55e7174 + a98bbfd commit 05de946

File tree

136 files changed

+2462
-874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+2462
-874
lines changed

.github/workflows/codespell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
jobs:
1919
codespell:
2020
name: Find and notify about common misspellings
21-
runs-on: ubuntu-20.04
21+
runs-on: ubuntu-latest
2222
# This should not fail the whole workflow run
2323
continue-on-error: true
2424

.github/workflows/debian-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
build:
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-latest
2020
env:
2121
# Fixes https://github.com/actions/virtual-environments/issues/3080
2222
STORAGE_OPTS: overlay.mount_program=/usr/bin/fuse-overlayfs
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Upload artifact
3636
if: ${{ github.event_name == 'push' }}
37-
uses: actions/upload-artifact@v3
37+
uses: actions/upload-artifact@v4
3838
with:
3939
name: debian-package-${{ matrix.codename }}-${{ github.sha }}
4040
path: '~/artifacts'

.github/workflows/pycodestyle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
jobs:
1919
pycodestyle:
2020
name: Run pycodestyle
21-
runs-on: ubuntu-20.04
21+
runs-on: ubuntu-24.04
2222

2323
steps:
2424
- name: Checkout repository

.github/workflows/python/github.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ def __init__(self):
3131

3232
def get_reviews(self):
3333
""" Get a list of reviews on a Github pull request as json object """
34-
reviews = self.session.get(self.api + 'repos/{}/pulls/{}/reviews'.format(self.github_repository, self.pr_id))
34+
reviews = self.session.get(self.api + f'repos/{self.github_repository}/pulls/{self.pr_id}/reviews')
3535
reviews.raise_for_status()
3636
return reviews.json()
3737

3838
def update_review(self, review_id, body):
3939
""" Update a review given by `review_id` and set its body to `body` """
4040
payload = {'body': body}
41-
resp = self.session.put(self.api + 'repos/{}/pulls/{}/reviews/{}'.format(self.github_repository, self.pr_id, review_id), json=payload)
41+
resp = self.session.put(self.api + f'repos/{self.github_repository}/pulls/{self.pr_id}/reviews/{review_id}', json=payload)
4242
resp.raise_for_status()
4343
return resp.json()
4444

4545
def post_review(self, body):
4646
""" Post a pull request review containing `body` and requesting changes """
4747
payload = {'body': body, 'event': "REQUEST_CHANGES"}
48-
resp = self.session.post(self.api + 'repos/{}/pulls/{}/reviews'.format(self.github_repository, self.pr_id), json=payload)
48+
resp = self.session.post(self.api + f'repos/{self.github_repository}/pulls/{self.pr_id}/reviews', json=payload)
4949
resp.raise_for_status()
5050
return resp.json()

.github/workflows/python/pycodestyle_comment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def style_error_format(style_error_list) -> str:
3434
""" Format the list of pycodestyle errors and return them a one string. """
3535
ret = ''
3636
for error in style_error_list:
37-
ret += '* {}\n'.format(error)
37+
ret += f'* {error}\n'
3838
return ret
3939

4040

@@ -45,7 +45,7 @@ def style_error_format(style_error_list) -> str:
4545
style_errors = list_style_errors()
4646

4747
if style_errors:
48-
print("Found {} errors.".format(len(style_errors)))
48+
print(f"Found {len(style_errors)} errors.")
4949

5050
gh = github.Github()
5151

.github/workflows/regexploit.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ on:
1919
jobs:
2020
regexploit:
2121
name: Find regular expressions which are vulnerable to ReDoS
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-latest
2323
# This should not fail the whole workflow run
2424
continue-on-error: true
2525

2626
steps:
2727
- name: Checkout repository
2828
uses: actions/checkout@v3
2929
- name: Install regexploit
30-
run: pip install regexploit
30+
#run: pip install regexploit
31+
# See https://github.com/doyensec/regexploit/pull/16
32+
run: pip install git+https://github.com/sebix/regexploit.git@unsupported-ops-yaml
3133
- name: Run regexploit
3234
run: /home/runner/work/intelmq/intelmq/.github/workflows/scripts/regexploit.sh

.github/workflows/scripts/setup-full.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# SPDX-FileCopyrightText: 2020 Birger Schacht
2+
# SPDX-FileCopyrightText: 2020 Birger Schacht, 2024 Institute for Common Good Technology
33
# SPDX-License-Identifier: AGPL-3.0-or-later
44

55
set -x
@@ -14,6 +14,10 @@ echo -e '-XX:+DisableExplicitGC\n-Djdk.io.permissionsUseCanonicalPath=true\n-Dlo
1414
sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch
1515
sudo systemctl start elasticsearch
1616

17+
sudo apt update
18+
# for psql (used below)
19+
DEBIAN_FRONTEND="noninteractive" sudo -E apt install -y postgresql-client
20+
1721
# Install the dependencies of all the bots
1822
pip install wheel
1923
for file in intelmq/bots/*/*/REQUIREMENTS.txt; do
@@ -30,7 +34,16 @@ done
3034
# Setup sudo and install intelmq
3135
sudo sed -i '/^Defaults\tsecure_path.*$/ d' /etc/sudoers
3236
sudo pip install .
33-
sudo intelmqsetup --skip-ownership
37+
38+
intelmq_user_exists=$(getent passwd intelmq ||:)
39+
if [[ "$UID" -eq '0' && -z "$intelmq_user_exists" ]]; then
40+
# create an unprivileged user, if currently running as root. Otherwise dropping privileges won't work
41+
groupadd -r intelmq
42+
useradd -r -d /var/lib/intelmq/ -c "user running intelmq" -g intelmq -s /bin/bash intelmq
43+
sudo intelmqsetup
44+
else
45+
sudo intelmqsetup --skip-ownership
46+
fi
3447

3548
# Initialize the postgres database
3649
intelmq_psql_initdb

.github/workflows/unittests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
21+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2222
type: ['full', 'basic']
2323

2424
services:
@@ -59,6 +59,7 @@ jobs:
5959
PGPORT: 5432
6060
PGUSER: intelmq
6161
PGPASSWORD: intelmq
62+
python_version: ${{ matrix.python-version }}
6263
run: bash .github/workflows/scripts/setup-full.sh
6364

6465
- name: Install test dependencies

CHANGELOG.md

Lines changed: 145 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,150 @@
11
<!-- comment
2-
SPDX-FileCopyrightText: 2015-2023 Sebastian Wagner
2+
SPDX-FileCopyrightText: 2015-2025 Sebastian Wagner
33
SPDX-License-Identifier: AGPL-3.0-or-later
44
-->
55

66
# CHANGELOG
77

88

9-
3.3.1 (unreleased)
10-
------------------
9+
This file lists all changes between IntelMQ releases.
10+
Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect on the administration of IntelMQ and contains steps that you need to be aware off for the upgrade.
11+
12+
13+
3.4.1 Patch release (unreleased)
14+
--------------------------------
1115

1216
### Configuration
1317

1418
### Core
15-
- `intelmq.lib.utils.drop_privileges`: When IntelMQ is called as `root` and dropping the privileges to user `intelmq`, also set the non-primary groups associated with the `intelmq` user. Makes the behaviour of running intelmqctl as `root` closer to the behaviour of `sudo -u intelmq ...` (PR#2507 by Mikk Margus Möll).
19+
- Drop support for Python 3.8 (fixes #2616, PR#2617 by Sebastian Wagner).
1620

1721
### Development
1822

1923
### Data Format
2024

25+
### Bots
26+
#### Collectors
27+
28+
#### Parsers
29+
30+
#### Experts
31+
- `intelmq.bots.experts.asn_lookup.expert`: Print URLs to stdout only in verbose mode (PR#2591 by Sebastian Wagner).
32+
33+
#### Outputs
34+
35+
### Documentation
36+
- Fix and refresh links to mailing lists (PR#2609 by Kamil Mańkowski)
37+
- `Aggregate Bot`: Add illustration graphics (PR#2612 by Sebastian Wagner).
38+
39+
### Packaging
40+
- 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).
41+
42+
### Tests
43+
- `intelmq.tests.lib.test_pipeline.TestAmqp.test_acknowledge`: Skip on all Python versions when running on CI (PR#2602 by Sebastian Wagner).
44+
- `.github/workflows/codespell.yml`, `debian-package.yml`, `regexploit.yml`: Upgrade to `ubuntu-latest` runners (PR#2602 by Sebastian Wagner).
45+
- `intelmq.test.test_conf`: With changed behaviour in ruamel.yaml on line wrapping since version 0.18.13, only test the parsabilty of `runtime.yaml` (PR#2619 by Sebastian Wagner).
46+
47+
### Tools
48+
- `intelmq.bin.intelmq_psql_initdb`: Use `JSONB` type by default, Postgres supports it since version 9 (PR#2597 by Sebastian Wagner).
49+
- `intelmq.bin.rewrite_config_files`: Removed obsolete JSON configuration file rewriter (PR#2613 by Sebastian Wagner).
50+
51+
### Contrib
52+
53+
### Known issues
54+
55+
56+
3.4.0 Feature release (2025-03-14)
57+
----------------------------------
58+
59+
### Configuration
60+
61+
### Core
62+
- AMQP: Fix maintaining pipeline connection when during interrupted connections (PR#2533 by Kamil Mankowski).
63+
- Python 3.8 or newer is required (PR#2541 by Sebastian Wagner).
64+
- `intelmq.lib.utils.list_all_bots`/`intelmqctl check`: Fix check for bot executable in $PATH by using the bot name instead of the import path (fixes #2559, PR#2564 by Sebastian Wagner).
65+
66+
### Bots
67+
#### Collectors
68+
- `intelmq.bots.collectors.shadowserver.collector_reports_api.py`:
69+
- Fixed behaviour if parameter `types` value is empty string, behave the same way as not set, not like no type.
70+
- `intelmq.bots.collectors.misp`: Use `PyMISP` class instead of deprecated `ExpandedPyMISP` (PR#2532 by Radek Vyhnal)
71+
- `intelmq.bots.collectors.http.collector_http`: Log the downloaded size in bytes to ease troubleshooting (PR#2554 by Sebastian Wagner).
72+
- `intelmq.bots.collectors.mail.collector_mail_url`:
73+
- Log the downloaded size in bytes to ease troubleshooting (PR#2554 by Sebastian Wagner).
74+
- Fix import for Timeout exception preventing another exception (fixes #2555, PR#2556 by Sebastian Wagner).
75+
- Remove `intelmq.bots.collectors.twitter` as it uses an unmaintained library and does not work any more (fixes #2346, #2441, PR#2568 by Sebastian Wagner).
76+
77+
#### Parsers
78+
- `intelmq.bots.parsers.shadowserver._config`:
79+
- fix error message formatting if schema file is absent (PR#2528 by Sebastian Wagner).
80+
- `intelmq.bots.parsers.shadowserver.parser`:
81+
- Fix to avoid schema download if not configured #2530.
82+
- `intelmq.bots.parsers.misp.parser`: Replace deprecated datetime function `utcfromtimestamp` for Ubuntu 24.04 compatibility (PR#2577 by Sebastian Wagner, fixes #2576, #2571).
83+
- `intelmq.bots.parsers.cleanmx.parser`: Replace deprecated datetime function `utcfromtimestamp` for Ubuntu 24.04 compatibility (PR#2577 by Sebastian Wagner, fixes #2576, #2571).
84+
- Renamed `intelmq.bots.parsers.twitter` to `intelmq.bots.parser.ioc_extractor` (PR#2568 by Sebastian Wagner).
85+
- Added `intelmq.bots.parsers.twitter` as a stub to load the IoC Extractor parser.
86+
87+
#### Experts
88+
- `intelmq.bots.experts.securitytxt`:
89+
- Added new bot (PR#2538 by Frank Westers and Sebastian Wagner).
90+
- `intelmq.bots.experts.misp`: Use `PyMISP` class instead of deprecated `ExpandedPyMISP` (PR#2532 by Radek Vyhnal).
91+
- `intelmq.bots.experts.fake.expert`: New expert to fake data (PR#2567 by Sebastian Wagner).
92+
93+
#### Outputs
94+
- `intelmq.bots.outputs.cif3.output`:
95+
- The requirement can only be installed on Python version < 3.12.
96+
- Add a check on the Python version and exit if incompatible.
97+
- Add a deprecation warning (PR#2544 by Sebastian Wagner).
98+
- `intelmq.bots.outputs.sql.output`:
99+
- Treat an empty string `fields` parameter as unset parameter, fixing a crash in default configuration (PR#2548 by Sebastian Wagner, fixes #2548).
100+
101+
### Documentation
102+
- `docs/admin/installation/linux-packages`: Add `[signed-by=]` options, add wget command as alternative to curl (PR#2547 by Sebastian Wagner).
103+
- 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).
104+
- Remove empty page tutorials/intelmq-manager (PR#2562 by Sebastian Wagner).
105+
106+
### Packaging
107+
- Packages for Ubuntu 24.04 (by Sebastian Wagner, fixes #2571).
108+
109+
### Tests
110+
- Install build dependencies for `pymssql` on Python 3.8 as there are no wheels available for this Python version (PR#2542 by Sebastian Wagner).
111+
- Install `psql` explicitly for workflow support on other platforms such as act (PR#2542 by Sebastian Wagner).
112+
- Create intelmq user & group if running privileged to allow dropping privileges (PR#2542 by Sebastian Wagner).
113+
- `intelmq.tests.lib.test_pipeline.TestAmqp.test_acknowledge`: Also skip on Python 3.11 and 3.12 besides on 3.8 when running on CI (PR#2542 by Sebastian Wagner).
114+
- Full pytest workflow: Version-independent install of postgres client, for Ubuntu 24.04 (default on GitHub now) test environment compatibility (PR#2557 by Sebastian Wagner).
115+
- Debian package build workflow: Use artifact upload v4 instead of v3 (PR#2565 by Sebastian Wagner).
116+
117+
### Known issues
118+
This is short list of the most important known issues. The full list can be retrieved from [GitHub](https://github.com/certtools/intelmq/labels/bug?page=2&q=is%3Aopen+label%3Abug).
119+
- intelmqctl: interactive run ignores custom log level (#2563).
120+
- `intelmq.parsers.html_table` may not process invalid URLs in patched Python version due to changes in `urllib` (#2382).
121+
- Breaking changes in 'rt' 3.0 library (#2367).
122+
- Type error with SQL output bot's `prepare_values` returning list instead of tuple (#2255).
123+
- `intelmq_psql_initdb` does not work for SQLite (#2202).
124+
- intelmqsetup: should install a default state file (#2175).
125+
- Misp Expert - Crash if misp event already exist (#2170).
126+
- Spamhaus CERT parser uses wrong field (#2165).
127+
- Custom headers ignored in HTTPCollectorBot (#2150).
128+
- intelmqctl log: parsing syslog does not work (#2097).
129+
- Bash completion scripts depend on old JSON-based configuration files (#2094).
130+
- Bots started with IntelMQ-API/Manager stop when the webserver is restarted (#952).
131+
- Corrupt dump files when interrupted during writing (#870).
132+
133+
134+
3.3.1 (2024-09-03)
135+
------------------
136+
137+
### Core
138+
- `intelmq.lib.utils.drop_privileges`: When IntelMQ is called as `root` and dropping the privileges to user `intelmq`, also set the non-primary groups associated with the `intelmq` user. Makes the behaviour of running intelmqctl as `root` closer to the behaviour of `sudo -u intelmq ...` (PR#2507 by Mikk Margus Möll).
139+
- `intelmq.lib.utils.unzip`: Ignore directories themselves when extracting data to prevent the extraction of empty data for a directory entries (PR#2512 by Kamil Mankowski).
140+
21141
### Bots
22142
#### Collectors
23143
- `intelmq.bots.collectors.shadowserver.collector_reports_api.py`:
24-
- Added support for the types parameter to be either a string or a list.
144+
- Added support for the types parameter to be either a string or a list (PR#2495 by elsif2).
25145
- Refactored to utilize the type field returned by the API to match the requested types instead of a sub-string match on the filename.
26-
- Fixed timezone issue for collecting reports.
146+
- Fixed timezone issue for collecting reports (PR#2506 by elsif2).
147+
- Fixed behaviour if parameter `reports` value is empty string, behave the same way as not set, not like no report (PR#2523 by Sebastian Wagner).
27148
- `intelmq.bots.collectors.shodan.collector_stream` (PR#2492 by Mikk Margus Möll):
28149
- Add `alert` parameter to Shodan stream collector to allow fetching streams by configured alert ID
29150
- `intelmq.bots.collectors.mail._lib`: Remove deprecated parameter `attach_unzip` from default parameters (PR#2511 by Sebastian Wagner).
@@ -32,10 +153,13 @@
32153
- `intelmq.bots.parsers.shadowserver._config`:
33154
- Fetch schema before first run (PR#2482 by elsif2, fixes #2480).
34155
- `intelmq.bots.parsers.dataplane.parser`: Use ` | ` as field delimiter, fix parsing of AS names including `|` (PR#2488 by DigitalTrustCenter).
156+
- all parsers: add `copy_collector_provided_fields` parameter allowing copying additional fields from the report, e.g. `extra.file_name`.
157+
(PR#2513 by Kamil Mankowski).
35158

36159
#### Experts
37160
- `intelmq.bots.experts.sieve.expert`:
38161
- For `:contains`, `=~` and `!~`, convert the value to string before matching avoiding an exception. If the value is a dict, convert the value to JSON (PR#2500 by Sebastian Wagner).
162+
- Add support for variables in Sieve scripts (PR#2514 by Mikk Margus Möll, fixes #2486).
39163
- `intelmq.bots.experts.filter.expert`:
40164
- Treat value `false` for parameter `filter_regex` as false (PR#2499 by Sebastian Wagner).
41165

@@ -46,15 +170,20 @@
46170
### Documentation
47171
- Bots: Clarify some section of Mail collectors and the Generic CSV Parser (PR#2510 by Sebastian Wagner).
48172

49-
### Packaging
50-
51-
### Tests
52-
53-
### Tools
54-
55-
### Contrib
56-
57-
### Known issues
173+
### Known Issues
174+
This is short list of the most important known issues. The full list can be retrieved from [GitHub](https://github.com/certtools/intelmq/labels/bug?page=2&q=is%3Aopen+label%3Abug).
175+
- `intelmq.parsers.html_table` may not process invalid URLs in patched Python version due to changes in `urllib` (#2382).
176+
- Breaking changes in 'rt' 3.0 library (#2367).
177+
- Type error with SQL output bot's `prepare_values` returning list instead of tuple (#2255).
178+
- `intelmq_psql_initdb` does not work for SQLite (#2202).
179+
- intelmqsetup: should install a default state file (#2175).
180+
- Misp Expert - Crash if misp event already exist (#2170).
181+
- Spamhaus CERT parser uses wrong field (#2165).
182+
- Custom headers ignored in HTTPCollectorBot (#2150).
183+
- intelmqctl log: parsing syslog does not work (#2097).
184+
- Bash completion scripts depend on old JSON-based configuration files (#2094).
185+
- Bots started with IntelMQ-API/Manager stop when the webserver is restarted (#952).
186+
- Corrupt dump files when interrupted during writing (#870).
58187

59188

60189
3.3.0 (2024-03-01)
@@ -180,10 +309,6 @@
180309
- got support for providing custom harmonization file, generating view for storing `raw` fields separately, and adding `IF NOT EXISTS`/`OR REPLACE` clauses ([PR#2404](https://github.com/certtools/intelmq/pull/2404) by Kamil Mankowski).
181310
- got support for generating JSONB fields for PostgreSQL schema (PR#2436 by Kamil Mankowski).
182311

183-
### Contrib
184-
185-
### Known issues
186-
187312

188313
3.2.1 (2023-08-28)
189314
------------------
@@ -304,7 +429,7 @@ This is short list of the most important known issues. The full list can be retr
304429
- Added an ExpertBot class - it should be used by all expert bots as a parent class
305430
- Introduced a module for IntelMQ related datatypes `intelmq.lib.datatypes` which for now only contains an Enum listing the four bot types
306431
- Added a `bottype` attribute to CollectorBot, ParserBot, ExpertBot, OutputBot
307-
- Introduces a module for IntelMQ processmanagers. The processmanagers were up until now part of the intelmqct script.
432+
- Introduces a module for IntelMQ processmanagers. The processmanagers were up until now part of the intelmqctl script.
308433
They now reside in `intelmq.lib.processmanager` which also contains an interface definition the processmanager implementations must adhere to.
309434
Both the processmanagers and the `intelmqctl` script were cleaned up a bit.
310435
The `LogLevel` and `ReturnType` Enums were added to `intelmq.lib.datatypes`.

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ graft intelmq/tests
1010
include COPYRIGHT
1111
include LICENSE
1212
include CHANGELOG.md
13-
recursive-exclude intelmq/bin intelmq_gen_feeds_docs.py intelmq_gen_harm_docs.py rewrite_config_files.py
13+
recursive-exclude intelmq/bin intelmq_gen_feeds_docs.py intelmq_gen_harm_docs.py
1414
exclude .*
1515
global-exclude *~
1616
global-exclude *.py[co]

0 commit comments

Comments
 (0)