Lecture 48: VPC Traffic Mirroring
- 课程:[NEW] AWS Certified Advanced Networking Specialty 2026
- 视频时长:09:21
- 来源:Udemy Lecture 24112962
- Slide 数量:6
- 画面切换:01:42、03:22、03:56、04:25、05:41
扫描说明
逐条检查了 Udemy 页面中的 217 条 Transcript cue,并对全长 09:21 的视频画面进行扫描。画面依次呈现标题、核心机制、两种镜像目标架构、过滤器以及注意事项,共识别出 6 张不同的 Slide。
Transcript 来自 Udemy 页面自带的英文自动字幕,没有使用 ASR。下面保留页面原文,包括其中的语法或识别错误。
1. VPC Traffic Mirroring 导论
时间范围:00:00–01:42
总结 / Summary
中文
VPC 流量镜像(VPC Traffic Mirroring)用于复制弹性网络接口(Elastic Network Interface, ENI)上的实际网络数据包,并把副本交给安全或监控设备进行深度检查。它与只记录元数据的 VPC 流日志(VPC Flow Logs)形成互补。
English
VPC Traffic Mirroring copies actual network packets from an Elastic Network Interface and sends the copies to security or monitoring appliances for deep inspection. It complements VPC Flow Logs, which record metadata rather than packet payloads.
Transcript
00:00 Hi, and welcome to this lecture.
00:01 VPC Traffic Mirroring.
00:03 So in the last lecture we saw,
00:05 monitoring your VPC traffic, right?
00:07 Where traffic can be captured in a CloudWatch or S3,
00:10 and then you can analyze this traffic
00:11 for maybe any anomalies,
00:15 or you want to see a certain pattern of the traffic, right?
00:19 But that happens typically in,
00:21 I would say offline mode,
00:23 or maybe you first capture the logs
00:24 and then you do analysis.
00:27 But in certain cases you want to do,
00:29 you know, real-time monitoring of your traffic.
00:32 And now, one way could be
00:34 to have the IPS and IDS system in place
00:38 and all the traffic should be going through
00:40 that IDS-IPS system.
00:42 And from there,
00:42 it is routed to your destination application host, right?
00:47 But again, it adds additional hops to your traffic, right?
00:50 And it may degrade your latency
00:53 or performance of overall network, right?
00:57 There is a better way to do this,
00:58 which called VPC Traffic Mirroring.
01:01 As the word suggests, the mirroring.
01:03 That means whatever traffic flows
01:05 in and out of your network, or particularly through ENI,
01:10 the same traffic in real time can be mirrored
01:14 to another target.
01:15 And then you can run your network monitoring system
01:18 on that target to see any malicious behavior
01:23 into your traffic.
01:24 So that's the use case for this VPC Traffic Mirroring.
01:28 So let's talk shortly about this.
01:32 This I haven't seen much coming into the exam,
01:35 but as we are talking about monitoring the traffic,
01:38 it is good to know about this traffic mirroring.
2. Traffic Mirroring 的用途与配置组件
时间范围:01:42–03:22
总结 / Summary
中文
流量镜像会从 EC2 实例的源 ENI 复制网络流量,并以带外方式(out-of-band)发送到内容检查、威胁监控或故障排除设备。配置顺序是先创建镜像目标(Mirror Target),再定义镜像过滤器(Mirror Filter),最后创建镜像会话(Mirror Session)把源、目标和规则关联起来。
English
Traffic Mirroring copies traffic from a source ENI on an EC2 instance and sends it out of band to appliances for content inspection, threat monitoring, or troubleshooting. Configuration consists of creating a mirror target, defining a mirror filter, and then creating a mirror session that ties the source, target, and rules together.
Transcript
01:42 So what it means is it copies your network traffic from ENI,
01:47 of EC2 instances, of course.
01:50 And then it sends that traffic to
01:53 another monitoring appliances,
01:55 or content inspection or threat monitoring system,
01:59 or maybe for troubleshooting, right?
02:01 So this is a relatively new feature.
02:02 And in the VPC console,
02:04 you can see these options where you can
02:08 define the Mirror Targets,
02:10 Mirror Filters, and the Mirror Sessions.
02:12 And once these sessions are started, all the traffic,
02:17 which hits the ENI is mirrored to another target,
02:21 where you can monitor that.
02:23 So the steps to configure the traffic mirroring
02:26 is you create a mirror target first.
02:29 Now target could be another EC2 instance.
02:33 Ultimately an ENI.
02:35 Or you can also send all the traffic to
02:38 Network Load Balancer.
02:40 Now those could be your target.
02:42 Then you can define the filter.
02:44 Now, what does filter means?
02:46 You can actually filter
02:47 which traffic you want to mirror, right?
02:50 Maybe from particular source IP
02:52 or for particular destination IP,
02:55 or from,
02:57 for a particular source port or destination port.
02:59 All these kind of filters you can apply
03:02 so that you know,
03:03 you don't inspect all the traffic all the time.
03:06 Only interested traffic or interested packets,
03:10 you can mirror and then inspect, right?
03:13 And finally you create a mirror session
03:15 once you have the mirror target and define the filter.
03:19 So if you look at this diagram.
3. 以 ENI 作为 Mirror Target
时间范围:03:22–03:56
总结 / Summary
中文
镜像目标(Mirror Target)可以是另一台流量分析设备的 ENI。源实例上的 Traffic Mirroring 复制数据包并封装后,在 VPC 内把镜像流量发送到目标子网中的分析器;这种结构适合单个或固定容量的网络虚拟设备。
English
A mirror target can be the ENI of a traffic-analysis appliance. Traffic Mirroring copies and encapsulates packets from the source instance and delivers them within the VPC to the analyzer in the target subnet, a model suited to a single or fixed-capacity virtual appliance.
Transcript
03:22 in the first subnet,
03:24 I have a traffic source, which is EC2 instance.
03:27 And as you know, EC2 has ENI.
03:30 And now I can define the traffic mirroring
03:33 for that ENI as a source.
03:35 And the destination is another ENI,
03:38 and which is attached to
03:39 another traffic analyzer application.
03:42 And I can now define the session
03:46 where it captures all the traffic
03:47 from this ENI to this ENI, right?
03:51 Now here, ENI is a target.
03:53 As I said, the target could also be NLB,
4. 以 NLB 作为 Mirror Target
时间范围:03:56–04:25
总结 / Summary
中文
网络负载均衡器(Network Load Balancer, NLB)也可作为镜像目标,并通过 UDP 端口 4789 接收封装后的镜像流量。NLB 能把流量分配给多个分析器实例,从而提供横向扩展(horizontal scaling)和更高可用性。
English
A Network Load Balancer can also serve as the mirror target and receive encapsulated mirrored traffic on UDP port 4789. The NLB distributes traffic across multiple analyzer instances, providing horizontal scaling and higher availability.
Transcript
03:56 Network Load Balancer.
03:57 So source remains the same,
03:59 but in target system now I have a NLB
04:02 and then you have the traffic analyzer applications
04:05 running on maybe a single or multiple instances.
04:08 And this is how you can,
04:10 you can capture the traffic through NLB as well.
04:13 So either of the configuration is okay,
04:15 depending on how much traffic you capture
04:19 and how many applications you are running.
04:21 You can have NLB or a single ENI.
5. Traffic Mirror Filters 与规则参数
时间范围:04:25–05:41
总结 / Summary
中文
镜像过滤器(Traffic Mirror Filter)决定哪些流量被复制。规则可按入站或出站方向、ACCEPT/REJECT 动作、协议、源/目的端口范围以及源/目的 CIDR 块匹配,并通过规则编号确定处理优先级,从而只把感兴趣的流量送往分析器。
English
A Traffic Mirror Filter determines which traffic is copied. Rules can match inbound or outbound direction, ACCEPT or REJECT action, protocol, source and destination port ranges, and source and destination CIDR blocks; rule numbers establish evaluation priority so only relevant traffic reaches the analyzer.
Transcript
04:25 Now you can also define filters, as I said.
04:28 So, this is say a source EC2 instance.
04:32 Which is say, instance A
04:34 traffic goes in and out of this instance,
04:36 and while the traffic flows in and out,
04:38 you can define the filter which captures this
04:42 and then mirrors to ENI or NLB.
04:45 So, the center block here
04:48 represents the mirror target basically.
04:50 And then these filters,
04:51 you can apply to multiple instances in your VPC.
04:55 And according to the filter,
04:57 all the traffic from all those sources
04:59 will be going to your target,
05:03 ENI or NLB.
05:04 So, traffic filter parameters are like inbound or outbound.
05:09 You can decide which traffic to capture
05:11 or which traffic to mirror,
05:13 whether inbound or outbound.
05:15 Whether accepted or rejected traffic has to be mirrored.
05:19 Which protocol?
05:20 So it supports L4, layer 4 protocol only.
05:23 Then a source port and destination port range
05:25 that you want to capture.
05:27 And then, source CIDR block and destination CIDR block.
05:30 So you can very well define the filter
05:32 using all these parameters
05:34 and only interesting traffic you can mirror, right?
05:38 To the target, okay?
6. Traffic Mirroring 关键注意事项
时间范围:05:41–09:21
总结 / Summary
中文
镜像源(Mirror Source)必须是支持的 ENI,镜像目标可为 ENI 或使用 UDP 4789 的 NLB。过滤器负责控制流量范围;源和目标既可位于同一 VPC,也可通过 VPC 对等连接(VPC Peering)或中转网关(Transit Gateway)跨 VPC,且源与目标可以属于不同 AWS 账户。部署时还要考虑镜像会话编号、带宽开销和分析设备容量。
English
The mirror source must be a supported ENI, while the target can be an ENI or an NLB using UDP 4789. Filters control traffic scope; source and target may reside in the same VPC or in connected VPCs through VPC Peering or a Transit Gateway, and they may belong to different AWS accounts. Designs must also account for session numbering, bandwidth overhead, and analyzer capacity.
Transcript
05:41 So with that, let's recap what we just learned,
05:43 and this is important for your exam to remember.
05:45 So VPC Traffic Mirroring basically
05:49 captures the traffic which flows in and out of your VPC,
05:52 and then you can mirror that and send it to a
05:55 potential network and security anomalies tool.
05:58 That's the purpose of VPC Traffic Mirroring.
06:01 The source of the traffic is always ENI,
06:04 Elastic Network Interface,
06:05 which is attached to your EC2 instance.
06:08 Now mirror target could be either another ENI,
06:11 which is attached to EC2 instance,
06:13 or it could be Network Load Balancer.
06:15 Now remember that in case of Network Load Balancer,
06:18 the UDP port is 4789.
06:22 So on the Network Load Balancer site,
06:24 this port should be open.
06:26 And also remember that on your port site,
06:30 the target port should also be open.
06:33 Typically in security group,
06:35 all the outbound traffic is open, but if it's not,
06:37 you have to make sure that it can go
06:39 to the UDP-4789 of your Network Load Balancer.
06:44 Now, when the mirror traffic happens,
06:47 you can also do the filtering.
06:49 And why we need filtering?
06:50 As I said,
06:51 because you want to only capture
06:53 certain type of the traffic.
06:55 Now that could be based on the source CIDR
06:57 or destination CIDR.
06:59 It could be based on the protocols.
07:00 It could be based on the ports as well.
07:03 And you can define multiple rules
07:05 for your traffic mirroring,
07:06 and these rules are numbered.
07:08 And of course you would have multiple rules because
07:11 maybe for UDP traffic
07:13 you want to send those packets to a different destination
07:17 where you can analyze that.
07:18 For UDP traffic
07:19 you want to send it to a different destination
07:21 for mirroring the traffic.
07:23 Or in some cases,
07:24 if the traffic is coming from particular source IP address,
07:27 you want to again send it to a different target mirror,
07:31 mirror target basically.
07:33 That all you can define in the rules
07:35 and whatever rules matches, according to the number,
07:38 it would send the traffic to a respective target.
07:42 Now, when you set up this traffic mirroring,
07:45 you know that that there is a source ENI,
07:47 there is a target ENI or Network Load Balancer.
07:50 Now these two things could be either in the same VPC
07:54 or they could also be in different VPCs.
07:57 But again,
07:58 the limitation is this VPC should be in the same region.
08:01 But then you can connect these VPCs
08:03 using intra-Region VPC peering
08:05 or intra-Region transit gateway.
08:08 So if your target VPCs in different regions,
08:11 that wouldn't be possible as of now,
08:14 but otherwise there is no restriction
08:16 that the traffic source
08:17 and the mirror target should be in the same VPC.
08:19 They can very well be across the VPCs.
08:23 Further, the Source and Destination ENIs,
08:27 or you can say mirror source and mirror target
08:29 could be in different AWS accounts as well.
08:33 Now, this is interesting because many a times maybe
08:36 you are hosting your network packet analysis tool
08:40 into your VPC
08:41 and you want to give that as a service to your customers.
08:44 Now, in that case your customers would have their VPC
08:46 in their own AWS account,
08:48 and then you can set up a VPC peering
08:50 between these two VPCs.
08:52 Though these VPCs are owned by different entities,
08:54 you can still monitor the traffic from your customers VPC.
08:58 So that is kind of a use case
08:59 you can also implement using the VPC Traffic Mirroring.
09:04 So I think that's it,
09:05 what you need to know about VPC Traffic Mirroring.
09:08 And I haven't seen that, this coming much into the exam,
09:13 but as we are learning everything about networking,
09:15 it's good to know.
09:17 So that's it about this lecture.
09:18 See you in the next lecture.
09:20 Thank you.
整讲总结 / Overall Summary
中文
本讲说明了 VPC 流量镜像(VPC Traffic Mirroring)如何把源 ENI 的真实数据包复制到安全分析设备。完整配置由镜像源(Mirror Source)、镜像目标(Mirror Target)、镜像过滤器(Mirror Filter)和镜像会话(Mirror Session)组成;目标既可采用单个 ENI,也可通过网络负载均衡器(Network Load Balancer, NLB)扩展到多个分析器。过滤规则决定复制范围,而跨 VPC、跨账户连接和 UDP 4789 封装则是架构设计中的重要考点。
English
This lecture explains how VPC Traffic Mirroring copies real packets from a source ENI to security-analysis appliances. A complete configuration combines a mirror source, mirror target, mirror filter, and mirror session; the target can be a single ENI or a Network Load Balancer that scales across multiple analyzers. Filter rules define the copied traffic, while cross-VPC and cross-account connectivity and UDP 4789 encapsulation are important architectural considerations.
返回顶部 ↑