Skip to content
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

[Metricbeat] - Support reporting of kernel audit subsystem statistics #7191

Closed
kholia opened this issue May 29, 2018 · 5 comments
Closed

[Metricbeat] - Support reporting of kernel audit subsystem statistics #7191

kholia opened this issue May 29, 2018 · 5 comments
Labels
Auditbeat discuss Issue needs further discussion. enhancement Metricbeat Metricbeat Stalled

Comments

@kholia
Copy link

kholia commented May 29, 2018

The kernel audit subsystem metrics are available using the following command,

$ sudo auditctl -s
enabled 1
failure 1
pid 806
rate_limit 0
backlog_limit 16384
lost 0
backlog 7
backlog_wait_time 15000
loginuid_immutable 0 unlocked

It would be great to track to track these metrics over time.

  • Doing so allows us to tune our auditd / auditbeat configuration properly for the observed systems.

  • An untuned auditd / auditbeat deployment can lead to performance and latency problems. Tracking audit subsystem metrics would be helpful in determining when problems (i.e. lost audit events, latency increases due to consequent backpressure) occur.

It seems that this information is not simply available from file(s) in the /proc directory.

$ sudo strace auditctl -s
...

socket(AF_NETLINK, SOCK_RAW, NETLINK_AUDIT) = 3

sendto(3, {len=16, type=0x3e8 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK, seq=1, pid=0}, 16, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 12) = 16

recvfrom(3, {{len=36, type=NLMSG_ERROR, flags=NLM_F_CAPPED, seq=1, pid=2795}, {error=0, msg={len=16, type=AUDIT_GET, flags=NLM_F_REQUEST|NLM_F_ACK, seq=1, pid=0}}}, 8988, MSG_PEEK|MSG_DONTWAIT, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, [12]) = 36

recvfrom(3, {{len=36, type=NLMSG_ERROR, flags=NLM_F_CAPPED, seq=1, pid=2795}, {error=0, msg={len=16, type=AUDIT_GET, flags=NLM_F_REQUEST|NLM_F_ACK, seq=1, pid=0}}}, 8988, MSG_DONTWAIT, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, [12]) = 36

select(4, [3], NULL, NULL, {tv_sec=0, tv_usec=100000}) = 1 (in [3], left {tv_sec=0, tv_usec=99998})
recvfrom(3, {{len=56, type=AUDIT_GET, flags=0, seq=1, pid=0}, "\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x26\x03\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00"...}, 8988, MSG_DONTWAIT, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, [12]) = 56

See #7157 ([Auditbeat] Avoid having Linux wait on clearing a backlog) for the motivation behind this feature request.

Thanks!

@kholia kholia added discuss Issue needs further discussion. Metricbeat Metricbeat labels May 29, 2018
@ruflin
Copy link
Member

ruflin commented May 29, 2018

@andrewkroh I wonder if this would make more sense to also be reported by auditbeat directly?

@andrewkroh
Copy link
Member

The lost metric is now collected by Auditbeat and reported through the Beats internal metric subsystem. The value is reported as auditd.kernel_lost. See #7179.

So it will show up in logs, be reported in the monitoring data that goes to ES, and be available over HTTP if http.host is configured.

@kholia
Copy link
Author

kholia commented May 29, 2018

Great!

Would it also be possible to report the backlog value? It could be helpful in tweaking the Auditbeat configuration for an observed system.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@kvch kvch added the Auditbeat label Jan 17, 2020
@botelastic
Copy link

botelastic bot commented Dec 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the Stalled label Dec 17, 2020
@botelastic botelastic bot closed this as completed Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auditbeat discuss Issue needs further discussion. enhancement Metricbeat Metricbeat Stalled
Projects
None yet
Development

No branches or pull requests

5 participants