Skip to content

Instantly share code, notes, and snippets.

@chinatimeline
Last active December 12, 2023 03:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chinatimeline/5386a4f9d82483aa5346b17d8d324877 to your computer and use it in GitHub Desktop.
Save chinatimeline/5386a4f9d82483aa5346b17d8d324877 to your computer and use it in GitHub Desktop.

Git项目匿名安全措施

2020年4月19日三名端点星項目志願者蔡伟、小唐和陈玫被警方逮捕, 有網友對導致蔡偉和陳玫身份泄漏的技術原因進行了詳細分析,指出他們二人在本應完全匿名的github項目中出現了其姓名拼音、與真實身份掛鉤的email、出生年月等信息,這種身份隔離的不徹底導致其被警方跟蹤。

按照這位匿名網友的方法,也對TerminusBot涉及的幾個repo進行了分析,發現同樣的結論,其中蔡偉和陳玫都用了實名。

如何查看某个git项目的所有作者和邮箱

將git項目clone到本地,在命令行中輸入 git shortlog -sne --all 查看項目所有分支上的作者和郵箱。

Terminus2049.github.io
   441  TerminusBot <terminus2049@protonmail.com>
   126  terminusbot <terminus2049@protonmail.com>
    97  TerminusBot <>
    70  TerminusBot <7903661+TerminusBot@users.noreply.github.com>
    57  cmmei <chanmei007@gmail.com>
    <deleted>
    <deleted>
    10  cc <7903661+tsai1993@users.noreply.github.com>
    <deleted>
     4  cc <cc@Echo-MacBook-Pro.local>
     4  tsai1993 <7903661+tsai1993@users.noreply.github.com>
     2  GitHub <cc@Echo-MacBook-Pro.local>
     2  Staticman <mail+staticman@eduardoboucas.com>
     1  Tsai1993 <38848556+Tsai1993@users.noreply.github.com>
     1  Tsai1993 <>
     1  Tsai1993 <Tsai2049@gmail.com>

Info-cn/Terminus
   105  cc <7903661+tsai1993@users.noreply.github.com>
    68  cmmei <chanmei007@gmail.com>
    33  tsai1993 <7903661+tsai1993@users.noreply.github.com>
     3  TerminusBot <7903661+TerminusBot@users.noreply.github.com>
     <deleted>

Tsai1993/aisixiang
    21  tsai1993 <caiw15@mails.tsinghua.edu.cn>
    18  cc <cc@ccdeMacBook-Air.local>
    12  tsai1993 <tsai1993@users.noreply.github.com>
     5  ubuntu <caiw15@mails.tsinghua.edu.cn>
     1  cc <tsai1993@qq.com>

其中代表Github賬戶身份的唯一數字ID 7903661曾用的名稱有TerminusBot、tsai1993、cc,而tsai1993曾經用過自己的清華大學實名郵箱 caiw15@mails.tsinghua.edu.cn, cc使用了tsai1993@qq.com cc@ccdeMacBook-Air.local cc@Echo-MacBook-Pro.local 等email,這也泄漏了蔡偉的身份以及喜歡使用MacBook的事實。

陳玫的ID一直是cmmei,email是 chanmei007@gmail.com,注意其email用了自己的實名拼音,如果在Google搜索這個郵箱,還能看到很多信息。

上述log展示中,用戶名前方的數字代表其提交的commit數量。可見蔡偉的各種ID貢獻了絕大多數commit,而陳玫貢獻的commit數量則僅次於蔡偉。陳玫和蔡偉在端點星項目的最早期Info-cn/Terminus就已經開始合作。

造成身份泄漏的可能原因:敏感项目未与日常计算机隔离,在使用git时因疏忽而使用了默认的全局设置,即日常的git用户名和邮箱。

如果您希望通過github從事政治敏感的項目,請用務必以上方法檢查自己的身份隔離情況,如果泄漏身份請隱藏或刪除該項目。

解决方案

  1. 所有敏感项目都在虚拟机中进行,与日常用电脑完全隔离,使用双虚拟机方案通过Tor访问网络。
  2. 对每个git项目单独配置局部用户名和密钥对
git config --local user.email "youremail@example.com"
git config --local user.name "Your Name"
git config --local core.sshCommand "ssh -i ~/.ssh/project-specific-private-key -F /dev/null"

参考鏈接

@cirosantilli
Copy link

cirosantilli commented Dec 29, 2020

Man, I can't believe they were so sloppy on operational security... :-(

https://stackoverflow.com/questions/27279359/how-to-make-git-work-to-push-commits-to-github-via-tor is also worth considering.

I had a related project at: https://github.com/cirosantilli/all-github-commit-emails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment