askill
zero-trust

zero-trustSafety 95Repository

Identify and remediate Zero Trust security gaps in Cloudflare deployments. Use this skill when auditing Access policies, checking staging/dev environment protection, detecting unprotected admin routes, or implementing mTLS and service tokens for machine-to-machine auth.

0 stars
1.2k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Cloudflare Zero Trust Skill

Audit and implement Zero Trust security policies using Cloudflare Access, service tokens, and mTLS. Ensure all environments (production, staging, dev) have appropriate access controls.

Environment Protection Matrix

EnvironmentExpected ProtectionCommon GapRisk Level
ProductionCF Access + WAF + Rate LimitingUsually protectedLOW
StagingCF Access (should mirror prod)Often missing AccessHIGH
DevelopmentCF Access or IP restrictionsFrequently exposedCRITICAL
Preview (PR deploys)CF Access or time-limitedOften publicHIGH
Admin/Internal APIsService Tokens + mTLSBasic auth onlyCRITICAL

Zero Trust Audit Workflow

Step 1: Environment Discovery

1. List all Workers in account via MCP
2. Identify environment patterns:
   - *-staging, *-dev, *-preview
   - staging.*, dev.*, preview.*
   - Feature branch deployments
3. Check route configurations

Step 2: Access Policy Verification

For each environment, verify:

// Query Access applications
mcp__cloudflare-access__list_applications()

// For each route/hostname, check if Access policy exists:
// - Authentication requirement
// - Allow/Block rules
// - Session duration
// - Geographic restrictions

Step 3: Audit Findings

IDNameSeverityCheck
ZT001Staging without AccessCRITICALstaging.* routes without Access policy
ZT002Dev environment exposedCRITICALdev.* publicly accessible
ZT003Preview deploys publicHIGH.pages.dev or preview. without Access
ZT004Admin routes unprotectedCRITICAL/admin/* without Access or auth middleware
ZT005Internal APIs no service tokenHIGHInternal service routes without mTLS/tokens
ZT006Weak session durationMEDIUMAccess session > 24h for sensitive routes
ZT007No geographic restrictionLOWAdmin access from any country
ZT008Missing bypass auditMEDIUMBypass rules without justification
ZT009Jobs route no service tokenCRITICAL/jobs/* without service token auth
ZT010Admin without MFAHIGHAdmin uses password-only (no OTP/MFA)
ZT011Hardcoded credentialsCRITICALService token credentials in source
ZT012Long admin sessionsMEDIUMAdmin session > 4h

Environment Detection Heuristics

Staging/Dev Indicators

Hostname patterns:
- staging.*, stage.*, stg.*
- dev.*, development.*
- preview.*, pr-*.*, branch-*.*
- *.pages.dev (Cloudflare Pages previews)
- localhost:*, 127.0.0.1:*

Wrangler config indicators:
- env.staging, env.development
- name: "*-staging", "*-dev"
- vars.ENVIRONMENT: "staging" | "development"

Admin Route Indicators

Path patterns requiring protection:
- /admin/*
- /api/admin/*
- /internal/*
- /dashboard/*
- /manage/*
- /config/*
- /_debug/*
- /metrics, /health (depends on sensitivity)

Output Format

# Zero Trust Audit Report

**Scope**: [Account/Zone]
**Environments Scanned**: X

## Critical Gaps (Immediate Action Required)

### [ZT001] Staging Environment Exposed
- **Route**: staging.example.com/*
- **Status**: No Access policy detected
- **Risk**: Staging data/functionality exposed to internet
- **Fix**: Create Access application with team email domain restriction
- **Provenance**: `[LIVE-VALIDATED]` via cloudflare-access MCP

## Recommendations

1. [ ] Create Access application for `staging.example.com`
2. [ ] Implement service token auth for CI/CD access
3. [ ] Add mTLS for internal service-to-service calls
4. [ ] Review and reduce session durations

MCP Tools for Zero Trust

// List Access applications
mcp__cloudflare-access__list_applications()

// Get application details
mcp__cloudflare-access__get_application({ app_id: "..." })

// List Access policies
mcp__cloudflare-access__list_policies({ app_id: "..." })

// Verify route protection
mcp__cloudflare-bindings__workers_list()

Quick Reference

TopicRecommendation
Preview deploysAlways protect with Access; use time-limited URLs
Service tokensRotate quarterly; scope to specific applications
mTLSRequired for PCI-DSS/HIPAA compliance scenarios
Session durationShorter for admin (1-4h), longer for general (24h)
Bypass rulesDocument and audit regularly; set expiration
Geographic restrictionsConsider for admin access
Device postureEnable for high-security environments (requires WARP)

Reference Files

For detailed implementation patterns, consult:

  • references/access-policies.md - Access policy patterns, Terraform examples, policy generator
  • references/tunnel-config.md - Cloudflare Tunnel setup, config.yml examples, deployment patterns
  • references/service-tokens.md - Service token auth, admin protection checklist, extended validation rules

Related Skills

  • architect: Overall architecture including Access integration
  • guardian: Security auditing across all Cloudflare services
  • loop-breaker: Preventing service token abuse in loops

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/12/2026

An exceptionally well-structured skill for Cloudflare Zero Trust security auditing. It includes specific audit codes, environment detection heuristics, and clear integration with MCP tools, making it highly actionable for an AI agent.

95
100
90
95
95

Metadata

Licenseunknown
Version-
Updated2/5/2026
Publishermajiayu000

Tags

apici-cdgithub-actionsobservabilitysecurity