当前位置:网站首页>每日面试1题-如何防止CDN防护被绕过
每日面试1题-如何防止CDN防护被绕过
2022-06-30 16:31:00 【qq_51550750】
当攻击者发现目标站点存在CDN防护的时候,会尝试通过查找站点的真实IP,从而绕过CDN防护。
我们来看一个比较常见的基于公有云的高可用架构,如下:
CDN(入口层)->WAF(应用层防护)-> SLB(负载层)-> ECS(源站) -> RDS(数据库)
即对应关系为:域名 cname CDN,CDN—>WAF,WAF—> SLB,SLB—> ECS。

SLB:Server Load Balancer 网络服务器之间的负载均衡
客户端向虚拟服务器发起连接时,通过某种负载均衡算法,转发到某真实服务器。
我们重点来关注一下CDN—>WAF—>SLB—>ECS这几层服务的关系。
假设,攻击者知道SLB的真实IP地址,就可以直接访问SLB的ip地址,从而轻易绕过CDN+WAF的安全防护。
如何防止CDN被绕过呢?
这里分享一个CDN防护技巧,通过中间件配置只允许域名访问,禁止ip访问。
这样处理的话,所有直接访问站点真实IP的请求都会被拒绝,任何用户只能通过域名访问站点,通过预先设定的网络链路,从DNS–>CDN–>waf防护–>源站,所有的访问请求都必须经过WAF检测。
即使攻击者找到了真实IP地址,修改本地hosts文件,强行将域名与IP解析,也无法访问到目标站点。
Nginx参考配置:
#添加一个server,在原server里绑定域名
server {
listen 80 default;
server_name _;
return 403;
}
server {
listen 80;
server_name www.demo.com;
.........
Apache参考配置:
#在httpd.conf最后面加上
<VirtualHost 此处填写IP>
ServerName 此处填写IP
<Location />
Order Allow,Deny
Deny from all
</Location>
</VirtualHost>
<VirtualHost 此处填写IP>
DocumentRoot /var/www/html
ServerName 此处填写域名
</VirtualHost>
边栏推荐
- 分布式机器学习:模型平均MA与弹性平均EASGD(PySpark)
- Unity particle_ Exception display processing
- K-line diagram interpretation and practical application skills (see position entry)
- Exch:exchange server 2013 is about to end support
- 开发那些事儿:如何在视频中添加文字水印?
- .NET ORM框架HiSql实战-第一章-集成HiSql
- 送受伤婴儿紧急就医,滴滴司机连闯五个红灯
- Shutter music recording playing audioplayers
- splitting. JS password display hidden JS effect
- 构建基本buildroot文件系统
猜你喜欢

浅析搭建高速公路视频监控平台的建设方案及必要性

Booking UI effect implemented by svg

零基础也能做Apple大片!这款免费工具帮你渲染、做特效、丝滑展示

理解现货白银走势的关键

Spin lock exploration

Canvas mouse control gravity JS effect

生成对抗网络,从DCGAN到StyleGAN、pixel2pixel,人脸生成和图像翻译。

New power of data analysis -- the first open source integrated real-time HTAP database in China was released by stonedb

Servlet operation principle_ API details_ Advanced path of request response construction (servlet_2)

k线图快速入门必读
随机推荐
[sword finger offer] 52 The first common node of two linked lists
A tough battle for Tencent cloud
The gates of Europe
[proteus simulation] Arduino uno uses 74ls148 to extend interrupt
Combination of applet container and Internet of things
[Architecture] 1366- how to draw an excellent architecture diagram
送受伤婴儿紧急就医,滴滴司机连闯五个红灯
Cesium-1.72 learning (eagle eye map of the earth)
Canvas cloud shape animation
Is there an optimal solution to the energy consumption anxiety in the data center?
Tubes响应性数据系统的设计与原理
Six photos vous montrent pourquoi TCP serre la main trois fois?
腾讯云的一场硬仗
leetcode:787. The cheapest transfer flight in station K [k-step shortest path + DFS memory + defaultdict (dict)]
【剑指Offer】剑指 Offer 53 - II. 0~n-1中缺失的数字
Flutter custom component
如何写一个技术方案
Login box tricks
NFT铸造交易平台开发详情
新技能:通过代码缓存加速 Node.js 的启动