From 7c9fa6a09fd9e616168200b72f57a29c79e79893 Mon Sep 17 00:00:00 2001 From: Massimo Candela Date: Fri, 27 Oct 2023 12:47:38 +0200 Subject: [PATCH 1/2] add rpki metadata to roa-diff --- src/monitors/monitorROAS.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/monitors/monitorROAS.js b/src/monitors/monitorROAS.js index bec88a9e..65a3d077 100644 --- a/src/monitors/monitorROAS.js +++ b/src/monitors/monitorROAS.js @@ -324,12 +324,17 @@ export default class MonitorROAS extends Monitor { `ROAs change detected: ${alertsStrings.slice(0, 10).join("; ")} and more...`; alerts = alerts.concat(alertsStrings); + const metadata = this.rpki.getMetadata(); this.publishAlert(md5(message), // The hash will prevent alert duplications in case multiple ASes/prefixes are involved matchedRule.prefix, matchedRule, message, - {diff: alertsStrings, subType: "roa-diff"}); + { + diff: alertsStrings, + subType: "roa-diff", + rpkiMetadata: metadata, + }); } } } From e7f711b0d319a53ec346eb413cc4e8891d22838f Mon Sep 17 00:00:00 2001 From: Massimo Candela Date: Fri, 27 Oct 2023 12:57:02 +0200 Subject: [PATCH 2/2] added rpkiMetadata payload to all rpki events --- src/monitors/monitorRPKI.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/monitors/monitorRPKI.js b/src/monitors/monitorRPKI.js index 5721f546..0f0be469 100644 --- a/src/monitors/monitorRPKI.js +++ b/src/monitors/monitorRPKI.js @@ -107,6 +107,8 @@ export default class MonitorRPKI extends Monitor { const origin = result.origin.getValue(); if (result && !this.rpki.getStatus().stale) { + const rpkiMetadata = this.rpki.getMetadata(); + const cacheKey = "a" + [prefix, origin] .join("-") .replace(/\./g, "_") @@ -123,20 +125,20 @@ export default class MonitorRPKI extends Monitor { prefix, matchedRule, message, - { covering: null, valid: null, roaDisappeared: true, subType: "rpki-disappear" }); + { rpkiMetadata, covering: null, valid: null, roaDisappeared: true, subType: "rpki-disappear" }); } else if (this.params.checkUncovered) { this.publishAlert(key, prefix, matchedRule, message, - { covering: null, valid: null, subType: "rpki-unknown" }); + { rpkiMetadata, covering: null, valid: null, subType: "rpki-unknown" }); } } else if (result.valid === false) { this.publishAlert(key, prefix, matchedRule, message, - { covering: result.covering, valid: false, subType: "rpki-invalid" }); + { rpkiMetadata, covering: result.covering, valid: false, subType: "rpki-invalid" }); } else if (result.valid) {