Configure packet forwarding for pods in EKS
By default, if you have configured traffic mirroring for EC2 instances that host an AWS Elastic Kubernetes Service (EKS) cluster, all of the traffic between nodes in the cluster is seen by the ExtraHop system. Most ExtraHop security detections can be generated from node-level traffic monitoring; however, if you want to monitor traffic between pods for added visibility, you must enable packet forwarding in your EKS cluster.
This guide shows you how to deploy the rpcapd software tap as a DaemonSet service that automatically configures packet forwarding for each pod in a cluster backed by EC2 instances. In addition to configuring packet forwarding, the rpcapd container also deduplicates packets that would otherwise be forwarded multiple times to the ExtraHop sensor.
Retrieve subnets for pods and services
Before you can configure the ExtraHop system to monitor pods in EKS, you must retrieve the subnets allocated to the pods and allocated to the services the pods support.
Important: | Note the subnets you retrieve; you will need the subnets in the deployment procedure. |
-
Retrieve the subnets for pods.
- In the AWS console, click Services and then select Elastic Kubernetes Service.
- Click Clusters.
- Click the name of the cluster that contains the pods you want to monitor.
- Click the Configuration tab.
- Click the Networking tab.
- For each subnet in the Subnets section, click the subnet, and then note the CIDR block in the IPv4 CIDR column of the Subnets table.
-
Retrieve the subnets for services.
- Return to the Networking tab on the Cluster page.
- Note the CIDR block under Service IPv4 range.
Configure the ExtraHop system to discover pods
With L2 discovery, the ExtraHop system assigns all IP addresses to an associated L2 device; this is the default setting for ExtraHop systems. If L2 discovery is enabled, you must configure the ExtraHop system to discover Kubernetes pods as remote devices, even if the pods are located on nodes inside your local network. Otherwise, the pod IP addresses will only be associated with the corresponding L2 devices for the Kubernetes nodes, and the system will not track the pods as separate devices.
Create the rpcapd container image
Create a container image for the containers that will forward packets to the ExtraHop system. After you create the container image, you must store the image in a registry that is accessible to all nodes in the EKS cluster. The registry can be the AWS Elastic Container Registry (ECR) or another third-party registry.
Note: | The following instructions show you how to create the container image with the Docker command-line interface on a Linux machine. However, you can create the image with any tool that produces Open Container Initiative (OCI) compliant images. The procedure might require different steps, depending on the tool and your environment. |
Thank you for your feedback. Can we contact you to ask follow up questions?