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

[Auditbeat] Fixes for system/socket dataset UDP and DNS #14315

Merged
merged 4 commits into from
Oct 30, 2019

Conversation

adriansr
Copy link
Contributor

This fixes a couple of problems with the dataset:

  • In some cases incoming UDP packets won't be processed by the dataset due to padding. Seems that some systems add more padding that others and some devices (eth) add more padding than loopback, and tests are run on loopback.
  • Single packet flows didn't have proper process and DNS enrichment.

Originally it would only dump 96 bytes, which is insufficient to
hold the IP and UDP headers in some cases where a lot of padding is used
by the kernel. In those cases the packet would be ignored.
Process data wasn't being properly populated for single-packet flows.
When the incoming sk_buff headers are out of founds for the capture
kprobe to dump the full IP and UDP headers, still generate a partial
flow that helps enrich the socket with local endpoint and process
information.

This flow will not be reported as an event because the remote-side is
missing.
@adriansr adriansr added bug review needs_backport PR is waiting to be backported to other branches. Auditbeat labels Oct 29, 2019
@adriansr adriansr requested a review from a team as a code owner October 29, 2019 21:34
@adriansr adriansr requested a review from andrewkroh October 30, 2019 14:19
st := makeState(nil, (*logWrapper)(t), time.Second, 0, time.Second)
lPort, rPort := be16(localPort), be16(remotePort)
lAddr, rAddr := ipv4(localIP), ipv4(remoteIP)
evs := []event{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this test format. It's easy to follow what's happening.

@adriansr adriansr merged commit c148759 into elastic:master Oct 30, 2019
adriansr added a commit to adriansr/beats that referenced this pull request Oct 30, 2019
This fixes a couple of problems with the dataset:

- In some cases incoming UDP packets won't be processed by the dataset
  due to excessive padding making the headers not fit into the first
  96 bytes dumped. Dump 256 bytes to make sure headers are collected.
- Single packet flows didn't have proper process and DNS enrichment.

(cherry picked from commit c148759)
@adriansr adriansr added v7.5.0 and removed needs_backport PR is waiting to be backported to other branches. labels Oct 30, 2019
adriansr added a commit that referenced this pull request Oct 30, 2019
)

This fixes a couple of problems with the dataset:

- In some cases incoming UDP packets won't be processed by the dataset
  due to excessive padding making the headers not fit into the first
  96 bytes dumped. Dump 256 bytes to make sure headers are collected.
- Single packet flows didn't have proper process and DNS enrichment.

(cherry picked from commit c148759)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
… (elastic#14331)

This fixes a couple of problems with the dataset:

- In some cases incoming UDP packets won't be processed by the dataset
  due to excessive padding making the headers not fit into the first
  96 bytes dumped. Dump 256 bytes to make sure headers are collected.
- Single packet flows didn't have proper process and DNS enrichment.

(cherry picked from commit f5db3b2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants