mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Delete SSL certificates from memory after ssl_established event.
- This is an attempt at fixing the memory issues brought about by the introduction of the new SSL analyzer. My initial testing shows a hefty memory saving.
This commit is contained in:
parent
e07e4ca117
commit
4931aa815f
1 changed files with 13 additions and 0 deletions
|
@ -28,6 +28,11 @@ export {
|
||||||
## This is where the default root CA bundle is defined. By loading the
|
## This is where the default root CA bundle is defined. By loading the
|
||||||
## mozilla-ca-list.bro script it will be set to Mozilla's root CA list.
|
## mozilla-ca-list.bro script it will be set to Mozilla's root CA list.
|
||||||
const root_certs: table[string] of string = {} &redef;
|
const root_certs: table[string] of string = {} &redef;
|
||||||
|
|
||||||
|
## This determines if the c$ssl record is deleted after the record is
|
||||||
|
## logged. You probably want this to be deleted since it contains
|
||||||
|
## the full certificate and all of the chain certificates in it.
|
||||||
|
const delete_certs_after_logging = T &redef;
|
||||||
|
|
||||||
global log_ssl: event(rec: Info);
|
global log_ssl: event(rec: Info);
|
||||||
|
|
||||||
|
@ -121,5 +126,13 @@ event ssl_established(c: connection) &priority=5
|
||||||
event ssl_established(c: connection) &priority=-5
|
event ssl_established(c: connection) &priority=-5
|
||||||
{
|
{
|
||||||
Log::write(SSL::LOG, c$ssl);
|
Log::write(SSL::LOG, c$ssl);
|
||||||
|
|
||||||
|
if ( delete_certs_after_logging )
|
||||||
|
{
|
||||||
|
if ( c$ssl?$cert )
|
||||||
|
delete c$ssl$cert;
|
||||||
|
if ( c$ssl?$cert_chain )
|
||||||
|
delete c$ssl$cert_chain;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue