如何使用Cloudflare Argo隧道保护原产地()

本文概述

  • 安装Cloudflare守护程序
  • 验证守护程序
  • 启动隧道
  • 在启动时启动Argo隧道
不要让某人绕过Cloudflare保护并滥用你的原始服务器!
Cloudflare是流行的CDN和安全平台之一, 为从小型企业到企业的数百万个站点提供支持。当你为网站实施Cloudflare时, 所有流量都会得到保护和加速。但是, 使用域名访问站点时, 这是正确的。如果有人找到了实际的服务器IP(来源)并滥用了该怎么办?
查找Cloudflare背后站点的服务器IP不需要很多。你可以了解操作方法, 如此处和此处所述。你会发现, 仅实施CDN和基于云的WAF是不够的。你还应该考虑保护原产地。
那么, 解决方案是什么?
Argo Tunnel – Cloudflare的智能解决方案, 可保护原始服务器免受直接攻击。
如何使用Cloudflare Argo隧道保护原产地()

文章图片
你需要在服务器上安装该守护程序, 以在服务器到Cloudflare网络之间创建加密隧道。复杂的ACL / IP表配置为零。
如何使用Cloudflare Argo隧道保护原产地()

文章图片
好消息是你不需要使用PRO或更高级别的计划。即使你处于免费计划下, 也可以开始使用它。你只需支付Argo订阅费用即可, 每月5美元起。
让我们从安装和设置开始。
安装Cloudflare守护程序
  • 使用root或sudo特权登录到原始服务器
  • 下载最新的稳定软件包。我在Ubuntu上, 所以其他操作系统的.deb文件请查看官方下载页面。
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb

  • 安装下载的软件包
dpkg -i cloudflared-stable-linux-amd64.deb

  • 让我们验证版本以确保已安装
[email  protected]:~# cloudflared --versioncloudflared version 2020.2.0 (built 2020-02-07-1653 UTC)[email  protected]:~#

大!
验证守护程序 接下来是使用守护程序向Cloudflare进行身份验证。运行以下命令
cloudflared tunnel login

  • 它将提示你URL, 你可以使用该URL登录到Cloudflare并授权该站点。
[email  protected]:~# cloudflared tunnel loginPlease open the following URL and log in with your Cloudflare account:https://dash.cloudflare.com/argotunnel?callback=https%3A%2F%2Flogin.argotunnel.com%XXXXX-XXX-XXXXXX%3BLeave cloudflared running to download the cert automatically.INFO[0030] Waiting for login...INFO[0060] Waiting for login...INFO[0090] Waiting for login...INFO[0120] Waiting for login...You have successfully logged in.If you wish to copy your credentials to a server, they have been saved to:/root/.cloudflared/cert.pem[email  protected]:~#

  • 获得授权后, 你应该会看到类似的内容。
如何使用Cloudflare Argo隧道保护原产地()

文章图片
启动隧道 让我们开始下面的隧道。
cloudflared tunnel --hostname [HOSTNAME] http://localhost:80

例如:
[email  protected]:~# cloudflared tunnel --hostname tunnel.geekflare.com http://0.0.0.0:80WARN[0000] Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /usr/local/etc/cloudflared /etc/cloudflared] INFO[0000] Version 2020.2.0INFO[0000] GOOS: linux, GOVersion: go1.12.7, GoArch: amd64 INFO[0000] Flagshostname=tunnel.geekflare.com proxy-dns-upstream="https://1.1.1.1/dns-query, https://1.0.0.1/dns-query"INFO[0000] cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/argo-tunnel/reference/service/ INFO[0000] Starting metrics serveraddr="127.0.0.1:35597"INFO[0000] Proxying tunnel requests to http://0.0.0.0:80 INFO[0000] Connected to LAXconnectionID=0INFO[0001] Each HA connection's tunnel IDs: map[0:xxx]connectionID=0INFO[0001] Route propagating, it may take up to 1 minute for your new route to become functionalconnectionID=0INFO[0003] Connected to LAX

恭喜你!原点已被锁定。尝试使用原始IP访问你的网站, 你应该看到” 拒绝连接” 消息。
在启动时启动Argo隧道 确保服务器重启后Argo隧道已启动。在服务器上运行以下命令。
cloudflared service install

总结
【如何使用Cloudflare Argo隧道保护原产地()】Cloudflare Argo隧道看起来很有希望。仅在30分钟左右, 你就可以保护原始服务器。

    推荐阅读