zeek/scripts/policy/protocols/conn/ip-proto-name-logging.zeek
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

20 lines
625 B
Plaintext

##! This script adds a string version of the ip_proto field. It's not recommended
##! to load this policy and the ip_proto removal policy at the same time, as
##! conn.log will end up with useless information in the log from this field.
@load base/protocols/conn
module Conn;
redef record Info += {
## A string version of the ip_proto field
ip_proto_name: string &log &optional;
};
event new_connection(c: connection) &priority=5 {
# In case we're the first access
Conn::set_conn(c, F);
if ( c$conn?$ip_proto && c$conn$ip_proto in IP::protocol_names )
c$conn$ip_proto_name = IP::protocol_names[c$conn$ip_proto];
}