NSG 安全组审计
nsg-audit
当运维人员或定时任务请求对 Zava Learning 资源组进行周期性网络安全组(NSG)和连通性路径审计时使用——枚举每个 NSG 及其规则,追踪完整路径(NSG、UDR/路由表、专用终结点、DNS 以及任何防火墙),标记过度宽松、被遮蔽、未使用或孤立的规则,并建议最小暴露的修正措施。只读;生成用于报告的结论。
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 189
- Forks
- 198
01 前言 Front Matter
- name
- nsg-audit
- tools
- [ "RunAzCliReadCommands", "GetAzCliHelp", "SearchMemory", "ExecutePythonCode", "microsoft-learn_microsoft_docs_search" ]
- metadata
- { "kind": "Skill", "api_version": "azuresre.ai/v2" }
- description
- Use when an operator or a scheduled task requests a periodic Network Security Group (NSG) and connectivity-path audit of the Zava Learning resource group — enumerate every NSG and its rules, trace the full path (NSGs, UDRs / route tables, Private Endpoints, DNS, and any firewall), flag overly-permissive, shadowed, unused, or orphaned rules, and recommend least-exposure corrections. Read-only; produces findings for a report.
03 SKILL.md 正文
Zava Learning — Network Security Group (NSG) & Connectivity-Path Audit
Resource Group: @@RG@@. Read-only audit — never create, modify, or delete an NSG, rule, route, or
firewall. This is a weekly posture review of the lab's network exposure and the integrity of its
connectivity paths, not an incident response.
1. Enumerate the network surface
- List every NSG:
az network nsg list -g @@RG@@. - For each NSG, list its security rules (custom + default):
az network nsg rule list -g @@RG@@ --nsg-name <nsg> --include-default. - Map each NSG to what it protects (
az network nsg show -g @@RG@@ -n <nsg> --query "{subnets:subnets[].id, nics:networkInterfaces[].id}"). An NSG attached to no subnet and no NIC is orphaned — itself a finding.
2. Evaluate every inbound (and risky outbound) rule
Flag, with an impact-based severity (see the zava-audit-report severity model):
- SEV1 — any inbound
Allowfrom*/Internet/0.0.0.0/0to a management port (22 SSH, 3389 RDP); a blanketAllow *:* *(any source, any port, any protocol); or a rule whosedescriptionmarks it temporary / break-glass ("temp", "troubleshooting", "INC-####") that is still present. - SEV2 — inbound
Allowfrom a broad source (large CIDR /Internet) to a data or admin port (e.g. 5432 Postgres, 6379 Redis, 1433, 27017, 8080-808x app-management ports) where the source should be a known subnet / Application Gateway only. - SEV3 — shadowed rules (a higher-priority rule fully masks a lower one so it can never match), unused / legacy rules (deny or allow referencing a decommissioned CIDR/subnet), overlapping / duplicate rules, priority inversions, and orphaned NSGs (attached to nothing). Distinguish the lab's intended exposure (the Application Gateway public lane ports 8081-8087 reaching the lane apps; the AppGw subnet allowing Internet inbound on 80/443 + those lane ports) from genuinely risky exposure — flag only what a real reviewer would. The lane data ports (Postgres, the reporting-VM subnet) should be reachable only from inside the VNet; the reporting VM has no public path and needs no inbound Internet at all.
3. Trace the full connectivity path (not just NSGs)
A real network audit follows the whole path. Enumerate and assess each layer, and flag misconfigurations:
- UDRs / route tables —
az network route-table list -g @@RG@@andaz network route-table route list. Flag routes that bypass a firewall / NVA (e.g.0.0.0.0/0 -> Internetwhere an appliance is expected), black-hole routes (nextHopType=None), routes to decommissioned next hops, and route tables not associated with any subnet. - Private Endpoints & Private DNS —
az network private-endpoint list -g @@RG@@; for data services (Postgres, Key Vault, Storage) check whether access is via Private Endpoint or left on a public endpoint, and whether the matching Private DNS zone + VNet link exist (az network private-dns zone list,... link vnet list). Flag a data service exposed publicly when a Private Endpoint is expected, or a Private Endpoint with a missing/dangling DNS zone link (which silently breaks name resolution). - DNS — confirm Private DNS zones resolve to the Private Endpoint NICs and have a VNet link; flag orphaned zones or links to deleted VNets.
- Firewall / NVA — if an Azure Firewall or other NVA is present (
az network firewall list -g @@RG@@), check that subnet UDRs actually force egress through it and review overly-permissive network/application rules; if none is present, note that egress is direct and whether that is acceptable for the lab. Where a control reference helps, cite Azure network-security guidance viamicrosoft-learn_microsoft_docs_search(deny-by-default, just-in-time access, hub-spoke segmentation, Private Link, forced tunneling).
4. Produce the findings table
For every finding output a row: Layer (NSG/UDR/PE/DNS/FW) · Resource · Rule/Route · Source → Dest:Port · Finding · Severity · Recommended fix. Sort SEV1 → SEV3. Also produce a short posture summary
(Healthy / Needs attention / At risk, counts by severity, the single most important action) and a
prioritized recommendations list.
5. Hand off to the branded report
This skill does not remediate. Pass the posture summary, the findings rows (each with its severity),
and the recommendations to the zava-audit-report skill, which renders the single branded,
downloadable PowerPoint deck and returns its download link. Surface that link to the operator.
04 同仓库更多 Skills
Zava 事件分析报告生成
zava-reporting
用于将已完成的 Zava Learning 事件分析打包呈现给受众。首先呈现带品牌标识的线程内执行摘要(内联前后对比视觉效果的 markdown),然后生成可下载的交付物——PowerPoint 演示文稿、HTML 电子邮件和 Teams 通知,使用 Zava 企业模板。调用的 agent 可将其缩小为子集(例如仅 HTML 报告)。产出内容和工件;它不负责发送。组装 rca-analysis、evidence-before-after、recommendations-next-steps 和 pr-delivery 的输出。
Zava 治理审计报告生成
zava-audit-report
用于将已完成的 Zava Learning 每周治理审计(NSG/网络安全、RBAC/最小权限或云成本)打包成一份采用 Zava 企业风格、带品牌标识的可下载 PowerPoint 演示文稿。调用的审计 agent 传入其发现结果(带严重级别的条目列表)和简短的安全态势摘要;本技能渲染演示文稿、应用脱敏处理,并返回附件下载链接。产出工件本身;它不负责发送。
ServiceNow 变更请求管理
servicenow-change-management
当 Zava Learning 调查产生了需要变更管理的持久性修复时使用——在为基础设施即代码或应用代码的根本原因打开 GitHub PR 之后,提出引用该 PR 的 ServiceNow 变更请求并附上 RCA 报告。是 ServiceNow 变更请求及附件操作的唯一负责方。
敏感信息脱敏
redaction-guard
每当要输出操作员可见的内容时使用——聊天/话题消息、PagerDuty 或 ServiceNow 记录、提交信息或拉取请求正文,或任何报告制品(HTML、PowerPoint、Teams 卡片)。确定性地屏蔽密钥、凭证、令牌、私钥、URI 中嵌入的密码以及个人身份信息(PII),确保它们不会出现在对话或任何交付物中。这是一项横切护栏,由产生输出的技能调用,而非一个操作手册步骤。
事件改进建议
recommendations-next-steps
用于为 Zava Learning 事件生成前瞻性的建议和后续步骤——包括按优先级排序的预防性、检测性和流程性行动,并附带负责人、目标日期和不采取行动的风险。其输出用于 zava-reporting 交付物。
事件根因分析
rca-analysis
用于为已解决或已缓解的 Zava Learning 事件生成根因分析叙述——包括事件时间线、触发因素与潜在根因(5-Whys)、促成因素以及如何呈现这些内容。定义 RCA 章节格式;其输出用于前后对比、建议和报告等交付物。