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

Use the Zeek is_orig field to set files tx_host/rx_host #3004

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

philrz
Copy link
Contributor

@philrz philrz commented Feb 13, 2024

A recent Zeek community Slack thread educated me about the is_orig field of Zeek files logs. As those docs explain:

If the source of this file is a network connection, this field indicates if the file is being sent by the originator of the connection or the responder.

In the changes I pushed in #2981 I wasn't yet aware of this so for the result in the Correlation view I'd just set the tx_host to be the id.resp_h of the files event and likewise set the rx_host to be the id.orig_h. This all makes sense for the common case of a file download, but it's incorrect for file uploads.

To illustrate the effect I've attached some test data query-aws.pcapng.gz which is a capture of my laptop (IP 199.83.220.169) performing a query over the lake API to a Zed service running on an AWS EC2 instance (IP 3.138.203.14).

When this pcap is imported into Zui, Zeek ends up finding two files events within this single connection, the first of which is a log of the query payload ({"query":"from inventory@main | count() by warehouse"}) and the second which is the query response ) ({warehouse:"chicago",count:2(uint64)} {warehouse:"miami",count:1(uint64)}).

With Zui commit cf615ef that's current tip of main before this PR's branch, both files events show the tx_host to be the same value: That of the AWS instance.

image

image

Now at commit ae287aa using the branch for this PR, the first files event shows my laptop as the tx_host, which is more in line with expectations since my laptop is what "originated" the sending of the query payload.

image

While the second files event shows the AWS instance as the tx_host, which also makes sense since it's what "originated" the sending of the query response.

image

@philrz philrz self-assigned this Feb 13, 2024
Copy link
Member

@jameskerr jameskerr left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@philrz philrz merged commit 5d04fd3 into main Feb 14, 2024
3 checks passed
@philrz philrz deleted the leverage-is_orig branch February 14, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants