vmware-harden 1.0.0__tar.gz

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.
Files changed (120) hide show
  1. vmware_harden-1.0.0/.gitignore +12 -0
  2. vmware_harden-1.0.0/LICENSE +21 -0
  3. vmware_harden-1.0.0/PKG-INFO +128 -0
  4. vmware_harden-1.0.0/README.md +107 -0
  5. vmware_harden-1.0.0/RELEASE_NOTES.md +59 -0
  6. vmware_harden-1.0.0/SECURITY.md +79 -0
  7. vmware_harden-1.0.0/examples/mcp-configs/README.md +43 -0
  8. vmware_harden-1.0.0/examples/mcp-configs/claude-code.json +20 -0
  9. vmware_harden-1.0.0/examples/mcp-configs/cline.json +13 -0
  10. vmware_harden-1.0.0/examples/mcp-configs/cursor.json +11 -0
  11. vmware_harden-1.0.0/examples/mcp-configs/goose.json +9 -0
  12. vmware_harden-1.0.0/examples/mcp-configs/uvx-fallback.json +21 -0
  13. vmware_harden-1.0.0/examples/mcp-configs/vscode-copilot.json +12 -0
  14. vmware_harden-1.0.0/mcp_server/__init__.py +0 -0
  15. vmware_harden-1.0.0/mcp_server/server.py +61 -0
  16. vmware_harden-1.0.0/pyproject.toml +55 -0
  17. vmware_harden-1.0.0/server.json +21 -0
  18. vmware_harden-1.0.0/skills/vmware-harden/SKILL.md +195 -0
  19. vmware_harden-1.0.0/skills/vmware-harden/references/capabilities.md +327 -0
  20. vmware_harden-1.0.0/skills/vmware-harden/references/cli-reference.md +234 -0
  21. vmware_harden-1.0.0/skills/vmware-harden/references/cross-skill-workflows.md +82 -0
  22. vmware_harden-1.0.0/skills/vmware-harden/references/setup-guide.md +209 -0
  23. vmware_harden-1.0.0/tests/__init__.py +0 -0
  24. vmware_harden-1.0.0/tests/eval/__init__.py +0 -0
  25. vmware_harden-1.0.0/tests/eval/regression/README.md +36 -0
  26. vmware_harden-1.0.0/tests/eval/regression/__init__.py +0 -0
  27. vmware_harden-1.0.0/tests/eval/regression/test_baseline_loadable.py +14 -0
  28. vmware_harden-1.0.0/tests/eval/regression/test_lab_scan.py +63 -0
  29. vmware_harden-1.0.0/tests/integration/__init__.py +0 -0
  30. vmware_harden-1.0.0/tests/integration/test_apply_e2e.py +133 -0
  31. vmware_harden-1.0.0/tests/integration/test_custom_baseline.py +158 -0
  32. vmware_harden-1.0.0/tests/integration/test_drift_e2e.py +60 -0
  33. vmware_harden-1.0.0/tests/integration/test_mcp_e2e.py +58 -0
  34. vmware_harden-1.0.0/tests/integration/test_scan_e2e.py +216 -0
  35. vmware_harden-1.0.0/tests/integration/test_web_e2e.py +78 -0
  36. vmware_harden-1.0.0/tests/integration/test_web_smoke.py +373 -0
  37. vmware_harden-1.0.0/tests/unit/__init__.py +0 -0
  38. vmware_harden-1.0.0/tests/unit/test_advisor.py +117 -0
  39. vmware_harden-1.0.0/tests/unit/test_baseline_dengbao.py +69 -0
  40. vmware_harden-1.0.0/tests/unit/test_baseline_extends.py +119 -0
  41. vmware_harden-1.0.0/tests/unit/test_baseline_loader.py +94 -0
  42. vmware_harden-1.0.0/tests/unit/test_baseline_model.py +205 -0
  43. vmware_harden-1.0.0/tests/unit/test_baseline_pci.py +63 -0
  44. vmware_harden-1.0.0/tests/unit/test_baseline_subset_count.py +48 -0
  45. vmware_harden-1.0.0/tests/unit/test_baseline_user_dir.py +64 -0
  46. vmware_harden-1.0.0/tests/unit/test_baseline_vsphere_scg.py +54 -0
  47. vmware_harden-1.0.0/tests/unit/test_check_runner.py +198 -0
  48. vmware_harden-1.0.0/tests/unit/test_cli_advise.py +125 -0
  49. vmware_harden-1.0.0/tests/unit/test_cli_apply.py +106 -0
  50. vmware_harden-1.0.0/tests/unit/test_cli_baseline_subcommands.py +104 -0
  51. vmware_harden-1.0.0/tests/unit/test_cli_drift.py +75 -0
  52. vmware_harden-1.0.0/tests/unit/test_cli_help.py +49 -0
  53. vmware_harden-1.0.0/tests/unit/test_collectors_datastores.py +84 -0
  54. vmware_harden-1.0.0/tests/unit/test_collectors_dfw.py +128 -0
  55. vmware_harden-1.0.0/tests/unit/test_collectors_hosts.py +119 -0
  56. vmware_harden-1.0.0/tests/unit/test_collectors_vms.py +93 -0
  57. vmware_harden-1.0.0/tests/unit/test_drift_diff.py +125 -0
  58. vmware_harden-1.0.0/tests/unit/test_drift_persistence.py +83 -0
  59. vmware_harden-1.0.0/tests/unit/test_drift_posture.py +110 -0
  60. vmware_harden-1.0.0/tests/unit/test_llm_provider.py +56 -0
  61. vmware_harden-1.0.0/tests/unit/test_mcp_audit.py +57 -0
  62. vmware_harden-1.0.0/tests/unit/test_mcp_basic.py +40 -0
  63. vmware_harden-1.0.0/tests/unit/test_mcp_tools.py +134 -0
  64. vmware_harden-1.0.0/tests/unit/test_pilot_client.py +68 -0
  65. vmware_harden-1.0.0/tests/unit/test_smoke.py +16 -0
  66. vmware_harden-1.0.0/tests/unit/test_suggestion_schema.py +100 -0
  67. vmware_harden-1.0.0/tests/unit/test_twin_multi_target.py +53 -0
  68. vmware_harden-1.0.0/tests/unit/test_twin_schema.py +35 -0
  69. vmware_harden-1.0.0/tests/unit/test_twin_snapshot.py +85 -0
  70. vmware_harden-1.0.0/tests/unit/test_twin_suggestion.py +97 -0
  71. vmware_harden-1.0.0/uv.lock +682 -0
  72. vmware_harden-1.0.0/vmware_harden/__init__.py +1 -0
  73. vmware_harden-1.0.0/vmware_harden/advisor/__init__.py +1 -0
  74. vmware_harden-1.0.0/vmware_harden/advisor/advisor.py +111 -0
  75. vmware_harden-1.0.0/vmware_harden/advisor/llm.py +60 -0
  76. vmware_harden-1.0.0/vmware_harden/baselines/__init__.py +0 -0
  77. vmware_harden-1.0.0/vmware_harden/baselines/builtin/__init__.py +0 -0
  78. vmware_harden-1.0.0/vmware_harden/baselines/builtin/cis-vmware-esxi-8.0-subset.yaml +391 -0
  79. vmware_harden-1.0.0/vmware_harden/baselines/builtin/dengbao-2.0-level3-vmware.yaml +482 -0
  80. vmware_harden-1.0.0/vmware_harden/baselines/builtin/pci-dss-4.0-vmware.yaml +275 -0
  81. vmware_harden-1.0.0/vmware_harden/baselines/builtin/vsphere-scg-v8-subset.yaml +299 -0
  82. vmware_harden-1.0.0/vmware_harden/baselines/loader.py +94 -0
  83. vmware_harden-1.0.0/vmware_harden/baselines/model.py +139 -0
  84. vmware_harden-1.0.0/vmware_harden/checks/__init__.py +0 -0
  85. vmware_harden-1.0.0/vmware_harden/checks/query.py +10 -0
  86. vmware_harden-1.0.0/vmware_harden/checks/runner.py +52 -0
  87. vmware_harden-1.0.0/vmware_harden/cli/__init__.py +4 -0
  88. vmware_harden-1.0.0/vmware_harden/cli/advise.py +93 -0
  89. vmware_harden-1.0.0/vmware_harden/cli/apply.py +106 -0
  90. vmware_harden-1.0.0/vmware_harden/cli/baseline.py +61 -0
  91. vmware_harden-1.0.0/vmware_harden/cli/drift.py +66 -0
  92. vmware_harden-1.0.0/vmware_harden/cli/main.py +27 -0
  93. vmware_harden-1.0.0/vmware_harden/cli/report.py +21 -0
  94. vmware_harden-1.0.0/vmware_harden/cli/runner.py +133 -0
  95. vmware_harden-1.0.0/vmware_harden/cli/scan.py +25 -0
  96. vmware_harden-1.0.0/vmware_harden/cli/web.py +35 -0
  97. vmware_harden-1.0.0/vmware_harden/collectors/__init__.py +0 -0
  98. vmware_harden-1.0.0/vmware_harden/collectors/base.py +17 -0
  99. vmware_harden-1.0.0/vmware_harden/collectors/datastores.py +57 -0
  100. vmware_harden-1.0.0/vmware_harden/collectors/dfw.py +82 -0
  101. vmware_harden-1.0.0/vmware_harden/collectors/hosts.py +57 -0
  102. vmware_harden-1.0.0/vmware_harden/collectors/vms.py +57 -0
  103. vmware_harden-1.0.0/vmware_harden/drift/__init__.py +1 -0
  104. vmware_harden-1.0.0/vmware_harden/drift/diff.py +163 -0
  105. vmware_harden-1.0.0/vmware_harden/drift/posture.py +102 -0
  106. vmware_harden-1.0.0/vmware_harden/mcp/__init__.py +1 -0
  107. vmware_harden-1.0.0/vmware_harden/mcp/tools.py +186 -0
  108. vmware_harden-1.0.0/vmware_harden/pilot/__init__.py +1 -0
  109. vmware_harden-1.0.0/vmware_harden/pilot/client.py +145 -0
  110. vmware_harden-1.0.0/vmware_harden/store/__init__.py +0 -0
  111. vmware_harden-1.0.0/vmware_harden/store/schema.py +82 -0
  112. vmware_harden-1.0.0/vmware_harden/store/twin.py +112 -0
  113. vmware_harden-1.0.0/vmware_harden/web/__init__.py +1 -0
  114. vmware_harden-1.0.0/vmware_harden/web/app.py +232 -0
  115. vmware_harden-1.0.0/vmware_harden/web/templates/_evidence.html +5 -0
  116. vmware_harden-1.0.0/vmware_harden/web/templates/_remediation.html +54 -0
  117. vmware_harden-1.0.0/vmware_harden/web/templates/base.html +28 -0
  118. vmware_harden-1.0.0/vmware_harden/web/templates/drift.html +66 -0
  119. vmware_harden-1.0.0/vmware_harden/web/templates/index.html +59 -0
  120. vmware_harden-1.0.0/vmware_harden/web/templates/violations.html +67 -0
@@ -0,0 +1,12 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .pytest_cache/
4
+ .venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ *.duckdb
9
+ *.duckdb.wal
10
+ .env
11
+ .coverage
12
+ htmlcov/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wei Zhou
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: vmware-harden
3
+ Version: 1.0.0
4
+ Summary: AI-native VMware compliance and baseline enforcement
5
+ Author-email: Wei Zhou <wei-wz.zhou@broadcom.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: anthropic<1.0,>=0.40
10
+ Requires-Dist: duckdb<2.0,>=0.10
11
+ Requires-Dist: fastapi<1.0,>=0.110
12
+ Requires-Dist: httpx<1.0,>=0.27
13
+ Requires-Dist: jinja2<4.0,>=3.1
14
+ Requires-Dist: mcp<2.0,>=1.0
15
+ Requires-Dist: pydantic<3.0,>=2.5
16
+ Requires-Dist: pyyaml<7.0,>=6.0
17
+ Requires-Dist: typer<1.0,>=0.12
18
+ Requires-Dist: uvicorn[standard]<1.0,>=0.27
19
+ Requires-Dist: vmware-policy<2.0,>=1.0.0
20
+ Description-Content-Type: text/markdown
21
+
22
+ # vmware-harden
23
+
24
+ > **Disclaimer**: Community-maintained open-source project. **Not affiliated with, endorsed by, or sponsored by VMware, Inc. or Broadcom Inc.** "VMware", "vSphere", "ESXi", and "NSX" are trademarks of Broadcom. Source code is publicly auditable at [github.com/zw008/VMware-Harden](https://github.com/zw008/VMware-Harden) under the MIT license.
25
+
26
+ AI-native VMware compliance and baseline enforcement. Sibling to the `vmware-*` skill family.
27
+
28
+ ## v1.0.0 — first public release
29
+
30
+ Production-ready compliance platform with **4 built-in baselines** (CIS ESXi, vSphere SCG v8, **等保 2.0 三级**, PCI-DSS 4.0), **65 rules**, multi-vCenter Twin, drift detection, **LLM Remediation Advisor**, **MCP server** with 6 audited tools, and a 3-page web dashboard.
31
+
32
+ ## Quickstart
33
+
34
+ ```bash
35
+ uv tool install vmware-harden
36
+
37
+ # List built-in baselines
38
+ vmware-harden baseline list
39
+
40
+ # Run a scan
41
+ vmware-harden scan --target <vcenter-name> --baseline cis-vmware-esxi-8.0-subset
42
+
43
+ # Or use 等保 2.0 三级 (国内合规独家)
44
+ vmware-harden scan --target <vc> --baseline dengbao-2.0-level3-vmware
45
+
46
+ # View results
47
+ vmware-harden report
48
+ vmware-harden drift
49
+
50
+ # Generate remediation suggestions
51
+ export ANTHROPIC_API_KEY=... # optional; falls back to mock without
52
+ vmware-harden advise --all-critical
53
+
54
+ # Web dashboard
55
+ vmware-harden web --port 8080 # → http://127.0.0.1:8080
56
+ ```
57
+
58
+ ## Built-in baselines
59
+
60
+ | Baseline | Rules | Applies to | Source |
61
+ |----------|-------|-----------|--------|
62
+ | `cis-vmware-esxi-8.0-subset` | 20 | host | CIS Benchmark v1.0 |
63
+ | `vsphere-scg-v8-subset` | 15 | host, vm | [VMware vcf-security-and-compliance-guidelines](https://github.com/vmware/vcf-security-and-compliance-guidelines) |
64
+ | `dengbao-2.0-level3-vmware` | 20 | host, vm, datastore, dfw_rule | GB/T 22239-2019 三级 |
65
+ | `pci-dss-4.0-vmware` | 10 | host, dfw_rule | PCI-DSS v4.0 |
66
+
67
+ ## Custom baselines
68
+
69
+ ```bash
70
+ vmware-harden baseline validate ./my-strict.yaml
71
+ vmware-harden baseline import ./my-strict.yaml --name my-strict-cis
72
+ vmware-harden scan --target <vc> --baseline my-strict-cis
73
+ ```
74
+
75
+ YAML supports `extends:` for inheriting from a built-in baseline. See `skills/vmware-harden/references/cli-reference.md`.
76
+
77
+ ## MCP server
78
+
79
+ ```bash
80
+ vmware-harden-mcp # stdio MCP server
81
+ ```
82
+
83
+ Configure your MCP client with one of `examples/mcp-configs/*.json`. 6 read-only tools: `list_baselines`, `list_violations`, `get_remediation`, `list_drift_events`, `get_baseline_rules`, `scan_target`.
84
+
85
+ ## Architecture
86
+
87
+ - **Estate Digital Twin** — DuckDB single file at `~/.vmware-harden/twin.duckdb`. Multi-target safe via target prefix on all node IDs.
88
+ - **Collectors** — lazy-import sibling vmware-* skills (no spawn overhead). All scans are READ; writes deferred to vmware-pilot.
89
+ - **Baseline schema** — Pydantic v2, strict (`extra="forbid"`), `extends:` inheritance, user-dir override.
90
+ - **Drift** — pure diff function with optional persistence; auto-runs after every scan.
91
+ - **Advisor** — LLM-driven Suggestion generation; Anthropic provider with prompt caching; mock fallback for tests / no-API-key environments.
92
+ - **Audit** — every MCP tool wrapped with `@vmware_tool` from family vmware-policy.
93
+ - **Web** — FastAPI + Jinja2 + Tailwind/HTMX/ECharts CDN.
94
+
95
+ ## Lab regression
96
+
97
+ ```bash
98
+ export VMWARE_HARDEN_LAB_TARGET=<your-vc>
99
+ pytest tests/eval/regression -v -m lab
100
+ ```
101
+
102
+ ## Family
103
+
104
+ - **vmware-aiops** — host inventory + ops (used by harden's HostCollector)
105
+ - **vmware-monitor** — read-only counterpart
106
+ - **vmware-storage** — datastore inventory
107
+ - **vmware-nsx-security** — DFW inventory
108
+ - **vmware-pilot** — execute remediations (writes; out of scope for harden)
109
+ - **vmware-policy** — `@vmware_tool` audit decorator
110
+
111
+ ## Acceptance criteria for v1.0
112
+
113
+ - 189+ tests passing
114
+ - Bandit: 0 issues at any severity
115
+ - All 6 MCP tools audited
116
+ - SKILL.md ≤ 3000 words, family-convention compliant
117
+ - SECURITY.md with 6 elements + Broadcom disclaimer
118
+ - 4 built-in baselines
119
+
120
+ ## References
121
+
122
+ - Design: parent monorepo `docs/plans/2026-05-03-vmware-harden-design.md`
123
+ - M1/M2/M3 plans: `docs/plans/2026-05-04-vmware-harden-{m1,m2,m3}-plan.md`
124
+ - Family CLAUDE.md: `/Users/zw/testany/myskills/CLAUDE.md`
125
+
126
+ ## License
127
+
128
+ MIT
@@ -0,0 +1,107 @@
1
+ # vmware-harden
2
+
3
+ > **Disclaimer**: Community-maintained open-source project. **Not affiliated with, endorsed by, or sponsored by VMware, Inc. or Broadcom Inc.** "VMware", "vSphere", "ESXi", and "NSX" are trademarks of Broadcom. Source code is publicly auditable at [github.com/zw008/VMware-Harden](https://github.com/zw008/VMware-Harden) under the MIT license.
4
+
5
+ AI-native VMware compliance and baseline enforcement. Sibling to the `vmware-*` skill family.
6
+
7
+ ## v1.0.0 — first public release
8
+
9
+ Production-ready compliance platform with **4 built-in baselines** (CIS ESXi, vSphere SCG v8, **等保 2.0 三级**, PCI-DSS 4.0), **65 rules**, multi-vCenter Twin, drift detection, **LLM Remediation Advisor**, **MCP server** with 6 audited tools, and a 3-page web dashboard.
10
+
11
+ ## Quickstart
12
+
13
+ ```bash
14
+ uv tool install vmware-harden
15
+
16
+ # List built-in baselines
17
+ vmware-harden baseline list
18
+
19
+ # Run a scan
20
+ vmware-harden scan --target <vcenter-name> --baseline cis-vmware-esxi-8.0-subset
21
+
22
+ # Or use 等保 2.0 三级 (国内合规独家)
23
+ vmware-harden scan --target <vc> --baseline dengbao-2.0-level3-vmware
24
+
25
+ # View results
26
+ vmware-harden report
27
+ vmware-harden drift
28
+
29
+ # Generate remediation suggestions
30
+ export ANTHROPIC_API_KEY=... # optional; falls back to mock without
31
+ vmware-harden advise --all-critical
32
+
33
+ # Web dashboard
34
+ vmware-harden web --port 8080 # → http://127.0.0.1:8080
35
+ ```
36
+
37
+ ## Built-in baselines
38
+
39
+ | Baseline | Rules | Applies to | Source |
40
+ |----------|-------|-----------|--------|
41
+ | `cis-vmware-esxi-8.0-subset` | 20 | host | CIS Benchmark v1.0 |
42
+ | `vsphere-scg-v8-subset` | 15 | host, vm | [VMware vcf-security-and-compliance-guidelines](https://github.com/vmware/vcf-security-and-compliance-guidelines) |
43
+ | `dengbao-2.0-level3-vmware` | 20 | host, vm, datastore, dfw_rule | GB/T 22239-2019 三级 |
44
+ | `pci-dss-4.0-vmware` | 10 | host, dfw_rule | PCI-DSS v4.0 |
45
+
46
+ ## Custom baselines
47
+
48
+ ```bash
49
+ vmware-harden baseline validate ./my-strict.yaml
50
+ vmware-harden baseline import ./my-strict.yaml --name my-strict-cis
51
+ vmware-harden scan --target <vc> --baseline my-strict-cis
52
+ ```
53
+
54
+ YAML supports `extends:` for inheriting from a built-in baseline. See `skills/vmware-harden/references/cli-reference.md`.
55
+
56
+ ## MCP server
57
+
58
+ ```bash
59
+ vmware-harden-mcp # stdio MCP server
60
+ ```
61
+
62
+ Configure your MCP client with one of `examples/mcp-configs/*.json`. 6 read-only tools: `list_baselines`, `list_violations`, `get_remediation`, `list_drift_events`, `get_baseline_rules`, `scan_target`.
63
+
64
+ ## Architecture
65
+
66
+ - **Estate Digital Twin** — DuckDB single file at `~/.vmware-harden/twin.duckdb`. Multi-target safe via target prefix on all node IDs.
67
+ - **Collectors** — lazy-import sibling vmware-* skills (no spawn overhead). All scans are READ; writes deferred to vmware-pilot.
68
+ - **Baseline schema** — Pydantic v2, strict (`extra="forbid"`), `extends:` inheritance, user-dir override.
69
+ - **Drift** — pure diff function with optional persistence; auto-runs after every scan.
70
+ - **Advisor** — LLM-driven Suggestion generation; Anthropic provider with prompt caching; mock fallback for tests / no-API-key environments.
71
+ - **Audit** — every MCP tool wrapped with `@vmware_tool` from family vmware-policy.
72
+ - **Web** — FastAPI + Jinja2 + Tailwind/HTMX/ECharts CDN.
73
+
74
+ ## Lab regression
75
+
76
+ ```bash
77
+ export VMWARE_HARDEN_LAB_TARGET=<your-vc>
78
+ pytest tests/eval/regression -v -m lab
79
+ ```
80
+
81
+ ## Family
82
+
83
+ - **vmware-aiops** — host inventory + ops (used by harden's HostCollector)
84
+ - **vmware-monitor** — read-only counterpart
85
+ - **vmware-storage** — datastore inventory
86
+ - **vmware-nsx-security** — DFW inventory
87
+ - **vmware-pilot** — execute remediations (writes; out of scope for harden)
88
+ - **vmware-policy** — `@vmware_tool` audit decorator
89
+
90
+ ## Acceptance criteria for v1.0
91
+
92
+ - 189+ tests passing
93
+ - Bandit: 0 issues at any severity
94
+ - All 6 MCP tools audited
95
+ - SKILL.md ≤ 3000 words, family-convention compliant
96
+ - SECURITY.md with 6 elements + Broadcom disclaimer
97
+ - 4 built-in baselines
98
+
99
+ ## References
100
+
101
+ - Design: parent monorepo `docs/plans/2026-05-03-vmware-harden-design.md`
102
+ - M1/M2/M3 plans: `docs/plans/2026-05-04-vmware-harden-{m1,m2,m3}-plan.md`
103
+ - Family CLAUDE.md: `/Users/zw/testany/myskills/CLAUDE.md`
104
+
105
+ ## License
106
+
107
+ MIT
@@ -0,0 +1,59 @@
1
+ # Release Notes
2
+
3
+ ## v1.0.0 — 2026-05-04
4
+
5
+ First public release. Production-ready compliance platform for VMware infrastructure with AI-native remediation guidance.
6
+
7
+ ### M3 highlights (this release)
8
+
9
+ - **Remediation Advisor** — LLM-driven Suggestion generation per violation. Provider abstraction (Anthropic + Mock); falls back to mock with stderr warning when `ANTHROPIC_API_KEY` unset. Persisted to Twin alongside violations.
10
+ - **MCP server** — Real FastMCP-based server (replaced the v0.x stub). 6 read-only tools: `list_baselines`, `list_violations`, `get_remediation`, `list_drift_events`, `get_baseline_rules`, `scan_target`. All wrapped with `@vmware_tool` for audit logging to `~/.vmware/audit.db`.
11
+ - **CLI: `vmware-harden advise`** — generates Suggestions with `--violation-id` or `--all-critical`.
12
+ - **Web Remediation panel** — HTMX-driven inline expansion on the violations page.
13
+ - **Documentation** — comprehensive `SKILL.md`, `SECURITY.md`, and `references/` directory (cli-reference, capabilities, setup-guide).
14
+ - **Publish artifacts** — `server.json` for MCP Registry; example configs for Claude Code/Cursor/Cline/VS Code Copilot/Goose; uvx fallback for corporate TLS environments.
15
+
16
+ ### M2 (recap — already in main)
17
+
18
+ - 4 baselines (CIS ESXi, vSphere SCG v8, **等保 2.0 三级**, PCI-DSS 4.0) — 65 rules
19
+ - 4 collectors: host, VM, datastore, NSX DFW
20
+ - Multi-target Twin (target:moref namespacing)
21
+ - Custom YAML import + extends inheritance
22
+ - Drift detection (config + inventory + posture)
23
+ - Web dashboard (FastAPI + HTMX + Tailwind + ECharts) — 3 pages
24
+
25
+ ### M1 (recap)
26
+
27
+ - DuckDB Estate Twin
28
+ - Pydantic-validated baseline schema
29
+ - SQL-based query check executor
30
+ - Initial CIS ESXi 8.0 baseline (20 rules)
31
+
32
+ ### Acceptance criteria for v1.0
33
+
34
+ - 189+ tests passing
35
+ - Bandit: 0 issues
36
+ - 6 MCP tools, all audited
37
+ - SKILL.md ≤ 3000 words, frontmatter compliant
38
+ - SECURITY.md with 6 elements + Broadcom disclaimer
39
+ - 4 built-in baselines
40
+
41
+ ### Known limitations (deferred to v1.1)
42
+
43
+ - **MCP audit `skill` field** logs as `unknown` due to `vmware_policy._infer_skill` looking for `vmware_<skill>` package layout (we use `mcp_server`). Same as sibling skills; not a regression.
44
+ - **vmware-pilot integration** is in this release (v1.0) but real Pilot endpoint integration may need adjustment based on Pilot v1.x API. Mock client is fully functional.
45
+ - **ScriptCheck rules rejected at load time** — declarative SQL (`QueryCheck`)
46
+ covers all v1.0 baselines (CIS, SCG, 等保, PCI). Implementing executable
47
+ script checks is a v2 feature gated on a security threat model
48
+ (sandboxing arbitrary Python from baseline YAML). Tracked at
49
+ `vmware_harden/baselines/loader.py` (search for "DEFERRED to v2.0").
50
+
51
+ ### Upgrade notes
52
+
53
+ This is the first public release; nothing to migrate from. New deployments:
54
+
55
+ ```bash
56
+ uv tool install vmware-harden
57
+ vmware-harden baseline list
58
+ vmware-harden scan --target <vc> --baseline cis-vmware-esxi-8.0-subset
59
+ ```
@@ -0,0 +1,79 @@
1
+ # Security Policy
2
+
3
+ ## Disclaimer
4
+
5
+ This is a community-maintained open-source project and is **not affiliated with, endorsed by, or sponsored by VMware, Inc. or Broadcom Inc.** "VMware" and "vSphere" are trademarks of Broadcom Inc.
6
+
7
+ **Author**: Wei Zhou, VMware by Broadcom — wei-wz.zhou@broadcom.com
8
+
9
+ ## Reporting Vulnerabilities
10
+
11
+ If you discover a security vulnerability, please report it privately:
12
+
13
+ - **Email**: wei-wz.zhou@broadcom.com
14
+ - **GitHub**: Open a [private security advisory](https://github.com/zw008/VMware-Harden/security/advisories/new)
15
+
16
+ Do **not** open a public GitHub issue for security vulnerabilities.
17
+
18
+ ## Security Design
19
+
20
+ ### Credential Management
21
+
22
+ - `vmware-harden` does **not** hold or read vSphere/NSX/Aria credentials directly. All infrastructure access is delegated to sibling skills (`vmware-aiops`, `vmware-monitor`, `vmware-nsx`, etc.), each of which manages its own `~/.vmware-<skill>/.env` with `chmod 600` enforcement.
23
+ - The only credential consumed by this skill is the LLM provider API key (e.g. `ANTHROPIC_API_KEY`), which **must** be supplied via environment variable. It is never read from config files, never logged, and never persisted to disk.
24
+ - Audit entries written to `~/.vmware/audit.db` contain operation metadata only — never credentials, raw prompts containing secrets, or LLM API keys.
25
+
26
+ ### Read-Only by Design
27
+
28
+ This skill is **strictly non-destructive**. Every MCP tool and every CLI command performs only read operations: it reads compliance baselines (YAML), queries sibling skills' read-only twin APIs, runs LLM analysis, and writes findings to local report files. **No tool in this codebase can modify vSphere, NSX, Aria, or Kubernetes state.** Remediation work is intentionally deferred to `vmware-pilot`, which provides approval gating and audit trails for write operations.
29
+
30
+ ### Compliance Baselines as Data
31
+
32
+ - Compliance baselines (CIS, DISA STIG, vendor hardening guides) ship as **YAML files** under `vmware_harden/baselines/`.
33
+ - Baselines are loaded through Pydantic models in **strict mode** — unknown fields are rejected, types are enforced, and no field is ever passed to `eval()`, `exec()`, or a shell.
34
+ - User-supplied baseline overrides go through the same Pydantic validation gate before being merged.
35
+
36
+ ### LLM Integration
37
+
38
+ - The only LLM integration is the **Anthropic API** via the official SDK. No alternate providers, no proxies, no shell-out to local models.
39
+ - LLM prompts are constructed from **typed Twin query results** (Pydantic-validated dataclasses from sibling skills), never from raw user free-text.
40
+ - LLM responses are parsed back through Pydantic validators before being persisted as findings; malformed responses are rejected with a structured error rather than being trusted blindly.
41
+ - The skill never executes LLM-generated code, shell commands, or API calls. LLM output is treated as data (text findings + structured severity), not as instructions.
42
+
43
+ ### Audit Logging
44
+
45
+ - Every MCP tool invocation is wrapped with the `@vmware_tool` decorator from `vmware-policy`.
46
+ - Each call appends an entry to `~/.vmware/audit.db` (SQLite WAL): timestamp, tool name, parameters (sanitized), result status, agent context.
47
+ - Audit-write failures degrade to stderr warnings and never block the primary operation.
48
+
49
+ ### SSL/TLS Verification
50
+
51
+ - `vmware-harden` makes **no direct TLS connections to vSphere, NSX, or Aria** — TLS verification policy is owned by the sibling skills it delegates to.
52
+ - The Anthropic API client uses the system CA bundle and full certificate verification by default.
53
+
54
+ ### Transitive Dependencies
55
+
56
+ - The only family-internal dependency is `vmware-policy` (the `@vmware_tool` decorator + audit logging).
57
+ - All other dependencies are standard Python packages (Pydantic, PyYAML, anthropic, Click, Rich).
58
+ - No post-install scripts, no background services, no daemons.
59
+
60
+ ### Prompt Injection Protection
61
+
62
+ - Twin query results consumed by the LLM are **typed Pydantic objects**, not raw API blobs. Free-form text fields (VM names, event messages, host log lines) are sanitized via the upstream skill's `_sanitize()` (≤500 chars, C0/C1 stripped) before crossing the skill boundary.
63
+ - LLM-side defense in depth: prompts wrap untrusted fields in explicit boundary markers (`[ASSET_NAME]`, `[EVENT_TEXT]`, …) so the model can distinguish data from instructions.
64
+ - Findings returned by the LLM are validated through Pydantic before being persisted; any field that fails type/length/enum validation is rejected, not stored.
65
+
66
+ ## Static Analysis
67
+
68
+ This project is scanned with [Bandit](https://bandit.readthedocs.io/) before every release, targeting 0 Medium+ issues:
69
+
70
+ ```bash
71
+ uvx bandit -r vmware_harden/ mcp_server/
72
+ ```
73
+
74
+ ## Supported Versions
75
+
76
+ | Version | Supported |
77
+ |---------|-----------|
78
+ | 1.5.x | Yes |
79
+ | < 1.5 | No |
@@ -0,0 +1,43 @@
1
+ # MCP Configuration Templates
2
+
3
+ Copy the relevant config snippet into your AI agent's MCP configuration file.
4
+
5
+ ## Prerequisites
6
+
7
+ ```bash
8
+ # Install vmware-harden (recommended — entry point is on PATH, no network at launch)
9
+ uv tool install vmware-harden
10
+ # or: pip install vmware-harden
11
+
12
+ # Optional: enable the LLM Remediation Advisor
13
+ export ANTHROPIC_API_KEY="sk-ant-..."
14
+ # Without ANTHROPIC_API_KEY, the advisor falls back to a deterministic mock provider.
15
+
16
+ # Twin DB defaults to ~/.vmware-harden/twin.duckdb; override with VMWARE_HARDEN_DB.
17
+ ```
18
+
19
+ ## Agent Configuration Files
20
+
21
+ | Agent | Config File | Template |
22
+ |-------|-------------|----------|
23
+ | Claude Code / Desktop | `~/.claude/settings.json` (or Claude Desktop config) | [claude-code.json](claude-code.json) |
24
+ | Cursor | Cursor MCP settings | [cursor.json](cursor.json) |
25
+ | Cline (VS Code) | `cline_mcp_settings.json` | [cline.json](cline.json) |
26
+ | VS Code Copilot | `.vscode/mcp.json` | [vscode-copilot.json](vscode-copilot.json) |
27
+ | Goose | `goose configure` or UI | [goose.json](goose.json) |
28
+ | uvx fallback (no install) | any of the above | [uvx-fallback.json](uvx-fallback.json) |
29
+
30
+ ## Corporate TLS / Proxy Notes
31
+
32
+ If `uvx` fails with `invalid peer certificate: UnknownIssuer` behind a corporate
33
+ TLS-intercepting proxy, prefer `uv tool install vmware-harden` and use the entry
34
+ point directly (`vmware-harden-mcp`). The installed binary does not hit the
35
+ network at launch. If you must use `uvx`, set `UV_NATIVE_TLS=true` so uv reads
36
+ the system CA store — see [uvx-fallback.json](uvx-fallback.json) and
37
+ references/setup-guide.md.
38
+
39
+ ## Safety Note
40
+
41
+ All MCP tools in vmware-harden are **read-only by design** in M3. Remediation
42
+ suggestions are returned as advisory data only — applying changes goes through
43
+ the separate `vmware-pilot` workflow with explicit human approval gates.
@@ -0,0 +1,20 @@
1
+ {
2
+ "_comment": [
3
+ "Claude Code / Claude Desktop MCP configuration for vmware-harden.",
4
+ "Prerequisites:",
5
+ " 1. Install: uv tool install vmware-harden (or: pip install vmware-harden)",
6
+ " 2. Optional: set ANTHROPIC_API_KEY to enable the LLM Remediation Advisor",
7
+ " (without it, the advisor falls back to a deterministic mock provider)",
8
+ " 3. Twin DB defaults to ~/.vmware-harden/twin.duckdb; override with VMWARE_HARDEN_DB",
9
+ " 4. Corporate TLS / proxy issues: see references/setup-guide.md (踩坑 #25)"
10
+ ],
11
+ "mcpServers": {
12
+ "vmware-harden": {
13
+ "command": "vmware-harden-mcp",
14
+ "args": [],
15
+ "env": {
16
+ "VMWARE_HARDEN_DB": "~/.vmware-harden/twin.duckdb"
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "mcpServers": {
3
+ "vmware-harden": {
4
+ "command": "vmware-harden-mcp",
5
+ "args": [],
6
+ "env": {
7
+ "VMWARE_HARDEN_DB": "~/.vmware-harden/twin.duckdb"
8
+ },
9
+ "disabled": false,
10
+ "autoApprove": []
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "vmware-harden": {
4
+ "command": "vmware-harden-mcp",
5
+ "args": [],
6
+ "env": {
7
+ "VMWARE_HARDEN_DB": "~/.vmware-harden/twin.duckdb"
8
+ }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "vmware-harden",
3
+ "description": "AI-native VMware compliance and baseline enforcement with LLM Remediation Advisor",
4
+ "command": "vmware-harden-mcp",
5
+ "args": [],
6
+ "env": {
7
+ "VMWARE_HARDEN_DB": "~/.vmware-harden/twin.duckdb"
8
+ }
9
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "_comment": [
3
+ "Fallback config for users without `uv tool install vmware-harden`.",
4
+ "Uses uvx to resolve the package on each launch.",
5
+ "",
6
+ "Corporate TLS proxy: set UV_NATIVE_TLS=true so uv uses the system CA store",
7
+ "(otherwise uv's bundled webpki rejects MitM proxies; see CLAUDE.md 踩坑 #25).",
8
+ "Prefer `uv tool install vmware-harden` + the entry-point configs whenever possible —",
9
+ "uvx re-resolves PyPI on every launch and is fragile on restricted networks."
10
+ ],
11
+ "mcpServers": {
12
+ "vmware-harden": {
13
+ "command": "uvx",
14
+ "args": ["--from", "vmware-harden", "vmware-harden-mcp"],
15
+ "env": {
16
+ "UV_NATIVE_TLS": "true",
17
+ "VMWARE_HARDEN_DB": "~/.vmware-harden/twin.duckdb"
18
+ }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "servers": {
3
+ "vmware-harden": {
4
+ "type": "stdio",
5
+ "command": "vmware-harden-mcp",
6
+ "args": [],
7
+ "env": {
8
+ "VMWARE_HARDEN_DB": "~/.vmware-harden/twin.duckdb"
9
+ }
10
+ }
11
+ }
12
+ }
File without changes
@@ -0,0 +1,61 @@
1
+ """vmware-harden MCP server entry point.
2
+
3
+ Tools are defined in vmware_harden.mcp.tools (so audit logs see skill=harden).
4
+ This module wires them into a FastMCP server and provides the stdio entry point.
5
+ """
6
+ import os
7
+ from pathlib import Path
8
+
9
+ from mcp.server.fastmcp import FastMCP
10
+
11
+ from vmware_harden.mcp import tools as t
12
+
13
+
14
+ def build_server(db_path: str | Path = "~/.vmware-harden/twin.duckdb") -> FastMCP:
15
+ """Construct and configure the MCP server."""
16
+ t._DB_PATH = Path(os.path.expanduser(str(db_path)))
17
+ server = FastMCP("vmware-harden")
18
+
19
+ @server.tool(name="list_baselines")
20
+ def _list_baselines_impl() -> list[dict]:
21
+ """[READ] List built-in and user-imported compliance baselines."""
22
+ return t.list_baselines()
23
+
24
+ @server.tool(name="list_violations")
25
+ def _list_violations_impl(severity: str | None = None) -> list[dict]:
26
+ """[READ] Latest snapshot's violations, optionally filtered by severity."""
27
+ return t.list_violations(severity)
28
+
29
+ @server.tool(name="get_remediation")
30
+ def _get_remediation_impl(violation_id: str) -> dict | None:
31
+ """[READ] Get the persisted Suggestion for a violation, or None."""
32
+ return t.get_remediation(violation_id)
33
+
34
+ @server.tool(name="list_drift_events")
35
+ def _list_drift_events_impl(limit: int = 50) -> list[dict]:
36
+ """[READ] Latest snapshot's change events."""
37
+ return t.list_drift_events(limit)
38
+
39
+ @server.tool(name="get_baseline_rules")
40
+ def _get_baseline_rules_impl(baseline_id: str) -> list[dict]:
41
+ """[READ] Return all rules of a given baseline."""
42
+ return t.get_baseline_rules(baseline_id)
43
+
44
+ @server.tool(name="scan_target")
45
+ def _scan_target_impl(
46
+ target: str, baseline: str = "cis-vmware-esxi-8.0-subset"
47
+ ) -> dict:
48
+ """[READ] Run a scan for `target` against `baseline`."""
49
+ return t.scan_target(target, baseline)
50
+
51
+ return server
52
+
53
+
54
+ def main() -> None:
55
+ """Entry point for `vmware-harden-mcp` (stdio transport)."""
56
+ server = build_server()
57
+ server.run()
58
+
59
+
60
+ if __name__ == "__main__":
61
+ main()
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "vmware-harden"
3
+ version = "1.0.0"
4
+ description = "AI-native VMware compliance and baseline enforcement"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ authors = [{ name = "Wei Zhou", email = "wei-wz.zhou@broadcom.com" }]
8
+ requires-python = ">=3.10"
9
+ dependencies = [
10
+ "typer>=0.12,<1.0",
11
+ "pydantic>=2.5,<3.0",
12
+ "duckdb>=0.10,<2.0",
13
+ "pyyaml>=6.0,<7.0",
14
+ # Reserved for v1.1 MCP integration (@vmware_tool decorator + audit logging).
15
+ "vmware-policy>=1.0.0,<2.0",
16
+ "fastapi>=0.110,<1.0",
17
+ "uvicorn[standard]>=0.27,<1.0",
18
+ "jinja2>=3.1,<4.0",
19
+ "httpx>=0.27,<1.0",
20
+ "anthropic>=0.40,<1.0",
21
+ "mcp>=1.0,<2.0",
22
+ ]
23
+
24
+ [dependency-groups]
25
+ dev = [
26
+ "pytest>=8.0,<10.0",
27
+ "pytest-cov>=5.0,<8.0",
28
+ "ruff>=0.5,<1.0",
29
+ ]
30
+
31
+ [project.scripts]
32
+ vmware-harden = "vmware_harden.cli.main:app"
33
+ vmware-harden-mcp = "mcp_server.server:main"
34
+
35
+ [build-system]
36
+ requires = ["hatchling"]
37
+ build-backend = "hatchling.build"
38
+
39
+ [tool.hatch.build.targets.wheel]
40
+ packages = ["vmware_harden", "mcp_server"]
41
+
42
+ [tool.ruff]
43
+ line-length = 100
44
+ target-version = "py310"
45
+
46
+ [tool.ruff.lint]
47
+ select = ["E", "F", "I", "N", "W", "UP"]
48
+
49
+ [tool.pytest.ini_options]
50
+ testpaths = ["tests"]
51
+ markers = [
52
+ "unit: Unit tests",
53
+ "integration: Integration tests with mocked external systems",
54
+ "lab: Tests requiring real VMware lab environment",
55
+ ]