From fd525c88715539246c792baeff4b83b0275000b5 Mon Sep 17 00:00:00 2001 From: Massimo Candela Date: Sat, 5 Jun 2021 03:05:20 +0200 Subject: [PATCH] added checkDisappearing parameter for monitorRPKI do avoid duplicated alerts with monitorROAS --- config.yml.example | 1 + docs/configuration.md | 1 + src/config/config.js | 3 ++- src/monitors/monitorRPKI.js | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.yml.example b/config.yml.example index fad0fbe..e95fd4a 100644 --- a/config.yml.example +++ b/config.yml.example @@ -52,6 +52,7 @@ monitors: params: thresholdMinPeers: 3 checkUncovered: false + checkDisappearing: false - file: monitorROAS channel: rpki diff --git a/docs/configuration.md b/docs/configuration.md index 4b1a4a9..404779a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -334,6 +334,7 @@ Parameters for this monitor module: |Parameter| Description| |---|---| |checkUncovered| If set to true, the monitor will alert also for prefixes not covered by ROAs in addition of RPKI invalid prefixes. | +|checkDisappearing| If set to true, the monitor will check also for disappearing ROAs. Important: set this feature to false if you have monitorROAS enabled; monitorROAS provides diffs including disappearing ROAs. | |thresholdMinPeers| Minimum number of peers that need to see the BGP update before to trigger an alert. | |maxDataSamples| Maximum number of collected BGP messages for each alert which doesn't reach yet the `thresholdMinPeers`. Default to 1000. As soon as the `thresholdMinPeers` is reached, the collected BGP messages are flushed, independently from the value of `maxDataSamples`.| |cacheValidPrefixesSeconds| Amount of seconds ROAs get cached in order to identify RPKI repository malfunctions (e.g., disappearing ROAs). Default to 7 days. | diff --git a/src/config/config.js b/src/config/config.js index d372a46..271ca0e 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -76,7 +76,8 @@ export default class Config { name: "rpki-monitor", params: { thresholdMinPeers: 3, - checkUncovered: false + checkUncovered: false, + checkDisappearing: false } }, { diff --git a/src/monitors/monitorRPKI.js b/src/monitors/monitorRPKI.js index dc82b11..7d24a4d 100644 --- a/src/monitors/monitorRPKI.js +++ b/src/monitors/monitorRPKI.js @@ -92,7 +92,7 @@ export default class MonitorRPKI extends Monitor { const covering = (extra.covering && extra.covering.length) ? extra.covering.map(i => `${i.prefix}|AS${i.asn}|maxLength:${i.maxLength}`).join(", ") : false; const coveringString = (covering) ? `Valid ROAs: ${covering}`: ''; - if (extra.roaDisappeared) { + if (extra.roaDisappeared && this.params.checkDisappearing) { return `The route ${message.prefix} announced by ${message.originAS} is no longer covered by a ROA.`; } else if (extra.valid === null && this.params.checkUncovered) { return `The route ${message.prefix} announced by ${message.originAS} is not covered by a ROA`;