mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00

- Basic API seems to works, but tests aren't updated yet. - Several scripts are available in policy/frameworks/intel that call the "seen" function to provide data into the intel framework to be tested. - Intel::policy is not done yet and needs to be discussed to figure out what it needs to have. - Running the intel framework and having it do something finally is really cool!
41 lines
1.1 KiB
Text
41 lines
1.1 KiB
Text
@load base/frameworks/intel
|
|
|
|
export {
|
|
redef enum Intel::Where += {
|
|
SSL::IN_SERVER_CERT,
|
|
SSL::IN_CLIENT_CERT,
|
|
SSL::IN_SERVER_NAME,
|
|
};
|
|
}
|
|
|
|
|
|
event x509_certificate(c: connection, is_orig: bool, cert: X509, chain_idx: count, chain_len: count, der_cert: string)
|
|
{
|
|
if ( chain_idx == 0 )
|
|
{
|
|
if ( /emailAddress=/ in cert$subject )
|
|
{
|
|
local email = sub(cert$subject, /^.*emailAddress=/, "");
|
|
email = sub(email, /,.*$/, "");
|
|
Intel::seen([$str=email,
|
|
$str_type=Intel::EMAIL,
|
|
$conn=c,
|
|
$where=(is_orig ? SSL::IN_CLIENT_CERT : SSL::IN_SERVER_CERT)]);
|
|
}
|
|
|
|
Intel::seen([$str=sha1_hash(der_cert),
|
|
$str_type=Intel::CERT_HASH,
|
|
$conn=c,
|
|
$where=(is_orig ? SSL::IN_CLIENT_CERT : SSL::IN_SERVER_CERT)]);
|
|
}
|
|
}
|
|
|
|
event ssl_extension(c: connection, is_orig: bool, code: count, val: string)
|
|
{
|
|
if ( is_orig && SSL::extensions[code] == "server_name" &&
|
|
c?$ssl && c$ssl?$server_name )
|
|
Intel::seen([$str=c$ssl$server_name,
|
|
$str_type=Intel::DOMAIN,
|
|
$conn=c,
|
|
$where=SSL::IN_SERVER_NAME]);
|
|
}
|