ZERO-COPY BASED MAIN CONTAINER'S SYSTEM CALL COLLECTION DEVICE AND METHOD FOR USING eBPF IN KUBERNETES SECONDARY CONTAINER
The system call collection apparatus using eBPF in a secondary Kubernetes container efficiently collects system calls with minimal overhead and secure monitoring, overcoming the limitations of existing tools by maintaining namespace isolation and reducing resource usage.
Patent Information
- Application Number
- US19/679377
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Priority Date
- 2025-05-23
- Filing Date
- 2026-05-15
- Publication Date
- 2026-11-26
AI Technical Summary
Existing system call collection tools like strace and sysdig are unsuitable for real-time monitoring in cloud-native environments due to high resource usage and network overhead, and sharing process namespaces between containers in Kubernetes pods poses security risks.
A system call collection apparatus using eBPF in a secondary container within a Kubernetes pod, comprising a Pod PID Provider, Data Collector, System Call Tracer, and PID Tracer, which creates and updates a PID list in a hashmap to track and store system calls without sharing namespaces, minimizing overhead and maintaining isolation.
Enables rapid, real-time system call collection with minimal overhead and secure monitoring of main containers while preserving namespace isolation, addressing performance and security limitations of conventional methods.
Smart Images

Figure US20260377208A1-D00000_ABST
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATION
[0001] The present application claims priority under 35 U.S.C. §119(a) to Korean Patent Application No. 0-2025-0067396 filed in the Korean Intellectual Property Office on May 23, 2025, which is incorporated herein by reference in its entirety.TECHNICAL FIELD
[0002] The present invention relates to a system and method for collecting system calls of a main container in a Kubernetes environment, wherein a cloud‑native environment is built using Kubernetes (v1.28.15), system‑call collection is performed in the pod—the smallest deployment unit of a Kubernetes service—while preserving the isolation mechanisms between containers within the pod, and a secondary container monitors in real time, with minimal overhead, the system calls invoked by the main container using eBPF‑based zero‑copy.BACKGROUND OF THE INVENTION
[0003] Registration No. 10-2679212 (2024.06.24), “Method, device, and computer‑readable recording medium for distribution and execution control of container images based on a secure kernel.”
[0004] Patent number 10‑2679212 discloses a technology that defines authorized files and processes within a container in a CRD to control malicious actions by an attacker exploiting container runtime vulnerabilities, and by performing access control based on this definition, creates a secure deployment and execution environment for containers.
[0005] Registration number 10-1428769 (2014.08.04), "Black box device and method for supporting reconfiguration of a smart grid system"
[0006] Patent number 10-1428769 discloses a black‑box device and method that support the rapid reconstruction of the environment at the time of an incident when an abnormal situation occurs in a smart‑grid system due to cyber attacks, system errors, and the like.
[0007] Registration No. 10-0959277 (May 14, 2010), “MBR attack blocking system using a control list at the kernel layer and a computer-readable recording medium containing the program.”
[0008] Patent No. 10‑0959277 discloses an MBR attack‑blocking system and a recording medium readable by a computer that stores the program, wherein, when a suspect process requests a change to the MBR (master boot record), the change request is virtually processed and the change information is recorded in a virtual change repository even if the user refuses the installation.
[0009] A system call can be an interface by which an application requests the kernel to use services provided by the operating system kernel.
[0010] System call collection can be performed for various purposes such as debugging, monitoring, analysis, and security auditing of processes that invoke system calls.
[0011] Existing tools for collecting system calls include strace, ftrace, and sysdig, for example.
[0012] The strace operates based on ptrace, intercepts all system calls, and forwards them to user space. Because the strace works by stopping the target process, handling the system call, and then resuming the process, it is unsuitable for real-time monitoring and can cause process execution delays due to context switching.
[0013] Here, the context switching refers to the technique of replacing the process to be executed on the CPU by suspending a currently running process and executing another process when multiple processes are running.
[0014] The sysdig uses a kernel module, but because it analyzes system calls in user space, its resource usage increases as the number of system calls invoked grows.
[0015] Also, the sysdig has the drawback that its analysis speed slows down when collecting large amounts of data.
[0016] In cloud‑native environments where multiple processes are broken down and many containers run those processes, system calls are collected to analyze the processes executing in each container. Here, “cloud‑native” can refer to the software approach used when building, deploying, and managing modern applications in a cloud computing environment.
[0017] However, existing tools such as strace, ftrace, and sysdig are not suitable for cloud-native environments that provide real-time services and run numerous processes.
[0018] Cloud-native architecture uses containers and Kubernetes to efficiently scale and operate applications. Here, Kubernetes can refer to a portable and scalable open-source platform for managing containerized workloads and services.
[0019] Kubernetes consists of multiple worker nodes (hosts) that run pods and a master node (host) that manages the worker nodes.
[0020] In this case, a pod is the smallest computing unit that can be created and managed in Kubernetes. A pod is a group of one or more containers.
[0021] A pod can be divided into a main container that provides the service and a secondary container that expands the main container’s functionality by providing features such as logging, monitoring, security, and data synchronization without modifying the application code within the main container.
[0022] In Kubernetes secondary containers, system calls may be collected to monitor the main container.
[0023] However, due to Linux's inter-container isolation mechanism, the secondary container cannot monitor the main container's processes.
[0024] Accordingly, the main container, or the host running the container, collects system calls and either sends them to the secondary container or delivers them to the secondary container via a shared file system.
[0025] However, these various approaches incur network overhead when transmitting system calls over a network, and cause resource overhead and latency due to file write / read when sharing a file system.
[0026] Accordingly, collecting system calls from the secondary container is not suitable for real-time monitoring.
[0027] Another monitoring method provided by Kubernetes is sharing the Process Namespace among containers within a pod.
[0028] Linux can provide a namespace feature that allows system resources to be isolated when executing a process.
[0029] The Process Namespace (PID Namespace) provides an independent process ID space for each container, ensuring that processes in different containers are isolated from one another.
[0030] By sharing the Process Namespace, the secondary container can monitor the main container's processes, eliminating the need for additional actions such as transmission or file write / read.
[0031] However, sharing a namespace allows containers within a pod to access passwords and secret keys in the file system and enables management between processes of different containers, which is not recommended from a security standpoint.
[0032] In particular, when the same PID (Process ID) namespace is shared, processes running in one container can be observed and controlled from another container, which can increase the risk of malicious process manipulation and information leakage.
[0033] Therefore, the emergence of a system call collection model that has low security risk, enables real-time monitoring, and incurs minimal resource overhead is urgently needed.DESCRIPTION OF THE INVENTIONProblem to be solved
[0034] The example of the present invention provides a method and system for collecting system calls of a main container, using eBPF in a Kubernetes secondary based on zero‑copy, by adopting a technique that gathers the main container’s system calls via the secondary to achieve rapid system‑call collection speed.
[0035] Furthermore, an example of the present invention aims to minimize the system call collection overhead of each main container in a Kubernetes environment by implementing a lightweight eBPF-based system call tracing mechanism.
[0036] Furthermore, an example of the present invention aims to collect system calls while maintaining process namespace isolation between containers within a Kubernetes pod.Means for Solving the Problem
[0037] The system call collection apparatus for a main container based on zero‑copy, utilizing eBPF in a secondary container of Kubernetes according to an example of the present invention comprises: a Pod PID Provider that creates a PID list for the main containers belonging to each of multiple pods; a Data Collector that registers the created PID list in a PID Hashmap; a System Call Tracer that, based on the PID Hashmap, tracks system calls invoked from the pods and stores them in a buffer; and a PID Tracer that updates the PID list registered in the PID Hashmap. The Data Collector can collect the system calls stored by the System Call Tracer by sharing the buffer.
[0038] Furthermore, the zero‑copy‑based system‑call collection method for a main container using eBPF in a secondary container of Kubernetes, according to an example of the present invention, may comprise: a step of generating a PID list for the main containers belonging to each of a plurality of pods by a Pod PID Provider; a step of registering the generated PID list in a PID hashmap by a Data Collector; a step of tracing system calls invoked in the pods based on the PID hashmap and storing them in a buffer by a System Call Tracer; a step of updating the PID list registered in the PID hashmap by a PID Tracer; and a step of having the Data Collector share the buffer and collect the system calls stored by the System Call Tracer.Effect of the Invention
[0039] According to an example of the present invention, by adopting a method of collecting system calls of the main container through a secondary container, a method and system for collecting system calls of a main container based on zero-copy using eBPF in a Kubernetes secondary container can be provided, achieving rapid system call collection speed.
[0040] Furthermore, according to the present invention, by implementing a lightweight system call tracing mechanism based on eBPF, the overhead of collecting system calls for each main container can be minimized in a Kubernetes environment.
[0041] Furthermore, according to the present invention, system calls can be collected while maintaining process namespace isolation between containers within a Kubernetes pod.BRIEF DESCRIPTION OF THE DRAWINGS
[0042] FIG. 1 is a block diagram showing the configuration of a system‑call collection apparatus for a zero‑copy‑based main container using eBPF in a Kubernetes secondary container according to an example of the present invention.
[0043] FIG. 2 is a diagram illustrating the Zero-copy-based system call collection system architecture in a secondary container provided by the present invention.
[0044] FIG. 3 is a diagram illustrating the Zero‑copy‑based system call collection process according to the present invention.
[0045] FIG. 4 is a flowchart illustrating a method for collecting system calls of a main container based on zero-copy using eBPF in a secondary container of Kubernetes, according to an example of the present invention.SPECIFIC DETAILS FOR CARRYING OUT THE INVENTION
[0046] In the following, the examples are described in detail with reference to the attached drawings. However, various modifications may be made to the examples, and the scope of the patent claim is not limited or restricted by these examples. All modifications, equivalents, or alternatives to the examples should be understood to be included within the scope of the claim.
[0047] The terms used in the examples are employed solely for descriptive purposes and shall not be construed as limiting. Singular expressions, unless clearly indicated otherwise by context, include plural expressions. In this specification, terms such as “include” or “comprise” are intended to indicate that the features, numbers, steps, actions, components, parts, or combinations thereof described in the specification are present, and should not be understood as excluding the presence or additional possibility of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.
[0048] Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as would be generally understood by a person of ordinary skill in the art to which the examples belong. Terms that are defined in commonly used dictionaries, or similarly, should be interpreted as having the meaning consistent with the context of the relevant technology, and unless explicitly defined in this application, they shall not be interpreted in an idealistic or overly formal sense.
[0049] Furthermore, when describing with reference to the attached drawings, the same component shall be assigned the same reference numeral regardless of the drawing symbols, and any redundant description thereof shall be omitted. In describing the examples, if a detailed explanation of the relevant prior art is deemed to unnecessarily obscure the essence of the example, such detailed description shall be omitted.
[0050] FIG. 1 is a block diagram showing the configuration of a system‑call collection apparatus for a zero‑copy‑based main container using eBPF in a Kubernetes secondary container according to an example of the present invention.
[0051] Referring to FIG. 1, the system call collection device (100) for a zero‑copy‑based main container that utilizes eBPF in a secondary container of Kubernetes, according to an example of the present invention (hereinafter abbreviated as “system‑call collection device”), may be configured to include a Pod PID Provider (110), a Data Collector (120), a System Call Tracer (130), and a PID Tracer (140).
[0052] First, the pod PID provider (110) creates a PID list for the main containers belonging to each of the multiple pods. In other words, the pod PID provider (110) can recognize the uniquely assigned PID for each main container and compile a PID list that includes the recognized multiple PIDs.
[0053] Here, the PID (Process ID) may be a unique identifier used to distinguish the processes running in each main container.
[0054] In creating the PID list, the pod PID provider (110) may operate within the node’s user space. Here, user space can be a user-accessible area that permits the user to access and input commands—such as function calls—to the kernel space described later.
[0055] The pod PID provider (110) can identify multiple IDs for each of the multiple pods. In other words, the pod PID provider (110) can identify the IDs of pods, which are the smallest deployable computing units that can be created and managed in Kubernetes. Each pod includes a main container that implements the process.
[0056] The pod PID provider (110) can identify multiple PIDs for the main containers belonging to each pod using the multiple IDs. In other words, the pod PID provider (110) can identify the PID of the main container belonging to a pod through the pod’s ID.
[0057] Thereafter, the pod PID provider (110) may generate the PID list by including the multiple PIDs. In other words, the pod PID provider (110) may create the PID list by incorporating the identified PIDs.
[0058] After creating the PID list, the pod PID provider (110) can deliver the created PID list to the secondary container.
[0059] Specifically, the pod PID provider (110) delivers the PID list of the main container to a data collector (120) placed in the secondary container, thereby allowing the process of the main container to be monitored from the secondary container while maintaining isolation between containers within the pod.
[0060] It establishes an environment that enables a secondary container to directly receive system calls invoked by the main container, even if it does not share the Process Namespace with the main container.
[0061] The data collector (120) registers the aforementioned PID list in the PID hashmap (150, PID Hashmap). In other words, when the data collector (120) receives a PID list from the pod PID provider (110), it can register it in the PID hashmap (150) that operates in the node’s kernel space.
[0062] More specifically, the data collector (120) can register the PID list in the PID hashmap (150) operating in the node’s kernel space when the PID list is delivered from the pod PID provider (110).
[0063] Here, kernel space may be the area that contains data structures, variables, functions, and other elements used by the kernel. Kernel space may be the area that protects the system by preventing those data structures, variables, functions, and other elements from being easily corrupted by the user. The user cannot access kernel space and can only access user space.
[0064] The PID list registered in the PID hashmap (150) can be used and managed (updated) by the system call tracer (130) operating in kernel space and the PID tracer (140).
[0065] The system call tracer (130), based on the PID hashmap (150), can track system calls invoked from the pod and store them in a buffer. In other words, the system call tracer (130) can identify the main container to be monitored using the PIDs in the PID list registered in the PID hashmap (150), and store in the buffer the system calls obtained by tracking the system calls invoked in association with the identified main container.
[0066] In this case, the buffer is a buffer (eBPF Ring Buffer) created based on eBPF, and the eBPF may be a Linux kernel technology that can execute sandbox programs in privileged environments such as the operating system kernel.
[0067] Specifically, the system call tracer (130) can track system calls invoked from the calling pod among the multiple pods and obtain the PID of that calling pod. Here, a calling pod can be defined as a pod in which a system call is invoked from its associated main container. In other words, by tracking system calls, the system call tracer (130) can acquire the PID of the calling pod that issued the system call.
[0068] Furthermore, the system call tracer (130) can determine whether the obtained PID is present in the PID hashmap (150). In other words, based on the list of PIDs registered in the PID hashmap (150), the system call tracer (130) can decide whether the calling pod is the pod of the main container that is being monitored by the secondary container.
[0069] Additionally, the system call tracer (130) may, based on the judgment result, store the invoked system call in the eBPF-based buffer (eBPF Ring Buffer) shared with the data collector if the PID is present. In other words, the system call tracer (130) can retain the traced system call in the buffer when it confirms that the PID of the obtained calling pod is registered in the PID hashmap (150) and therefore is a monitoring target.
[0070] After the system call is stored in the buffer by the system call tracer (130), the data collector (120) can share that buffer and collect the system calls stored by the system call tracer (130). In other words, the data collector (120) can access the buffer at regular intervals or at specific times and collect the main container’s system calls that the system call tracer (130) has traced and stored.
[0071] The PID tracer (140) updates the PID list registered in the PID hashmap (150). In other words, the PID tracer (140) can serve to refresh the PID list registered in the PID hashmap (150) in response to changes in the processor implemented in the main container.
[0072] When updating the PID list, the PID tracer (140) can update the PID list by distinguishing between process creation and process termination.
[0073] To this end, the PID tracer (140) can determine the type of the invoked system call. In other words, the PID tracer (140) can judge whether the invoked system call is a creation or a termination.
[0074] If the identified type concerns the creation of a process, the PID tracer (140) can verify whether the PPID (parent PID) of the calling pod is registered in the PID hashmap (150). In other words, the PID tracer (140) can check whether the PID (PPID) of the main container belonging to the parent (upper) pod of the calling pod that is implementing a new process is already recorded in the PID hashmap (150).
[0075] Furthermore, the PID tracer (140) may, if the verification result indicates that it is registered, record the PID of the called pod obtained by the system call tracer (130) in the PID hashmap (150) to update it. In other words, when the PID tracer (140) determines that a system call is newly invoked based on a process associated with the parent (upper) pod, it can add the PID of the called pod to the PID list registered in the PID hashmap (150).
[0076] Conversely, if the identified type concerns the termination of the process, the PID tracer (140) can verify whether the PID of the calling pod obtained by the system call tracer (130) is registered in the PID hashmap. In other words, the PID tracer (140) can confirm that the PID of the main container belonging to the calling pod that terminates the process is pre‑registered in the PID hashmap (150).
[0077] Furthermore, the PID tracer (140) can update by removing the called pod’s PID from the PID hashmap (150) if the verification result shows it is registered. In other words, since the PID tracer (140) confirms that the system call is invoked based on a process that terminates in association with the called pod, it can remove the called pod’s PID from the PID list registered in the PID hashmap (150).
[0078] According to an example of the present invention, by adopting a method of collecting system calls of the main container through a secondary container, a method and system for collecting system calls of a main container based on zero-copy using eBPF in a Kubernetes secondary container can be provided, achieving rapid system call collection speed.
[0079] Furthermore, according to the present invention, by implementing a lightweight system call tracing mechanism based on eBPF, the overhead of collecting system calls for each main container can be minimized in a Kubernetes environment.
[0080] Furthermore, according to the present invention, system calls can be collected while maintaining process namespace isolation between containers within a Kubernetes pod.
[0081] The system call collection device (100) of the present invention can monitor, in real time with minimal overhead, the system calls invoked by the main container from a secondary container while preserving the isolation mechanisms between containers within a pod in a Kubernetes environment.
[0082] The system call collection device (100) can provide a zero-copy–based system call collection technology using eBPF to overcome the performance and security limitations of conventional system call collection methods.
[0083] Here, eBPF may be a programming technique that can execute sandbox programs in a privileged environment such as the Linux operating system kernel space.
[0084] The system call collection device (100) can address 1) network overhead, 2) resource overhead caused by file write / read, 3) degradation of real-time system call collection performance, and 4) security issues arising from namespace sharing.
[0085] To address the problems of (1) network overhead and (2) resource overhead caused by file write / read, the system call collection device (100) directly collects system calls in a secondary container, but does not share the Process Namespace with the main container.
[0086] 3) To address the issue of performance degradation in real-time system call collection, the system call collection device (100) can provide a technique that does not affect the process being traced and does not slow down the collection speed even when gathering large amounts of data.
[0087] 4) To address security issues caused by namespace sharing, the system call collection device (100) can safely monitor the processes of the main container without sharing the Process Namespace between the main container and the secondary container within the pod.
[0088] The system call collection device (100) has established a cloud-native environment using Kubernetes (v1.28.15) and can provide system call collection technology at the pod level, the minimal deployment unit of Kubernetes services.
[0089] The system call collection device (100) provides a zero‑copy‑based system call collection architecture that utilizes eBPF in a secondary container, and can be configured to include a main‑container PID list collection module (Pod PID Provider) in the root PID namespace, a system call collection module (Data Collector) within the secondary container, a system call collection module in the Linux kernel using eBPF (System Call Tracer), and a monitoring‑target update module in the Linux kernel using eBPF (PID Tracer).
[0090] Kubernetes consists of a single master node and multiple worker nodes. The master node manages the worker nodes and the Kubernetes state, while the worker nodes can deploy and run containers.
[0091] A pod is the smallest deployable computing unit that can be created and managed in Kubernetes. A pod can consist of a group of one or more containers. Within the same pod, one or more secondary containers can run alongside the primary application container.
[0092] In the present invention, the secondary container can perform a monitoring role of collecting system calls generated by the main container.
[0093] FIG. 2 is a diagram illustrating the zero-copy–based system call collection system architecture in a secondary container as provided by the present invention.
[0094] As shown in FIG. 2, the architecture provided by the present invention may include multiple Pods (Pod0–Podn) and a Node.
[0095] Each of the multiple Pods may include a main container and a secondary container that is deployed in correspondence with the main container. A data collector that gathers the main container’s PID and system calls from the node may be deployed in the secondary container.
[0096] A node may comprise a user space where the Pod PID Provider is deployed, and a kernel space where the PID trace and system call tracer are deployed.
[0097] The Pod PID Provider can identify the PID of the main container and provide it to the secondary container.
[0098] PID Trace can trace the invoked PID and manage the list of PIDs registered in the PID Hashmap.
[0099] The system call tracer can track system calls and keep them in an eBPF ring buffer shared with a secondary container.
[0100] The system call collection device (100) provides an architecture composed of three layers—the Node’s user space, kernel space, and a secondary container (Secondary container)—and can include modules for system call collection in each layer.
[0101] A node can refer to the host that runs a pod in Kubernetes.
[0102] A Pod PID Provider can be placed in the node's user space.
[0103] The Pod PID Provider can identify the PID of the main container in the root PID namespace, create a PID list, and deliver it to the secondary container.
[0104] Each PID namespace has a parent (upper) namespace, but only the root PID namespace is a top-level namespace without a parent. In the root PID namespace, nesting is possible, and all processes running on the host can be identified.
[0105] By delivering the PID list of the Main Container to the Secondary Container, the system call collection device (100) can safely monitor the Main Container’s processes from the Secondary Container while maintaining isolation between containers within the pod.
[0106] The kernel space of a node can perform real-time system call tracing.
[0107] In a Kubernetes environment, because multiple Pods run simultaneously on a single node, real-time system call tracing can be performed more efficiently in kernel space rather than user space.
[0108] The System Call Tracer, which resides in kernel space, can trace and collect system calls using eBPF technology.
[0109] Furthermore, the PID tracer deployed in kernel space can be designed to enable long-term tracking by continuously updating the PID of the main container being monitored.
[0110] The system call collection device (100) may provide a secondary container, a dedicated secondary container for real-time monitoring of the main container.
[0111] The Data Collector within the secondary container can interface with modules deployed in the node’s user space and kernel space to collect efficient real-time system calls with minimal overhead, even in cloud-native environments.
[0112] FIG. 3 is a diagram illustrating the Zero‑copy‑based system call collection process according to the present invention.
[0113] The Pod PID Provider in user space can collect the Pod ID.
[0114] The Pod PID Provider can collect the PIDs of the main containers belonging to each pod using the collected IDs.
[0115] The Pod PID Provider can transmit the collected multiple PIDs to the Secondary Container.
[0116] The Data Collector of the Secondary Container can receive multiple PIDs from the Pod PID Provider.
[0117] The Data Collector can register the multiple transmitted PIDs in a PID hashmap that operates in the node's kernel space.
[0118] PID Trace and System call Tracer can track system calls invoked in a pod based on the PID hashmap.
[0119] When a system call is invoked from an arbitrary pod (the calling pod), the system call tracer can trace the system call invoked at the trace entry point and obtain the PID of the main container belonging to the calling pod (Get Current PID).
[0120] The system call tracer can store the invoked system call in an eBPF ring buffer, allowing it to be shared with the data collector, if the obtained PID is present in the PID hashmap.
[0121] PID Trace can identify the type of system call that was invoked.
[0122] If the identified system call type concerns process creation, the PID trace fetches the calling pod’s parent PID (PPID), checks whether the fetched PPID is registered in the PID hashmap, and if it is, registers the calling pod’s PID—previously obtained by the system‑call tracer—in the PID hashmap.
[0123] Conversely, if the identified system call type concerns process termination, the PID trace retrieves the PID of the called pod obtained earlier by the system call tracer (Fetch PID), checks whether the retrieved PID is registered in the PID hashmap (Lookup Hashmap), and if it is registered, it can remove that PID from the PID hashmap (Remove PID).
[0124] The Data Collector accesses the eBPF ring buffer and can continuously collect the system calls stored by the System Call Tracer.
[0125] The system call collection device (100) obtains the list of target PIDs for tracing the initial main container through the Pod PID Provider, and this PID list can be delivered to the Data Collector.
[0126] Afterward, the Data Collector can register the transmitted PID list in the PID hashmap within kernel space.
[0127] Accordingly, the modules (PID Trace and System call Tracer) in the Kernel Space can be activated.
[0128] The system call tracer can filter the main container of a PID registered in the PID hashmap and collect system calls invoked that are related to the processes implemented in that main container.
[0129] PID Tracer continuously monitors changes in the target PID, enabling continuous system call monitoring even in dynamically changing process environments.
[0130] Pod PID Provider is a module that collects the list of main container PIDs from the root PID namespace.
[0131] The Pod PID Provider is a module that runs in user space and can manage the process list of Pods running on the node and the main container within each Pod.
[0132] The Pod PID Provider may operate in the sequence of collecting the Pod ID, collecting the PIDs of the main container within the Pod, and transmitting the PID list to the secondary container of each main container.
[0133] Through this, the Pod PID Provider can safely perform system call collection by enabling the secondary container to gather the main container’s PID list while maintaining isolation between containers within the pod.
[0134] In collecting Pod IDs, each node in Kubernetes can run a Pod.
[0135] Each node in Kubernetes can create and delete containers, perform status checks, and more through the CRI (Container Runtime Interface).
[0136] Here, the CRI may be an interface that enables Kubernetes to communicate with the container runtime that runs containers.
[0137] When a Pod is created, the master node can assign unique identifiers called Pod ID and Container ID to each Pod and the containers within the Pod for management.
[0138] These Pod IDs and Container IDs can be shared with the worker nodes that run the Pods.
[0139] The Pod ID running on each node can be verified through the CRI.
[0140] Therefore, the Pod PID Provider can collect the Pod IDs of Pods running on the node via the CRI.
[0141] When collecting the PIDs of the Main Container within a Pod, the Pod PID Provider can identify the container ID and the process IDs running in the container for each Pod via the Pod ID.
[0142] The Pod PID Provider identifies the ID of the main container within a pod using the CRI and the pod ID, and obtains the main container’s root PID in the host’s root PID namespace using the CRI and the main container’s ID.
[0143] The PIDs in the Main Container are linked as child processes of the root PID.
[0144] Thus, the Pod PID Provider can obtain the full PID list by collecting the IDs of the Main Container’s child processes via the root PID.
[0145] When transmitting the PID list to the Secondary Container of each Main Container, the Pod PID Provider can send the PID list of the Main Container in each Pod running on the node to the Secondary Container within that pod.
[0146] If the transmission is completed successfully, the subsequent PID list does not require additional transmission because it is managed in the PID hashmap in kernel space.
[0147] Therefore, the Pod PID Provider can provide the initial PID list to the Secondary Container only for newly created Pods.
[0148] The Data Collector is a system call collection module within the Secondary Container.
[0149] The Data Collector can be executed within a Secondary Container for monitoring the Main Container.
[0150] The Data Collector receives the list of PIDs of the Main Container sent by the Pod PID Provider, registers it as the list of PIDs to be tracked in Kernel Space, and can also handle system calls collected in Kernel Space.
[0151] The Data Collector receives and registers the PID list of the Main Container (Register PID).
[0152] The Data Collector stores the list of main container PIDs received from the Pod PID Provider in a PID hashmap, enabling the sharing of tracking target information between kernel space and user space.
[0153] The Data Collector can activate modules in the Kernel Space (Execute Tracers).
[0154] The Data Collector stores the received PID list in a PID hashmap, then activates the system call tracer and PID tracer in kernel space, enabling it to begin full-fledged system call collection.
[0155] System Call Tracer is a system call collection module in the Linux kernel that uses eBPF.
[0156] The System Call Tracer can trace system calls made by the processes stored in the PID hashmap for tracing.
[0157] The System Call Tracer is implemented using eBPF technology and can operate in the sequence of system call tracing followed by system call storage.
[0158] The System Call Tracer can perform real-time monitoring while using minimal resources by directly analyzing system calls in kernel space.
[0159] In system call tracing, the System Call Tracer can collect system calls through each system call tracepoint (Trace Entry Point).
[0160] Here, a tracepoint may be a static instrumentation mechanism defined within the Linux kernel as a predefined tracing point that enables monitoring and tracing of system calls, function entry / exit, important events, and so on. In other words, a tracepoint is an instrumentation mechanism that is triggered each time a system call function is executed in the Linux kernel.
[0161] Therefore, when a system call is invoked and the corresponding tracepoint is triggered, the System Call Tracer can identify the PID that called the system call (Get Current PID).
[0162] To verify whether the PID belongs to the Main Container process, the System Call Tracer can look up the list of Main Container PIDs stored by the Data Collector in the PID hashmap (Lookup Hashmap).
[0163] If the identified PID belongs to the PID Hashmap, the System Call Tracer can determine that the system call was invoked from the main container within the pod.
[0164] For system call storage, the System Call Tracer can identify system calls invoked by processes within the Main Container and then insert them into an eBPF ring buffer (Perf Buffer).
[0165] The System Call Tracer can insert predefined system call information such as system call arguments, system call number, system call execution time, PPID (Parent PID), and others into an eBPF ring buffer for data sharing between kernel space and user space.
[0166] The System Call Tracer can eliminate the need for data copying by utilizing an eBPF ring buffer shared between kernel space and user space during the system call collection process.
[0167] This zero-copy–based system call collection, after the initial capture, enables data to be shared directly from kernel space to user space without any additional copying or storage, thereby reducing system resource usage while increasing collection speed.
[0168] PID Tracer is a monitoring target update module within the Linux kernel that utilizes eBPF.
[0169] Even after the Data Collector registers the initial PID in the PID Hashmap, processes can be created or terminated within the Main Container, so the PID list must be continuously updated.
[0170] To this end, the PID Tracer can track the creation and termination of processes in the Main Container by checking the Main Container’s process state in real time within kernel space and updating the PID hashmap.
[0171] Through this, the PID Tracer can perform sustainable system call tracing even in dynamically changing environments.
[0172] In tracing process creation / termination system calls, the PID Tracer can continuously track processes within the Main Container via the process creation / termination system call tracepoint (Trace Process Control System call).
[0173] The PID Tracer can track system calls related to the process lifecycle (e.g., fork, clone, exit, exit_group) and update the PID hashmap.
[0174] In the case of a process creation system call, the PID Tracer extracts the PPID (Parent PID) of the process created via the system call (Fetch PPID), checks whether that PPID exists in the PID Hashmap (Lookup Hashmap), and if it does, registers the newly created PID in the Hashmap (Register PID).
[0175] In the case of a process termination system call, the PID Tracer identifies the PID that invoked the termination system call (Fetch PID), checks whether that PID exists in the hashmap (Lookup Hashmap), and if it does, removes the PID from the PID hashmap (Remove PID).
[0176] The system call collection device (100) can achieve rapid system call collection speed by collecting the main container's system calls through a secondary container.
[0177] Additionally, the system call collection device (100) can minimize the system call collection overhead for each main container in a Kubernetes environment by implementing an eBPF-based lightweight system call tracing mechanism.
[0178] The system call collection device (100) can maintain process namespace isolation between containers within a Kubernetes pod through the operation of the Pod PID Provider and the System Call Tracer.
[0179] Below, FIG. 4 details the workflow of the system call collection device (100) for a zero‑copy‑based main container that utilizes eBPF in the secondary container of Kubernetes, according to examples of the present invention.
[0180] FIG. 4 is a flowchart illustrating a method for collecting system calls of a main container based on zero-copy using eBPF in a secondary container of Kubernetes, according to an example of the present invention.
[0181] The method for collecting system calls of a main container based on zero-copy using eBPF in a secondary container of Kubernetes, according to this example, may be performed by the system call collection device (100).
[0182] First, in the pod PID provider of the system call collection device (100), a PID list for the main containers belonging to each of the multiple pods is generated (410). Step (410) may involve the pod PID provider recognizing the PID uniquely assigned to each main container and compiling a PID list that includes the recognized multiple PIDs.
[0183] Here, the PID (Process ID) may be a unique identifier used to distinguish the processes running in each main container.
[0184] In constructing the PID list, the pod PID provider may operate in the node's user space. Here, user space may be a user-accessible region that allows a user to access and issue commands such as function calls to kernel space.
[0185] The pod PID provider can identify multiple IDs for each of the multiple pods. In other words, the pod PID provider can identify the IDs of pods, which are the smallest deployable computing units that can be created and managed in Kubernetes. Each pod includes a main container that implements the process.
[0186] The pod PID provider can identify multiple PIDs for the main containers belonging to each pod via the multiple IDs. In other words, the pod PID provider can identify the PID of the main container belonging to a specific pod using that pod's ID.
[0187] Subsequently, the pod PID provider can create the PID list by including the multiple PIDs. In other words, the pod PID provider can generate the PID list by incorporating the identified PIDs.
[0188] After the PID list is created, the pod PID provider may deliver the created PID list to the secondary container.
[0189] Specifically, the pod PID provider enables the secondary container to monitor the main container’s processes while preserving isolation between containers in the pod by passing the main container’s PID list to a data collector deployed in the secondary container.
[0190] It establishes an environment that enables a secondary container to directly receive system calls invoked by the main container, even if it does not share the Process Namespace with the main container.
[0191] Also, in the data collector of the system call collection device (100), the created PID list is registered in the PID hashmap (PID Hashmap) (420). Step (420) may be the process by which, when the data collector obtains a PID list from the pod PID provider, it registers it in the PID hashmap operating in the node’s kernel space.
[0192] More specifically, the data collector, when the PID list is delivered from the pod PID provider, can register the PID list in the PID hashmap operating in the node’s kernel space.
[0193] Here, kernel space may be the area that contains data structures, variables, functions, and other elements used by the kernel. Kernel space may be the area that protects the system by preventing those data structures, variables, functions, and other elements from being easily corrupted by the user. The user cannot access kernel space and can only access user space.
[0194] The PID list registered in the PID hashmap can be utilized and managed (updated) by the system call tracer and the PID tracer operating in kernel space.
[0195] Continuing, the system call tracer of the system call collection device (100) may, based on the PID hashmap, track system calls invoked from the pod and store them in a buffer (430). Step (430) may comprise a process in which the system call tracer, using the PIDs in the PID list registered in the PID hashmap, identifies the main container to be monitored and then stores in the buffer the system calls obtained by tracing the system calls invoked in association with the identified main container.
[0196] In this case, the buffer is a buffer (eBPF Ring Buffer) created based on eBPF, and the eBPF may be a Linux kernel technology that can execute sandbox programs in privileged environments such as the operating system kernel.
[0197] Specifically, the system call tracer can track system calls invoked in the calling pod among the multiple pods and obtain the PID of that calling pod. Here, a calling pod may be defined as a pod in which a system call is invoked from its associated main container. In other words, by tracking system calls, the system call tracer can acquire the PID of the calling pod that issued the system call.
[0198] Furthermore, the system call tracer can determine whether the obtained PID is present in the PID hashmap. In other words, based on the list of PIDs registered in the PID hashmap, the system call tracer can decide whether the calling pod is the pod of the main container that is being monitored by the secondary container.
[0199] Furthermore, the system call tracer can store the invoked system call in the eBPF‑based buffer (eBPF Ring Buffer) shared with the data collector if, according to the determination result, the PID exists. In other words, when the system call tracer confirms that the PID of the calling pod it has obtained is registered in the PID hashmap and therefore is a monitoring target, it can retain the traced system call in the buffer.
[0200] Furthermore, the PID tracer of the system call collection device (100) updates the PID list registered in the PID hashmap (440). Step (440) may be a process in which the PID tracer refreshes the PID list registered in the PID hashmap in accordance with changes to the processor implemented in the main container.
[0201] When updating the PID list, the PID tracer can update the list by distinguishing between process creation and process termination.
[0202] To this end, the PID tracer can determine the type of the invoked system call. In other words, the PID tracer can decide whether the invoked system call is a creation or a termination.
[0203] If the identified type concerns the creation of a process, the PID tracer can verify whether the PPID (Parent PID) of the calling pod is registered in the PID hashmap. In other words, the PID tracer can check whether the PID (PPID) of the main container belonging to the parent (upper) pod of the calling pod that implements a new process is pre‑registered in the PID hashmap.
[0204] Furthermore, the PID tracer, if the verification result indicates that it is registered, can record the PID of the called pod obtained by the system call tracer in the PID hashmap and update it. In other words, the PID tracer, upon confirming that a system call is newly invoked based on a process associated with the upper (parent) pod, can add the PID of the called pod to the list of PIDs registered in the PID hashmap.
[0205] Conversely, if the identified type concerns the termination of the process, the PID tracer can verify whether the PID of the calling pod obtained by the system call tracer is registered in the PID hashmap. In other words, the PID tracer can confirm that the PID of the main container belonging to the calling pod that terminates the process is pre‑registered in the PID hashmap.
[0206] Furthermore, the PID tracer can update by removing the called pod’s PID from the PID hashmap if, as confirmed, it is registered. In other words, since the PID tracer determines that the system call is invoked based on a process that terminates in relation to the called pod, it can remove the called pod’s PID from the list of PIDs registered in the PID hashmap.
[0207] Also, after the system call tracer stores system calls to a buffer, the data collector can share that buffer and collect the system calls stored by the system call tracer (450). Step (450) may be a process in which the data collector accesses the buffer at regular intervals or at a specific point in time to collect the main container’s system calls that the system call tracer has traced and stored.
[0208] According to an example of the present invention, by adopting a method of collecting system calls of the main container through a secondary container, a method and system for collecting system calls of a main container based on zero-copy using eBPF in a Kubernetes secondary container can be provided, achieving rapid system call collection speed.
[0209] Furthermore, according to the present invention, by implementing a lightweight system call tracing mechanism based on eBPF, the overhead of collecting system calls for each main container can be minimized in a Kubernetes environment.
[0210] Furthermore, according to the present invention, system calls can be collected while maintaining process namespace isolation between containers within a Kubernetes pod.
[0211] The method of the example can be implemented in the form of program instructions that can be executed by various computer means and recorded on a computer‑readable medium. The computer‑readable medium may contain program instructions, data files, data structures, either alone or in combination. The program instructions recorded on the medium may be specially designed and configured for the example, or they may be publicly disclosed to and usable by computer‑software practitioners. Examples of computer‑readable storage media include magnetic media such as hard disks, floppy disks, and magnetic tape; optical media such as CD‑ROMs and DVDs; magneto‑optical media such as floptical disks; and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, and flash memory. Examples of program instructions include machine‑code generated by a compiler as well as high‑level language code that can be executed by a computer using an interpreter or similar. The aforementioned hardware devices can be configured to operate as one or more software modules to perform the example’s functions, and the converse is also true.
[0212] The software may include a computer program, code, instruction, or any combination thereof, and can configure a processing device to operate as desired or command the processing device independently or collectively. Software and / or data may be embodied permanently or temporarily in any type of machine, component, physical device, virtual equipment, computer storage medium or device, or in a transmitted signal wave, in order to be interpreted by the processing device or to provide commands or data to the processing device. The software may be distributed across network‑connected computer systems, and may be stored or executed in a distributed manner. Software and data may be stored on one or more computer‑readable recording media.
[0213] Although the examples described above have been explained with limited drawings, a person of ordinary skill in the art can apply various technical modifications and variations based on them. For example, the disclosed technologies may be performed in an order different from the described method, and / or the components of the disclosed system, structure, device, circuit, etc., may be combined or arranged in a form different from the described method, or may be replaced or substituted by other components or equivalents, yet appropriate results can still be achieved.
[0214] Therefore, other implementations, other examples, and equivalents to the claims also fall within the scope of the claims set forth below.
Claims
1. A zero-copy-based system call collection apparatus for a main container using eBPF in a secondary container of Kubernetes, the apparatus comprising:a pod PID provider configured to create a PID list for main containers belonging to each of a plurality of pods;a data collector configured to register the created PID list in a PID hashmap;a system call tracer configured to trace system calls invoked from the pods based on the PID hashmap and to store the traced system calls in a buffer; anda PID tracer configured to update the PID list registered in the PID hashmap,wherein the data collector is configured to collect the system calls stored by the system call tracer by sharing the buffer.
2. The apparatus of claim 1, wherein the pod PID provider is configured to deliver the PID list of the main container to the data collector deployed in the secondary container, thereby enabling the secondary container to monitor processes of the main container while maintaining isolation between containers within a pod.
3. The apparatus of claim 2, wherein the pod PID provider is configured to:operate in user space of a node;identify a plurality of IDs respectively corresponding to the plurality of pods;identify, through the plurality of IDs, a plurality of PIDs for the main containers belonging to the respective pods; andcreate the PID list including the plurality of PIDs.
4. The apparatus of claim 3, wherein the data collector is configured to register the PID list in the PID hashmap operating in kernel space of the node when the PID list is delivered from the pod PID provider.
5. The apparatus of claim 4, wherein the system call tracer is configured to:trace a system call invoked from a calling pod among the plurality of pods and obtain a PID of the calling pod;determine whether the obtained PID is present in the PID hashmap; andwhen the obtained PID is present in the PID hashmap, store the invoked system call in an eBPF-based buffer shared with the data collector.
6. The apparatus of claim 5, wherein the PID tracer is configured to:determine a type of the invoked system call;when the determined type relates to creation of a process, verify whether a PPID of the calling pod is registered in the PID hashmap; andwhen the PPID of the calling pod is registered in the PID hashmap, update the PID hashmap by recording therein the PID of the calling pod obtained by the system call tracer.
7. The apparatus of claim 6, wherein the PID tracer is further configured to:when the determined type relates to termination of the process, verify whether the PID of the calling pod obtained by the system call tracer is registered in the PID hashmap; andwhen the PID of the calling pod is registered in the PID hashmap, update the PID hashmap by removing the PID of the calling pod from the PID hashmap.
8. A zero-copy-based method for collecting system calls of a main container using eBPF in a secondary container of Kubernetes, the method comprising:creating, by a pod PID provider, a PID list for main containers belonging to each of a plurality of pods;registering, by a data collector, the created PID list in a PID hashmap;tracing, by a system call tracer, system calls invoked from the pods based on the PID hashmap and storing the traced system calls in a buffer;updating, by a PID tracer, the PID list registered in the PID hashmap; andcollecting, by the data collector, the system calls stored by the system call tracer by sharing the buffer.
9. The method of claim 8, further comprising delivering, by the pod PID provider, the PID list of the main container to the data collector deployed in the secondary container, thereby enabling the secondary container to monitor processes of the main container while maintaining isolation between containers within a pod.
10. The method of claim 9, wherein creating the PID list comprises:operating the pod PID provider in user space of a node;identifying a plurality of IDs respectively corresponding to the plurality of pods;identifying, through the plurality of IDs, a plurality of PIDs for main containers belonging to the respective pods; andcreating the PID list including the plurality of PIDs.
11. The method of claim 10, wherein registering the PID list comprises registering the PID list in the PID hashmap operating in kernel space of the node when the PID list is delivered from the pod PID provider.
12. The method of claim 11, wherein storing the traced system calls in the buffer comprises:tracing a system call invoked from a calling pod among the plurality of pods and obtaining a PID of the calling pod;determining whether the obtained PID is present in the PID hashmap; andwhen the obtained PID is present in the PID hashmap, storing the invoked system call in an eBPF-based buffer shared with the data collector.
13. The method of claim 12, wherein updating the PID list comprises:determining a type of the invoked system call;when the determined type relates to creation of a process, verifying whether a PPID of the calling pod is registered in the PID hashmap; andwhen the PPID of the calling pod is registered in the PID hashmap, updating the PID hashmap by recording therein the PID of the calling pod obtained by the system call tracer.
14. The method of claim 13, wherein updating the PID list further comprises:when the determined type relates to termination of the process, verifying whether the PID of the calling pod obtained by the system call tracer is registered in the PID hashmap; andwhen the PID of the calling pod is registered in the PID hashmap, updating the PID hashmap by removing the PID of the calling pod from the PID hashmap.
15. A non-transitory computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to perform the method of claim 8.
