8000 Packet capture context by oshaked1 · Pull Request #4072 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Packet capture context #4072

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

Merged
merged 4 commits into from
Jul 11, 2024
Merged

Conversation

oshaked1
Copy link
Contributor

1. Explain what the PR does

This PR adds context information to pcap files generated by Tracee. Based on the type of pcap, an interface description that contains various pieces of context information in JSON format is added.

Example of an interface description for a process pcap:

{"container":{"id":"c373adfdc4ac4c3a330c4fda09ad9398bcfb99c381b97cb044c813a397547def","name":"gallant_nightingale","image":"busybox:latest","imageDigest":"busybox@sha256:5eef5ed34e1e1ff0a4ae850395cbf665c4de6b4b83a32a0bc7bcb998e24e7bbb"},"kubernetes":{"podName":"","podNamespace":"","podUID":"","podSandbox":false},"hostName":"c373adfdc4ac","processName":"ping","process":{"threadStartTime":1716378637481073915,"processId":1,"cgroupId":526,"threadId":1,"parentProcessId":0,"hostProcessId":191684,"hostThreadId":191684,"hostParentProcessId":191665,"userId":0,"mountNamespace":4026532371,"pidNamespace":4026532374,"executable":""}}

This closes #4050.

2. Explain how to test it

An integration test was added for the context information.

To manually read the interface description containing the context information, use the following python script with the pcap file as an argument:

import sys
import pcapng

pcap_path = sys.argv[1]
with open(pcap_path, 'rb') as f:
    scanner = pcapng.FileScanner(f)
    for block in scanner:
        if isinstance(block, pcapng.blocks.InterfaceDescription):
            print(block.options['if_description'])

@oshaked1 oshaked1 force-pushed the packet_capture_context branch from 0f96004 to 55dbbde Compare May 22, 2024 12:41
@oshaked1 oshaked1 added this to the v0.22.0 milestone Jun 23, 2024
@oshaked1 oshaked1 force-pushed the packet_capture_context branch from 55dbbde to c05c6c2 Compare June 24, 2024 07:09
@oshaked1 oshaked1 force-pushed the packet_capture_context branch 3 times, most recently from fd8b145 to 1e33f25 Compare June 30, 2024 12:17
@yanivagman yanivagman removed this from the v0.22.0 milestone Jul 4, 2024
@oshaked1 oshaked1 force-pushed the packet_capture_context branch from 1e33f25 to 8cd4dfe Compare July 11, 2024 08:38
Copy link
Collaborator
@yanivagman yanivagman left a comment

Choose a reason for hiding this comment

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

LGTM

@yanivagman yanivagman merged commit 8f6b459 into aquasecurity:main Jul 11, 2024
32 checks passed
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.

Add context info to packet captures
2 participants
0