EmmanuelAdesina/CloudVitals

GitHub: EmmanuelAdesina/CloudVitals

一款极简的 AWS 云安全配置扫描器,用五项核心检查快速评估账户安全状况并给出修复命令。

Stars: 0 | Forks: 0

``` # CloudVitals **Is your AWS account one misconfiguration away from a breach? Find out in 10 seconds.** --- Cloud misconfiguration is the #1 cause of cloud data breaches. Not zero-days. Not nation-state hackers. **Human error.** An S3 bucket left public. A security group with `0.0.0.0/0`. A root account without MFA. Existing tools "solve" this by running **300+ checks** and drowning you in PDFs. They are built for compliance auditors, not developers. By the time you parse the noise, the attacker has already exfiltrated your data. CloudVitals does the opposite. **Five checks. Zero noise. One score. One fix.** --- ## 它检查的内容 | Check | Why It Destroys Companies | Zero Trust Principle | |---|---|---| | **Public S3 Buckets** | #1 cause of data leaks — attackers scan for these automatically | Verify Explicitly | | **Open Security Groups** | `0.0.0.0/0` on port 22 or 3389 is a ransomware invitation | Assume Breach | | **Unencrypted EBS Volumes** | Compliance failure + instant data exposure if snapshot leaks | Use Least Privilege | | **Root Account Missing MFA** | One phished password = total account takeover | Verify Explicitly | | **CloudTrail Disabled** | No audit trail = undetectable breach, indefinite dwell time | Assume Breach | If you pass all five, you are not "secure." You are **not immediately on fire.** That is the baseline CloudVitals enforces. --- ## 一条命令 ```bash # 要求:Go 1.22+、Python 3.9+、AWS credentials aws configure go install github.com/EmmanuelAdesina/CloudVitals@latest cloudvitals scan ``` **输出:** ``` =================================================== CloudVitals Security Score: 72/100 Status: AT RISK — 2 critical findings =================================================== SEVERITY CHECK STATUS FINDINGS critical Public S3 Bucket Access FAIL 1 critical Open Security Groups FAIL 1 high Root Account Missing MFA FAIL 1 --- Public S3 Bucket Access (critical) --- Resource: arn:aws:s3:::backup-bucket Region: us-east-1 Detail: S3 bucket public access block not fully enabled Fix: aws s3api put-public-access-block --bucket backup-bucket \ --public-access-block-configuration \ BlockPublicAcls=true,IgnorePublicAcls=true,\ BlockPublicPolicy=true,RestrictPublicBuckets=true --- Open Security Groups (critical) --- Resource: sg-0a1b2c3d Region: us-east-1 Detail: Inbound rule allows 0.0.0.0/0 on port 22 Fix: aws ec2 revoke-security-group-ingress \ --group-id sg-0a1b2c3d \ --ip-permissions IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges='[{CidrIp=0.0.0.0/0}]' ``` 没有仪表盘。没有 200 页的 PDF。**一个评分,一个发现,以及修复它的精确 CLI 命令。** ## 架构 ``` ┌─────────────────────────────────────────────────────────────┐ │ CloudVitals CLI (Go) │ │ ┌──────────────┐ ┌──────────────┐ ┌─────────────────────┐ │ │ │ Runner │ │ Risk Scorer │ │ Output Formatter │ │ │ │ (Concurrent)│ │ (0-100) │ │ (Terminal/JSON/ │ │ │ │ │ │ │ │ SARIF/GitHub │ │ │ │ │ │ │ │ Actions) │ │ │ └──────────────┘ └──────────────┘ └─────────────────────┘ │ └────────────────────────┬────────────────────────────────────┘ │ ┌───────────────┼───────────────┐ ▼ ▼ ▼ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ AWS │ │ GCP │ │ Azure │ │ Provider │ │ Provider │ │ Provider │ │ (Python) │ │ (Python) │ │ (Python) │ │ │ │ │ │ │ │ • S3 │ │ • Storage │ │ • Blob │ │ • EC2/SG │ │ • Firewall │ │ • NSG │ │ • IAM │ │ • IAM │ │ • AD/Entra │ │ • CloudTrail│ │ • AuditLog │ │ • Monitor │ └─────────────┘ └─────────────┘ └─────────────┘ ``` **Go** 负责 CLI、并发和输出格式化。 **Python** 通过官方 API(boto3、google-cloud、azure-identity)处理云 SDK 逻辑。 **YAML 注册表**定义检查规则,无需重新编译二进制文件。 这种分离是有意为之的。Python 拥有成熟的云 SDK。Go 具备出色的 CLI 人体工程学。我们在每一层都使用了最合适的工具。 ## 为什么开发这个工具 我是一名大一的网络安全专业学生,正朝着云安全架构(Zero Trust、多云)的方向发展。这就是我的工作成果证明——对真实的云资源发起真实的 API 调用,而不是理论幻灯片。 如果你正在招聘云安全、基础设施或平台工程领域的岗位:**这就是我能构建的东西。** 生产级的并发、干净的 provider 接口,以及映射到真实攻击模式的安全检查。 如果你是一名讨厌浪费时间的工具的开发者:**这就是我曾需要、却找不到的工具。** ## 添加一项检查(20 分钟) 最快的贡献方式。无需修改 Go 代码。 **1. 在 `internal/providers/aws/checks/` 中编写 Python 脚本**: ``` #!/usr/bin/env python3 import argparse import json import boto3 def check(profile, region): # Your boto3 logic here findings = [] # ... inspect resources, append to findings if misconfigured status = "fail" if findings else "pass" print(json.dumps({ "check_id": "your_check_id", "check_name": "Human Readable Name", "status": status, "severity": "critical", "findings": findings, "executed_at": None, "error_msg": None })) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--profile", default="default") parser.add_argument("--region", default="us-east-1") args = parser.parse_args() check(args.profile, args.region) ``` **2. 在 `config/checks.yaml` 中注册它**: ``` checks: - id: your_check_id name: "Human Readable Name" description: "What this check detects" provider: aws severity: critical script: your_check.py ``` **3. 测试它:** ``` go run ./cmd/cloudvitals -profile default -region us-east-1 ``` 提交一个 PR。欢迎首次贡献者。 ## 路线图 - [x] AWS S3 公开访问检查 - [ ] AWS 安全组开放性 - [ ] AWS EBS 加密 - [ ] AWS root MFA 强制执行 - [ ] AWS CloudTrail 状态 - [ ] GCP provider(GCS 公开存储桶、防火墙规则) - [ ] Azure provider(Blob storage、NSG 规则) - [ ] GitHub Actions 集成(PR 上的安全记分卡) - [ ] 用于 GitHub Advanced Security 的 SARIF 输出 - [ ] 用于 IaC 扫描的 Pre-commit hook - [ ] 用于 CI/CD pipeline 的 JSON 输出 ## CloudVitals 不是什么 - 不是完整的 CSPM。如果你需要 300 项检查,请使用 Prowler。 - 不是保险产品。我们检测错误配置。我们不对违规行为进行赔偿。 - 不是区块链项目。我们在适当的地方使用 SHA-256 进行内部完整性校验。仅此而已。 - 不是托管服务。这是一个你在自己的环境中运行的 CLI 工具。你的凭证永远不会离开你的机器。 ## 许可证 MIT 许可证 — 见 [LICENSE](LICENSE) **一句话概括:** CloudVitals 会检查那些真正会让公司遭受重创的五种 AWS 错误配置,为你提供安全评分,并准确告诉你如何修复它们。只需 10 秒。而且完全免费。
标签:AWS, DPI, EVTX分析, Go, GraphQL安全矩阵, Ruby工具, 安全基线检查, 安全扫描器, 日志审计, 逆向工具