当前位置: 首页 > Skill >

Vmware Harden

Vmware Harden

Vmware Harden

在用户需要对 vSphere/ESXi/NSX 环境进行 VMware 合规审计、基线检查或漂移检测时使用此技能。直接...

1.7.5 2026.11.26 495
获取Skill文件查看使用说明
作 者:许景 许可证: 更新时间:2026.11.26
本文目录展开

VMware Harden (Compliance & Baseline)

Disclaimer: 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. Source code is publicly auditable at github.com/zw008/VMware-Harden under the MIT license.

AI-native VMware compliance scanner — built-in CIS / vSphere SCG / 等保 2.0 三级 / PCI-DSS / BSI IT-Grundschutz / EU NIS2 baselines, drift detection, LLM-driven remediation advice, and a web dashboard.

Companion skills: vmware-aiops (inventory + collectors data source; host/VM remediation target), vmware-monitor (read-only inspection), vmware-storage (datastore remediation target), vmware-nsx (segment/gateway evidence), vmware-nsx-security (DFW evidence + remediation target), vmware-aria (metrics correlation), vmware-avi (load balancer evidence), vmware-vks (Tanzu Kubernetes evidence), vmware-pilot (remediation execution with approval gates), vmware-policy (audit log). See references/cross-skill-workflows.md for end-to-end remediation flows that span pilot + sibling skills.

What This Skill Does

Category Tools Count Read or Write
Baseline Management 6 built-in baselines (CIS ESXi 8.0, vSphere SCG v8, 等保 2.0 L3, PCI-DSS 4.0, BSI ITGS, EU NIS2) + custom YAML loader 6+N Read
Scanning Multi-collector (vCenter, ESXi, NSX, vSAN, K8s) → typed Twin store 1 pipeline Read (no target writes)
Drift Detection Snapshot-to-snapshot configuration diff (per-node added/removed/changed fields) 1 type Read
Remediation Advisor LLM-driven (Anthropic) suggestions per violation; mock fallback when no key 1 advisor Read
Web Dashboard FastAPI + Jinja2 read-only UI for violations / drift / advice 1 server Read
MCP Server Compliance query tools 6 All Read

Quick Install

uv tool install vmware-harden
vmware-harden baseline list

For first-time use, ensure a vmware-aiops target is configured (harden uses aiops collectors) and optionally set ANTHROPIC_API_KEY for live remediation advice.

When to Use This Skill

Use vmware-harden when the user needs to:

  • Run a compliance scan against CIS / vSphere SCG / 等保 2.0 三级 / PCI-DSS / BSI IT-Grundschutz / EU NIS2
  • Author or import a custom YAML baseline (e.g., internal corporate baseline)
  • Detect drift between two scans of the same target
  • Get AI-suggested remediation steps for a violation (advice only — does not execute)
  • Browse a web dashboard of compliance posture across multiple targets

Do NOT use this skill when:

  • The task is general vCenter/ESXi monitoring or read-only inspection → use vmware-monitor
  • The task is VM lifecycle, snapshots, or guest operations → use vmware-aiops
  • The user wants to actually execute a remediation (set advanced setting, change DFW rule, etc.) → use vmware-pilot (multi-step approval-gated workflow)
  • The task is purely NSX networking/segments → use vmware-nsx

Related Skills — Skill Routing

User Intent Recommended Skill
"Scan ESXi for CIS compliance" vmware-harden ← this skill
"Check 等保 2.0 三级" vmware-harden
"What changed since last week?" (drift) vmware-harden
"Fix this violation now" vmware-pilot (approval-gated execution)
"List VMs / hosts / alarms" vmware-monitor
"Reconfigure / power / migrate VM" vmware-aiops
"Edit DFW rule" vmware-nsx-security
"Browse audit log" vmware-policy (vmware-audit log)

Common Workflows

