vmware-debug 2.2.0__py3-none-any.whl → 2.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vmware_debug/__init__.py CHANGED
@@ -6,4 +6,4 @@ remediation to vmware-aiops / vmware-pilot. Never writes to any VMware system
6
6
  and never executes fixes; its only writes go to the local case ledger.
7
7
  """
8
8
 
9
- __version__ = "2.2.0"
9
+ __version__ = "2.3.1"
vmware_debug/cli.py CHANGED
@@ -11,6 +11,7 @@ from __future__ import annotations
11
11
 
12
12
  import json
13
13
  import sys
14
+ from functools import wraps
14
15
  from pathlib import Path
15
16
  from typing import Optional
16
17
 
@@ -20,7 +21,7 @@ from rich.table import Table
20
21
 
21
22
  from vmware_debug import __version__
22
23
  from vmware_debug.mcp.tools import build_incident_timeline, list_symptom_categories
23
- from vmware_policy import audited, cli_local
24
+ from vmware_policy import PolicyDenied, audited, cli_local, sanitize
24
25
 
25
26
 
26
27
  def _harden_console_encoding() -> None:
@@ -53,6 +54,19 @@ app = typer.Typer(
53
54
  console = Console()
54
55
 
55
56
 
57
+ def handle_cli_errors(func):
58
+ """Render policy refusals after the audited wrapper has recorded the denial."""
59
+ @wraps(func)
60
+ def wrapper(*args, **kwargs):
61
+ try:
62
+ return func(*args, **kwargs)
63
+ except PolicyDenied as exc:
64
+ rule = f" (rule: {sanitize(exc.result.rule, 100)})" if exc.result.rule else ""
65
+ typer.echo(f"Denied by policy: {sanitize(exc.result.reason, 500)}{rule}", err=True)
66
+ raise typer.Exit(1) from None
67
+ return wrapper
68
+
69
+
56
70
  @app.command()
57
71
  @cli_local("prints the installed version")
58
72
  def version() -> None:
@@ -61,6 +75,7 @@ def version() -> None:
61
75
 
62
76
 
63
77
  @app.command()
78
+ @handle_cli_errors
64
79
  @audited(tool="list_symptom_categories")
65
80
  def categories() -> None:
66
81
  """List the symptom categories debug recognises and what to check for each."""
@@ -74,6 +89,7 @@ def categories() -> None:
74
89
 
75
90
 
76
91
  @app.command()
92
+ @handle_cli_errors
77
93
  @audited(tool="build_incident_timeline")
78
94
  def triage(
79
95
  events_file: Optional[Path] = typer.Option(
@@ -898,5 +898,8 @@ def main(
898
898
  )
899
899
 
900
900
 
901
+ # Role metadata for network callers (HLD §18).
902
+ import vmware_debug.policy_roles # noqa: F401
903
+
901
904
  if __name__ == "__main__":
902
905
  main()
@@ -0,0 +1,27 @@
1
+ """What vmware-policy needs to apply roles to this skill (HLD §18 D-21/D-22).
2
+
3
+ Policy cannot see which tools escape a role or how a missing target resolves; this
4
+ module declares them. Imported by the MCP server (roles apply only to a network
5
+ MCP server). With a vmware-policy that has no roles module (< 1.24) nothing is
6
+ declared.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from vmware_policy import skill_name
12
+
13
+ #: Tools that give their holder more than a role. Host-path tools are added by
14
+ #: policy while a file root is set.
15
+ ESCAPES = frozenset()
16
+
17
+
18
+ try:
19
+ from vmware_policy.roles import declare_role_metadata
20
+ except ImportError: # vmware-policy without roles: nothing to declare
21
+ declare_role_metadata = None
22
+
23
+ if declare_role_metadata is not None:
24
+ declare_role_metadata(
25
+ skill_name(__name__),
26
+ escapes=ESCAPES,
27
+ )
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: vmware-debug
3
- Version: 2.2.0
3
+ Version: 2.3.1
4
4
  Summary: VMware diagnostic brain — offline incident triage, log/event correlation, and root-cause routing across the VMware skill family
5
5
  Project-URL: Homepage, https://github.com/vmware-skills/VMware-Debug
6
6
  Project-URL: Repository, https://github.com/vmware-skills/VMware-Debug
7
7
  Project-URL: Issues, https://github.com/vmware-skills/VMware-Debug/issues
8
8
  Project-URL: Changelog, https://github.com/vmware-skills/VMware-Debug/blob/main/RELEASE_NOTES.md
9
- Author-email: Wei Zhou <wei-wz.zhou@broadcom.com>
9
+ Author-email: Wei Zhou <zhouwei008@gmail.com>
10
10
  License-Expression: MIT
11
11
  Keywords: ai-ops,debug,diagnostics,mcp,rca,troubleshooting,vmware,vsphere
12
12
  Classifier: Development Status :: 4 - Beta
@@ -14,7 +14,8 @@ Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Topic :: System :: Monitoring
16
16
  Requires-Python: >=3.10
