Cloudflare免费WAF抵御站点攻击

Cloudflare免费WAF抵御站点攻击
子非鱼1.放通自己ip
①作用
放通自己的ip,避免策略把自己的拦截了,避免自己每次都需要验证。
②配置截图
2.允许搜索机器人
①作用
允许谷歌、必应等搜索机器人正常爬取你的网站,有助于网站排名。
②表达式预览
1 | (cf.client.bot) or (http.user_agent contains "duckduckgo") or (http.user_agent contains "facebookexternalhit") or (http.user_agent contains "Feedfetcher-Google") or (http.user_agent contains "LinkedInBot") or (http.user_agent contains "Mediapartners-Google") or (http.user_agent contains "msnbot") or (http.user_agent contains "Slackbot") or (http.user_agent contains "TwitterBot") or (http.user_agent contains "ia_archive") or (http.user_agent contains "yahoo") |
③设置策略
跳过,允许机器人搜索。
3.禁止指定区域
①作用:
禁止指定区域的用户访问
②操作方式
操作看博主视频操作,这个根据自己的个性化需求自己选择。
③设置策略
阻止
不允许这些用户访问你的站点
很多大兄弟看不到我的站点就是因为我限制了大佬区域,避免被大陆的爬虫爬取到,在国内传播带来不利影响。
效果图:
4.全球用户访问记录
①作用:
全球所有的用户访问都会有ip记录,方便你追踪,通过5s盾保护安全
②表达式预览
1 | (ip.geoip.continent eq "AF") or (ip.geoip.continent eq "AN") or (ip.geoip.continent eq "AS") or (ip.geoip.continent eq "EU") or (ip.geoip.continent eq "NA") or (ip.geoip.continent eq "OC") or (ip.geoip.continent eq "SA") or (ip.geoip.continent eq "T1") |
③设置策略
js质询
所有的用户访问都需要等待1-5s的时间,不用用户点击,会自动跳过,感知比较好,不会太大影响感知体验,并且可以提前加载网页缓存,避免ddos攻击。
效果图:
5.阻值恶意流量
①作用:
风险评分大的用户,直接让用户交互才能进行下一步,抵御攻击很好用。
②表达式预览:
1 | (cf.threat_score ge 5 and not cf.client.bot) or (not http.request.version in {"HTTP/1.2" "HTTP/2" "HTTP/3" "SPDY/3.1"}) or (not http.user_agent contains "Mozilla/") |
③设置策略
托管质询
出来一个框框,需要用户点击才能进行下一步,一定程度影响用户体验。
效果图:
6.nginx配置介绍
通过配置文件,只能通过域名访问网站,禁止直接通过ip地址+80或者是443访问自己的网站,避免泄露源站的ip地址。
nginx配置文件代码
1 | #全局块 |
评论
匿名评论隐私政策















