Report context

January 28, 2022 ยท View on GitHub

All the report modules inherit the method getContext from the super class Report. This method returns a dictionary with some pre-computed tags useful for composing textual reports. Such tags are reported in the table below.

TagDescription
summaryThe summary of the alert
earliestThe date of the earliest event that triggered the alert (format YYYY-MM-DD HH:mm:ss)
latestThe date of the last event that triggered the alert (format YYYY-MM-DD HH:mm:ss)
channelThe channel where the alert is coming from
typeThe name of the monitor that triggered the alert
prefixThe monitored prefix involved in the alert
descriptionThe description of the prefix involved in the alert
asnThe monitored AS involved in the alert
pathsThe AS Paths involved in the alert
pathNumberThe count of AS Paths in the alert
peersThe number of peers that were able to see the issue
neworiginThe AS announcing the monitored prefix (e.g., in case of a hijack, neworigin will contain the hijacker, asn will contain the usual origin)
newprefixThe prefix announced (e.g., in case of a hijack, newprefix will contain the more specific prefix used for the hijack, prefix will contain the usual prefix)
bgplayA link to BGPlay
rpkiLinkA link to the rpki validator online

Usage example: The alert involves ${prefix} in ${earliest} will be translated in something like The alert involves 1.2.3.4/24 in 2020-04-14 04:02:13.

The same approach must be used to populate the templates available in config.yml. If you are writing a template for an API call, convert the JSON to string (e.g., '{"text": "${summary}"}').