17
- Requires-Dist: mcp[cli]<2.0,>=1.28
17
+ Requires-Dist: certifi>=2026.10.19
18
+ Requires-Dist: mcp[cli]<2.0,>=1.30
18
19
  Requires-Dist: pyyaml<7.0,>=6.0
19
20
  Requires-Dist: rich<15.0,>=13.0
20
21
  Requires-Dist: typer<1.0,>=0.12
@@ -25,6 +26,8 @@ Description-Content-Type: text/markdown
25
26
 
26
27
  # VMware Debug
27
28
 
29
+ For a read-only check of this skill with your model and agent host, use the shared [model-fit self-test](https://github.com/vmware-skills/marketplace/blob/main/MODEL_FIT_SELF_TEST.md) in the marketplace root.
30
+
28
31
  > **Disclaimer**: Community-maintained open-source project, **not affiliated with,
29
32
  > endorsed by, or sponsored by VMware, Inc. or Broadcom Inc.** "VMware" and
30
33
  > "vSphere" are trademarks of Broadcom. Source is publicly auditable under the MIT
@@ -105,6 +108,8 @@ event actually is.
105
108
 
106
109
  ## Security
107
110
 
111
+ CLI policy refusals print the reason and rule, exit with code 1, and retain one `denied` audit row.
112
+
108
113
  Offline and credential-free by construction: it connects to no vCenter/NSX/Aria, has no destructive surface on
109
114
  VMware, and holds no secret to leak. The only writes are the local case ledger: evidence, gaps, hypotheses and
110
115
  grade history are append-only; `timeline.md` is regenerated from the evidence, and `case.json` holds the current
@@ -145,6 +150,71 @@ pip wheel . -w dist # → dist/*.whl (or: uv build, for just this packa
145
150
  pip install --no-index --find-links dist vmware-debug
146
151
  ```
147
152
 
153
+ <!-- usage: remote-and-exposure -->
154
+ ## Remote access (HTTPS) and limiting tools
155
+
156
+ By default `vmware-debug mcp` speaks stdio to one local client and offers every tool. Two options change that
157
+ (vmware-policy ≥ 1.21.0).
158
+
159
+ **Serve over HTTPS** so clients on other machines can connect. Every caller needs a bearer token:
160
+
161
+ ```bash
162
+ vmware-audit token create alice # prints the token once; give it to alice
163
+ vmware-audit token list # names only
164
+ vmware-audit token revoke alice # refused from its next request, no restart
165
+ vmware-debug mcp --transport https --host 0.0.0.0 --port 8443 \
166
+ --cert /etc/vmware-mcp/server.pem --key /etc/vmware-mcp/server-key.pem \
167
+ --public-name mcp.example.com
168
+ ```
169
+
170
+ Connect a client (Claude Code shown; any MCP client that supports streamable HTTP and custom headers works):
171
+
172
+ ```bash
173
+ claude mcp add --transport http vmware-debug https://mcp.example.com:8443/mcp \
174
+ --header "Authorization: Bearer $VMWARE_MCP_TOKEN"
175
+ ```
176
+
177
+ ```json
178
+ {
179
+ "mcpServers": {
180
+ "vmware-debug": {
181
+ "type": "http",
182
+ "url": "https://mcp.example.com:8443/mcp",
183
+ "headers": { "Authorization": "Bearer ${VMWARE_MCP_TOKEN}" }
184
+ }
185
+ }
186
+ }
187
+ ```
188
+
189
+ - The server will not start without a token, refuses Host/Origin values outside `--public-name`, and checks
190
+ before it binds that unauthenticated requests get 401. Use a certificate your clients trust for those names.
191
+ - Behind a TLS-terminating reverse proxy on the same machine use `--transport http --host 127.0.0.1
192
+ --public-name mcp.example.com` and pass the `Authorization` header through.
193
+ - Behind a load balancer or gateway on another machine, keep `--transport https` (a self-signed certificate is
194
+ fine), list in `--public-name` the host name the balancer sends as `Host`, and have it forward `Authorization`.
195
+ Its health probe can use `GET /healthz`, which needs no token and returns only `{"status": "ok"}`
196
+ (vmware-policy ≥ 1.23.0).
197
+ - Send `traceparent` or `X-Request-ID` with each request to have it stored on the audit row;
198
+ `vmware-audit log --correlation-id ID` then finds the calls behind one platform request.
199
+ - The audit log records each caller as `token:<name>`. Calls naming different targets run in parallel; calls that
200
+ name no target run one at a time, so name the target when several people share a server.
201
+ - **Everyone who can reach the endpoint acts with this server's account.** Tokens identify callers; they grant
202
+ nothing on the platform. Run one endpoint per privilege level.
203
+ - **Several people or roles on one endpoint:** run `vmware-audit roles enable` once, then give each token a role (`vmware-audit token create NAME --role reader`, or a role in `roles.yaml` naming tools and targets; vmware-policy ≥ 1.24.0). A role limits what the token may call on this endpoint; it cannot grant more than the account has. See vmware-policy's README, "Roles for network callers".
204
+
205
+ **Offer only read tools, plus the writes you choose:**
206
+
207
+ ```bash
208
+ vmware-debug mcp --expose read --allow-write close_case
209
+ # or: VMWARE_DEBUG_MCP_EXPOSE=read VMWARE_DEBUG_MCP_ALLOW_WRITE=close_case vmware-debug mcp
210
+ ```
211
+
212
+ Tools not offered do not appear in the client's tool list. A bad value or an unknown write tool stops the server
213
+ (exit 2). This limits what clients are offered; it is not authorization, so the account itself should be
214
+ least-privilege.
215
+
216
+ Details: `skills/vmware-debug/references/setup-guide.md` ("Serving MCP over HTTPS", "Limiting which tools are offered").
217
+
148
218
  ## License
149
219
 
150
220
  MIT.
@@ -1,10 +1,11 @@
1
- vmware_debug/__init__.py,sha256=JjgubSbR8Xhn-i8kk8lV2EtYQxwqZUwSAQqxyW3k46o,376
2
- vmware_debug/cli.py,sha256=nho92ORzfyqEPPvnFWuAY3J5uyWpVdzx5kAd7DPmbcA,5690
1
+ vmware_debug/__init__.py,sha256=j8ECx8s2eEC3ROlRNhSlH5UljOsOSNKlai9D6NbjHe0,376
2
+ vmware_debug/cli.py,sha256=AShbZTiMu_WuhfSbIB74ZhvLPRgOJHhrzzUEV_xYtZs,6284
3
3
  vmware_debug/envelope.py,sha256=66AQzI_h4JoopUcFxHvqaFe48rYRZz0uX9Wdm5lDcuI,11235
4
+ vmware_debug/policy_roles.py,sha256=iaKA3rT5qg0tfjO59cZHjsJTF4xirIzmsxfkVytrgH0,844
4
5
  vmware_debug/mcp/__init__.py,sha256=isuSzMWp1iXgJWGz2Q0JyUXlDTfcFfHNPSTHALuNHaA,220
5
6
  vmware_debug/mcp/tools.py,sha256=TcWywxro1zqGYFmJC8NUgxb7DMyGpSQbZusJrHzqnGI,2796
6
7
  vmware_debug/mcp_server/__init__.py,sha256=QZpQxriDdqDCYaS-HP7McsaPbTPbHwcamIwu-7UxY-E,49
7
- vmware_debug/mcp_server/server.py,sha256=uz4BnW-6Zu7G4fYYffT6B5cfOQ7xVFDzLWsmpASTrfc,47379
8
+ vmware_debug/mcp_server/server.py,sha256=pzaqn3oZIgxszVmCzRGZY33rrvupgrdtsPxducXTiGc,47475
8
9
  vmware_debug/ops/__init__.py,sha256=Co9u0zZexST7-IOUBOAS5eq5RHkaEeI2FqfYijzhI1g,46
9
10
  vmware_debug/ops/skill_names.py,sha256=JkBaKBJYyq0RrEqzro-e-zhSVh7Cn5wlxjAoakgXSyY,3990
10
11
  vmware_debug/ops/timeline.py,sha256=GzafF7jkEfa6cr3H2wO0At7fZEBdn_9m9_0Omh7faTs,27556
@@ -25,7 +26,7 @@ vmware_debug/ops/cases/store.py,sha256=dIgdAR111_gDoZ4rYbTtccuiaQVdksMCDoZOHKmbW
25
26
  vmware_debug/ops/cases/timeline.py,sha256=WbJg2xUrqyHxMERBFYA-tgU9Mmy67whH9GGh96R8ifk,7843
26
27
  vmware_debug/rules/evidence_sources.yaml,sha256=w8YOdUtKw-oi-t9c5ePJaktx7CwZlfFinH8aQAQfhzo,11387
27
28
  vmware_debug/rules/grading_rules.yaml,sha256=USCp7D2geU_CZgscvo8GMHEHZPgqbzbjqE-qwWG3QtA,3261
28
- vmware_debug-2.2.0.dist-info/METADATA,sha256=HCpMz0WTX-CNGVrBN0YmFA3M6IANeTRMH7fRJFyAPVM,8059
29
- vmware_debug-2.2.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
30
- vmware_debug-2.2.0.dist-info/entry_points.txt,sha256=4d14JRHy0ouSOfCJyczaxUFH6p8AsHZNS19AKom0v4c,109
31
- vmware_debug-2.2.0.dist-info/RECORD,,
29
+ vmware_debug-2.3.1.dist-info/METADATA,sha256=2XYQYn0ppAvQEPW4Kh0V9xDKGWUp8stG0VzX5hOofHE,11883
30
+ vmware_debug-2.3.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
31
+ vmware_debug-2.3.1.dist-info/entry_points.txt,sha256=4d14JRHy0ouSOfCJyczaxUFH6p8AsHZNS19AKom0v4c,109
32
+ vmware_debug-2.3.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.32.4
2
+ Generator: hatchling 1.33.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any