FogSecurity/yes3-scanner

GitHub: FogSecurity/yes3-scanner

一款专注于AWS S3存储桶安全扫描的工具,帮助用户识别访问配置风险并评估勒索软件防护能力。

Stars: 102 | Forks: 8

# YES3 Scanner: 又一个 S3 Scanner YES3 会扫描 AWS 账户中以下类别的潜在 S3 安全问题: * 访问问题,例如公共访问 * 预防性 S3 安全设置 * 附加安全措施,例如加密和 SSE-C 加密阻断 * 勒索软件防护、数据保护和恢复 如需帮助或反馈,请通过 [info@fogsecurity.io](mailto:info@fogsecurity.io) 联系我们。我们正在持续深耕这一领域,并正在开发一款更全面的扫描器,支持多账户(组织)和对象级扫描。如果您有兴趣加入私密测试,请联系我们。 博客文章:[fogsecurity.io/blog/yes3-amazon-s3](http://www.fogsecurity.io/blog/yes3-amazon-s3) YES3 曾在以下平台亮相: - Cybr AWS Training:[Cybr Training](https://cybr.com/hands-on-labs/lab/securing-s3-against-ransomware-with-yes3/) - AWS Fundamentals Training:[AWS Fundamentals](https://awsfundamentals.com/resources) - Help Net Security:[Help Net Security](https://www.helpnetsecurity.com/2025/04/07/yes3-scanner-open-source-s3-security-scanner/) - AWS Security Digest:[AWS Security Digest](https://awssecuritydigest.com/past-issues/aws-security-digest-203) - tl;dr sec 简报:[tl;dr Sec](https://tldrsec.com/p/tldr-sec-274) ## 检查项 YES3 Scanner 会检查以下 S3 配置项: ### 访问问题与公共访问 - 存储桶访问控制列表 (ACL) - 存储桶策略 (基于资源的策略) - 存储桶网站设置 #### 预防性 S3 安全设置 - 账户级公共访问阻断 - 存储桶级公共访问阻断 - 已禁用的 ACL (通过所有权控制) #### 附加安全 - 存储桶加密设置 - 存储桶是否阻断 SSE-C 加密 - S3 服务器访问日志 #### 勒索软件防护与恢复 - 对象锁定配置 - 存储桶版本控制设置 - 存储桶生命周期配置 ## 入门指南:安装 YES3 Scanner 及要求 - 需要安装 Python 3 和 AWS 的 boto3 库。 - 运行 YES3 需要 AWS 凭证和相应的访问权限。有关此工具的 IAM 要求的更多信息,请参阅我们的 [IAM 文档](iam/iam.md),其中详细说明了如何为 YES3 安装 IAM 以及所需的 IAM 权限。 可以通过 `pip3 install` 和 `requirements.txt` 文件来安装依赖项。如果需要,可以使用 Python 虚拟环境。 ``` pip3 install -r requirements.txt ``` 注意:由于 S3 的 API 近期发生了更改,YES3 需要最新版本的 boto3。如果您的 boto3 版本过旧,YES3 会向您发出警告。有关版本要求,请参见 requirements。 有关配置 AWS 凭证的信息,请参阅 AWS 的文档[此处](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html) ## 运行 YES3 Scanner ``` python3 yes3.py --profile ``` 注意:虽然 S3 是全球性的,但 AWS boto3 中的某些客户端(例如 Service Quotas、S3 Control 和 STS)需要指定区域。YES3 Scanner 使用 Service Quotas 来检查存储桶限制,而全局限制仅显示在 us-east-1 区域。因此,YES3 Scanner 会将 `us-east-1 ` 用作 Service Quotas、STS 和 S3 Control 的默认区域。由于 S3 具有全球性质,YES3 Scanner 将会核算所有区域中的存储桶。因此,YES3 的 API 调用将在 CloudTrail 的 us-east-1 区域中显示。 ### 可选:传入要扫描的存储桶 默认情况下,YES3 Scanner 将扫描 AWS 账户中该区域内的所有存储桶。要指定运行 YES3 Scanner 的特定存储桶,可以使用 `--buckets` 参数。`--buckets` 参数接受一个以逗号分隔的存储桶名称列表(不带空格)。 示例命令: ``` python3 yes3.py --profile --buckets fog-bucket-1,fog-bucket-2,fog-bucket-3 ``` ### 示例输出 示例输出: ``` YES3 SCANNER RESULTS ---------------------------- AWS Account: 123412341234 Account Settings Account Block Public Access Overall Status: OK ---------------------------- Bucket Summary Buckets Scanned: 14 ---------------------------- Buckets potentially public: 3 fog-pub-sample-bucket | Public Method: ['acl'] fog-pub-sample | Public Method: ['policy', 'acl] fog-pub-policy-sample | Public Method: ['policy'] ---------------------------- Buckets with Access Issues: 1 sample-locked-bucket ---------------------------- Buckets with default S3-Owned Encryption: 6 Buckets without SSE-C Encryption blocked: 1 Buckets with a Block Public Access setting disabled: 3 Buckets with Bucket ACLs Enabled: 2 Buckets with ACLs set to public: 0 Buckets with Bucket Policy set to public: 1 Buckets with Object Lock disabled: 5 Buckets with Versioning disabled: 4 Buckets with Lifecycle Config Set to Expiration: 1 Buckets with Public Access from Website Setting: 0 Buckets with Server Access Logs Disabled: 5 ---------------------------- Additional Bucket Details Buckets with default S3-Owned Encryption: sample-bucket-1, sample-bucket-2, sample-bucket-3, sample-bucket-4, sample-bucket-5, sample-bucket-6 Buckets without SSE-C Encryption blocked: sample-bucket-2 Buckets with a Block Public Access setting disabled: sample-bucket-1, sample-bucket-2, sample-bucket-3 Buckets with Bucket ACLs Enabled: sample-bucket-1, sample-bucket-2 Buckets with ACLs set to public: Buckets with Bucket Policy set to public: sample-bucket-1 Buckets with Object Lock disabled: sample-bucket-1, sample-bucket-2, sample-bucket-3, sample-bucket-4, sample-bucket-5 Buckets with Versioning disabled: sample-bucket-1, sample-bucket-2, sample-bucket-3, sample-bucket-4 Buckets with Lifecycle Config Set to Expiration: sample-bucket-7 Buckets with Public Access from Website Setting: Buckets with Server Access Logs Disabled: sample-bucket-1, sample-bucket-2, sample-bucket-3, sample-bucket-4, sample-bucket-5 ``` ## 联系我们 请通过 info@fogsecurity.io 联系我们获取支持和更多信息。
标签:ACL, AWS安全, boto3, Bucket Policy, DevSecOps, GraphQL安全矩阵, Python, S3存储桶, SSE-C, Streamlit, 上游代理, 公开访问阻止, 勒索软件防护, 安全可观测性, 安全扫描器, 对象锁定, 数据加密, 数据恢复, 无后门, 漏洞利用检测, 版本控制, 访问控制, 逆向工具