-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Elastic Agent] Shared Packetbeat Sniffer Configuration #22227
Comments
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
Pinging @elastic/ingest-management (Team:Ingest Management) |
@blakerouse @michalpristas Would be great to get your thoughts on the above on how we could do this. I wonder how we should think of it: Config for a specific process? Config for a list of inputs? Global configs we just ship everywhere? Other? |
I was thinking of an alternative approach that might get us what we need, and would like to hear thoughts about it. If, instead of approaching each protocol as an inputs:
- type: packet
# other sniffer configuration here
streams:
- type: flow
timeout: 10s
period: 10s
keep_null: false
data_stream:
dataset: packet.flow
type: logs
- type: icmp
data_stream:
dataset: packet.icmp
type: logs The above would allow the packetbeat spec configuration to pretty much just look like this: # artifact stuff up here
rules:
- filter_values:
selector: inputs
key: type
values:
- packet
- inject_agent_info: {}
- filter:
selectors:
- inputs
- output
# when clause down here Packetbeat would then either have to enforce The one downside to the single element The downside to the multiple sniffers is that it'll take a bit longer to implement and require some research (not sure how it'll effect system resources or what sort of multi-sniffer setups are actually supported by libpcap). If we want to go the multiple sniffer route, but are ok punting on it for now, we could always do the single element enforcement for now and extend Packetbeat in the future. Thoughts? CC: @andrewkroh |
@ruflin I prefer @andrewstucki latest approach, but I don't know if it being limited on the intergration packages side is an issue? Would it maybe be possible for agent to just pass multiple inputs down to Packetbeat and allow packet beat to build the shared sniffer from those values. This would basically be Packetbeat understanding a top level |
@blakerouse so I don't think we're actually limited anymore, I rewrote the packet sniffer management code so that we can run up to 100 sniffers in a single packetbeat instance. What that means essentially is that you can have up to 100 integrations enabled in a policy that each use the That said, I'm still looking for a way of passing in
of the above. So it would still be good to carry on this conversation. |
There is an other ongoing discussion with @urso on how input should look and it goes more in the direction of, everything should be an input. I'm personally leaning in the direction of having 1 input per protocol as I think it is also more intuitive to configure. It seems like based on your comment above, packetbeat would be able to summarise the following config to run only 2 sniffers? (see the different sniffer configs). I heavily simplified the config and it might not be correct, just for example purpose:
The above also allows to potentially have a nginx packet with an option to sniff traffic on port 80 and than just ship it down as an additional input. Packetbeat will figure out with additional sniffers are needed or not. For limitations on the packages side: Lets ignore it for now, we can fix it. |
The discussion mentioned is here: https://docs.google.com/document/d/1g1yBQ4W0nLNmc7rdU_oApeqk8-O-7OJMIibwaijM-HY/edit#heading=h.969mszu50xv1 According to "Model2" in the discussion the configuration would become:
The defaults is a shared set of settings, but streams would be allowed to overwrite settings. Packetbeat would need to create a "sniffer" for each device found. Individual analyzers/streams are configured within the sniffer per stream that matches. |
@urso that would make sense. It is pretty similar to what's already here with the addition of overriding of individual device-level settings per-stream. I like the added flexibility as well It's a bit funky in the sense that the configuration presented to packetbeat is grouped by package/integration and in the configuration munging code we'd need to regroup inputs logically based off of device-level configuration, but I agree that it keeps the general semantics of inputs = "sniffer"/"device", streams = "protocol" fairly in place. |
Met with @andrewkroh and here's a summary of how we're going to approach this:
This will essentially allow us to move forward with the spec from #22145 and then add the sniffer configuration code to Packetbeat. For additional details about indexing strategy/package implementation, I think maybe we can have that conversation in #21356? |
@andrewstucki Could you share a bit background on the pros / cons and how you reached the conclusion to go with 1? This is so we can get back to this thread and have a place to look up not just the decision. |
PROS
CONS
|
Thanks for the details. In summary from an Elastic Agent perspective, packetbeat is just a single input. |
Hi! We're labeling this issue as |
While migrating Packetbeat to be managed by Agent we came across a bit of a snag when it comes to our current Packetbeat architecture. Currently Packetbeat has a series of protocols/flows that can be modeled as
inputs
, however it also has a shared sniffer implementation. Basically the single shared sniffer dispatches packets to any registered protocol/flow handlers that then process and publish them. Currently all of that configuration is underpacketbeat.interfaces
(i.e.packetbeat.interfaces.device
).Ideally we'd have a mechanism to pass this sort of singleton configuration to packetbeat, but right now we're pretty much limited to whatever comes in
inputs
.This is more or less an extension of some of the conversation in #20679 and arguably falls under exactly what @ruflin advocated:
The text was updated successfully, but these errors were encountered: