mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Added tls info to alerts (#6073)
This commit is contained in:
parent
064a7121df
commit
2f522c2e6f
2 changed files with 30 additions and 0 deletions
|
|
@ -4715,6 +4715,29 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function addTLSInfoToAlertDescr(msg, alert_json)
|
||||
if ((alert_json)
|
||||
and (table.len(alert_json["tls"] or {}) > 0)) then
|
||||
|
||||
if alert_json["tls"]["protos.tls.notBefore"] and alert_json["tls"]["protos.tls.notAfter"] then
|
||||
msg = msg .. string.format(" [%s: %s - %s]",
|
||||
i18n("flow_details.tls_certificate_validity"),
|
||||
formatEpoch(alert_json["tls"]["protos.tls.notBefore"]),
|
||||
formatEpoch(alert_json["tls"]["protos.tls.notAfter"]))
|
||||
end
|
||||
|
||||
if alert_json["tls"]["protos.tls.version"] then
|
||||
msg = msg .. string.format(" [%s: %s]",
|
||||
i18n("flow_details.tls_version"),
|
||||
alert_json["tls"]["protos.tls.version"])
|
||||
end
|
||||
end
|
||||
|
||||
return msg
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function addBytesInfoToAlertDescr(msg, value)
|
||||
local predominant_bytes = i18n("traffic_srv_to_cli")
|
||||
if (value["cli2srv_bytes"] or 0) > (value["srv2cli_bytes"] or 0) then
|
||||
|
|
@ -4734,6 +4757,7 @@ function addExtraFlowInfo(msg, alert_json, value)
|
|||
msg = addScoreToAlertDescr(msg, ntop.getFlowAlertScore((tonumber(value["alert_id"]))))
|
||||
msg = addHTTPInfoToAlertDescr(msg, alert_json)
|
||||
msg = addDNSInfoToAlertDescr(msg, alert_json)
|
||||
msg = addTLSInfoToAlertDescr(msg, alert_json)
|
||||
msg = addBytesInfoToAlertDescr(msg, value)
|
||||
|
||||
return msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue