Traffic Capture
AWS VPC Traffic Mirroring
Step-by-step AWS setup that copies the traffic of selected network cards to the HOSSIDARK capture card over VXLAN (UDP 4789), validated on the Hossidark Lab Network.
On this page
What it is for
AWS has no switch ports to mirror. VPC Traffic Mirroring copies the packets of chosen network cards (ENIs), wraps each copy in VXLAN over UDP 4789 and sends it to a mirror target. HOSSIDARK receives the copy on its capture card, unwraps the VXLAN header and analyses the original packet exactly as if it came from a switch SPAN port. Production traffic is never delayed: only a copy leaves the source card.
Source ENI (router, servers, workstations)
| mirror session (filter: accept all, both directions)
v
Mirror target -- capture ENI of HOSSIDARK (one VPC)
-- internal NLB, UDP 4789 (many sources, several subnets/VPCs)
|
v VXLAN UDP 4789
HOSSIDARK capture card -> unwrap -> sensor -> detections -> console
Before you start
| Requirement | Detail |
|---|---|
| Licence | Network module (always included) |
| Source instances | Nitro-based instance types. Older Xen types cannot be mirror sources. |
| Appliance | Two network cards: management (console, updates) and capture (receives mirrors only). |
| Permissions | IAM rights ec2:CreateTrafficMirror*, ec2:ModifyTrafficMirror*, ec2:Describe* |
| Network | UDP 4789 allowed from source subnets to the capture card (or NLB). |
| Cost | AWS bills each mirrored ENI per hour plus the data transfer between Availability Zones. |
Step by step
1. Add the capture card to the appliance
- EC2 > Network Interfaces > Create network interface in the appliance subnet.
- Attach it to the HOSSIDARK instance as device index 1.
- Disable Source/destination check on this card.
- Security group of the card: inbound UDP 4789 from the source subnets; no outbound rule is required.
2. Create the mirror target
- One VPC, few sources: target type Network Interface, choose the capture card.
- Many sources or several VPCs: create an internal Network Load Balancer with a UDP 4789 listener whose target group contains the capture card (target type IP). Use an HTTP health check on
/api/public/health, port 1999, of the management card. Then create the mirror target of type Network Load Balancer.
aws ec2 create-traffic-mirror-target \
--network-interface-id eni-CAPTURE --description "HOSSIDARK capture"
3. Create the mirror filter
One filter with two rules, accept everything:
aws ec2 create-traffic-mirror-filter --description "HOSSIDARK all"
aws ec2 create-traffic-mirror-filter-rule --traffic-mirror-filter-id tmf-ID \
--traffic-direction ingress --rule-number 100 --rule-action accept \
--source-cidr-block 0.0.0.0/0 --destination-cidr-block 0.0.0.0/0
aws ec2 create-traffic-mirror-filter-rule --traffic-mirror-filter-id tmf-ID \
--traffic-direction egress --rule-number 100 --rule-action accept \
--source-cidr-block 0.0.0.0/0 --destination-cidr-block 0.0.0.0/0
Tip: to save cost, add a reject rule with a lower number for backup or storage replication traffic you do not need analysed.
4. Create one session per source card
aws ec2 create-traffic-mirror-session \
--network-interface-id eni-SOURCE \
--traffic-mirror-target-id tmt-ID \
--traffic-mirror-filter-id tmf-ID \
--session-number 1 --virtual-network-id 4789
- Mirror the internal card of the border router or firewall first: it sees all north-south and most east-west traffic.
- Add server cards (domain controllers, file servers, mail) for complete lateral-movement visibility.
- Do not set
--packet-lengthunless you want truncated packets; full packets give full protocol analysis.
5. Point capture at the card
In the installer or in Network Settings > Sensing, choose the capture card. The terminal capture menu offers the same choice. Encapsulation is detected automatically.
How to confirm it works
- Console: Network Settings > Sensing shows the card as Receiving with a growing packet counter.
- Terminal: the communication tests report the capture card as
OKand the packets per second. - Generate traffic from a mirrored machine (open a website); within a minute the flow appears in Assets & Topology.
Common problems
| Symptom | Cause | Fix |
|---|---|---|
| Counter stays at 0 | UDP 4789 blocked | Allow UDP 4789 inbound on the capture card security group (and NACL). |
| Session creation refused | Source is not Nitro | Change instance type or mirror another card on the path. |
| Only one direction seen | Filter has only one rule | Add both ingress and egress accept rules. |
| Packets from NLB lost | Target unhealthy | Fix the NLB health check; the NLB drops traffic to unhealthy targets. |
| Too much traffic | All cards mirrored | Add reject rules for backup/replication or mirror only choke points. |
How it works inside
The sensor recognises the VXLAN header (8 bytes after UDP 4789), records the VNI as the mirror session, removes the outer headers and passes the inner Ethernet frame to the same pipeline used for physical SPAN. The original source and destination addresses are preserved, so assets, topology and detections show the real machines, never the mirror target.