{"id":47731620,"url":"https://github.com/zw008/vmware-nsx-security","last_synced_at":"2026-06-12T01:01:40.288Z","repository":{"id":347314071,"uuid":"1193207226","full_name":"zw008/VMware-NSX-Security","owner":"zw008","description":"VMware NSX DFW microsegmentation and security: distributed firewall, security groups, tags, traceflow, IDPS — MCP tools for AI agents","archived":false,"fork":false,"pushed_at":"2026-05-29T02:14:40.000Z","size":433,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T03:22:17.295Z","etag":null,"topics":["agent-skills","ai-skill","claude-code","codex","dfw","firewall","gemini-cli","mcp","nsx","security","vmware"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zw008.png","metadata":{"files":{"readme":"README-CN.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-27T01:31:37.000Z","updated_at":"2026-05-29T02:14:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zw008/VMware-NSX-Security","commit_stats":null,"previous_names":["zw008/vmware-nsx-security"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/zw008/VMware-NSX-Security","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zw008%2FVMware-NSX-Security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zw008%2FVMware-NSX-Security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zw008%2FVMware-NSX-Security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zw008%2FVMware-NSX-Security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zw008","download_url":"https://codeload.github.com/zw008/VMware-NSX-Security/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zw008%2FVMware-NSX-Security/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33635961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-skills","ai-skill","claude-code","codex","dfw","firewall","gemini-cli","mcp","nsx","security","vmware"],"created_at":"2026-04-02T21:40:40.722Z","updated_at":"2026-06-12T01:01:40.221Z","avatar_url":"https://github.com/zw008.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VMware NSX Security\n\n\u003e **作者**: Wei Zhou, VMware by Broadcom — wei-wz.zhou@broadcom.com\n\u003e 本项目由 VMware 工程师维护的社区项目，非 VMware 官方产品。\n\u003e VMware 官方开发者工具请访问 [developer.broadcom.com](https://developer.broadcom.com)。\n\nVMware NSX DFW 微分段与安全管理 MCP skill — 21 个工具，涵盖分布式防火墙策略与规则、安全组、VM 标签、Traceflow 数据包追踪和 IDPS。\n\n\u003e **配套 skill**：[vmware-nsx](https://github.com/zw008/VMware-NSX)（网络）、[vmware-aiops](https://github.com/zw008/VMware-AIops)（VM 生命周期）、[vmware-monitor](https://github.com/zw008/VMware-Monitor)（监控）\n\n## 快速开始\n\n```bash\nuv tool install vmware-nsx-security\n\nmkdir -p ~/.vmware-nsx-security\ncp config.example.yaml ~/.vmware-nsx-security/config.yaml\n# 编辑 config.yaml，填写 NSX Manager 地址\n\necho \"VMWARE_NSX_SECURITY_NSX_PROD_PASSWORD=your_password\" \u003e ~/.vmware-nsx-security/.env\nchmod 600 ~/.vmware-nsx-security/.env\n\nvmware-nsx-security doctor\n```\n\n## 功能\n\n| 类别 | 工具数 |\n|------|--------|\n| DFW 策略 | 列出、获取、创建、更新、删除、列出规则（6 个） |\n| DFW 规则 | 创建、更新、删除、统计（4 个） |\n| 安全组 | 列出、获取、创建、删除（4 个） |\n| VM 标签 | 列出标签、应用标签、移除标签（3 个） |\n| Traceflow | 运行追踪、获取结果（2 个） |\n| IDPS | 列出 Profile、签名状态 + 全局设置（2 个） |\n\n**共 21 个 MCP 工具**（10 只读 + 11 写入）\n\n## MCP 服务器配置\n\n**v1.5.15+ 推荐方式**：完成 `uv tool install vmware-nsx-security` 后，**一条命令启动 MCP**：\n\n```bash\n# 推荐 — 单命令，无网络依赖\nvmware-nsx-security mcp\n\n# 指定配置路径\nVMWARE_NSX_SECURITY_CONFIG=/path/to/config.yaml vmware-nsx-security mcp\n```\n\n添加到 `~/.claude.json`：\n\n```json\n{\n  \"mcpServers\": {\n    \"vmware-nsx-security\": {\n      \"command\": \"vmware-nsx-security\",\n      \"args\": [\"mcp\"],\n      \"env\": {\n        \"VMWARE_NSX_SECURITY_CONFIG\": \"~/.vmware-nsx-security/config.yaml\"\n      }\n    }\n  }\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e备选方案：uvx（不安装）或 legacy 入口\u003c/summary\u003e\n\n```bash\n# 不想安装，临时运行（每次需要联网 resolve 依赖）\nuvx --from vmware-nsx-security vmware-nsx-security mcp\n\n# 旧 entry point（仍可用，向后兼容）\nvmware-nsx-security-mcp\n```\n\n\u003e **公司 TLS 代理网络下？** uvx 可能报 `invalid peer certificate: UnknownIssuer`。\n\u003e 推荐使用上面的 `vmware-nsx-security mcp`（无需联网），或 `export UV_NATIVE_TLS=true`。\n\n\u003c/details\u003e\n\n## 常见操作\n\n### 对应用进行微分段\n\n```bash\n# 1. 按标签创建安全组 — 使用 create_group MCP 工具\n#    （tag_scope=tier, tag_value=web → Condition value 为 \"tier|web\"；\n#      多个条件类型（标签/IP/Segment）之间为 OR 关系）\n\n# 2. 创建 DFW 策略\nvmware-nsx-security policy create web-app-policy --name \"Web to App\" --category Application\n```\n\n### 为 VM 打标签\n\n```bash\n# 查询 VM 及其 external ID\nvmware-nsx-security tag list my-vm-01\n\n# 使用 external ID 应用标签\nvmware-nsx-security tag apply \u003cexternal-id\u003e --scope tier --value web\n```\n\n### 追踪数据包路径\n\n```bash\nvmware-nsx-security traceflow run \u003csrc-lport-id\u003e \\\n  --src-ip 10.0.1.5 --dst-ip 10.0.2.10 --proto TCP --dst-port 443\n```\n\n输出包含 `operation_state`（`IN_PROGRESS`/`FINISHED`/`FAILED`）、按\n`resource_type` 区分的逐跳 `observations`（Dropped* 条目携带 `reason` +\n`acl_rule_id`）以及 `dfw_hits` 命中摘要。\n\n## 安全性\n\n- **依赖检查**：有活跃规则时不允许删除策略；被 DFW 规则/作用域引用的安全组不允许删除；引用扫描失败时中止删除\n- **审计日志**：所有写操作记录到 `~/.vmware-nsx-security/audit.log`（JSON Lines 格式）\n- **输入验证**：ID 字符集校验；API 返回文本经过 `_sanitize()` 清洗，防止提示注入\n- **Dry-run 模式**：CLI 写命令均支持 `--dry-run` 预览\n- **凭据安全**：密码仅从环境变量读取，永不写入 config.yaml\n\n### 配套 Skill\n\n| Skill | 功能范围 | 工具数 | 安装 |\n|-------|---------|:-----:|------|\n| **[vmware-aiops](https://github.com/zw008/VMware-AIops)** ⭐ 入口 | VM 生命周期、部署、Guest 操作、集群管理 | 31 | `uv tool install vmware-aiops` |\n| **[vmware-monitor](https://github.com/zw008/VMware-Monitor)** | 只读监控：告警、事件、VM 信息 | 8 | `uv tool install vmware-monitor` |\n| **[vmware-nsx](https://github.com/zw008/VMware-NSX)** | NSX 网络：Segment、网关、NAT、IPAM | 31 | `uv tool install vmware-nsx-mgmt` |\n| **[vmware-storage](https://github.com/zw008/VMware-Storage)** | 数据存储、iSCSI、vSAN | 11 | `uv tool install vmware-storage` |\n| **[vmware-vks](https://github.com/zw008/VMware-VKS)** | Tanzu 命名空间、TKC 集群生命周期 | 20 | `uv tool install vmware-vks` |\n| **[vmware-aria](https://github.com/zw008/VMware-Aria)** | Aria Ops 指标、告警、容量规划 | 18 | `uv tool install vmware-aria` |\n\n## 许可证\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzw008%2Fvmware-nsx-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzw008%2Fvmware-nsx-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzw008%2Fvmware-nsx-security/lists"}