[Auditbeat] Socket metricset#8834
Conversation
webmat
left a comment
There was a problem hiding this comment.
LGTM overall.
I have a few comments about leveraging ECS more, mostly :-)
490b15d to
4da95d8
Compare
Add sockets metricset to system module. Also adds information about users to the existing `host` metricset.
d1a182b to
b117a37
Compare
|
Should be ready for another review. High-level changes since the last:
|
tsg
left a comment
There was a problem hiding this comment.
Left one question I wasn't sure about, but otherwise LGTM.
andrewkroh
left a comment
There was a problem hiding this comment.
Overall this looks pretty good and I'm glad you were able to reuse some Metricbeat parts.
I'm curious how strongly others feel about the utility of persisting state to disk for this metricset. And I think we need some changes to more closely match ECS.
|
Changes:
@andrewkroh Let me know if this looks good, please. |
|
Adding |
|
@cwurm Yes, when I did a big push on Filebeat modules, the MO was to add the fields as locally as possible (e.g. module's overall Fully defining all fields in libbeat has some issues. One of which is that there used to be only a few common fields. So each Beat would list them right alongside their local field definitions in the documentation, and it wasn't an issue. When introducing ECS' 100+ fields, this means the Beat fields are drowned in common field definitions 😆 It's fine that they're documented explicitly in each Beat, but it should be made clear which are common fields and which are specific fields. @ruflin is working on improving documentation generation and other wide ranging issues like this. |
|
@cwurm If you are targeting 6.x, please don't add all ECS fields and only the ones you need ;-) |
|
@ruflin Which fields did you have in mind? This will go into |
|
@cwurm Can you ping me on the backport? I'm worried that some fields might conflict with fields we have set as alias in 6.x (hopefully not). |
Collects information about open sockets (Linux only). Uses netlink to query for all currently open sockets. Sends information about all sockets on start, and periodically as determined by `state.period`. Otherwise, sends only newly opened or closed sockets. The sockets are enriched with process and user information.
This
socketsmetricset is mostly based on Metricbeat'ssocketmetricset. It uses the same code in a number of places:NetlinkSession)UserCache), direction (ListenerTable), and process (ProcTable).Otherwise, it pretty much follows the conventions of the existing metricsets in the
systemmodule.There are a few things we might want to do in the future:
hostmetricset. With a list of users available over there we might want to access that instead of doing new lookups here.processesmetricset, so we might want to use that instead of relying onProcTable. We'll still have to scan/procto find the PID owning a socket though./proc(e.g. NFS). At least some can be owned by RPC services, and I have a working prototype for enriching such sockets with information about the RPC service that owns them. It's a bit tricky to get a list of RPC services in a good way so we might not want to do it now. I'll open an issue after this.