-
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
[Auditbeat] Socket metricset #8834
[Auditbeat] Socket metricset #8834
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one question I wasn't sure about, but otherwise LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
sockets
metricset is mostly based on Metricbeat'ssocket
metricset. 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
system
module.There are a few things we might want to do in the future:
host
metricset. With a list of users available over there we might want to access that instead of doing new lookups here.processes
metricset, so we might want to use that instead of relying onProcTable
. We'll still have to scan/proc
to 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.