FeeiCN/GSIL
GitHub: FeeiCN/GSIL
基于自定义规则持续监控 GitHub 公开仓库中企业敏感信息泄露并自动告警的 Python 工具。
Stars: 2148 | Forks: 484
# GSIL(GitHub 敏感信息泄露)
[中文文档](https://github.com/FeeiCN/GSIL/blob/master/README-zh.md)
## 安装
```
$ git clone https://github.com/FeeiCN/GSIL.git
$ cd GSIL/
$ pip install -r requirements.txt
```
## 配置
### GSIL/config.gsil(将 config.gsil.cfg.example 复制为 config.gsil.cfg):告警邮箱和 Github 配置
```
[mail]
host : smtp.exmail.qq.com
# SMTP 端口(非 SSL 端口,但将使用 TLS 加密)
port : 25
# 多个发送者用逗号 (,) 分隔
mails : gsil@domain.com
from : GSIL
password : your_password
# 多个接收者用逗号 (,) 分隔
to : feei@feei.cn
[github]
# 扫描的数据是否将立即克隆到本地
# 克隆到 ~/.gsil/codes/ 目录
clone: false
# Github Token,多个 token 用逗号 (,) 分隔
# https://github.com/settings/tokens
tokens : your_token
```
### GSIL/rules.gsil(将 rules.gsil.yaml.example 复制为 rules.gsil.yaml):扫描规则
| 字段 | 含义 | 是否可选 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| keyword | 关键字 | 必填 | - | 使用多个关键字时,使用空格分隔(例如:`'username password'`),当需要精确搜索时,使用双引号(例如:`"quotesele.me"`) |
| ext | 文件后缀 | 可选 | 所有后缀 | 多个后缀以逗号分隔(例如:`java,php,python`) |
| mode | 匹配模式 | 可选 | normal-match | `normal-match`(匹配包含关键字的行以及其附近的行) / `only-match`(仅匹配包含关键字的行) / `full-match`(不推荐使用)(搜索结果显示整个文件)|
```
{
# usually using the company name, used as the first parameter to open the scan(Example:`python gsil.py test`)
"test": {
# General use of product name
"mogujie": {
# Internal domain name of the company
"\"mogujie.org\"": {
# mode/ext options no need to configure by default
"mode": "normal-match",
"ext": "php,java,python,go,js,properties"
},
# Company code's characteristic code
"copyright meili inc": {},
# Internal host domain name
"yewu1.db.mogujie.host": {},
# External mailbox
"mail.mogujie.com": {}
},
"meilishuo": {
"meilishuo.org": {},
"meilishuo.io": {}
}
}
}
```
## 使用
```
$ python gsil.py test
# 验证 token 有效性
$ python gsil.py --verify-tokens
```
```
$ crontab -e
# 每小时运行一次
0 * * * * /usr/bin/python /var/app/GSIL/gsil.py test > /tmp/gsil
# 每天晚上 11 点发送统计报告
0 23 * * * /usr/bin/python /var/app/GSIL/gsil.py --report
```
* 扫描报告生成一次后将不会重复报告,缓存记录保存在 ~/.gsil/ 目录中 *
## 参考
- [GSIL详细介绍](https://feei.cn/gsil/)
标签:DLP, ESC4, GitHub安全, GitHub敏感信息泄露, OSINT, Python安全工具, SMTP, 信息泄露检测, 凭证监控, 安全合规, 实时处理, 提示注入防御, 敏感词匹配, 源代码安全, 网络代理, 网络资产监控, 自动化安全工具, 逆向工具, 邮件告警