1. First-time scan with 等保 2.0 三级

  1. Install: uv tool install vmware-harden

  2. Verify aiops is configured: vmware-aiops doctor — harden reuses aiops connection for the vCenter collector

  3. List baselines: vmware-harden baseline list — confirm dengbao-2.0-level3-vmware is present

  4. Scan: vmware-harden scan --baseline dengbao-2.0-level3-vmware --target prod-vcenter

  5. Report: vmware-harden report --format json > violations.json (or vmware-harden web for the rendered dashboard)

    Failure branch: If you see ConnectError: vmware-aiops target not found, the aiops side is not configured. Run vmware-aiops init first; harden cannot scan without a working collector.

2. Custom baseline import + scan

  1. Author YAML under ~/.vmware-harden/baselines/my-corp.yaml (see references for schema)

  2. Validate: vmware-harden baseline validate ~/.vmware-harden/baselines/my-corp.yaml

  3. Import: vmware-harden baseline import ~/.vmware-harden/baselines/my-corp.yaml

  4. Scan: vmware-harden scan --baseline my-corp --target prod-vcenter

    Failure branch: baseline validate failure usually means a check.path references a node type the collectors do not produce (e.g. nsx.gateway.* when no NSX collector ran). See references/cli-reference.md for valid node paths and the baseline schema.

3. Drift investigation

  1. Run scan today: vmware-harden scan --target prod-vcenter --baseline cis-vmware-esxi-8.0-subset

  2. Run scan again next week (or after a change window): same command

  3. View drift: vmware-harden drift (renders the latest snapshot vs its prior snapshot for the same target)

  4. Get advice on critical drift: vmware-harden advise --violation-id <id> or vmware-harden advise --all-critical (uses ANTHROPIC_API_KEY; falls back to mock template if unset)

  5. Open web view: vmware-harden web --port 8080 then navigate to /drift

    Failure branch: If vmware-harden drift reports No drift detected since previous snapshot, both scans likely ran against the same state. Ensure two scans actually completed against the same --target; the Twin DB at ~/.vmware-harden/twin.duckdb must contain at least two snapshots for that target.

Usage Mode

Scenario Recommended Why
Local CLI scans by an operator CLI Direct, scripts well into CI
AI agent integration MCP 6 read-only tools, structured responses
Reviewing posture interactively Web vmware-harden web — sortable tables, drift timeline
CI/CD pipeline gates CLI Exit code reflects compliance pass/fail

MCP Tools (6 — 6 read, 0 write)

Category Tool Description
Baseline list_baselines All built-in + imported baselines (id, framework, version)
Baseline get_baseline_rules Rules for a given baseline_id (severity, references)
Violation list_violations Current violations, filterable by severity
Violation get_remediation Remediation suggestion for a violation_id (LLM or mock)
Drift list_drift_events Recent drift events from snapshot diff
Scan scan_target Trigger a scan against a target (read-only on the target)

All 6 tools are read-only with respect to vSphere/NSX. Writes to the local Twin DuckDB are scan-internal and do not modify any VMware resource. Actual remediation execution is intentionally deferred to vmware-pilot (approval-gated).

CLI Quick Reference

vmware-harden baseline list
vmware-harden baseline import <path>
vmware-harden baseline validate <path>
vmware-harden scan --baseline <id> --target <name>
vmware-harden report [--format text|json]
vmware-harden drift [--format text|json]
vmware-harden advise (--violation-id <id> | --all-critical)
vmware-harden web [--host 127.0.0.1] [--port 8080]

Full CLI reference: see references/cli-reference.md Full capabilities table with response token estimates: see references/capabilities.md

Troubleshooting

"vmware-aiops target not found" / collectors return empty

Harden does not connect to vCenter directly — it relies on vmware-aiops collectors. Run vmware-aiops doctor and confirm the --target name matches an aiops target.

ANTHROPIC_API_KEY not set — advice looks generic

The advisor falls back to a deterministic mock template when no API key is present. Set export ANTHROPIC_API_KEY=... in your shell or in ~/.vmware-harden/.env for live LLM-driven suggestions.

uvx reports "UnknownIssuer" behind a corporate TLS proxy

Don't use uvx for the MCP server in this environment. Use the entry point installed by uv tool install:

{
  "command": "vmware-harden-mcp",
  "args": []
}

This avoids uvx re-resolving PyPI through the corporate MitM proxy. As a workaround, UV_NATIVE_TLS=true lets uv use the system CA store. See CLAUDE.md 踩坑 #25.

"Twin DB not found" on first MCP call

Run at least one scan first: vmware-harden scan --baseline cis-vmware-esxi-8.0-subset --target <t>. The DuckDB file is created on first scan at ~/.vmware-harden/twin.duckdb (override with VMWARE_HARDEN_DB).

等保 baseline rules are not firing (all checks "skipped")

The 等保 baseline references node types from multiple collectors (vCenter advanced settings + ESXi NTP + NSX DFW). If only the vCenter collector ran, rules referencing nsx.* paths skip with status "no evidence". Run a scan with all collectors enabled, or filter the baseline to only the relevant rules.

Web dashboard shows 0 violations even after a scan

Verify the dashboard is reading the same DuckDB. If VMWARE_HARDEN_DB is set in your shell but not in the systemd/launchd unit running vmware-harden web, the web server reads the default ~/.vmware-harden/twin.duckdb while your scans wrote elsewhere.

Audit & Safety

  1. Source code: github.com/zw008/VMware-Harden — MIT license, publicly auditable.
  2. Config / state files: custom baselines in ~/.vmware-harden/baselines/*.yaml; Twin DuckDB at ~/.vmware-harden/twin.duckdb. No passwords are stored — all credentials live in the upstream skill (~/.vmware-aiops/.env).
  3. Webhook data scope: none. Harden makes no outbound network calls other than (a) optional Anthropic API requests when ANTHROPIC_API_KEY is set for advisor suggestions, and (b) the local web dashboard bound to 127.0.0.1 by default.
  4. TLS verification: harden does not connect to vCenter/NSX directly — TLS handling is delegated to vmware-aiops. The advisor's HTTPS calls to api.anthropic.com use system TLS verification (no opt-out).
  5. Prompt injection protection: advisor LLM context is built exclusively from typed Twin queries (rule id, severity, evidence dict) — no free-text user input is forwarded. Evidence text passes through _sanitize() (truncate ≤500 chars, strip C0/C1 control characters).
  6. Least privilege: all 6 MCP tools are read-only. Remediation execution is intentionally not exposed — agents that need to apply a fix must invoke vmware-pilot, which provides approval gates and audit logging.

All MCP operations are audited via the @vmware_tool decorator (vmware-policy dependency) to ~/.vmware/audit.db. View with vmware-audit log --last 20.

Full setup / security / AI platform compatibility: see references/setup-guide.md

License

MIT — github.com/zw008/VMware-Harden

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,016
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,004
Apache开启.htaccess及使用方法详解

本文介绍如何在本地Apache环境中启用.htaccess文件,主要涉及修改httpd.conf中的AllowOverride参数。同时详细解析.htaccess的多种实用功能,包括自定义错误页面、目录密码保护、IP访问限制、URL自动转向、默认首页设置以及防止图片盗链等配置方法,并分析了使用.htaccess对服务器性能和安全性的潜在影响。

2026.05.09 1,001
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,001
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,000
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,000
Skill 文件
  • SKILL.md
    • VMware Harden (Compliance & Baseline)
    • What This Skill Does
    • Quick Install
    • When to Use This Skill
    • Related Skills — Skill Routing
    • Common Workflows
      • 1. First-time scan with 等保 2.0 三级
      • 2. Custom baseline import + scan
      • 3. Drift investigation
    • Usage Mode
    • MCP Tools (6 — 6 read, 0 write)
    • CLI Quick Reference
    • Troubleshooting
      • "vmware-aiops target not found" / collectors return empty
      • ANTHROPIC_API_KEY not set — advice looks generic
      • uvx reports "UnknownIssuer" behind a corporate TLS proxy
      • "Twin DB not found" on first MCP call
      • 等保 baseline rules are not firing (all checks "skipped")
      • Web dashboard shows 0 violations even after a scan
    • Audit & Safety
    • License
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期