cloudflare / goflow

The high-scalability sFlow/NetFlow/IPFIX collector used internally at Cloudflare.
BSD 3-Clause "New" or "Revised" License
852 stars 171 forks source link

IPFIX Template decoding does not handle Enterprise-Specific Information Elements #125

Open rafal-prasal opened 7 months ago

rafal-prasal commented 7 months ago

According to IPFIX RFC, when field highest bit is set to 1 then the field is considered Enterprise. In such case just after that filed there are additional 4 bytes with value Enterprise Number an id in the field interpretation for the lookup table.

Due to that when hitting records with Enterprise-Specific Information Elements will get corrupted.

link to RFC https://datatracker.ietf.org/doc/html/rfc7011#page-64

link to faulty function: https://github.com/cloudflare/goflow/blob/742cddc5dc37bac910151b9519e2720776ba404d/decoders/netflow/netflow.go#L93