DRAFT: ICMP protocol support (issue #250)#285
Conversation
|
@darxriggs It's great that you are adding support for the ICMP protocol. Here is a quick tutorial about how to add a new protocol in Packetbeat: https://www.elastic.co/guide/en/beats/packetbeat/current/_developer_guide_adding_a_new_protocol.html. Please let us know if you have any questions. |
|
@monicasarbu Thanks for the info. I already read this guide. But as ICMP is neither a TCP nor a UDP protocol the guide is only partly useful. As already stated by you in issue #267 some parts are already outdated. Publishing a transaction now is done via |
There was a problem hiding this comment.
I would suggest to name it withIcmp. I'm aware that there are still quite a few variables that use _ but we should migrate to the new naming standard camelCase for the new variables (in case it doesn't break something).
There was a problem hiding this comment.
Ok. I was already wondering what the naming convention is in the project but didn't find a consistent one.
But inside the Config structs you still go with Camel_case so that it's underscores in the .yml config file?
There was a problem hiding this comment.
No, we also plan to go with camelCase in the config. See here for an example: https://github.com/elastic/filebeat/blob/master/etc/filebeat.yml#L43
There was a problem hiding this comment.
I updated all my "internal" code to use camelCase. The "external" code which is in other files like config.go and protos.go I left as is, not to mix both naming conventions in a single file.
I suggest that the switch from under_score to camelCase is done in one go.
|
@darxriggs This looks very promising. It is especially cool that you also added system tests. |
417eb68 to
d0a4fcd
Compare
protos/icmp/icmp.go
Outdated
There was a problem hiding this comment.
we've got some additions in tsg/gopacket. Longterm we will try to get these back into upstream and update all references thereafter.
There was a problem hiding this comment.
Yes I know about additions. I also have pull request open (google/gopacket#134) but nobody is looking at it.
|
All in all looks good, but reporting to ES can be improved + really nice to have feature. Thanks for your PR. |
|
I'll let you know when I am finished incorporating the review comments and some more tests & cleanup. |
|
@darxriggs Are there still changes you want to do or is this mostly ready to be merged? I'm asking because we are planning to do a reorganization of our repositories this week (merging the official Beats in a single repo). The way we plan to do it will keep this repository alive, so this PR won't be lost or closed. However, we'll move all packetbeat files in a packetbeat/ folder, so this will mean it will be likely more work to merge it. Let me know what you think, we could merge it and keep improving on it later, but I'm also happy to keep it open and do the rebase work after we change the repos. |
|
@tsg Sorry for being so quiet for some time. Some final questions: |
|
That's great news! In our normal workflow the person who submits the PR does the history cleanup and rebase. But the rebase might be complex in this case due to your point b) and I don't want to put more work on you, so if squashing to a single commit is all you need, I can do that for you tomorrow. Let me know please. |
* test for the correct directory * otherwise when the "env" directory exists no virtualenv is installed
8cd8e3e to
50f70be
Compare
* supports ICMPv4 and ICMPv6 * this protocol is different to all the existing ones as it's based directly on IP (not TCP/UDP) and therefore doesn't use ports * TODOs * add more ICMP types (that are not provided as constants in gopacket) * add support for SendRequest and SendResponse
50f70be to
aacd991
Compare
|
Ok. What did I do finally?
I guess now it's up to you. |
DRAFT: ICMP protocol support (issue #250)
This is the implementation to support the ICMP protocol. (see issue #250)
ICMP is the 1st non-transport level protocol in packetbeat. So a big question is how to integrate such protocols in the current infrastructure.
Please provide any kind of feedback.
Design Decisions
icmpMessage
icmpTransaction
icmpTuple
Icmp
publishTransaction() as Cache.Delete() tries to aquire a lock but Cache.Cleanup() already aquired one -> deadlock
BPF Filter
also see https://www.snellman.net/blog/archive/2015-05-18-whats-wrong-with-pcap-filters/
tested with scapy
scenarios