使用 ChatGPT 扫描客户管理的 AWS 策略以查找漏洞。
该工具会自动将客户账号替换为随机生成的账号,从而在将策略发送给 ChatGPT 之前对其进行脱敏处理。对于 OpenAI 而言,仅知道存在漏洞的策略而不知道配置了该策略的账号是毫无用处的。此外,内部提示词始终会返回以 Yes 或 No 开头的响应,因此我们只解析响应的这一部分来判断是否存在漏洞。使用该工具的用户应手动检查输出中的响应,以确定其上下文。它并不完美,但绝对很有帮助。
在 Twitter 上关注我 (Mike Felch - @ustayready)
usage: scan.py [-h] --key KEY [--profile PROFILE] [--redact]
Retrieve all customer managed policies and check the default policy version for vulnerabilities
optional arguments:
-h, --help show this help message and exit
--key KEY OpenAI API key
--profile PROFILE AWS profile name to use (default: default)
--redact Redact sensitive information in the policy document (default: True)
CloudGPT the AWS vulnerability scanner
python scan.py --key ABC --profile AWSPROFILE
您可以通过以下命令安装并运行:
$ git clone https://github.com/ustayready/cloudgpt
$ cd cloudgpt
~/cloudgpt $ virtualenv -p python3 .
~/cloudgpt $ source bin/activate
(cloudgpt) ~/cloudgpt $ python scan.py