Skip to content

Commit afc3de3

Browse files
authored
Merge pull request #2573 from kamil-certat/iep8
Implementing IEP008 - constituency field
2 parents f712bc6 + a38d6b1 commit afc3de3

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
4141
```
4242
- added `severity` field to help with triaging received events (PR#2575 by Kamil Mańkowski).
4343
To allow saving the field in PostgreSQL database in existing installations, the following schema update is necessary: `ALTER TABLE events ADD severity varchar(10);`.
44+
- Implementing [IEP008](https://github.com/certtools/ieps/tree/main/008) introducing the `constituency` field for easier identification in
45+
multi-constituency setups. (PR#2573 by Kamil Mańkowski)
46+
To use in current PostgreSQL installations, a schema update may be
47+
necessary: `ALTER TABLE events ADD "constituency" text;`.
4448

4549
### Bots
4650
#### Collectors

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ALTER TABLE events ADD "product.vendor" text;
2828
ALTER TABLE events ADD "product.version" text;
2929
ALTER TABLE events ADD "product.vulnerabilities" text;
3030
ALTER TABLE events ADD severity varchar(10);
31+
ALTER TABLE events ADD "constituency" text;
3132
```
3233

3334
### Configuration

intelmq/etc/harmonization.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"description": "Free text commentary about the abuse event inserted by an analyst.",
1818
"type": "String"
1919
},
20+
"constituency": {
21+
"description": "Internal identifier for multi-constituency setup",
22+
"type": "String"
23+
},
2024
"destination.abuse_contact": {
2125
"description": "Abuse contact for destination address. A comma separated list.",
2226
"type": "LowercaseString"

intelmq/lib/upgrades.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ def v350_new_fields(configuration, harmonization, dry_run, **kwargs):
10171017
"product.vendor",
10181018
"product.version",
10191019
"product.vulnerabilities",
1020+
"constituency",
10201021
]:
10211022
if field not in harmonization["event"]:
10221023
if field not in builtin_harmonisation["event"]:

intelmq/tests/bin/initdb.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CREATE TABLE events (
44
"classification.taxonomy" varchar(100),
55
"classification.type" text,
66
"comment" text,
7+
"constituency" text,
78
"destination.abuse_contact" text,
89
"destination.account" text,
910
"destination.allocated" timestamp with time zone,

intelmq/tests/lib/test_upgrades.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ def test_v350_new_fields(self):
886886
self.assertIn("severity", result[2]["event"])
887887

888888

889+
889890
for name in upgrades.__all__:
890891
setattr(TestUpgradeLib, 'test_function_%s' % name,
891892
generate_function(getattr(upgrades, name)))

0 commit comments

Comments
 (0)