zscaler/zscaler-mcp-server/analyze-policy-rules
Claude Code and agent skill by zscaler/zscaler-mcp-server
- community
Checking that the SKILL.md file is still in the repository.
Analyze Zscaler Microsegmentation (ZMS) policy rules for optimization opportunities. Reviews custom and default policy rules, identifies stale or unused rules, detects overly permissive rules, maps cross-zone communication patterns, and assesses default security posture. Use when an administrator asks: 'Are there unused policy rules?', 'Which rules are too broad?', 'Optimize our segmentation policies', 'Review our default deny posture', 'Show me policy rule coverage', or 'Analyze our ZMS policies.'
Install
npx vskill@latest install zscaler/zscaler-mcp-server/analyze-policy-rulesSKILL.md
ZMS: Analyze Policy Rules & Segmentation Optimization
Keywords
policy rules, segmentation policies, microsegmentation rules, default policy, deny all, allow all, stale rules, unused rules, overly permissive, rule optimization, cross-zone, app zones, lateral movement, zero trust policy, rule priority, policy coverage
Overview
Perform a focused analysis of Zscaler Microsegmentation policy rules to identify optimization opportunities. This skill examines custom segmentation rules for staleness, breadth, and coverage gaps; evaluates default policy posture (deny vs allow); maps cross-zone communication patterns through app zones; and correlates policy rules with resource group structure to identify unprotected segments.
Policy rules are the enforcement backbone of microsegmentation. They define which resource groups can communicate with each other, over which ports and protocols, and in which direction. Poorly maintained rules lead to either excessive lateral movement risk (too permissive) or application breakage (too restrictive).
Rule evaluation order matters: Rules are evaluated by priority — higher priority rules are matched first. A misconfigured priority can cause a restrictive rule to shadow an intended allow rule, or vice versa.
Use this skill when: A security architect needs to audit policy rule hygiene, identify stale rules, tighten overly permissive rules, review default posture, or prepare for a compliance audit that requires demonstrating least-privilege segmentation.
Important:
- All ZMS tools require
ZSCALER_CUSTOMER_IDto be set as an environment variable. - All current MCP tools are read-only (Query operations).
- The ZMS API supports full CRUD for policy rules via mutations (
policyRuleCreate,policyRuleUpdate,policyRuleDelete,defaultPolicyRulesCreate/Update/Delete) but these are not yet exposed through MCP tools.
Workflow
Follow this 5-step process for a comprehensive policy rule analysis.
Step 1: Inventory All Policy Rules
Fetch all custom policy rules:
Using fetch_all=True bypasses pagination and returns every custom rule. For large tenants with hundreds of rules, use pagination instead:
For each rule, capture:
- Name and description: Is the rule clearly documented?
- Action: Allow or Block
- Priority: Higher values are evaluated first
- Source target: Which resource group(s) can initiate
- Destination target: Which resource group(s) can receive
- Ports: Specific port ranges (TCP/UDP) or "any"
- Protocol: TCP, UDP, ICMP, or any
- Last hit (`lastHit`): When the rule was last matched — critical for staleness
- Created/modified timestamps: When was the rule created and last changed?
List default (baseline) policy rules:
Default rules establish the baseline security posture:
- Default deny (recommended): All traffic blocked unless explicitly allowed by a custom rule. This is the Zero Trust approach.
- Default allow: All traffic allowed unless explicitly blocked. This is permissive and not recommended for production.
- Direction: Whether the default applies to inbound, outbound, or both
- Scope type: Global vs per-segment default behavior
Step 2: Identify Stale and Unused Rules
Analyze `lastHit` timestamps across all rules:
Rules that have never been hit or haven't been hit in a long time are candidates for removal or review.
Classification criteria:
- Never hit: Rule has no
lastHitvalue — may have been created but never matched traffic. Candidate for removal if older than 30 days. - Stale (> 90 days): Rule hasn't matched traffic in over 90 days. Likely obsolete unless protecting infrequent maintenance windows.
- Aging (30-90 days): Rule hasn't matched recently but may be seasonal or periodic. Flag for review.
- Active (< 30 days): Rule is actively matching traffic. Healthy.
Also check creation timestamps:
- Rules created more than 6 months ago with no hits are almost certainly obsolete
- Rules with names suggesting temporary access ("temp", "debug", "migration", "test") should be reviewed regardless of age
Build a staleness summary:
Step 3: Detect Overly Permissive Rules
Identify rules that are too broad:
A rule is overly permissive if it:
- Allows "any" port: No port restriction means all network services are accessible
- Allows "any" protocol: No protocol restriction
- Has wildcard source or destination: Applies to all resource groups rather than specific ones
- Allows both directions: No directionality constraint
- Combines multiple of the above: The more wildcards, the broader the rule
Risk levels:
- Critical: Any-to-any allow rule (completely defeats segmentation)
- High: Specific source, any destination, any port (source can reach anything)
- Medium: Specific source and destination, but any port (all services exposed between groups)
- Low: Specific source, destination, and ports but broad port ranges (e.g., 1-65535)
Assess each permissive rule:
- Is the breadth intentional and documented?
- Can it be narrowed to specific ports/protocols?
- Is there a business justification?
- Would tightening the rule break existing traffic? (check
lastHitto see if it's active)
Step 4: Map Cross-Zone Communication Patterns
List all app zones:
List resource groups for correlation:
Build a communication matrix:
Cross-reference policy rules with app zones and resource groups to build a matrix showing which zones can communicate with which:
Analysis points:
- Intra-zone: Are there rules controlling traffic within a zone? Often missed.
- Cross-zone paths: Does each cross-zone path have a corresponding allow rule with specific ports?
- Shared services access: Do all zones have appropriate access to DNS, NTP, logging?
- Database tier isolation: Is the database tier only accessible from the app tier? Direct web-to-DB is a red flag.
- Missing zones: Are there resource groups not assigned to any app zone?
Step 5: Assess Overall Policy Health
Compile the full picture:
- Default posture: Is the baseline deny-all? If not, flag as critical.
- Rule count: Appropriate for environment size? Too few may mean gaps; too many may mean complexity.
- Staleness ratio: What percentage of rules are active vs stale?
- Permissiveness score: How many rules use wildcards for ports/protocols?
- Coverage: Are all resource groups referenced in at least one policy rule?
- Priority conflicts: Are there rules with the same priority that could cause unpredictable behavior?
Check resource group protection for correlation:
Groups with members but no policy coverage represent segmentation gaps.
Present Policy Analysis Report
Edge Cases
No Custom Policy Rules
All Rules Are Active
Default Posture Is Allow
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/zms/analyze-policy-rules/SKILL.md
Popularity
- Repository stars
- 39
- Repository forks
- 18
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zscaler/zscaler-mcp-server/analyze-policy-rules)