mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Another change to possibly fix the SSL memory consumption problem.
- If a protocol violation happens, Bro now logs what it has seen up until the protocol violation and deletes the c$ssl record so that a long lived connection with a protocol violation does continue to hold the memory.
This commit is contained in:
parent
c87704cc25
commit
ee1884ca93
1 changed files with 21 additions and 9 deletions
|
@ -70,6 +70,20 @@ function set_session(c: connection)
|
|||
if ( ! c?$ssl )
|
||||
c$ssl = [$ts=network_time(), $uid=c$uid, $id=c$id, $cert_chain=vector()];
|
||||
}
|
||||
|
||||
function finish(c: connection, violation: bool)
|
||||
{
|
||||
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;
|
||||
}
|
||||
if ( violation )
|
||||
delete c$ssl;
|
||||
}
|
||||
|
||||
event ssl_client_hello(c: connection, version: count, possible_ts: time, session_id: string, ciphers: count_set) &priority=5
|
||||
{
|
||||
|
@ -120,14 +134,12 @@ event ssl_established(c: connection) &priority=5
|
|||
|
||||
event ssl_established(c: connection) &priority=-5
|
||||
{
|
||||
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;
|
||||
}
|
||||
finish(c, F);
|
||||
}
|
||||
|
||||
event protocol_violation(c: connection, atype: count, aid: count,
|
||||
reason: string) &priority=5
|
||||
{
|
||||
if ( c?$ssl )
|
||||
finish(c, T);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue