Skip to content

Commit f61c7cc

Browse files
authored
feat: Implemented mandatory write tools allowlist and double-confirmation for DELETE operations and elicitations" (#13)
* feat: Added Layered security features, fixes and improvements * feat: implement mandatory write tools allowlist and double-confirmation for DELETE operations Major security enhancements to align with MCP best practices: Security Features: - Mandatory write tools allowlist with wildcard support (zpa_create_*, zia_delete_*) - No backdoor to enable all - allowlist required when ZSCALER_MCP_WRITE_ENABLED=true - Double-confirmation for all 33 DELETE operations (permission dialog + server-side block) - Tool annotations: readOnlyHint=True for 110 read tools, destructiveHint=True for 93 write tools - Hidden kwargs parameter prevents AI agents from bypassing DELETE confirmations Implementation: - Added zscaler_mcp/common/tool_helpers.py for registration utilities - Added zscaler_mcp/common/elicitation.py for confirmation logic - CLI flags: --enable-write-tools and --write-tools with env var support - 5-layer defense-in-depth security model Fixes: - Fixed update operations sending null values to API (now fetches current state) - Fixed Pydantic validation errors in confirmation responses - Fixed MockServer.add_tool() missing annotations parameter - Fixed 21 orphaned commas causing syntax errors - Fixed missing Union imports - Removed test_use_legacy_env.py (attempted real API calls) Tests: - 163/163 unit tests passing - Updated delete tests with kwargs parameter - Added confirmation-required test cases Documentation: - Updated README with comprehensive security model - Rewrote docsrc/guides/configuration.rst with clear authentication guide - Updated docsrc/guides/release-notes.rst with v0.3.0 entries - Fixed Sphinx RST title underlines - Comprehensive CHANGELOG for v0.3.0 This implementation exceeds industry standards (Terraform/PagerDuty MCP servers) by providing mandatory allowlists and double-confirmation for destructive operations. * fix: Fixed markdown lint
1 parent 7d06312 commit f61c7cc

File tree

168 files changed

+24604
-15387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+24604
-15387
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ memory-bank/
200200
.codeium/
201201
.tabnine/
202202
.github-copilot/
203+
.gemini/
203204
.roo/
204205
.aider/
205206
.aider*

.markdownlint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"MD013": false,
44
"MD024": false,
55
"MD033": false,
6-
"MD041": false
6+
"MD041": false,
7+
"MD051": false
78
}

CHANGELOG.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
11
# Zscaler Integrations MCP Server Changelog
22

3+
## 0.3.0 (October 27, 2025) - Security & Confirmation Release
4+
5+
### Notes
6+
7+
- Python Versions: **v3.11, v3.12, v3.13**
8+
9+
### 🔐 Security Enhancements
10+
11+
**Multi-Layer Security Model**:
12+
13+
- Default read-only mode (110+ safe tools always available)
14+
- Global `--enable-write-tools` flag required for write operations
15+
- **Mandatory allowlist** via `--write-tools` (supports wildcards: `zpa_create_*`, `zia_delete_*`)
16+
- Tool annotations: `readOnlyHint=True` for read operations, `destructiveHint=True` for write operations
17+
- **Double-confirmation for DELETE operations**: Permission dialog + server-side confirmation block (33 delete tools)
18+
19+
**Write Tools Allowlist** (Mandatory):
20+
21+
- No write tools registered unless explicit allowlist provided
22+
- Prevents accidental "allow all" scenarios
23+
- Granular control with wildcard patterns
24+
25+
**DELETE Operation Protection**:
26+
27+
- All 33 delete operations require **double confirmation**
28+
- First: AI agent permission dialog (`destructiveHint`)
29+
- Second: Server-side confirmation via hidden `kwargs` parameter
30+
- Prevents irreversible actions from being executed accidentally
31+
32+
### Added
33+
34+
- `zscaler_mcp/common/tool_helpers.py`: Registration utilities for read/write tools with annotations
35+
- `zscaler_mcp/common/elicitation.py`: Confirmation logic for delete operations
36+
- `--enable-write-tools` / `ZSCALER_MCP_WRITE_ENABLED`: Global write mode toggle
37+
- `--write-tools` / `ZSCALER_MCP_WRITE_TOOLS`: Mandatory allowlist (required when write mode enabled)
38+
- `build_mcpb.sh`: Automated packaging script with bundled Python dependencies
39+
- Hidden `kwargs` parameter to all 33 delete functions for server-side confirmation
40+
- `destructiveHint=True` annotation to all 93 write operations
41+
42+
### Changed
43+
44+
- MCPB packages now bundle all Python dependencies (51MB vs 499KB)
45+
- Update operations now fetch current resource state to avoid sending `null` values to API
46+
- Enhanced server logging with security posture information
47+
- Updated test suite for confirmation-based delete operations (163 tests passing)
48+
49+
### Fixed
50+
51+
- Fixed `MockServer.add_tool()` missing `annotations` parameter for `--list-tools` functionality
52+
- Fixed update operations in ZPA segment groups, server groups, app connector groups, service edge groups to handle optional fields correctly
53+
- Fixed Pydantic validation errors in confirmation responses (return string instead of dict)
54+
- Fixed MCPB packaging to include all required dependencies
55+
- Removed problematic `test_use_legacy_env.py` (attempted real API calls)
56+
57+
### Documentation
58+
59+
- Updated README with comprehensive security model documentation
60+
- Added write tools allowlist examples and usage patterns
61+
- Documented double-confirmation flow for delete operations
62+
- Added migration guide for users upgrading from 0.2.x
63+
364
## 0.2.2 (October 6, 2025)
465

566
### Notes

README.md

Lines changed: 895 additions & 135 deletions
Large diffs are not rendered by default.

docsrc/_build/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 336d62ff7aaf47f64464f814d9835706
3+
config: 3b89983bf845304102367034de2572d7
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
26 Bytes
Binary file not shown.
104 Bytes
Binary file not shown.
7.75 KB
Binary file not shown.
248 KB
Binary file not shown.
104 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)