Created
April 2, 2019 20:11
-
-
Save mpurzynski/a99cf00d15325e2138fcf23c341d4c8c to your computer and use it in GitHub Desktop.
add_hash_to_ssl_log.bro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@load base/protocols/ssl | |
module SSL; | |
redef record Info += { | |
server_cert_md5: string &log &optional; | |
client_cert_md5: string &log &optional; | |
server_cert_sha1: string &log &optional; | |
client_cert_sha1: string &log &optional; | |
}; | |
event ssl_established(c: connection) &priority=50 | |
{ | |
if (c$ssl$cert_chain[0]?$md5) | |
c$ssl$server_cert_md5 = c$ssl$cert_chain[0]$md5; | |
if (c$ssl$client_cert_chain[0]?$md5) | |
c$ssl$client_cert_md5 = c$ssl$client_cert_chain[0]$md5; | |
if (c$ssl$cert_chain[0]?$sha1) | |
c$ssl$server_cert_sha1 = c$ssl$cert_chain[0]$sha1; | |
if (c$ssl$client_cert_chain[0]?$sha1) | |
c$ssl$client_cert_sha1 = c$ssl$client_cert_chain[0]$sha1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment