-
Notifications
You must be signed in to change notification settings - Fork 19
add TLS info decoder #210
add TLS info decoder #210
Conversation
function process_message() | ||
local payload = read_message("Payload") | ||
local ok, report = pcall(cjson.decode, payload) | ||
if not ok then return -1, fhr end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/fhr/report/
DWL if possible, I would like to avoid multidecoders. |
} | ||
|
||
-- create PEM data from base64 encoded DER | ||
function make_pem(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The make_pem, read_cert and parse_cert functions should be local
local failedCertChain = report["failedCertChain"] | ||
local ee = nil | ||
local rootMost = nil | ||
if failedCertChain and "table" == type(failedCertChain) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type check will suffice
end | ||
|
||
-- calculate the clock skew - in seconds, since os.time() returns those | ||
local reportTime = report["timestamp"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry one more input validation: if reportTime is a boolean true this plugin will crash. If this is a concern its type should be tested.
It appears this decode drops submissionDate, without which we lose the ability to partition this data reasonably in S3. |
A decoder for extracting key information (clock skew, Subject or SAN / hostname match status and Issuer common name) from TLS error reports.
This requires my modifications to lua-openssl (see zhaozg/lua-openssl#92) - and, for the hostname checks, needs OpenSSL version 1.0.2 (or later). It should still work with an earlier version of OpenSSL but the hostname checks will be omitted.
Feedback welcome.