Skip to content

Commit 7bb2119

Browse files
fix unstable roa alert hash
1 parent e20cdd7 commit 7bb2119

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/monitors/monitorROAS.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ export default class MonitorROAS extends Monitor {
266266
}
267267
alerts = alerts.concat(alertsStrings);
268268

269-
this.publishAlert(md5(alertsStrings), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
269+
this.publishAlert(md5(alertsStrings.join(",")), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
270270
matchedRule.prefix,
271271
matchedRule,
272272
message,
@@ -313,7 +313,7 @@ export default class MonitorROAS extends Monitor {
313313

314314
alerts = alerts.concat(alertsStrings);
315315

316-
this.publishAlert(md5(alertsStrings), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
316+
this.publishAlert(md5(alertsStrings.join(",")), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
317317
matchedRule.asn.getId(),
318318
matchedRule,
319319
message,
@@ -392,7 +392,7 @@ export default class MonitorROAS extends Monitor {
392392
alerts = alerts.concat(alertsStrings);
393393
const metadata = this.rpki.getMetadata();
394394

395-
this.publishAlert(md5(alertsStrings), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
395+
this.publishAlert(md5(alertsStrings.join(",")), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
396396
matchedRule.prefix,
397397
matchedRule,
398398
message,
@@ -433,7 +433,7 @@ export default class MonitorROAS extends Monitor {
433433
alerts = alerts.concat(alertsStrings);
434434
const metadata = this.rpki.getMetadata();
435435

436-
this.publishAlert(md5(alertsStrings), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
436+
this.publishAlert(md5(alertsStrings.join(",")), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
437437
matchedRule.asn.getId(),
438438
matchedRule,
439439
message,

tests/rpki_tests/tests.external-roas.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,30 @@ describe("RPKI monitoring external", function() {
7979
]
8080
}
8181
,
82-
"28c7aa78b6286e0e3c6583797f7df47c": {
83-
id: '28c7aa78b6286e0e3c6583797f7df47c',
82+
"d73cec3dff536ee9d815e2e84a5f0e6e": {
83+
id: 'd73cec3dff536ee9d815e2e84a5f0e6e',
8484
truncated: false,
8585
origin: 'roa-monitor',
8686
affected: 2914,
8787
message: 'The following ROAs will expire in less than 2 hours: <1.2.3.0/24, 2914, 24, ripe>',
8888

8989
},
90-
"47807c7558dbe001b4aad9f3a87eb427": {
91-
id: '47807c7558dbe001b4aad9f3a87eb427',
90+
"e3fe0356a69144801ec33bb0e23a59e0": {
91+
id: 'e3fe0356a69144801ec33bb0e23a59e0',
9292
truncated: false,
9393
origin: 'roa-monitor',
9494
affected: '94.5.4.3/22',
9595
message: 'ROAs change detected: removed <94.5.4.3/22, 2914, 22, ripe>'
9696
},
97-
"de3bd9a6cdeeb05e1c2c7c04f7220485" : {
98-
id: 'de3bd9a6cdeeb05e1c2c7c04f7220485',
97+
"743e491dfaa8a6fcb5193f290d30450e" : {
98+
id: '743e491dfaa8a6fcb5193f290d30450e',
9999
truncated: false,
100100
origin: 'roa-monitor',
101101
affected: '2001:db8:123::/48',
102102
message: 'ROAs change detected: removed <2001:db8:123::/48, 65000, 48, ripe>'
103103
},
104-
"129aafe3c8402fb045b71e810a73d425": {
105-
id: '129aafe3c8402fb045b71e810a73d425',
104+
"fca966677a80a6f4b9144452ae23f139": {
105+
id: 'fca966677a80a6f4b9144452ae23f139',
106106
truncated: false,
107107
origin: 'roa-monitor',
108108
affected: 2914,

0 commit comments

Comments
 (0)