Skip to content
This repository was archived by the owner on Feb 15, 2020. It is now read-only.

Conversation

mozmark
Copy link
Contributor

@mozmark mozmark commented May 20, 2016

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.

function process_message()
local payload = read_message("Payload")
local ok, report = pcall(cjson.decode, payload)
if not ok then return -1, fhr end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/fhr/report/

@mreid-moz
Copy link
Contributor

@trink @whd Do we plan to put this decoder into the "multidecoder" on the edge? Or are we going to aim to do this decoding downstream from Kafka on the DWL?

@whd
Copy link
Member

whd commented Jun 1, 2016

DWL if possible, I would like to avoid multidecoders.

}

-- create PEM data from base64 encoded DER
function make_pem(data)
Copy link
Contributor

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
Copy link
Contributor

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"]
Copy link
Contributor

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.

@trink trink merged commit 5f5f4d0 into mozilla-services:master Jun 9, 2016
@whd
Copy link
Member

whd commented Jun 9, 2016

It appears this decode drops submissionDate, without which we lose the ability to partition this data reasonably in S3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants