1
00:00:00,390 --> 00:00:01,530
So here is a lecture

2
00:00:01,530 --> 00:00:04,530
that is more focused on solution architecture,

3
00:00:04,530 --> 00:00:08,100
and this is around DDoS protection and best practices.

4
00:00:08,100 --> 00:00:10,440
So let's assume that you have this kind of architecture,

5
00:00:10,440 --> 00:00:13,410
we have an Auto Scaling Group with EC2 instances.

6
00:00:13,410 --> 00:00:16,050
It's fronted by an Elastic Load Balancer,

7
00:00:16,050 --> 00:00:18,364
and then your load balancer can be either exposed

8
00:00:18,364 --> 00:00:22,050
by a global accelerator, as fixed IPs,

9
00:00:22,050 --> 00:00:25,140
or it can be fronted, for example, by CloudFront.

10
00:00:25,140 --> 00:00:28,933
CloudFront can be linked to a WAF,

11
00:00:28,933 --> 00:00:31,500
a Web Application Firewall, and so on.

12
00:00:31,500 --> 00:00:36,000
You can have Route 53 for DNS routing.

13
00:00:36,000 --> 00:00:38,280
And finally, you could also have another architecture

14
00:00:38,280 --> 00:00:41,190
where you have CloudFront and the API Gateway.

15
00:00:41,190 --> 00:00:42,690
So this is just to represent

16
00:00:42,690 --> 00:00:44,100
the kind of combinations you can do.

17
00:00:44,100 --> 00:00:45,750
Obviously, there are more than one.

18
00:00:45,750 --> 00:00:47,490
But the idea is that we're going to discuss,

19
00:00:47,490 --> 00:00:49,230
thanks to the letter BP1,

20
00:00:49,230 --> 00:00:51,510
Best Practice 1, Best Practice 2, et cetera.

21
00:00:51,510 --> 00:00:52,740
what the implications are

22
00:00:52,740 --> 00:00:55,470
in terms of DDoS resiliency, okay?

23
00:00:55,470 --> 00:00:59,190
So by using CloudFront, we are actually at the edge.

24
00:00:59,190 --> 00:01:02,250
So this slide is all about edge location mitigation.

25
00:01:02,250 --> 00:01:03,960
That means that your web application delivery

26
00:01:03,960 --> 00:01:05,099
is at the edge,

27
00:01:05,099 --> 00:01:06,720
and so you're going to be protected

28
00:01:06,720 --> 00:01:09,840
against DDoS Common Attacks by using Shield,

29
00:01:09,840 --> 00:01:11,850
just a normal setup of Shield,

30
00:01:11,850 --> 00:01:14,190
so SYN floods and UDP reflection.

31
00:01:14,190 --> 00:01:16,710
If you use the Global Accelerator,

32
00:01:16,710 --> 00:01:20,280
it's going to be able to access your application

33
00:01:20,280 --> 00:01:22,860
around the world, again, at the edge.

34
00:01:22,860 --> 00:01:24,690
And again, it's fully integrated with Shield

35
00:01:24,690 --> 00:01:26,280
for DDoS protection.

36
00:01:26,280 --> 00:01:28,740
So it's very helpful if your backend

37
00:01:28,740 --> 00:01:31,320
is somehow not compatible with CloudFront.

38
00:01:31,320 --> 00:01:34,080
In this case, you would have Global Accelerator

39
00:01:34,080 --> 00:01:35,010
in front of it.

40
00:01:35,010 --> 00:01:37,530
And so that means that no matter what backend you have,

41
00:01:37,530 --> 00:01:40,740
you're either using CloudFront or Global Accelerator,

42
00:01:40,740 --> 00:01:44,040
you will be fully distributed at the edge of AWS

43
00:01:44,040 --> 00:01:48,150
and the edge location will be DDoS protected.

44
00:01:48,150 --> 00:01:50,760
Also, if you use Route 53,

45
00:01:50,760 --> 00:01:53,310
then the Domain Name Resolution is global.

46
00:01:53,310 --> 00:01:54,270
It's at the edge,

47
00:01:54,270 --> 00:01:58,140
and you also have a DDoS Protection mechanism on your DNS.

48
00:01:58,140 --> 00:02:00,240
So we understand that if we're at the edge,

49
00:02:00,240 --> 00:02:02,133
we can have a better DDoS protection.

50
00:02:03,180 --> 00:02:07,980
Next, we can have the best practices for DDoS mitigation.

51
00:02:07,980 --> 00:02:10,830
So first let's look at the infrastructure layer defense.

52
00:02:10,830 --> 00:02:13,890
This is BP1, BP3, and BP6.

53
00:02:13,890 --> 00:02:17,430
So the idea is that by using CloudFront, Global Accelerator,

54
00:02:17,430 --> 00:02:20,460
Route 53, and the Elastic Load Balancing,

55
00:02:20,460 --> 00:02:24,870
we protect our Amazon EC2 instances against high traffic.

56
00:02:24,870 --> 00:02:28,710
And this is the idea that by using all these services,

57
00:02:28,710 --> 00:02:30,990
the traffic is going to be handled by most of them

58
00:02:30,990 --> 00:02:34,590
before ever reaching our EC2 instances.

59
00:02:34,590 --> 00:02:38,130
Now if we enable our EC2 instances with Auto Scaling,

60
00:02:38,130 --> 00:02:39,750
that means that in case the traffic

61
00:02:39,750 --> 00:02:42,570
does indeed reach our Auto Scaling group,

62
00:02:42,570 --> 00:02:44,340
we can scale automatically

63
00:02:44,340 --> 00:02:48,990
to accommodate for a greater load on our application.

64
00:02:48,990 --> 00:02:51,060
And if we use Elastic Load Balancing,

65
00:02:51,060 --> 00:02:54,780
then the ELB is going to automatically spread the traffic

66
00:02:54,780 --> 00:02:56,760
across many EC2 instances.

67
00:02:56,760 --> 00:02:58,470
So that means that EC2 instances

68
00:02:58,470 --> 00:03:03,090
will have a manageable amount of traffic onto them

69
00:03:03,090 --> 00:03:05,430
provided the fact that the Auto Scaling Group, of course,

70
00:03:05,430 --> 00:03:06,663
has scaled as well.

71
00:03:07,800 --> 00:03:10,170
Now at the Application Layer Defense,

72
00:03:10,170 --> 00:03:15,090
we can detect and filter malicious requests at BP1 and BP2.

73
00:03:15,090 --> 00:03:16,320
So the idea is that CloudFront

74
00:03:16,320 --> 00:03:18,300
is going to serve static content

75
00:03:18,300 --> 00:03:19,980
and serve it from edge locations,

76
00:03:19,980 --> 00:03:22,560
therefore protecting your backend.

77
00:03:22,560 --> 00:03:25,320
And then you can use WAF on top of CloudFront

78
00:03:25,320 --> 00:03:27,270
or your Application Load Balancers

79
00:03:27,270 --> 00:03:30,180
to filter and block requests based on request signatures.

80
00:03:30,180 --> 00:03:32,850
For example, you can block specific IPs,

81
00:03:32,850 --> 00:03:35,340
specific request types, and so on.

82
00:03:35,340 --> 00:03:37,860
And if you use the WAF rate-based rules,

83
00:03:37,860 --> 00:03:41,100
you can automatically block the IPs of bad actors.

84
00:03:41,100 --> 00:03:44,100
So you can use a bunch of managed rules on WAF

85
00:03:44,100 --> 00:03:48,210
to block IPs based on reputation or block anonymous IPs

86
00:03:48,210 --> 00:03:49,110
and so on.

87
00:03:49,110 --> 00:03:52,290
And using CloudFront, you can block specific geographies.

88
00:03:52,290 --> 00:03:55,500
The idea is that CloudFront and WAF are managed services,

89
00:03:55,500 --> 00:03:56,520
and so they will take care

90
00:03:56,520 --> 00:03:58,800
of filtering some requests for you

91
00:03:58,800 --> 00:04:02,280
so you can be protected against DDoS attack.

92
00:04:02,280 --> 00:04:04,200
And, of course, using Shield Advanced,

93
00:04:04,200 --> 00:04:05,820
so in case you enable it,

94
00:04:05,820 --> 00:04:09,360
then it will automatically create WAF rules for you

95
00:04:09,360 --> 00:04:11,160
to mitigate layer 7 attacks.

96
00:04:11,160 --> 00:04:13,740
So this is good for the Application Layer Defense,

97
00:04:13,740 --> 00:04:16,649
again, to protect your EC2 instances

98
00:04:16,649 --> 00:04:18,600
from getting any bad requests

99
00:04:18,600 --> 00:04:19,923
or at least minimize them.

100
00:04:20,760 --> 00:04:24,510
And also, how do we reduce our attack surface?

101
00:04:24,510 --> 00:04:26,040
So the idea with this architecture

102
00:04:26,040 --> 00:04:29,850
is that the backend AWS resources

103
00:04:29,850 --> 00:04:33,210
that are used to serve our application are hidden.

104
00:04:33,210 --> 00:04:36,090
So we have BP1, BP4, and BP6.

105
00:04:36,090 --> 00:04:38,940
So if you use CloudFront, the API Gateway,

106
00:04:38,940 --> 00:04:40,500
or Elastic Load Balancing,

107
00:04:40,500 --> 00:04:42,570
we can hide our backend resources.

108
00:04:42,570 --> 00:04:43,840
The attacker will never know

109
00:04:43,840 --> 00:04:47,880
if it's a Lambda function or EC2 instances or ECS tasks

110
00:04:47,880 --> 00:04:48,750
and so on,

111
00:04:48,750 --> 00:04:52,020
because we have used other things in front of them.

112
00:04:52,020 --> 00:04:54,930
Also, we can set up security groups and Network ACLs

113
00:04:54,930 --> 00:04:58,200
to filter traffic based on specific IPs.

114
00:04:58,200 --> 00:05:00,270
And Elastic IPs, if we use them,

115
00:05:00,270 --> 00:05:04,470
they can be protected by AWS Shield Advanced as well.

116
00:05:04,470 --> 00:05:06,630
And then you can protect API endpoints themselves.

117
00:05:06,630 --> 00:05:08,610
So if you use the API Gateway,

118
00:05:08,610 --> 00:05:10,320
then you can hide whatever backend it is,

119
00:05:10,320 --> 00:05:13,410
whether it be EC2, Lambda, or something else.

120
00:05:13,410 --> 00:05:15,750
And if you use the edge-optimized mode,

121
00:05:15,750 --> 00:05:16,800
you're already global.

122
00:05:16,800 --> 00:05:19,440
Otherwise, you can use CloudFront plus the regional mode

123
00:05:19,440 --> 00:05:22,200
which gives you more control for DDoS protection.

124
00:05:22,200 --> 00:05:25,230
And if you use WAF on top of the API Gateway,

125
00:05:25,230 --> 00:05:29,070
then you can get filtering of any HTTP request.

126
00:05:29,070 --> 00:05:31,530
And if you set up the API Gateway correctly,

127
00:05:31,530 --> 00:05:32,850
you can have burst limits,

128
00:05:32,850 --> 00:05:33,990
you can do headers filtering,

129
00:05:33,990 --> 00:05:37,110
and you can use and force API keys for your users,

130
00:05:37,110 --> 00:05:39,960
therefore protecting yourself from a DDoS attack.

131
00:05:39,960 --> 00:05:42,390
So hopefully, this kind of architecture makes sense

132
00:05:42,390 --> 00:05:44,100
and you understand the different ways

133
00:05:44,100 --> 00:05:45,540
you can protect against DDoS,

134
00:05:45,540 --> 00:05:48,960
because the exam will ask you to think just like that, okay?

135
00:05:48,960 --> 00:05:50,310
So that's it for this lecture.

136
00:05:50,310 --> 00:05:51,330
I hope you liked it,

137
00:05:51,330 --> 00:05:53,280
and I will see you in the next lecture.

