当 bot-token 发布到 public Github repo 时,Slack-app 已从工作区中删除

Slack-app got removed from workspace when bot-token got publish to public Github repo

我正在开发 CI 配置以推送到远程服务器中的多个项目。

所以我临时将它们推送到 github public 项目,其中有一个 config.cfg 文件包含下面这些行。

SLACK_BOT_TOKEN="xoxb-265693953920-1151243933765-cz72nwcOIUkd7cU8SjDYf5k7"
SLACK_DEFAULT_CHANNEL=ci

但是奇怪的事情发生了, 每次我推送配置文件时,Slackbot 都会抛出一条消息“从该频道删除了一个集成:{app name}”。所以我必须不断更新新令牌并将其重新安装到 Workspace。

我的意思是,我的自定义 SlackBot 每次 Slack_Bot_Token 被推送到 github 存储库时都会被删除。即使我等了几个小时或十分钟后。同样的结果,我一推它就被删除了。 (也发生在新的新鲜APP上)

这是非常奇怪的行为,我真的不认为 github 和 slack 以某种方式联系在一起,一旦它的令牌暴露就神奇地删除应用程序。

This is extreme weird behaviour, and I dont really think github and slack are linked together somehow that magically remove APP as soon as its Token got exposed.

不过他们是:https://docs.github.com/en/code-security/secret-security/about-secret-scanning

秘密扫描是一种机制,可以检测 GitHub 中意外泄露的秘密并将其报告给受影响的服务。已有 40 多个合作伙伴参与其中,包括 Slack。

GitHub scans repositories for known types of secrets, to prevent fraudulent use of secrets that were committed accidentally.

Secret scanning is automatically enabled on public repositories. When you push to a public repository, GitHub scans the content of the commits for secrets. If you switch a private repository to public, GitHub scans the entire repository for secrets.

可能故意将实时令牌发布到 public GitHub 回购不是正确的方法,我建议改用私人回购。