Skip to content

Commit

Permalink
fix unstable roa alert hash
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Feb 7, 2025
1 parent e20cdd7 commit 7bb2119
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/monitors/monitorROAS.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default class MonitorROAS extends Monitor {
}
alerts = alerts.concat(alertsStrings);

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

alerts = alerts.concat(alertsStrings);

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

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

this.publishAlert(md5(alertsStrings), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
this.publishAlert(md5(alertsStrings.join(",")), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
matchedRule.asn.getId(),
matchedRule,
message,
Expand Down
16 changes: 8 additions & 8 deletions tests/rpki_tests/tests.external-roas.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,30 @@ describe("RPKI monitoring external", function() {
]
}
,
"28c7aa78b6286e0e3c6583797f7df47c": {
id: '28c7aa78b6286e0e3c6583797f7df47c',
"d73cec3dff536ee9d815e2e84a5f0e6e": {
id: 'd73cec3dff536ee9d815e2e84a5f0e6e',
truncated: false,
origin: 'roa-monitor',
affected: 2914,
message: 'The following ROAs will expire in less than 2 hours: <1.2.3.0/24, 2914, 24, ripe>',

},
"47807c7558dbe001b4aad9f3a87eb427": {
id: '47807c7558dbe001b4aad9f3a87eb427',
"e3fe0356a69144801ec33bb0e23a59e0": {
id: 'e3fe0356a69144801ec33bb0e23a59e0',
truncated: false,
origin: 'roa-monitor',
affected: '94.5.4.3/22',
message: 'ROAs change detected: removed <94.5.4.3/22, 2914, 22, ripe>'
},
"de3bd9a6cdeeb05e1c2c7c04f7220485" : {
id: 'de3bd9a6cdeeb05e1c2c7c04f7220485',
"743e491dfaa8a6fcb5193f290d30450e" : {
id: '743e491dfaa8a6fcb5193f290d30450e',
truncated: false,
origin: 'roa-monitor',
affected: '2001:db8:123::/48',
message: 'ROAs change detected: removed <2001:db8:123::/48, 65000, 48, ripe>'
},
"129aafe3c8402fb045b71e810a73d425": {
id: '129aafe3c8402fb045b71e810a73d425',
"fca966677a80a6f4b9144452ae23f139": {
id: 'fca966677a80a6f4b9144452ae23f139',
truncated: false,
origin: 'roa-monitor',
affected: 2914,
Expand Down

0 comments on commit 7bb2119

Please sign in to comment.