Skip to content

Commit 18fe09c

Browse files
committed
Enhancment: Do not export ovpn field for short flows.
1 parent 69db2d9 commit 18fe09c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

process/ovpn.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ int OVPNPlugin::pre_update(Flow &rec, Packet &pkt)
206206
void OVPNPlugin::pre_export(Flow &rec)
207207
{
208208
RecordExtOVPN *vpn_data = (RecordExtOVPN *) rec.get_extension(RecordExtOVPN::REGISTERED_ID);
209+
210+
//do not export ovpn for short flows, usually port scans
211+
uint32_t packets = rec.src_packets + rec.dst_packets;
212+
if (packets <= 5) {
213+
rec.remove_extension(RecordExtOVPN::REGISTERED_ID);
214+
return;
215+
}
216+
209217
if (vpn_data->pkt_cnt > min_pckt_treshold && vpn_data->status == status_data) {
210218
vpn_data->possible_vpn = 100;
211219
} else if (vpn_data->pkt_cnt > min_pckt_treshold && ((double) vpn_data->data_pkt_cnt / (double) vpn_data->pkt_cnt) >= data_pckt_treshold) {

0 commit comments

Comments
 (0)