MongoDBBenchmark
Scanning 7.25 Million Public Repositories on China's Largest Git Platform for Secrets
Summary
An independent security researcher scanned 7,256,531 public repositories on Gitee, China’s largest indigenous Git hosting platform, using both TruffleHog and Kingfisher. The dual-scanner pipeline found 26,400 unique verified-live credentials after deduplication, with Alibaba Cloud AccessKey pairs being the most common leaked type. Repository enumeration required combining Gitee’s limited REST API, per-user page scraping, and the platform’s internal Elasticsearch widget, using bucket splitting to work around a 200-result cap. The scan cost roughly $3,000 and ran for one month on Modal’s serverless compute platform. Gitee’s per-repository credential density of 3.64 per 1,000 repos exceeded comparable published scans of GitLab and Bitbucket.
Context
Gitee is China’s national open-source code hosting platform, with a severely constrained public API and no platform-vendor secret-scanning partnerships. A 2021 attempt to study credential exposure on Gitee concluded its APIs were too limited to scale the research.
Approach / What changed
The researcher built a pipeline on Modal that cloned 7.25 million Gitee repositories and ran TruffleHog and Kingfisher concurrently, verifying credentials against vendor APIs at scan time. Repository enumeration combined Gitee’s REST API, per-user page scraping, and the platform’s internal Elasticsearch widget, using bucket splitting to work around a 200-result cap.
Takeaways
Gitee has no public equivalent of the platform-vendor secret-scanning partnerships standard on GitHub, making it an attractive surface for credential exposure.
Running both TruffleHog and Kingfisher caught more than twice as many unique credentials as either tool alone, because their detector coverage is largely complementary.
The same Modal + dual-scanner pipeline is portable to most Git hosts with little more than a clone-URL substitution, at a cost of roughly $3,000 for 7.25 million repos.
FAQ
How did the researcher bypass Gitee's 200-result search cap?
The researcher used bucket splitting: when a query hit the 200-result cap, they split it by the language buckets returned in the Elasticsearch response, then by license, then by deeper prefix, until each branch fit within the limit.
How did TruffleHog and Kingfisher differ in coverage?
TruffleHog dominated Alibaba Cloud key detection (9,428 vs. 993), while Kingfisher dominated DeepSeek (2,940 vs. 230), OpenAI (1,198 vs. 150), HuggingFace (154 vs. 1), and Chinese-AI services like Zhipu (1,489 vs. 0) that TruffleHog has no detector for.
What was the cost and duration of the scan?
The total cost was $3,097.64, fully absorbed by a $5,000 compute-credit sponsorship from Modal. The scan ran for roughly one month with 350 concurrent containers.
Source and freshness
- Source
- mongodb.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.