scima安全脚本
scimma-security-scripts的Python项目详细描述
scima安全脚本
用于快速管理AWS活动的脚本集。它们可以从pip包(link)运行,也可以以raw.py格式运行
先决条件
- Python 3.x版
- AWS CLI(带凭据文件)
- 在api.github.com网站格式为~/.netrc的身份验证令牌
machine api.github.com login %user% password %access token%
。得到你的here。在 - jq公司
- Windows或*nix计算机
安装
要在系统级安装此脚本,请运行pip install scimma-security-scripts
。
要原始运行它们,请从官方存储库下载。在
可用子命令
当使用pip安装时,可以使用sc {subcommand}
命令运行脚本,并且可以使用sc {subcommand} -h
检索可用参数。在
sc inf_查找
从保险库转储cloudtail json事件记录,该事件记录的某些值与globstring匹配。在
vault文件是一个包含json对象数组的“记录”字典,每个cloudtrail事件一个json对象。事件有很多种,每个事件都有不同的json模式。在
Shell用户可以使用jq和sort、uniq、tablate甚至grep构造简单的分析过滤器
示例:
Use | Command |
---|---|
find all json records in vault referring to July 1, 2020 | ^{ |
find all json records in vault describing actions taken by user named "petravic" in the first week of August | ^{ |
make a formatted table of events, time, and assocated IP addressed. | ^{ |
find all json records in the vault in the first 6 days in august | ^{ |
extract event names and display the most numerous events. | ^{ |
use GREP to explore file | ^{ |
sc inf_报告
运行tag、s3、secret、certificate、repo inventory报告
sc inf峈u型保险库
将Cloudtrail日志下载到vault目录。下载是增量的--以前的下载不是 重新获取或删除。在
vault文件是存储在$HOME/.vault下的浓密目录树。叶子是(许多json)文件,每个文件只覆盖一小部分时间。这些文件包含AWS事件记录。在
其他工具(特别是通过_内容.py)基于 在trailscraper上使用下载的数据进行分析。在
sc x\u报告
与Duo的Cloudmapper类似,但它摄取更多,绘制更多图形,并使用标记来绘制图形
sc控制审计
运行审核,检查系统依赖项、附加到目标角色的策略、调用方的权限(如果足够)、存储库状态、帐户中存在的角色以及调用方的标识。在
sc控制绿色按钮
从目标角色中剥离所有策略,并将建议的poweruser和RoleManagementWithCondition附加在一起
sc控制按钮
从目标角色中剥离所有策略并停止所有区域中的所有EC2实例
sc test_绿色按钮
模拟绿色按钮功能
sc test_红色按钮
模拟红色按钮功能
配置文件
当使用sc
命令调用时,脚本将从内置的^{em1}中提取默认参数$默认.cfg文件。控制台接口还检查通过$SCIMMA_SECURITY_CFG
变量指定的文件。在
如果未检测到该变量,则会自动创建该变量,并且可以通过编辑~/.bash_profile(bash)、~/.zshenv(zsh)或运行SETX SCIMMA_SECURITY_CFG "path/config.cfg" /M
(cmd)进行修改。预期的配置文件格式如下:
[DEFAULT] profile=scimma-uiuc-aws-admin role=scimma_power_user vaultdir=~/.vault loglevel=NORMAL # info tools [TAG_REPORT] dbfile=:memory: [DOWNLOAD] bucket=s3://scimma-processes/Scimma-event-trail accountid=585193511743
运行原始脚本
虽然不打算作为主要的运行方式,但脚本可以单独执行。例如:
python find_by_content.py -dd 14 *petravic*
相当于
sc inf_find -dd 14 *petravic*
- 项目
标签: