cloudflare-zero-trust
它能做什么
这个工具可以在不使用 VPN 的情况下,保护你的内部应用(比如仪表盘或管理系统)。它会根据访问者的身份以及所用的设备,来控制谁能访问哪些内容。
适用场景
- ✓用来替代通过 VPN 访问内部系统的方式。
- ✓确保只有获得授权的人才能访问重要工具。
- ✓让远程团队能够安全地访问内部资源。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-zero-trust/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想在任何地方都能访问我的内部仪表盘,同时还要保证安全。”
每周 5 个新技能,1 分钟读完。
工作原理
它会在你的内部服务器和 Cloudflare 网络之间建立一条安全隧道。然后你可以设置规则,规定谁可以访问哪些应用,系统会检查访问者的身份以及其设备是否安全。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Cloudflare Zero Trust
Secure access to internal services without VPNs using Cloudflare's Zero Trust platform (Access, Tunnel, Gateway, and WARP).
When to Use
- Replacing VPN access to internal web applications, SSH, or RDP.
- Enforcing identity-aware access policies on internal tools (dashboards, admin panels).
- Exposing on-premises or private-network services securely to remote teams.
- Filtering DNS traffic to block malware, phishing, and shadow IT.
- Enforcing device posture checks (managed devices, OS version, disk encryption).
Prerequisites
- Cloudflare account with Zero Trust plan (free tier supports up to 50 users).
- A domain on Cloudflare (for Access application hostnames).
- Identity provider configured (Google Workspace, Okta, Azure AD/Entra ID, GitHub).
cloudflaredCLI installed on the server hosting internal services.
# Install cloudflared
# macOS
brew install cloudflared
# Debian/Ubuntu
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflared.list
sudo apt update && sudo apt install -y cloudflared
# Docker
docker pull cloudflare/cloudflared:latest
Cloudflare Tunnel Setup
Tunnels create encrypted outbound connections from your infrastructure to Cloudflare's edge, eliminating the need to open inbound ports.
Create and Configure a Tunnel
# Authenticate with Cloudflare
cloudflared tunnel login
# Create a named tunnel
cloudflared tunnel create internal-apps
# This creates credentials at ~/.cloudflared/<TUNNEL_ID>.json
# List tunnels
cloudflared tunnel list
# Route DNS to the tunnel (creates a CNAME record)
cloudflared tunnel route dns internal-apps grafana.example.com
cloudflared tunnel route dns internal-apps wiki.example.com
cloudflared tunnel route dns internal-apps ssh.example.com
Tunnel Configuration File
# ~/.cloudflared/config.yml
tunnel: <TUNNEL_ID>
credentials-file: /home/deploy/.cloudflared/<TUNNEL_ID>.json
ingress:
# Grafana dashboard
- hostname: grafana.example.com
service: http://localhost:3000
# Internal wiki
- hostname: wiki.example.com
service: http://localhost:8080
originRequest:
noTLSVerify: true
# SSH access via browser
- hostname: ssh.example.com
service: ssh://localhost:22
# Private network access (CIDR routing)
- hostname: internal.example.com
service: http://10.0.0.0/24
# Catch-all — required as the last rule
- service: http_status:404
Run the Tunnel
# Run in foreground (for testing)
cloudflared tunnel run internal-apps
# Install as a systemd service
sudo cloudflared service install
sudo systemctl enable cloudflared
sudo systemctl start cloudflared
# Or run via Docker
docker run -d --name cloudflared \
--restart unless-stopped \
-v /home/deploy/.cloudflared:/etc/cloudflared \
cloudflare/cloudflared:latest \
tunnel run internal-apps
Docker Compose with Tunnel
# docker-compose.yml
version: "3.8"
services:
cloudflared:
image: cloudflare/cloudflared:latest
restart: unless-stopped
command: tunnel run
environment:
- TUNNEL_TOKEN=${TUNNEL_TOKEN}
networks:
- internal
grafana:
image: grafana/grafana:latest
networks:
- internal
wiki:
image: requarks/wiki:2
networks:
- internal
networks:
internal:
driver: bridge
Access Policies
Access policies control who can reach applications behind Cloudflare.
Create an Access Application
# Via API — create a self-hosted application
curl -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Grafana",
"domain": "grafana.example.com",
"type": "self_hosted",
"session_duration": "12h",
"auto_redirect_to_identity": true,
"allowed_idps": ["<IDP_UUID>"]
}'
Policy Types and Examples
# Allow policy — members of the engineering group
curl -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps/<APP_ID>/policies" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Engineering Team",
"decision": "allow",
"include": [
…
常见问题
这个要付费吗?
有免费套餐,最多支持 50 位用户,很适合入门或小型团队使用。
设置起来复杂吗?
需要一些技术配置,比如在服务器上安装程序,并在 Cloudflare 控制面板中设置规则。不过有详细的指南可以帮你完成。
可以用于任何内部应用吗?
可以。它支持网页应用、SSH 访问(供管理员使用),甚至还能以可控的方式访问整个私有网络。
详情
作者的原始描述
Protect internal apps with Cloudflare Access, device posture, and Zero Trust policies.
热度
- GitHub 星标
- 48k
- 排名
- #4170
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。