implementing-cloud-vulnerability-posture-management
使用 AWS Security Hub、Azure Defender for Cloud 以及 Prowler、ScoutSuite 等开源工具实施云安全态势管理(CSPM),实现多云漏洞检测。
Best use case
implementing-cloud-vulnerability-posture-management is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
使用 AWS Security Hub、Azure Defender for Cloud 以及 Prowler、ScoutSuite 等开源工具实施云安全态势管理(CSPM),实现多云漏洞检测。
Teams using implementing-cloud-vulnerability-posture-management should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/implementing-cloud-vulnerability-posture-management/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How implementing-cloud-vulnerability-posture-management Compares
| Feature / Agent | implementing-cloud-vulnerability-posture-management | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
使用 AWS Security Hub、Azure Defender for Cloud 以及 Prowler、ScoutSuite 等开源工具实施云安全态势管理(CSPM),实现多云漏洞检测。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 实施云漏洞态势管理(Implementing Cloud Vulnerability Posture Management)
## 概述
云安全态势管理(Cloud Security Posture Management,CSPM)持续监控云基础设施中的错误配置、合规违规和安全风险。与传统漏洞扫描不同,CSPM 专注于云原生风险:IAM 过度授权、暴露的存储桶、未加密数据、缺失的网络控制以及服务错误配置。本技能涵盖使用 AWS Security Hub、Azure Defender for Cloud 以及 Prowler、ScoutSuite 等开源工具进行多云 CSPM 管理。
## 前置条件
- 已配置 SecurityAudit IAM 策略的 AWS CLI
- 具有 Security Reader 角色的 Azure CLI
- Python 3.9+,包含 `boto3`、`azure-identity`、`azure-mgmt-security`
- Prowler(https://github.com/prowler-cloud/prowler)
- ScoutSuite(https://github.com/nccgroup/ScoutSuite)
## AWS Security Hub
### 启用 Security Hub
```bash
# 启用 AWS Security Hub 并使用默认标准
aws securityhub enable-security-hub \
--enable-default-standards \
--region us-east-1
# 启用特定标准
aws securityhub batch-enable-standards \
--standards-subscription-requests \
'{"StandardsArn":"arn:aws:securityhub:us-east-1::standards/aws-foundational-security-best-practices/v/1.0.0"}' \
'{"StandardsArn":"arn:aws:securityhub:us-east-1::standards/cis-aws-foundations-benchmark/v/1.4.0"}'
# 获取发现摘要
aws securityhub get-findings \
--filters '{"SeverityLabel":[{"Value":"CRITICAL","Comparison":"EQUALS"}],"RecordState":[{"Value":"ACTIVE","Comparison":"EQUALS"}]}' \
--max-items 10
```
### Security Hub 标准
| 标准 | 说明 |
|------|------|
| AWS 基础安全最佳实践 | AWS 推荐的基线控制 |
| CIS AWS 基准 1.4 | CIS 加固要求 |
| PCI DSS v3.2.1 | 支付卡行业控制 |
| NIST SP 800-53 Rev 5 | 联邦安全控制 |
## Azure Defender for Cloud
### 启用 Defender CSPM
```bash
# 启用 Defender for Cloud 免费层
az security pricing create \
--name CloudPosture \
--tier standard
# 检查安全评分
az security secure-score list \
--query "[].{Name:displayName,Score:current,Max:max}" \
--output table
# 获取安全建议
az security assessment list \
--query "[?status.code=='Unhealthy'].{Name:displayName,Severity:metadata.severity,Resource:resourceDetails.id}" \
--output table
# 获取告警
az security alert list \
--query "[?status=='Active'].{Name:alertDisplayName,Severity:severity,Time:timeGeneratedUtc}" \
--output table
```
## 开源工具:Prowler
### 安装和执行
```bash
# 安装 Prowler
pip install prowler
# 运行完整 AWS 扫描
prowler aws --output-formats json-ocsf,csv,html
# 运行特定检查
prowler aws --checks s3_bucket_public_access iam_root_mfa_enabled ec2_sg_open_to_internet
# 针对特定 AWS Profile 和区域运行
prowler aws --profile production --region us-east-1 --output-formats json-ocsf
# 运行 CIS 基准合规检查
prowler aws --compliance cis_1.5_aws
# 运行 PCI DSS 合规检查
prowler aws --compliance pci_3.2.1_aws
# 扫描 Azure 环境
prowler azure --subscription-ids "sub-id-here"
# 扫描 GCP 环境
prowler gcp --project-ids "project-id-here"
```
### Prowler 检查类别
| 类别 | 示例 |
|------|------|
| IAM | Root MFA、密码策略、访问密钥轮换 |
| S3 | 公开访问、加密、版本控制 |
| EC2 | 安全组、EBS 加密、元数据服务 |
| RDS | 公开访问、加密、备份保留 |
| CloudTrail | 已启用、已加密、日志验证 |
| VPC | 流量日志、默认安全组限制 |
| Lambda | 公开访问、运行时版本 |
| EKS | 公开端点、Secret 加密 |
## 开源工具:ScoutSuite
```bash
# 安装 ScoutSuite
pip install scoutsuite
# 运行 AWS 评估
scout aws --profile production
# 运行 Azure 评估
scout azure --cli
# 运行 GCP 评估
scout gcp --project-id my-project
# 结果以交互式 HTML 报告形式输出
# 在浏览器中打开 scout-report/report.html
```
## 多云聚合
```python
import json
import subprocess
from datetime import datetime, timezone
def run_prowler_scan(provider, output_dir, compliance=None):
"""对云提供商运行 Prowler 扫描。"""
cmd = ["prowler", provider, "--output-formats", "json-ocsf",
"--output-directory", output_dir]
if compliance:
cmd.extend(["--compliance", compliance])
result = subprocess.run(cmd, capture_output=True, text=True, timeout=3600)
return result.returncode == 0
def aggregate_findings(prowler_dirs):
"""聚合多次 Prowler 扫描的发现结果。"""
all_findings = []
for scan_dir in prowler_dirs:
json_files = list(Path(scan_dir).glob("*.json"))
for jf in json_files:
with open(jf, "r") as f:
for line in f:
try:
finding = json.loads(line.strip())
all_findings.append(finding)
except json.JSONDecodeError:
continue
# 按严重性排序
severity_order = {"critical": 0, "high": 1, "medium": 2, "low": 3, "informational": 4}
all_findings.sort(key=lambda f: severity_order.get(
f.get("severity", "informational").lower(), 5
))
return all_findings
def generate_posture_report(findings, output_path):
"""生成云安全态势报告。"""
report = {
"generated_at": datetime.now(timezone.utc).isoformat(),
"total_findings": len(findings),
"by_severity": {},
"by_provider": {},
"by_service": {},
}
for f in findings:
sev = f.get("severity", "unknown")
provider = f.get("cloud_provider", "unknown")
service = f.get("service_name", "unknown")
report["by_severity"][sev] = report["by_severity"].get(sev, 0) + 1
report["by_provider"][provider] = report["by_provider"].get(provider, 0) + 1
report["by_service"][service] = report["by_service"].get(service, 0) + 1
with open(output_path, "w") as f:
json.dump(report, f, indent=2)
return report
```
## 参考资料
- [AWS Security Hub](https://aws.amazon.com/security-hub/)
- [Azure Defender for Cloud](https://learn.microsoft.com/en-us/azure/defender-for-cloud/)
- [Prowler](https://github.com/prowler-cloud/prowler)
- [ScoutSuite](https://github.com/nccgroup/ScoutSuite)
- [CIS 基准](https://www.cisecurity.org/cis-benchmarks)Related Skills
testing-api-for-mass-assignment-vulnerability
测试 API 是否存在批量赋值(mass assignment,自动绑定)漏洞——攻击者可在 API 请求中附加额外参数,从而修改本不应被访问的对象属性。测试人员识别可写端点,向请求体注入未公开字段(role、isAdmin、price、balance),验证服务器是否在未过滤的情况下将这些字段绑定到数据模型。属于 OWASP API3:2023 Broken Object Property Level Authorization 范畴。适用于批量赋值测试、参数绑定滥用、自动绑定漏洞或 API 过度发布(over-posting)相关请求。
securing-kubernetes-on-cloud
本技能涵盖通过实施 Pod 安全标准(Pod Security Standards)、网络策略、工作负载身份、RBAC 权限控制、镜像准入控制和运行时安全监控,对 EKS、AKS 和 GKE 上的托管 Kubernetes 集群进行加固。涉及云平台特定安全功能,包括 EKS 的 IRSA、GKE 的工作负载身份(Workload Identity)以及 AKS 的托管身份(Managed Identity)。
performing-web-application-vulnerability-triage
使用 OWASP 风险评级方法论对 DAST/SAST 扫描器的 Web 应用程序漏洞发现进行分类,区分真阳性和假阳性,并确定修复优先级。
performing-vulnerability-scanning-with-nessus
使用 Tenable Nessus 执行认证和未认证漏洞扫描,识别网络基础设施、服务器和应用程序中的已知漏洞、 错误配置、默认凭据和缺失补丁。扫描器将发现与 CVE 数据库和 CVSS 评分关联,生成优先级修复指导。 适用于漏洞扫描、Nessus 评估、补丁合规检查或自动化漏洞检测等请求场景。
performing-ssrf-vulnerability-exploitation
通过探测云元数据端点、内网服务和协议处理器,检测用户可控 URL 参数中的 服务端请求伪造(SSRF)漏洞。测试 AWS/GCP/Azure 元数据 API(169.254.169.254)、 通过 HTTP 进行内网端口扫描、URL 协议绕过技术以及 DNS 重绑定检测。
performing-ssl-certificate-lifecycle-management
SSL/TLS 证书生命周期管理涵盖请求、颁发、部署、监控、续期和吊销 X.509 证书的完整流程。不当的证书管理是导致中断和安全事件的主要原因。本技能涵盖使用 Python 和 ACME 协议工具自动化整个证书生命周期。
performing-ot-vulnerability-scanning-safely
使用被动监控、原生协议查询和经过精心控制的Tenable OT Security主动扫描,在OT/ICS环境中安全执行漏洞扫描,在不破坏工业过程或导致旧版控制器崩溃的情况下识别漏洞。
performing-ot-vulnerability-assessment-with-claroty
本技能涵盖使用Claroty xDome平台在OT环境中执行漏洞评估,实现全面资产发现、风险评分、漏洞关联和修复优先级排序。内容涉及通过流量分析进行被动漏洞识别、OT设备安全主动查询、与CVE数据库和ICS-CERT公告集成,以及考虑运营影响和补偿控制措施的基于风险的优先级排序。
performing-indicator-lifecycle-management
指标生命周期管理跟踪 IOC 从初始发现到验证、富化、部署、监控和最终停用的全过程。本技能涵盖实施 IOC 质量评估、老化策略、置信度衰减评分、误报跟踪、命中率监控和自动到期的系统化流程,以维护高质量、可操作的指标数据库,最大限度减少分析师疲劳并提高检测效能。
performing-endpoint-vulnerability-remediation
通过基于风险评分对 CVE 进行优先级排序、部署补丁、应用配置变更和验证修复 来执行端点漏洞修复。适用于修复漏洞扫描发现的问题、响应严重 CVE 公告 或维护端点合规性与补丁管理 SLA 的场景。适用于涉及漏洞修复、CVE 补丁、 端点漏洞管理或安全修复部署的请求。
performing-cloud-storage-forensic-acquisition
通过收集 API 远程数据和端点设备本地同步客户端制品,对 Google Drive、OneDrive、Dropbox 和 Box 等云存储服务执行取证获取和分析。
performing-cloud-penetration-testing
对 AWS、Azure 和 GCP 云环境执行授权渗透测试,识别 IAM 错误配置、暴露的存储桶、过度宽松的安全组、 无服务器函数漏洞以及从初始访问到账户沦陷的云特定攻击路径。测试人员使用云原生工具及 Pacu、 ScoutSuite 等专用框架枚举并利用云基础设施。适用于云渗透测试、AWS 安全评估、Azure 渗透测试 或云基础设施安全测试等请求场景。