Skip to content

Commit

Permalink
Merge branch 'dev' into dist
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Oct 27, 2023
2 parents 93ba3c7 + e7f711b commit a348929
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/monitors/monitorROAS.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/monitors/monitorRPKI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, "_")
Expand All @@ -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) {

Expand Down

0 comments on commit a348929

Please sign in to comment.