cloud-collector
💡 摘要
自动化合规证据收集,适用于AWS、GCP和Azure,生成审计准备好的包。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);文件读写范围与路径穿越风险;依赖锁定与供应链风险。以最小权限运行,并在生产环境启用前审计代码与依赖。
Generate audit-ready evidence packages with automatic mapping to SOC 2, ISO 27001, NIST 800-53, and CIS benchmarks. Outputs structured JSON for GRC tools and formatted Markdown for auditor review.
Installation
Via skills.sh
npx skills add Workstreet-Compliance/Cloud-Collector
Via pip
git clone https://github.com/Workstreet-Compliance/Cloud-Collector.git cd Cloud-Collector pip install -r requirements.txt
Quick Start
Using with Claude Code
Just ask naturally:
"Collect SOC 2 evidence from my AWS account"
"Generate ISO 27001 audit documentation for GCP project xyz"
"Check my Azure subscription for NIST 800-53 compliance"
Programmatic Usage
from skills.evidence_collector.scripts.aws_evidence import AWSEvidenceCollector from skills.evidence_collector.scripts.output_formatter import EvidenceFormatter # Collect evidence collector = AWSEvidenceCollector() package = collector.collect_all() # Export EvidenceFormatter.save(package, "./evidence_output") # JSON + Markdown
from skills.evidence_collector.scripts.gcp_evidence import GCPEvidenceCollector collector = GCPEvidenceCollector(project_id="my-project-id") package = collector.collect_all()
from skills.evidence_collector.scripts.azure_evidence import AzureEvidenceCollector collector = AzureEvidenceCollector(subscription_id="your-subscription-id") package = collector.collect_all()
Evidence Categories
| Category | AWS | GCP | Azure | |:---------|:----|:----|:------| | IAM | Users, roles, policies, MFA | IAM bindings, service accounts | RBAC, custom roles | | Logging | CloudTrail | Audit logs, sinks | Activity logs, diagnostics | | Storage | S3 policies, encryption | GCS IAM, public access | Storage account security | | Security | Security Hub findings | Security Command Center | Defender for Cloud | | Encryption | KMS keys, rotation | Cloud KMS key rings | Key Vault config | | Network | VPC, security groups, NACLs | Firewall rules, VPC | NSGs, VNets |
Frameworks
See references/control_mappings.md for complete mapping details.
Prerequisites
# Option 1: AWS CLI aws configure # Option 2: Environment variables export AWS_ACCESS_KEY_ID=xxx export AWS_SECRET_ACCESS_KEY=xxx
Required permissions:
iam:Get*,iam:List*cloudtrail:Describe*,cloudtrail:Get*s3:GetBucket*,s3:ListBucketsecurityhub:Get*kms:Describe*,kms:List*ec2:Describe*
# Option 1: Application Default Credentials gcloud auth application-default login # Option 2: Service account export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
Required roles:
roles/iam.securityReviewerroles/logging.viewerroles/storage.objectViewerroles/securitycenter.findingsViewerroles/cloudkms.viewerroles/compute.viewer
# Option 1: Azure CLI az login # Option 2: Service principal export AZURE_CLIENT_ID=xxx export AZURE_CLIENT_SECRET=xxx export AZURE_TENANT_ID=xxx
Required roles:
ReaderSecurity ReaderKey Vault Reader
Output Formats
JSON
Structured output for automated processing and GRC tool integration.
{ "metadata": { "collection_timestamp": "2024-01-15T10:30:00Z", "cloud_provider": "aws", "account_id": "123456789012" }, "evidence": [...], "control_mappings": [...] }
Markdown
Human-readable reports with evidence grouped by category and control mapping tables—ready for auditor review.
Project Structure
cloud-evidence-collector/
├── skills/
│ └── evidence-collector/
│ ├── SKILL.md # Claude instructions
│ ├── scripts/
│ │ ├── aws_evidence.py
│ │ ├── gcp_evidence.py
│ │ ├── azure_evidence.py
│ │ └── output_formatter.py
│ └── references/
│ ├── control_mappings.md
│ └── evidence_schema.json
├── .claude-plugin/plugin.json # Claude plugin config
├── skills.json # skills.sh config
└── requirements.txt
Contributing
- Fork the repository
- Create a feature branch
- Add evidence collectors or control mappings
- Submit a pull request
Security
This tool collects read-only evidence. It does not modify any cloud resources.
- Always use least-privilege credentials
- Review collected evidence before sharing externally
- For security issues, email ryan@workstreet.com
优点
- 自动化证据收集。
- 支持多个云平台。
- 为GRC工具生成结构化输出。
缺点
- 需要云凭证。
- 仅限只读操作。
- 依赖于云服务提供商的API。
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 Workstreet-Compliance.
