监控您的 Slack Enterprise Grid 以获取敏感信息
项目描述
企业网格的 Slack Watchman
关于企业网格的 Slack Watchman
Slack Watchman for Enterprise Grid 使用 Slack Enterprise Grid DLP API 来查找 Slack Enterprise 中公开的潜在敏感数据。
注意:Slack Watchman for Enterprise Grid 专为 Slack 的 Enterprise Grid 订阅者设计。如果您在没有企业订阅的情况下使用 Slack,则可以使用标准版本的Slack Watchman
特征
Enterprise Grid 的 Slack Watchman 寻找:
- API 密钥、令牌和服务帐户
- AWS, Azure, GCP, Google API, Slack (keys & webhooks), Twitter, Facebook, GitHub
- 通用私钥
- 访问令牌、承载令牌、客户端机密、私有令牌
- 文件
- 证书文件
- 潜在的有趣/恶意/敏感文件(.docm、.xlsm、.zip 等)
- 可执行文件
- 钥匙串文件
- 流行服务的配置文件(Terraform、Jenkins、OpenVPN 等)
- 个人资料
- 泄露的密码
- 护照号码、出生日期、社会安全号码、国民保险号码、驾照号码(英国)、个人纳税人识别号码
- 简历、薪资信息
- 财务数据
- PayPal Braintree 代币、银行卡详细信息、IBAN 号码、CUSIP 号码
- 预算文件
它在 Enterprise 中的所有工作区中的以下位置查找这些公开的数据:
- 公共频道
- 私人频道
- 消息草稿
- 松弛连接通道
- 直接消息
- 多人直接消息
基于时间的搜索
Slack Watchman for Enterprise Grid 可以搜索过去 24 小时内在您的企业中发送的所有消息。API 中的限制和数据处理瓶颈不允许超过 24 小时的查询时间。
您可以提供时间段以在运行时使用--hours
和--minutes
选项进行搜索。这意味着您可以安排定期运行,一般来说很少而且经常是最好的方法。
多处理
多处理用于搜索在获取企业中发送的所有消息时可能检索到的大量数据。您可以指定在运行时使用多少个核心,使用的核心越多,处理速度通常越快。话虽如此,您仍然受到 API 的限制。
我发现最有效的方法是使用 8-12 个内核。
--cores
您可以在运行时使用可选标志指定核心。如果未设置此标志,Slack Watchman 将自动使用所有可用内核,最多 8 个。
签名
Slack Watchman 使用自定义 YAML 签名来检测 Slack 中的匹配项。
他们遵循以下格式:
---
filename:
enabled: [true|false]
meta:
name:
author:
date:
description: # what the search should find
severity: # rating out of 100
tombstone: [true|false]
scope:
- [files|messages]
file_types: # optional list for use with file searching*
locations: # what conversations to search in. Any combination of:
- public
- private
- connect
- im
- mpim
test_cases:
match_cases:
- # test case that should match the regex*
fail_cases:
- # test case that should not match the regex*
search_strings:
- # search query(s) to use in Slack
pattern: # Regex pattern to filter out false positives
有 Python 测试可确保签名格式正确,并且正则表达式模式在tests
目录中工作
有关签名以及如何添加自己的签名的更多信息在文件中docs/signatures.md
。
要求
松弛 API 令牌
要为 Enterprise Grid 运行 Slack Watchman,您需要一个 Slack API 访问令牌,该令牌被授权使用 Enterprise DLP API。
为此,您需要创建一个Slack 应用程序并在组织级别安装它。
该应用程序需要添加以下用户令牌范围:
discovery:read
discovery:write
team:read
users:read
注意:discovery:read
并且discovery:write
只能由 Slack 自己添加到应用程序中,您需要联系您的 Slack CSM。他们还将为您提供有关如何在组织级别安装应用程序和检索访问令牌的说明。
提供令牌
在环境变量中提供令牌SLACK_WATCHMAN_EG_TOKEN
安装
您可以通过 pip 安装最新的稳定版本:
python3 -m pip install slack-watchman-eg
或者自己从源代码构建,如果您打算添加自己的签名,这很有用:
下载发布源文件,然后从顶级存储库运行:
python3 -m pip build
python3 -m pip install --force-reinstall dist/*.whl
码头工人形象
Slack Watchman for Enterprise Grid 也可以从 Docker 中心以 Docker 映像的形式获得:
docker pull papermountain/slack-watchman-eg:latest
然后,您可以在容器中运行 Slack Watchman for Enterprise Grid,确保传递所需的环境变量:
// help
docker run --rm papermountain/slack-watchman-eg -h
// scan all
docker run --rm -e SLACK_WATCHMAN_EG_TOKENN=xoxp... papermountain/slack-watchman-eg --hours 1 --cores 8
docker run --rm --env-file .env papermountain/slack-watchman-eg --hours 1 --cores 8
用法
usage: slack-watchman-eg [-h] [--hours HOURS] [--minutes MINUTES] [--cores CORES] [--version] [--users] [--workspaces] [--sandbox] [--tombstone] [--tombstone-text-file TOMBSTONE_FILEPATH]
Monitoring your Slack Enterprise Grid for sensitive information
options:
-h, --help show this help message and exit
--hours HOURS How far back to search in whole hours between 1-24. Defaults to 1 if no acceptable value given
--minutes MINUTES How far back to search in whole minutes between 1-60
--cores CORES Number of cores to use between 1-12
--version show program's version number and exit
--users Find all users
--workspaces Find all workspaces
--sandbox Search using only sandbox signatures
--tombstone Tombstone (REMOVE) all matching messages
--tombstone-text-file TOMBSTONE_FILEPATH
Path to file containing custom tombstone notification text (Optional)
其他守望者应用
您可能对 Watchman 系列中的其他应用程序感兴趣:
执照
该项目的源代码是根据GNU 通用公共许可证发布的。该项目与 Slack 无关。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
内置分布
slack_watchman_eg -1.1.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8fc6191565471347313f87af04e32b250deac7ec89c0c5a0f359134e5ee56c64 |
|
MD5 | 7b792d8bf0d6ab5c0a594e94e92cea18 |
|
布莱克2-256 | a815344f524c614bfb0e73f79ab387b965216f33723708bffa8489df9c1e1274 |