layers/netflow: NFv9/10 flow record type fix#4813
Conversation
|
This comes from #4810. I've revised a number of fields. A couple of thoughts:
cc @gpotter2 |
gpotter2
left a comment
There was a problem hiding this comment.
Thanks for looking into this, we likely should try to adapt the code so that it supports NBytesField to support integer values of arbitrary lengths. Right now this code likely won't work.
Ack. It would be good to support the 8bytes counters, as this is a commonly used thing. |
This commit fixes the Python types of a number of fields defined in Netflowv9/10 for the following pre-defined fields (mostly the ones in RFC3954 https://datatracker.ietf.org/doc/html/rfc3954). It appears that in absence of an assigned field type, it defaults to BytesField instead of IntField. Fields: * IN_BYTES, IN_PKTS, OUT_BYTES, OUT_PKTS: IntField (4 bytes). Please note code doesn't seem to support the larget 8byte optional length. * MUL_DST_PKTS, MUL_DST_BYTES: same as above * INPUT_SNMP, OUTPUT_SNMP: ShortField (2 bytes), iface index. Note: code doesn't seem to support optional larger values (undefined max. length, but 8 bytes might be sufficient). Note there are _many_ other field types defined that are not part of the spec / unknown without field type and length. Fixes secdev#4810 Signed-off-by: Marc Sune <marcdevel@gmail.com>
Remove unnecessary `print()` in _GenNetflowRecordV9(). Fixes secdev#4810 Signed-off-by: Marc Sune <marcdevel@gmail.com>
fa89ccb to
cd72cb2
Compare
|
Thanks again a lot for the PR and sorry for the gazillion years of wait... |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4813 +/- ##
=======================================
Coverage 80.27% 80.28%
=======================================
Files 375 375
Lines 92476 92480 +4
=======================================
+ Hits 74238 74245 +7
+ Misses 18238 18235 -3
🚀 New features to boost your workflow:
|
This commit fixes the Python types of a number of fields defined in Netflowv9/10 for the following pre-defined fields (mostly the ones in RFC3954 https://datatracker.ietf.org/doc/html/rfc3954).
It appears that in absence of an assigned field type, it defaults to BytesField instead of IntField. Fields:
Note there are many other field types defined that are not part of the spec / unknown without field type and length.
Fixes #4810