Luawig/dsh-cloudflare-access ↗★ 0
dsh-cloudflare-access
Cloudflare Access JWT verification and remote DSH privileged authorization
AI 分析
核心用途是保护暴露在公网的 DSH 实例,利用 Cloudflare Access 进行身份验证。适合将 DSH 部署在云端并通过安全网关进行远程访问的团队或个人。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Luawig/dsh-cloudflare-accessドキュメント
README 全文を読む ↗Cloudflare Access configuration
- Put the DSH Web origin behind a Cloudflare Access application.
- Copy the application Audience (
aud) and your team domain, for examplehttps://example.cloudflareaccess.com. - Cloudflare injects
Cf-Access-Jwt-Assertionon authenticated requests. The plugin verifies that header only. It does not trust theCF_Authorizationcookie.
Issuer and JWKS URL are derived:
issuer = teamDomain
JWKS = /cdn-cgi/access/certs
You do not configure issuer or jwksUrl separately. Multiple audiences are supported.
DSH configuration
Pin team domain and audiences with environment variables in production. Env locks the trust root so a remote Settings session cannot retarget another Cloudflare team.
dsh --profile web --trusted-host dsh.example.com
| Variable | Meaning |
|---|---|
DSH_CF_ACCESS_TEAM_DOMAIN | Team domain / issuer |
DSH_CF_ACCESS_AUDIENCES | Comma-separated audiences |
DSH_CF_ACCESS_ORDINARY_MODE | off | optional | required |
If a variable exists, even as an empty string, that field is locked. Environment variables override Cordis / bundle config.
Cordis overlay (only used when the matching env var is unset):
cloudflare:
teamDomain: https://example.cloudflareaccess.com
audiences:
- xxxxxxxxxxxxxxxxx
auth:
ordinary: off
Missing teamDomain or audiences: the plugin still starts, loopback is unchanged, remote privileged APIs are denied.